Stock API for the retrieval and setting of stock values

Stock API for the retrieval and setting of stock values

KornitX provides a Stock API to allow suppliers to provide up-to-date stock information when stock positions change by making a PUT request to the stock update endpoint.


A retailer can also use the stock API to retrieve stock information by making a GET request to the stock retrieval endpoint.
Alert
Please note that fulfillers are not able to send a GET request against their own stock.
Use of these API endpoints is optional.

Endpoints


1.1 Updating Stock Levels

Stock levels can be updated using either the fulfiller SKU or the barcode as the identifier of the stock product.  The barcode of a stock product can be found in the eCommerce and Data tab of the product.
For stock updates, there is a simple call that allows the update of stock quantity.  The following provides an example of a call that sets the quantity of two stock products:
curl-X PUT -d"{{"sku":"ABCD","data": {"quantity_available": 10 }},{"barcode": "1234567891011", "data": {"quantity_available":12}} ]'-H "Authorization: Basic <COMPANYREFID>: <APIKEY>" -H"Content-type: application/json" https://api-sl-2-2.custom-gateway.net/stock/availability
where <COMPANYREFID> is your fulfiller company ref ID and where <APIKEY> is the API Key associated with that fulfiller company.

1.2 Retrieving stock levels

A second API end-point allows request and retrieval of stock levels for each stock product via the sales channel company within KornitX.  Use of this endpoint requires fulfillers to keep stock levels up to date for the products that they supply.

An example of the API call and data retrieved is shown below:


curl "https://api-sl-2-2.custom-gateway.net/stock" -H"Authorization: Basic <COMPANYREFID>:<APIKEY>"
where <COMPANYREFID> is your sales channel company ref ID and where <APIKEY> is the API Key associated with that sales channel company.
The following illustrates a sample of the data structure and attributes retrieved by the above API call:

{

   "stock":[

      {

         "linked":[

            {

               "product":{

                  "id":1538144,

                  "supplier_sku":"00884422",

                  "retail_sku":"00884422"

               },

               "variant":null

            }

         ],

         "quantity_available":10000,

         "lead_time_days":0,

         "daily_capacity":0

      },

      {

         "linked":[

            {

               "product":{

                  "id":2947461,

                  "supplier_sku":"FM06231FOC",

                  "retail_sku":""

               },

               "variant":null

            }

         ],

         "quantity_available":0,

         "lead_time_days":0,

         "daily_capacity":0

      }

   ]

}


The API call will return the supplier and retail SKU associated with each stock product visible to the Retailer, variant data (where for example there are linked size options), the quantity available (stock level) and any lead-time and daily capacity metrics set against the stock product.