Skip to content

CancelWO

Cancels the work orders you list, as Cancel Work Order does on the work order page. Use it when a container or load is dropped from a job in your system. To close finished work orders instead, use CloseWO; to open cancelled ones again, use ReopenWO.

How to sign in and read the response: Authentication, Responses.

POST /api/v1/CancelWO
Token: your-token
Content-Type: application/json
[48211, 48212, 48299]
Field Required Meaning
The body Yes A JSON list of work order IDs, whole numbers. Not an object: the list itself is the body.

TrakIT cancels the work orders one at a time, in the order of the list. Each one is cancelled or refused on its own: a refusal does not stop the others, and does not undo those already cancelled. The other work orders of their jobs are not cancelled.

For the request:

Rule Info when it fails
The Token header holds a valid token. Token missing in header, Token invalid or expired, or another answer listed in Login token
The user is a system administrator with API access. API User must be SysAdmin with API Access
The body is a list of at least one ID. No WO IDs supplied

For each work order, in the Info of its entry in RetInfo:

Rule Info when it fails
A work order has that ID. No such work order
None of its items is committed to a warehouse. Cannot cancel Work Order with committed items
Your company’s validations for Save WO Header, Save Job Header and Cancel WO pass. Their own messages
The work order is active or abandoned. A closed work order must be re-opened before it can be cancelled. Work Order is already cancelled, Work Order is already closed

RetInfo has one entry for each ID, in the order you sent them. RowsAffected is the number of work orders cancelled. Code is 1 when at least one was cancelled, and 0 when none was; Info is empty either way. Always read the entries.

{
"Code": 1,
"Info": "",
"RetInfo": [
{ "WOID": 48211, "Success": true, "Info": "" },
{ "WOID": 48212, "Success": false, "Info": "Work Order is already closed" },
{ "WOID": 48299, "Success": false, "Info": "No such work order" }
],
"RowsAffected": 1,
"Scalar": null,
"Identity": 0
}
Field Meaning
WOID The work order ID, as you sent it.
Success true when the work order was cancelled, false when it was refused.
Info Why the work order was refused. Empty when it was cancelled.
  • A cancelled work order gets the status Cancelled (2 in GetWO), with the date and the API user as the user who cancelled it. Its audit log says Cancelled via API. The API records no reason for cancellation.
  • The work order leaves delay tracking, and its yard moves are no longer linked to it.
  • Unlike cancelling in TrakIT, the API sends no email to the work order’s responsible person.
  • For each work order cancelled, TrakIT works out its computed data fields, runs the event and data actions that are due and your company’s actions for Cancel WO, and tells the users who subscribed to Cancel WO notifications.
  • If a request times out, you can send it again: work orders already cancelled are refused with Work Order is already cancelled and stay cancelled.