Skip to content

Send order line delivery history

POST
/api-connector/order/deliveryHistory
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.

Send order line delivery history by buyer

Media typeapplication/json
object
order
required

The order header information identifying the purchase order to update.

object
companyId

The optional Tradecloud company ID of the buyer. Only needed when the integration user is authorized for multiple companies.

string format: uuid

Example

aa8bae80-b303-4237-8226-f4a209592a5b
purchaseOrderNumber
required

The purchase order number for which the update is sent.

string

Example

PO12345
lines
required

Information about the order lines for which the delivery history is sent. Lines not present in this array are left untouched.

Array<object>
>= 1 items
object
position
required

The position of the order line for which the delivery history is sent.

string

Example

0001
deliveryHistory
required

The 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.

Array<object>

A delivery line in the delivery history.

object
position

The position in the history. The position should be unique within the schedule and immutable.

string format: digits

Example

01
date
required

The actual delivery date of this delivery position. Date has ISO 8601 date format.

string format: YYYY-MM-DD

Example

2019-12-31
quantity
required

The actual delivered quantity of this delivery position. Quantity has a decimal format.

number

Example

1234.56
erpLastChangeDateTime

ISO local date and time at which the order was updated in your ERP system.

string format: YYYY-MM-DDThh:mm:ss

Example

2019-12-31T10:11:12
erpLastChangedBy

The employee who is responsible for or who added, updated or responded to this order.

object
email

Employee email as known in Tradecloud.

string format: email

Example

contact@yourcompany.com

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.

Media type*/*
object
code
required
string

Example

missing.property
message
required
string

Example

Property X was missing

Not 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

Media type*/*
object
message
required
string

Example

Authentication failed
attemptsLeft

The number of authentication attempts left before the user is banned. Applicable when authentication through Basic Authentication fails.

integer

Example

2
banned

Int describing the number of seconds left before the user is allowed to attempt a login with Basic Authentication again.

integer

Example

300

Not authorized, the user is authenticated but does not have the necessary permission.

Media type*/*
object
message
required
string

Example

Not authorized for this action

Order not found.

An unexpected error occurred, Tradecloud ops will be alerted. May or may not contain a structured response body.

Media type*/*
object
code
required
string

Example

some.error
message
required
string

Example

Some error occurred
cause

The 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.

Media type*/*
object
message
required
string

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.