Inventory API

Easily update inventory in your Shopify store in bulk based on SKUs or Barcodes

Last updated
December 10, 2024

POST Bulk update inventory

Update inventory in a store in bulk based on provided SKUs or Barcodes.

POST /api/{store_host}/inventory/bulk_update

Parameters

type required
The type of inventory change you would like to use for the bulk update. May be one of "available" or "on_hand".

lookup_key required
The key which should be used to search your products while performing the bulk update. May be one of "sku" or "barcode".

inventory_levels required
A list of inventory level objects which should be applied to the store. Each inventory level object must provide:

  • location_id: the Shopify internal ID for the inventory location where the inventory change should be applied to.
  • lookup_value: the SKU or Barcode (depending on which value was provided in the lookup_key parameter) which the inventory change should be applied to.
  • inventory_level: the new inventory level which should be applied.
[
  {
    "location_id": 123456789,
    "lookup_value": "EXAMPLE-SKU-123",
    "inventory_level": 4
  },
  ...
]


Example

The following example cURL request bulk updates the available inventory for two SKUs at the location 123456789 in the store example.myshopify.com.

Request

curl --location 'https://api.synkro-app.com/api/stores/example/inventory/bulk_update' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-Synkro-Access-Token: synkro_at_*******' \
--data '{
    "type": "available",
    "lookup_key": "sku",
    "inventory_levels": [
        {
            "location_id": 123456789,
            "lookup_value": "EXAMPLE-SKU-1",
            "inventory_level": 1
        },
        {
            "location_id": 123456789,
            "lookup_value": "EXAMPLE-SKU-2",
            "inventory_level": 2
        }
    ]
}'


Successful response 202

{
    "message": "Updating inventory for 2 found variants in 1 sub-operation(s)"
}

Close Modal