Request to cancel order (/orders/cancel_job)

Created by Tony Leblanc

March 24, 2020

Method takes up to 5 arguments:
{
"order": "42",
"RIGHT-BREAK": "",
"RIGHT-EMP": "",
"LEFT-BREAK": "POWER",
"LEFT-EMP": "TAL", “REASON”:”CUS”
}

The order number is required; the other parameters are used only if one or more of the lenses is to be broken when the order is canceled. If breakage codes are not specified, the lenses will be returned to inventory. The reason code is required if the system setting in the order1 tab “Enter reason code when deleting order” is checked.

The end point checks to see if the specified order exists, and if so, if it qualifies to be canceled. If the order does not exist, is already completed, already flagged for deletion, or has been through a job station station that is marked as “Non-Cancel”, then the job will not be canceled and an appropriate message returned.

If a reason code is required and the reason code entered is not valid, then the order cannot be deleted.

If the job can be canceled, it is marked so in Rx-Universe, and a “successful” message returned to the endpoint.