Popular

↑↓ move ↵ open All results →

Integration API · Inventory

Set stock

PUThttps://{store}/api/v1/integrations/inventory

Sets the stock of up to 100 variants at once, by SKU (case-insensitive) or by variant id — also variants made in the admin, not only those your key created. Each row is reported on its own: one unknown SKU never rejects the batch.

status per row: updated, unchanged, not_found, or ambiguous_sku when two variants share the SKU (set it by variant_id). A change sends the inventory.updated webhook, as an edit in the admin does.

Integration key with the inventory:write ability: Authorization: Bearer {key}.
Idempotent. Needs an Idempotency-Key header: repeating the key returns the first response.

Request body application/json

itemsarray of objectsrequired
Rows of {sku or variant_id, quantity}: 1 to 100; quantity 0 to 1 000 000.

Example

{
    "items": [
        {
            "sku": "HOOD-BLK-M",
            "quantity": 12
        },
        {
            "variant_id": 4412,
            "quantity": 0
        }
    ]
}

Responses

200One result per row, in request order.
{
    "data": [
        {
            "index": 0,
            "sku": "HOOD-BLK-M",
            "variant_id": 4410,
            "status": "updated",
            "quantity": 12
        },
        {
            "index": 1,
            "sku": null,
            "variant_id": 4412,
            "status": "not_found",
            "quantity": null
        }
    ]
}
401Missing, unknown or revoked key.
{
    "code": "unauthenticated",
    "message": "Integration key is inactive.",
    "field": null
}
403The key lacks inventory:write, or the store’s plan has no API access.
{
    "code": "forbidden",
    "message": "Integration key cannot inventory:write.",
    "field": null
}
422A field is invalid; field names it.
{
    "code": "validation_error",
    "message": "name is required.",
    "field": "name"
}
429More than 60 requests a minute for this key. Wait Retry-After seconds.
{
    "code": "rate_limited",
    "message": "Too many integration requests.",
    "field": null
}