Documentation Index

Fetch the complete documentation index at: https://docs.wair.ai/llms.txt

Use this file to discover all available pages before exploring further.

POST /Stock

Prev Next

GENERAL INFORMATION

Purpose

This endpoint is used for setting/updating/correcting stock levels on a location/SKU.

How the data is used

This endpoint is used to set/update/correct the current stock on hand on a location/SKU. The stock on hand is of course the basis of all processes that Wallie can manage, making this a mandatory dataset, unless you go with the POST /StockMutations approach to share your stock information.

We only want the actual stock on hand in this endpoint, not the available stock (stock on hand plus/minus the stock allocations).

Best practices

  1. We always recommend to use POST /StockMutations as this enables you to upload the historical mutations which enables the possibilities of a backtest. If you do not have mutations in your source system you can use this endpoint. If you do have mutations and they are 100% accurately reflecting the current stock on hand, this endpoint becomes optional/not needed.

  2. We recommend to send us the updated stock as fast as possible after it changes, so the Wair platform always has the most accurate stock when creating the replenishments/redistributions.

  3. We need the stock information for both warehouses and locations (see this page of the POST /Locations for a detailed explanation on the different types of locations).

  4. At Wair we technically only know stock mutations, so when you call this API with a stock level we look at the sum of the existing stock mutations and create a mutation of the stock level from this API call is different then the sum of our stock mutations. If you only use this endpoint and send stock levels on a regular interval we just create mutations on our end if stock levels are different.

  5. This endpoint only updates the location/SKU stock levels in the API call. It does not set the stock level to 0. Make sure to also send the stock levels of 0 at least once if the stock drops to 0 on a specific location/SKU.

  6. The stockDateTime field is only used to determine the datetime for the mutation we create on our end. It cannot be used to correct past stock levels.

  7. If you want to correct the entire stock and also correct SKU’s that have a stock level of 0, you can use the fullLoad parameter set to true. This will correct the stock of all the SKU/Locations that you did not include in the requests to 0.

Common pitfalls

  1. Not aligning the skuId with the skuId you send to the POST /Items, same goes for the locationId and the POST /Locations endpoint.

  2. Not including the location/SKUs where the stock has dropped to 0, as mentioned above.

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

stockDateTime

Global stock date time used for the fullLoad, only send in combination with a fullLoad.

“2023-12-08T14:43:44.664Z“

Body example:

{
  "stock": [
    {
      "locationId": "guid01",
      "skuId": "guid01",
      "stockDateTime": "2023-12-08T14:43:44.664Z",
      "quantity": 10
    }
  ]
}

Additional information:

Fieldname

Context

Mandatory

Type / max field length

locationId

The id of the location you want to set/update/correct the stock level.

Yes

string / 80 characters

skuId

The id of the SKU you want to set/update/correct the stock level.

Yes

string / 80 characters

stockDateTime

The datetime you want us to register the correction on. Please refer to the common pitfalls for this field

Yes

datetime

quantity

What the actual stock on hand is for the location SKU

Yes

integer

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.