Stock

The Stock Import Endpoint

https://{BASE_URL}/imports/stock

All import integration endpoints use the same authentication parameters, please see Authentication page for more details.

The stock import endpoint is intended for the situation where the stock count needs to be overridden for one or more products. This can be necessary if the singular truth is placed in a third party system.

Each stock count imported through the stock endpoint will, if successfully imported, become a stock event of the type external_reset.

Importing stock counts

The body of the POST request must be a JSON object with the following layout:

Without variants:

{
    "stock_location_id": {
        "product1": 7,
        "product2": 7
    }
}

With variants:

{
    "stock_location_id": {
        "product1": 7,
        "product2": 7,
        "product3": {
            "variant1": 7,
            "variant2": 7
        }
    }
}

It is possible to import products that do not (yet) exist at a given stock location.

It is not possible to import stock numbers to a non existing stock location.

Upon success a HTTP 200 OK reponse will be given with body looking something like this:

{
    "status": "OK",
    "message": "Import of 2 stock value(s) initiated"
}

The number of values that has been parsed from the request will be noted in the message (as seen in the example above).