GENERAL INFORMATION
Purpose
This endpoint is used for creating and updating your stock targets (also known as min/max, safety level/reorder point). The stock target object also includes a “reservedQuantity”, so if you do not have stock targets but do have reservations on the stock you can use this endpoint to set/update the stock reservations.
How the data is used
This data is used to inform Wallie about your current/historical stock targets. This data is used to share the current/historical stock targets you have used before Wallie with 2 reasons:
You share your initial stock target to inform Wallie there is new stocktarget for that location/SKU to inform Wallie he can take over the stock target calculation
We can keep track of processed stock targets, to measure Wallie’s impact correctly
When using the stock target integration for Wallie this becomes a mandatory dataset to send.
As mentioned above, you can also create reservations on the stock, to exclude stock from a specific warehouse for replenishment.
Best practices
Both the stock targets that are created in the source system need to be sent, but also the stock targets that Wallie has generated, which are retrieved from GET /Recommendations/stockTargets needs to be sent back using this endpoint. This way we can exclude the successfully retrieved stock targets from Wallie from the GET /Recommendations/stockTargets endpoint. This can make a difference of tens of thousands stock targets in that API.
When you have stock targets and are using this endpoint for that purpose, please send regular updates (at least once a day) to ensure the most recent stock targets are in the Wair platform.
When do not have stock targets in your source system, but want to implement this endpoint for the reservations you can set the minimum/maximum quantity to null (not zero).
When Wallie wants to stop replenishment he sets the stock target to 0. In most ERP systems the stock target is deleted when set to 0, but we want to have feedback that the stock target was successfully processed so take this situation into account. We do have a fall back mechanism on our end that we assume the stock target has been processed if it was set to 0 but we did not receive feedback.
Common pitfalls
Not aligning the skuId with the skuId you send to the POST /Items, same goes for the locationId and the POST /Locations endpoint.
Do not generated a random id for the stockTargetId field in the integration, only use id’s that are fixed in the source system, this prevents accidentally creating targets instead of trying to update them with a different endingDate for example.
Use cases
As a business analyst I want to measure how Wallie’s stock targets perform versus our own historical stock targets in the backtest.
As a merchandiser I want to inform Wallie about the stock reservations we have put on our warehouse’s stock on hand for our E-Commerce channels, so this is not used for replenishment.
As a business analyst I want to inform Wallie that we have successfully retrieved and set Wallie’s stock target so the performance can be tracked in the Wair platform.
TECHNICAL INFORMATION
Authentication
Bearer token, information on page POST /Token
Headers
Name | Description | Example |
|---|---|---|
X-Tenant | Tenant code supplied by Wair | “TENANT” |
QueryParameters:
Name | Description | Example |
|---|---|---|
fullLoad | See documentation: Integration core principles | true |
moreRecordsAvailable | See documentation: Integration core principles | false |
Body example:
{
"stockTargets": [
{
"stockTargetId": "fe95aaef-34f1-4b74-8019-03a481dee321",
"locationId": "d83d4014-9cb3-46eb-8779-33b6f513e4f1",
"skuId": "100001-10-M",
"minimumQuantity": 1,
"maximumQuantity": 3,
"reservedQuantity": 10,
"startingDate": "2023-09-08T09:44:09.246Z",
"endingDate": "2025-10-08T09:44:09.246Z"
}
]
}Field information:
Fieldname | Context | Mandatory | Type / max field length |
|---|---|---|---|
stockTargetId | Unique identifier for this stock target, for example a uuid, needs to be unique across all stock targets. If you want to update a stock target, send it again using this id. | Yes | string / 80 characters max |
locationId | id of the SKU you are setting the stock target/reservation for | Yes | string / 80 characters max |
skuId | id of the SKU you are setting the stock target/reservation for | Yes | string / 80 characters max |
minimumQuantity | The minimum quantity of stock target (leave null if you only want to set reservation) | No | integer |
maximumQuantity | The maximum quantity of stock target (leave null if you only want to set reservation) | No | integer |
reservedQuantity | The quantity which you want to reserve (leave null if you only want to set the stock targets) | No | Integer |
startingDate | The FROM date where this stock target/reservation becomes active. You can default it to '1970-01-01T00:00:00.000Z' if you do not have this in the source system, as this field is mandatory | Yes | datetime |
endingDate | The TO date where this stock target/reservation becomes active. | No | datetime |
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.