UpdateWOHeader
Changes some header fields of one open
work order: what Edit work order
does in TrakIT, for the fields listed below. Use it when your system learns a detail after the job
was created with CreateJob, for example the container number of a booking
or the transporter that will collect it. To record events and data fields, use
SaveSeqData instead.
How to sign in and read the response: Authentication, Responses.
POST /api/v1/UpdateWOHeaderToken: your-tokenContent-Type: application/json{ "WOID": 48211, "Fields": [ { "ContNum": "ABCU1234560" }, { "SealNum": "SL778812" }, { "TransID": 2210 }, { "Weight": 21450.5 } ]}| Field | Required | Meaning |
|---|---|---|
WOID |
Yes | The work order’s ID, a whole number. |
Fields |
Yes | The header fields to change: a list of objects, each with one field from the table below and its new value. Put one field in each object: TrakIT reads only the first. |
TrakIT reads WOID and Fields by name, and these two names are case-sensitive. The field names in
Fields are not: ContNum and contnum are the same.
Header fields you can change
Section titled “Header fields you can change”Name each field as below. Fields you leave out keep their values.
| Field | Meaning |
|---|---|
ContNum |
Container No., at most 20 characters. TrakIT stores it as you send it: send it in capitals, without spaces. An empty string clears it. It is not changed while the work order has a Yard Position. |
SealNum |
Seal Number, at most 100 characters: letters A to Z, digits, spaces and # $ % + , - . / @ _. |
Commodity |
Commodity, at most 500 characters. |
LoadType |
Load Type: the code or alternate code of an active load type, for example 22G1. TrakIT stores the load type’s own code. |
OpID |
Carrier: an entity ID, or 0 to remove the carrier. |
TransID |
Transporter: an entity ID, or 0 to remove it. |
RetTransID |
Return Transporter: an entity ID, or 0 to remove it. |
OwnCont |
Shipper Container: true when the shipper owns the container, otherwise false. |
Resp |
Responsible Person: a user ID, for example JSMITH. |
Weight |
Weight, in kilograms, from 0 to 50,000,000. |
Priority |
The work order’s priority, a whole number: 1 Critical, 2 High, 3 Normal, 4 Low or 5 Very Low. 0 sets 3. |
Send numbers as JSON numbers and OwnCont as true or false. A null is refused for them: to
remove an entity, send 0.
Other header fields, such as the customer, the agents, the volume or the job type, cannot be changed here. A change applies to this work order only, not to the other work orders of its job.
TrakIT reads the fields in the order you send them and stops at the first one it refuses. It then checks the work order’s header as it would be after the change: the checks on the responsible person, weight, load type, commodity, seal number and priority also apply to the values you do not send. Nothing is saved unless every check passes.
| 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 request has a JSON body. | No request body found |
WOID is a whole number. |
WOID missing or invalid |
Fields is a list. |
No field list found |
| A work order has that ID. | No such work order |
| The work order is active or abandoned, not closed or cancelled. | WO ... is not open |
Each field in Fields is one of the fields above. |
... is not recognized or supported |
OpID, TransID, RetTransID, Weight and Priority are numbers. |
OpID should be numeric, TransID should be numeric, RetTransID should be numeric, Weight should be numeric, Priority should be numeric |
OwnCont is true or false. |
OwnCont must be boolean |
| The responsible person is not empty. | Responsible Person must be specified. |
| The weight is from 0 to 50,000,000. | Weight must be in range 0 to 50,000,000 Kg |
| The load type, if any, is the code or alternate code of an active load type. | Load Type is not valid |
| If the container is in the container master with a verified load type, the work order has that load type. | Load Type '...' does not match Container Master |
| The commodity holds no script. | Commodity contains invalid characters |
| The seal number has only the characters allowed. | Seal Number contains invalid characters |
| The priority is from 1 to 5. | Priority must be between 1 (Urgent) and 5 (On Hold) |
| The seal number is at most 100 characters. | Seal Number can be a maximum of 100 characters |
| Your company’s validations for Save WO Header and Save Job Header pass. | Their own messages |
Resp is a user ID. |
Unable to save. User ... is not valid |
OpID, TransID and RetTransID are entity IDs, and ContNum is at most 20 characters. |
Unable to save |
Response
Section titled “Response”On success, Code is 1, Info is empty and RetInfo is null. Read the work order with
GetWO to see it.
{ "Code": 1, "Info": "", "RetInfo": null, "RowsAffected": 0, "Scalar": null, "Identity": 0}- The change is recorded in the work order’s audit log under the API user’s name, when a value has changed.
- The data fields of the work order’s carrier, transporters and agents are copied to its events and data where your company has set that up: see Copy values to work orders.
- TrakIT then runs your company’s actions for Save WO Header, and tells the users who subscribed to Update WO Header notifications.
- Send the values your workflow requires: a header field that it makes Mandatory on its Header Fields tab should not be cleared, a commodity should come from the workflow’s list if it has one, and a container number should be valid for the workflow.

