Skip to main content

Dispatch

Dispatch provides access to the dispatch resource. Dispatches can be posted relative to retail orders or trade orders. This is an alternative to the simple dispatch mechanism which allows order items to be marked as dispatched. Dispatch allows multiple dispatches to be made against a single order, so long as the host allows it. The endpoint can still be used but you must take care to follow dispatch rules set by the hosts.

Dispatch Properties

PropertyExampleDescription
id"788F9E..."Unique id of the dispatch
fk_orderRef"157194..."The foreign key to the order the dispatch is being made for.
type"Retail"The type of order that is being dispatched. Allowed values are: Retail and Trade. If not specified the type will default to "Retail"
carrier"UK48HR"Shipping carrier
trackingRef""Shipping tracking reference
detail{object}Not currently used
dispatch_dispatchItem{}[related entities]}collection of dispatchItems related to the order see dispatchitem resource

Dispatch Methods

GET/api/dispatch

Returns all dispatches for the current scope with all published fields.

POST/api/dispatch

Parses the request object and creates a dispatch (if validated). The dispatch items are passed as part of the request object. As well as passing the dispatch quantity you can also pass a quantity to cancel using the cancelQty property.

All exposed properties of the Dispatch can be inserted with the exception of id. The example given shows the recommended fields to be used. Please see the Dispatch Items documentation for item fields which are allowable in a post to the dispatch endpoint.

The response will return the entire dispatch and in addition a response_status property. It is the responsibility of the developer to ensure that fields are filled to the customers requirement. This may vary based on shipping and processing requirements.

Example

Example of a returned dispatch entity with included related items
{
"response": {
"page": 1,
"pageCount": 1,
"recordsSent": 1,
"recordsFound": 1,
"order": [
{
"id": "788F9E86F23B0A46B458983FB1B5AA38",
"fk_orderRef": "A0E87AE771BAC84DBA994FEC70537912",
"type": "Retail",
"dispatchDate": "2022-01-10T12:43:22",
"carrier": "UK48HR",
"trackingRef": "XX1234567",
"dispatch_dispatchItem": [
{
"id": "C0458E1496D21B499A3DCAE799A2DC87",
"fk_dispatch": "788F9E86F23B0A46B458983FB1B5AA38",
"fk_orderItemRef": "E3DDB440D1E0554D957B029B3F58D361",
"description": "",
"dispatchQty": 1,
"cancelQty": 0
}
],
"detail": {}
}
]
}
}