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.




    • Related Articles

    • Stock Management and Stock API

      A new stock management system has been added. Key features include: Makes use of stock products in CPP. The ability to export and import stock levels. Webhooks that allow retailers to receive stock level updates from suppliers in near realtime. Stock ...
    • Product Integration | Generic API

      Introduction This article has been created to show how to setup the Product integration Kornit X has built to connect to Generic API.  Setup To setup the Generic API integration, please head to your category and within and within the advanced ...
    • Red Bubble API

      Red Bubble is an eCommerce artist portal that hosts millions of artwork designs by independent artists from all around the world. The artwork is available for purchase, on demand, printed on anything from clothing & apparel to home decor & ...
    • Notification Integration | Generic API

      Introduction Kornit X has built a notification integration to connect to a Generic API. This notifications integration will alert the customers whenever an order has been received, dispatched and delivered. Integration Setup For orders that you have ...
    • Supplier Integration | Generic API

      Introduction The Order Push API from Kornit X is our generic Order Manager API allowing us to POST order data in JSON format (matching the structure of our standard orders in API) to an endpoint nominated by a supplier. This is a cheaper alternative ...