Send order line delivery history
const url = 'https://api.tradecloud1.com/v2/api-connector/order/deliveryHistory';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"order":{"companyId":"aa8bae80-b303-4237-8226-f4a209592a5b","purchaseOrderNumber":"PO12345"},"lines":[{"position":"0001","deliveryHistory":[{"position":"01","date":"2019-12-31","quantity":1234.56}]}],"erpLastChangeDateTime":"2019-12-31T10:11:12","erpLastChangedBy":{"email":"contact@yourcompany.com"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.tradecloud1.com/v2/api-connector/order/deliveryHistory \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "order": { "companyId": "aa8bae80-b303-4237-8226-f4a209592a5b", "purchaseOrderNumber": "PO12345" }, "lines": [ { "position": "0001", "deliveryHistory": [ { "position": "01", "date": "2019-12-31", "quantity": 1234.56 } ] } ], "erpLastChangeDateTime": "2019-12-31T10:11:12", "erpLastChangedBy": { "email": "contact@yourcompany.com" } }'Replace the delivery history of one or multiple lines within an order. Requires Integration role.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Send order line delivery history by buyer
object
The order header information identifying the purchase order to update.
object
The optional Tradecloud company ID of the buyer. Only needed when the integration user is authorized for multiple companies.
Example
aa8bae80-b303-4237-8226-f4a209592a5bThe purchase order number for which the update is sent.
Example
PO12345Information about the order lines for which the delivery history is sent. Lines not present in this array are left untouched.
object
The position of the order line for which the delivery history is sent.
Example
0001The full delivery history for this order line.
The existing deliveryHistory of the order line is replaced by this list. Send the complete current delivery history as known in your ERP system; previously recorded deliveries that are not included will be removed. An empty array [] is the clear operation: it removes all existing delivery history lines for the order line. The total number of delivery history lines is limited to 100 lines per order line.
A delivery line in the delivery history.
object
The position in the history. The position should be unique within the schedule and immutable.
Example
01The actual delivery date of this delivery position. Date has ISO 8601 date format.
Example
2019-12-31The actual delivered quantity of this delivery position. Quantity has a decimal format.
Example
1234.56ISO local date and time at which the order was updated in your ERP system.
Example
2019-12-31T10:11:12The employee who is responsible for or who added, updated or responded to this order.
object
Employee email as known in Tradecloud.
Example
contact@yourcompany.comResponses
Section titled “Responses”Successfully verified and sent order line delivery history.
Successfully queued the request. The delivery history has not yet been verified.
Bad request, the user should check the response body for more info.
object
Example
missing.propertyExample
Property X was missingNot authenticated, the user should authenticate using a valid access token, use Basic Authentication, or refresh to get a valid token. May or may not contain a structured response body
object
Example
Authentication failedThe number of authentication attempts left before the user is banned. Applicable when authentication through Basic Authentication fails.
Example
2Int describing the number of seconds left before the user is allowed to attempt a login with Basic Authentication again.
Example
300Not authorized, the user is authenticated but does not have the necessary permission.
object
Example
Not authorized for this actionOrder not found.
An unexpected error occurred, Tradecloud ops will be alerted. May or may not contain a structured response body.
object
Example
some.errorExample
Some error occurredThe cause of this error. Free-format JSON object.
object
Service is not healthy (bad gateway), Tradecloud ops will be alerted. Will not contain a structured response body.
Service is unavailable (overloaded or down for maintenance), Tradecloud ops will be alerted. May or may not contain a structured response body.
object
Example
Could not retrieve data from external source.Service is unavailable (gateway timeout), Tradecloud ops will be alerted. Will not contain a structured response body.
