Stock API
The KornitX platform offers fulfillers the ability to update the stock of the products that they supply. This is achieved by setting the “Stock” flag in the General tab of a blank product in the Catalog module or setting the Product Type to Stock Only.
The blank product with the stock flag would hold a stock value for itself only. For the product with the Product Type set to Stock Only, it’s possible to link that stock product to 1 or more blank products in the platform. This link can even be done at variant level.
The stock levels of these products can then be managed in the Production module under Inventory. Each time a product is ordered, the value set against the stock product that’s linked to it, is reduced by 1.
In addition to this, KornitX offers API endpoints to allow fulfillers to update of stock values within the platform.
Updating Stock Values in the KornitX Platform
The Stock Availability endpoint allows fulfillers to update the stock values of the products that they supply, via a HTTP PUT request.
Stock Availability Endpoint - https://api-sl-2-2.kornitx.net/stock/availability
Request Headers
The request requires the Content-Type and Basic Authorization headers.
Content-Type: application/json
Authorization: Basic COMPANYREFID:APIKEY
Don't forget to replace COMPANYREFID
and APIKEY
with your fulfiller company reference ID and API key respectively!
Request Body
Stock can be updated in 2 ways. By fulfiller SKU or by barcode.
The fulfiller SKU is stored in the Fulfiller SKU field, which is in the General tab of the stock product in the catalog module.
Barcode is found in the Barcode field, which is in the eCommerce tab of the stock product in the catalog module.
An example request body showing each method is provided below.
[
{
"barcode": "1234567891011",
"data": {
"quantity_available": 200
}
},
{
"sku": "SGS7E-CS-G-TEST",
"data": {
"quantity_available": 101
}
},
{
"sku": "R86409-LXL-PSTEST",
"data": {
"quantity_available": 50
}
}
]
Response Body
An example response body can be seen below.
{
"successful": [
{
"id": 8965296,
"quantity_available": 200,
"last_modified": "2023-02-07 15:18:08"
},
{
"id": 8965089,
"quantity_available": 101,
"last_modified": "2023-02-07 15:18:08"
},
{
"id": 8274177,
"quantity_available": 50,
"last_modified": "2023-02-07 15:18:08"
}
]
}