Stock
Frequency:
The stock data is retrieved once a day, at an agreed-upon time, for the previous date.
Expected data:
Data about stock for a specific store and date.
- Purchase Active Articles: Stock data should include only articles that active for purchasing.
- Store Active Assortment: Include stock data for articles that are part of the store's active assortment.
- Positive Stock Quantities: Only positive stock quantities should be reported.
Handling Special Cases:
- If the stock is negative, zero, or not available: The store stock quantity should be reported as 0 (zero).
Technical:
If a stock record does not exist in DSOrder, the record will be created.
If a stock record already exists in DSOrder, the existing record will be updated with the new data.
Import Full Stock
Method: POST
URL: https://{url}/stock/{date}/{store_id}
POST request is used to do full stock update for specific store and date. It deletes previously submitted data.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| date | string | Yes | Date in format yyyy-mm-dd |
| store_id | string | Yes | Unique store identifier in external system |
Request Body
The request body is a JSON array of objects.
| Name | Type | Required | Description |
|---|---|---|---|
| article_id | string | Yes | Unique article identifier in external system |
| quantity | number | Yes | Stock total quantity |
Request Example
[
{
"article_id": "ART-00001",
"quantity": 123
},
{
"article_id": "ART-00002",
"quantity": 12.250
}
]
Response
200: OK — Success
{
"success": true,
"message": null,
"data": null,
"warnings": []
}
200: OK — Error
{
"success": false,
"message": "Stock import failed",
"data": null,
"warnings": []
}
Import Partial Stock
Method: PATCH
URL: https://{url}/stock/{date}/{store_id}
PATCH request is used to do partial stock update for specific store and date. It updates existing article stock and inserts new records if required.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| date | string | Yes | Date in format yyyy-mm-dd |
| store_id | string | Yes | Unique store identifier in external system |
Request Body
The request body is a JSON array of objects.
| Name | Type | Required | Description |
|---|---|---|---|
| article_id | string | Yes | Unique article identifier in external system |
| quantity | number | Yes | Stock total quantity |
Request Example
[
{
"article_id": "ART-00001",
"quantity": 123
},
{
"article_id": "ART-00002",
"quantity": 12.250
}
]
Response
200: OK — Success
{
"success": true,
"message": null,
"data": null,
"warnings": []
}
200: OK — Error
{
"success": false,
"message": "Stock import failed",
"data": null,
"warnings": []
}