Skip to main content

Customer Orders

Frequency:

Customer order data and changes are required to be sent in near real-time.

Expected data:

Customer order document to be created or updated.

Technical:

If a customer order does not exist in DSWMS, it will be created.

If a customer order already exists in DSWMS, the existing document will be updated with the new data.

details is the complete list of order lines. Lines are matched by line_number: existing lines are updated, new line numbers are added, and lines stored in DSWMS that are missing from the request are deleted.

The order is only accepted if DSWMS can attach it to a delivery for the given split group, store, plant and delivery date. If there is none, the request is rejected with Delivery unavailable for customer order.

store_id, split_group_id, plant_id and every article_id must already exist in DSWMS, and the article must have a unit of the quantity_unit_type_id that is sent. Otherwise the whole document is rejected with, for example, Store 010239 not found, Split Group 1015 not found, Plant 102849 not found, Article 0001 not found or Article 0001 unit 2 not found.

An update is only possible while the customer order is in status 1 (Created). Once picking has started, the request is rejected with Customer Order Status doesn't allow updates.


POST https://{url}/v1/orders/customer​

Create or update a customer order.

Request Body​

The request body is a JSON object containing customer order header fields and a details array with the order lines.

Customer order fields:

NameTypeRequiredDescription
idstringYesCO unique identifier in ERP
type_idintegerYesCO type: 1 - Regular (Stock), 2 - JIT
store_idstringYesStore unique identifier in ERP
split_group_idstringYesSplit group unique identifier in ERP
plant_idstringYesPlant unique identifier in ERP
requested_delivery_datestringYesDate and time when the order is planned to be delivered, as unix timestamp (seconds or milliseconds) or yyyy-MM-ddTHH:mm:ss
detailsarrayYesArray of detail line objects for the customer order

Detail object (inside details array):

NameTypeRequiredDescription
line_numberintegerYesCO detail line number
article_idstringYesArticle unique identifier in ERP
quantitynumberYesCO detail ordered quantity
quantity_unit_type_idintegerYesCO detail ordered quantity unit type: 1 - base unit, 2 - warehouse unit, 3 - layer unit, 4 - pallet unit
purchase_order_idstringConditionalPurchase Order identifier. Mandatory for type_id: 2 (JIT), where the purchase order must already exist in DSWMS. Ignored for type_id: 1

Request Example​

{
"id": "3000437294",
"type_id": 1,
"store_id": "010239",
"split_group_id": "1015",
"plant_id": "102849",
"requested_delivery_date": "1604481362",
"details": [
{
"line_number": 100,
"article_id": "0001",
"quantity": 72,
"quantity_unit_type_id": 1
},
{
"line_number": 200,
"article_id": "0047",
"quantity": 40,
"quantity_unit_type_id": 2,
"purchase_order_id": "3000437294"
}
]
}

Response​

200: OK — Success​

{
"success": true,
"message": null
}

400: Bad Request — Error​

{
"success": false,
"message": "Customer Order Status doesn't allow updates"
}