Skip to main content

Sales

Frequency:

Sent once a day, at an agreed time, for the previous day — one request per store.

Expected data:

Total sold quantity per article for a specific store and date.

  • Positive sales quantities: report only records with a positive sold quantity.
  • Purchase active articles: include only articles that are active for purchasing.
  • Store active assortment: include only articles that are part of the store's active assortment.

Excluded sales data:

  • Negative or zero sales must not be reported.
  • Articles without sales must not be included.
  • Discounted sales, where the price is reduced because the article cannot be sold in time (for example, nearing the end of its shelf life), must not be reported. These are considered lost sales and are not to be confused with promotion sales.

Technical:

  • Articles unknown to DSOrder are skipped without an error.
  • Records with a quantity of 99999 or more are skipped without an error.
  • A missing or null quantity is saved as 0.
  • Quantities are stored with three decimal places.
  • Each successful import triggers recalculation in DSOrder for that store and date.

Import Sales​

Method: POST
URL: https://{url}/sales/{date}/{store_id}

Replaces the sales of the store for the date. All sales previously sent for this store and date are deleted and replaced with the request content, so always send the complete sales of the day.

Resending the same request is safe.

Path Parameters​

NameTypeRequiredDescription
datedateYesSales date in yyyy-mm-dd format
store_idstringYesUnique store identifier in the external system

Request Body​

The request body is a JSON array of objects.

NameTypeRequiredDescription
article_idstringYesUnique article identifier in the external system
quantitynumberYesTotal sold quantity in base units

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​

Unknown store:

{
"success": false,
"message": "Store with external ID 'STORE-9999' was not found for organization '42'",
"data": null,
"warnings": []
}

Request body is not a valid array of sales records, or contains undocumented fields:

{
"success": false,
"message": "Failed to map JSON",
"data": null,
"warnings": []
}

Other possible messages are "Failed to process JSON" (body is not valid JSON) and "Failed to process request" (unexpected error, for example a date that is not in yyyy-mm-dd format).