Stock API for the retrieval and setting of stock values

Stock API for the retrieval and setting of stock values

Custom Gateway provides a Stock API to allow suppliers to provide up-to-date stock information when stock positions change. This is updated via a Custom Gateway API end-point  


There are two API end-points, one which allows the setting of stock levels per stock product and one that allows the retrieval of stock status for all products.


The stock API allows Asiatic Carpets to POST stock updates using a RESTful API. 



1.1 Setting stock levels

For stock updates, there is a simple call that allows the update of stock quantity, based on the manufacturer’s sku assigned to the stock product.  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 } }, { "sku": "EFGH", "data": { "quantity_available": 12 } } ]' -H "Authorization: Basic REFID:<KEY>" -H"Content-type: application/json" https://api-sl-2-2.custom-gateway.net/stock/availability


where REFID is the Custom Gateway supplier company code and where KEY is the API Key associated with that supplier company.



1.2 Retrieving stock levels

A second API end-point allows request and retrieval of stock levels for each stock product via the Retailer company within Custom Gateway.


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 <CompanyID>: <APIKEY>"


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. ...
    • Veeqo Stock Management API Accounting Integration

      An integration has been made between Veeqo and OMS in order to control stock within the Veeqo system. Settings There are two settings specific to this integrations API key and Channel Name, the Channel name is the name of the store (store and channel ...
    • Managing Product Stock

      To manage stock, first log into the Order-iT system and choose the 'Stock Items' option from the Order-iT section in the left hand column. This page shows the total stock, any allocated stock and the amount available for new orders. The search block ...
    • Stock Picking Documents - Standard

      An example of the label can be seen below, and in PDF form attached This label contains a Item Description, SKU, Quantity and Item ID Barcode for station scanpoints. Label Dimensions - 110 x 30 MM Examples Purchase Locations -  ...
    • KornitX Platform Imports - Simple Stock (Creation Only)

      We offer this quick and easy way for fulfillers to create basic Stock Products which can be used for configurable stock items within variants or just to quickly create stock products to be sold on retailer websites. The headers for this import have ...