Purchase Orders
Frequency:
Purchase order data and changes are required to be sent in near real-time.
Expected data:
Purchase order document to be created or updated.
Technical:
If a purchase order does not exist in DSWMS, it will be created.
If a purchase order already exists in DSWMS, the existing document will be updated with the new data.
An update is only possible until the start of the receive process on the DSWMS side for the respective purchase order.
POST https://{url}/v1/orders/purchase
Create or update a purchase order.
Request Body
The request body is a JSON object containing purchase order header fields and a details array with the order lines.
Purchase order fields:
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | PO unique identifier in ERP |
| type_id | integer | No | PO type: 1 - Regular, 2 - JIT, 3 - XDOCK, 4 - Empties return, 5 - Material return |
| split_group_id | string | Yes | Split group unique identifier in ERP |
| plant_id | string | Yes | Plant unique identifier in ERP |
| supplier_id | string | Yes | Supplier unique identifier in ERP |
| supplier_name | string | Yes | Supplier name |
| order_date | string | Yes | PO order date |
| delivery_date | string | Yes | PO delivery date |
| proposal_order_id | string | No | Proposal order identifier from DSO |
| details | array | Yes | Array of detail line objects for the purchase order |
Detail object (inside details array):
| Name | Type | Required | Description |
|---|---|---|---|
| line_number | integer | Yes | PO detail line number |
| article_id | string | Yes | Article unique identifier in ERP |
| min_purchase_shelf_life | string | Yes | Minimum shelf life allowed to receive |
| quantity | number | Yes | PO detail ordered quantity |
| quantity_unit_type_id | integer | Yes | PO detail quantity unit type: 1 - base unit, 2 - warehouse unit, 3 - layer unit, 4 - pallet unit |
Request Example
{
"id": "3000437294",
"type_id": 1,
"split_group_id": "1015",
"plant_id": "102849",
"supplier_id": "917923956",
"supplier_name": "Coca Cola Latvia SIA",
"order_date": "1603979144",
"delivery_date": "1604340600",
"proposal_order_id": "1234567",
"details": [
{
"line_number": 100,
"article_id": "0001",
"min_purchase_shelf_life": "1605000600",
"quantity": 144,
"quantity_unit_type_id": 1
},
{
"line_number": 200,
"article_id": "0047",
"min_purchase_shelf_life": "1606023000",
"quantity": 60,
"quantity_unit_type_id": 2
}
]
}
Response
200: OK — Success
{
"success": true,
"message": null
}
400: Bad Request — Error
{
"success": false,
"message": "Reception has already started"
}