GENERAL INFORMATION
Purpose
This endpoint is used for creating Sales and Returns and updating them if they have been modified. For us the definition of “Sales” are all the sales of your tradeable goods to end consumers.
How the data is used
The actual and historical sales data is the most crucial data set for Wallie to be able to recognize patterns in sales and generate accurate, making it a mandatory data set. The sales data is also used throughout our customer portal to show how a style is performing.
Best practices
As mentioned above, we need the sales and returns to end consumers, this means the sales of your regular brick and mortar stores (possibly also with tablet assisted sales), your e-commerce channel(s) that sell goods to end consumers, but also the sales of your re-sellers who send you the EDI SLSRPT. No need to send the B2B sales data to this endpoint.
We always recommend to have at least two full calendar years of sales data, but if you have more, we highly recommend to send it. If you limited historical sales data available in your ERP, it is worth looking to export it from your data warehouse if the is still present there.
Make sure to update the sales at a very regular interval, as mentioned in the Integration core principles, to avoid outdates sales if an export goes into an error when only running once a day.
For e-commerce sales we recommend to create a location in the POST /Locations endpoint for each of your online sales channel and use the locationId you have assigned there as the locationId for these e-commerce sales.
When sharing the re-sellers sales to end consumers (EDI SLRTP data) we also recommend to create a location in the POST /Locations endpoint for each of your re-seller location and use the locationId you have assigned there as the locationId for these sales.
All the prices we ask need to be in your local currency.
In case there is a return, a new API needs to be done with a new salesId, but with negative quantities/prices (more details below).
Ensure that the locationId used aligns with the id you are sending to the POST /Locations endpoint and the skuId on the saleslines align with the skuId sent to the POST /Items endpoint.
Common pitfalls
Not using your local currency for the prices is a common mistake.
The salesLineId’s need to be unique across all sales, often a linenumber is used instead of a salesLineId which is not unique across all sales. If you only have a linenumber, you need to combine the salesid and linenumber (seperated by a dash - or underscore _ to keep unique).
TECHNICAL INFORMATION
Authentication
Bearer token, information on page POST /Token
Headers
Name | Description | Example |
|---|---|---|
X-Tenant | Tenant code supplied by Wair | “TENANT” |
QueryParameters:
No queryParameters required.
Body example:
{
"sales": [
{
"salesId": "74bab526-90a0-433e-82e9-2a9c8bdeb8af",
"code": "POS25-000001"
"salesDateTime": "2023-09-06T13:50:31.331Z",
"currencyCode": "LOCAL",
"locationId": "0001",
"salesLines": [
{
"salesLineId": "0bab28ed-53fa-43e0-aad4-cf4a32158b4d",
"skuId": "10001-10-XXL",
"lineNumber": 1,
"originalSalesAmountInclVat": 39.99,
"salesAmountInclVat": 29.99,
"vatPercentage": 21,
"costPrice": 9.50,
"online": false,
"quantitySold": 1,
"quantityTransferred": 1,
"quantityCancelled": 0
]
}
]
}
]
}Field information:
Fieldname | Context | Mandatory | Type / max field length |
|---|---|---|---|
salesId | Unique identifier for this sale, for example a uuid, needs to be unique across all sales. If you want to update a sale, send the sale again using this id. | Yes | string / 80 characters max |
salesDateTime | Yes | datetime | |
currencyCode | We only support local currency, so sending a fixed value of “LOCAL” will do. | Still mandatory for now but field will be deprecated | |
locationId | The location where the sale took place, read | Yes | string / 80 chara |
salesLineId | Unique identifier for this sales line, for example a uuid, needs to be unique across all sales lines. Read the common pitfall, as this can go wrong in the implementatipn | Yes | string / 80 chara |
skuId | The id of the SKU that has been sold to the customer | Yes | |
lineNumber | The line number of the sales line, does not have to be unique across all sales | Yes | integer |
originalSalesAmountInclVat | The price before discounts, including VAT. In case of a return/refund, amount needs to be negative | Yes | decimal |
salesAmountInclVat | The price after discounts, including VAT. In case of a return/refund, amount needs to be negative | Yes | decimal |
vatPercentage | The sales tax percentage | Yes, but if you do not have this information then default to 0 | decimal |
costPrice | The price the retailer paid to purchase a single unit of this SKU from the vendor. For returns/refunds, this amount should remain positive also in case of refunds (use unit cost only, not unit cost × quantity). | ||
online | If the sale was from an online sales channel or not | Yes | boolean |
quantitySold | The number of pieces | Yes | decimal |
quantityTransferred | The same as the quantitySold by default | Still mandatory for now but field will be deprecated | decimal |
quantityCancelled | You can default this to 0, as it is being deprecated. | Still mandatory for now but field will be deprecated | decimal |
RESPONSE
StatusCodes:
200 = OK.
401 = Unauthorized, which means an expired/missing/invalid token.
400 = Bad request, see body of the response to check which validation errors have occured.
500 = System error, see body of the response to check which error has occured or contact integration support.
Body Example:
No body in the response.