CloseWO
Closes the work orders you list, as Close Work Order does on the
work order page. Use it when the work is
finished in your system. To cancel work orders instead, use CancelWO; to
open closed ones again, use ReopenWO.
How to sign in and read the response: Authentication, Responses.
POST /api/v1/CloseWOToken: your-tokenContent-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 closes the work orders one at a time, in the order of the list. Each one is closed or refused on its own: a refusal does not stop the others, and does not undo those already closed. The other work orders of their jobs are not closed.
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 |
| Your company’s validations for Save WO Header, Save Job Header and Close Manually pass. | Their own messages |
| If the workflow has warehouse operations and the work order has warehouse items, they are committed. | Items not committed |
A work order that is already closed or cancelled is left as it is, and its Info says
Work Order is already closed. or Work Order is already cancelled.
Response
Section titled “Response”RetInfo has one entry for each ID, in the order you sent them. RowsAffected is the number of
entries whose Success is true. Code is 1 when at least one entry’s Success is true, and
0 when none is; Info is empty either way. Always read the entries.
{ "Code": 1, "Info": "", "RetInfo": [ { "WOID": 48211, "Success": true, "Info": "" }, { "WOID": 48212, "Success": false, "Info": "Items not committed" }, { "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 TrakIT accepted the work order, false when it refused it. |
Info |
Why the work order was refused, or a note. Empty when this request closed it. Read it together with Success: see Rules for a work order that was already closed or cancelled. |
- A closed work order gets the status Closed (
3inGetWO), with the date and the API user as the user who closed it. Its audit log saysClosed via API. - For each work order closed, TrakIT works out its computed data fields, runs the event and data actions that are due and your company’s actions for Close Manually, and tells the users who subscribed to Close WO notifications.
- If a request times out, you can send it again: work orders already closed are left as they are.

