API reference

Inventory

On this page

Stock levels for each size, and the permanent stock history. The only way to change stock through the API is adjusting it with a reason, which is written to the stock history with the key as its author.

The stock row#

FieldTypeMeaning
variant_idintegerThe size id.
product_idintegerThe product id.
productstringThe product name.
sizestringThe size label.
skustring or nullThe SKU of the size (or of the product when it has one size).
on_handintegerUnits counted on the shelf.
reservedintegerUnits held for orders.
availableintegerUnits the shop can sell from.
reorder_levelinteger or nullThe level at which the size counts as low. null means the store's default level applies.
statusstringin_stock, low or out.
counted_atstring or nullWhen the size was last counted (ISO 8601, UTC).
updated_atstring or nullWhen the stock level last changed (ISO 8601, UTC).

The stock history line#

FieldTypeMeaning
idintegerThe movement id.
variant_idintegerThe size id.
product_idinteger or nullThe product id.
skustring or nullThe SKU of the size.
reasonstringA reason code, for example sale, damaged or adjustment_add.
reason_labelstringThe reason in words.
changeintegerThe change in units: positive when stock was added, negative when it was removed.
balance_afterintegerUnits on hand after the change.
referenceobject or nullWhere the change came from: an object with type and id, or null.
reference.typestringThe kind of source, for example api_key.
reference.idintegerThe id of the source.
notestring or nullThe note saved with the change.
bystringapi_key, staff or system.
created_atstringWhen the change was recorded (ISO 8601, UTC).

The answer to an adjustment#

FieldTypeMeaning
movement_idintegerThe id of the stock history line that was written.
variant_idintegerThe size that was changed.
modestringadd, remove or set, as you sent it.
beforeintegerUnits on hand before the change.
afterintegerUnits on hand after the change.
changeintegerThe change in units (positive or negative).
inventoryobjectThe new stock row of the size (the same fields as GET /inventory).

List stock levels#

GET/api/v1/inventoryread:inventory

One row per size: on_hand, reserved, available (what the shop sells from), reorder_level and a status (in_stock, low, out).

Query parameters

NameTypeMeaning
product_idintegerOnly the sizes of this product.
variant_idintegerOnly this size.
skustringThe SKU of a size (or of a product that has one size).
statusstringin_stock, low or out.
One of: in_stock, low, out
qstringWords in the product name, SKU or size.
limitintegerRows per page, 1 to 100 (default 25). per_page works too.
pageintegerPage number, starting at 1.
updated_sincestringOnly rows changed at or after this time (ISO 8601, for example 2026-11-21T10:00:00Z, or a date).

Example request

curl -s "https://yourstore.example.com/api/v1/inventory?status=low&limit=50" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example answer (200 OK)

{
    "data": [
        {
            "variant_id": 31,
            "product_id": 7,
            "product": "Sample Product",
            "size": "250 g",
            "sku": "SAMPLE-001-250",
            "on_hand": 8,
            "reserved": 0,
            "available": 8,
            "reorder_level": 10,
            "status": "low",
            "counted_at": "2026-11-01T09:00:00Z",
            "updated_at": "2026-11-21T10:00:00Z"
        }
    ],
    "meta": {
        "page": 1,
        "per_page": 25,
        "total": 1,
        "last_page": 1
    },
    "links": {
        "first": "https://yourstore.example.com/api/v1/inventory?page=1",
        "last": "https://yourstore.example.com/api/v1/inventory?page=1",
        "prev": null,
        "next": null
    }
}

Errors

StatusCodeWhen
401missing_api_key, invalid_api_key, revoked_api_key, expired_api_keyThe key is missing, not valid, revoked or expired.
403insufficient_scopeThe key does not have the read:inventory scope. error.required_scope names it. (api_key_disabled and ip_not_allowed also give 403.)
422validation_failedupdated_since could not be read as a date or time.
429rate_limitedMore requests than the key's limit in a minute. Wait for Retry-After.

Example error answer (403):

{
    "error": {
        "code": "insufficient_scope",
        "message": "This API key does not have the \"read:inventory\" scope. Add it to the key in the admin (API & webhooks > API keys), or use a key that has it.",
        "required_scope": "read:inventory"
    }
}

List stock history#

GET/api/v1/inventory/movementsread:inventory

The permanent stock history, newest first: every change with its reason, the balance after it and where it came from.

from and to are dates (YYYY-MM-DD) and include the whole day.

Query parameters

NameTypeMeaning
product_idintegerOnly this product.
variant_idintegerOnly this size.
skustringThe SKU of a size.
reasonstringA reason code, for example sale, damaged, adjustment_add.
One of: opening, sale, order_cancelled, payment_failed_restock, return, return_restock, return_writeoff, adjustment_add, adjustment_remove, damaged, expired, found, count_correction, import, manual_edit, transfer_out, transfer_in, admin_reinstate, late_payment_oversold, resync
fromstringFrom this date (YYYY-MM-DD).
tostringUp to this date (YYYY-MM-DD).
limitintegerRows per page, 1 to 100 (default 25). per_page works too.
pageintegerPage number, starting at 1.

Example request

curl -s "https://yourstore.example.com/api/v1/inventory/movements?sku=SAMPLE-001-250&limit=50" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example answer (200 OK)

{
    "data": [
        {
            "id": 9012,
            "variant_id": 31,
            "product_id": 7,
            "sku": "SAMPLE-001-250",
            "reason": "adjustment_add",
            "reason_label": "Stock added",
            "change": 24,
            "balance_after": 32,
            "reference": {
                "type": "api_key",
                "id": 2
            },
            "note": "Received: Delivery from the supplier",
            "by": "api_key",
            "created_at": "2026-11-21T10:00:00Z"
        }
    ],
    "meta": {
        "page": 1,
        "per_page": 25,
        "total": 1,
        "last_page": 1
    },
    "links": {
        "first": "https://yourstore.example.com/api/v1/inventory/movements?page=1",
        "last": "https://yourstore.example.com/api/v1/inventory/movements?page=1",
        "prev": null,
        "next": null
    }
}

Errors

StatusCodeWhen
401missing_api_key, invalid_api_key, revoked_api_key, expired_api_keyThe key is missing, not valid, revoked or expired.
403insufficient_scopeThe key does not have the read:inventory scope. error.required_scope names it. (api_key_disabled and ip_not_allowed also give 403.)
422validation_failedfrom or to is not a date like 2026-11-21.
429rate_limitedMore requests than the key's limit in a minute. Wait for Retry-After.

Example error answer (403):

{
    "error": {
        "code": "insufficient_scope",
        "message": "This API key does not have the \"read:inventory\" scope. Add it to the key in the admin (API & webhooks > API keys), or use a key that has it.",
        "required_scope": "read:inventory"
    }
}

Add, remove or set stock#

POST/api/v1/inventory/adjustmentswrite:inventory

The only way to change stock through the API. The same rules as the Adjust box on the Inventory page: a reason from the same list is required, you cannot remove more than is available, and "set" means a counted number (reason correction or other). It is recorded in the stock history with this key as the author. Send expected to refuse the change if the stock is not what you last saw. Returns the movement and the new stock row.

Send variant_id or sku to say which size to change.

The answer is 201 when the stock changed and 200 when the adjustment changed nothing. It contains the stock history line (movement_id) and the new stock row.

Send expected (the available stock you last saw) to make the change safe against another change in between: if the stock is different, nothing is changed and you get 409 stock_changed.

Request body (JSON)

FieldTypeRequiredLimitsMeaning
variant_idintegerNoThe size to change. Send this or sku.
Example: 31
skustringNoat most 100 charactersThe SKU of the size (or of a product that has exactly one size). Send this or variant_id.
Example: SAMPLE-001-250
modestringYesadd or remove: change by quantity. set: make the stock exactly quantity (a counted number).
One of: add, remove, set
Example: add
quantityintegerYes0 to 1000000Units to add or remove (1 or more), or the counted number for set.
Example: 24
reasonstringYesreceived or found (add only), damaged or expired (remove only), correction or other (any; set needs one of these). other needs a note.
One of: received, found, damaged, expired, correction, other
Example: received
notestring or nullNoat most 500 charactersA note for the stock history (required when the reason is other).
Example: Delivery from the supplier, invoice 4471
expectedinteger or nullNoat least 0The available stock you last saw. If it has changed, nothing is changed and you get 409.
Example: 96

Any field not listed here is refused with 422. Send an Idempotency-Key header so a retry is safe (see Requests).

Example request

curl -s -X POST "https://yourstore.example.com/api/v1/inventory/adjustments" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6f1c0b3e-0d5a-4a52-9d5e-1f6c2a7b9e10" \
  -d '{
    "sku": "SAMPLE-001-250",
    "mode": "add",
    "quantity": 24,
    "reason": "received",
    "note": "Delivery from the supplier, invoice 4471"
}'

Example answer (201 Created)

{
    "data": {
        "movement_id": 9012,
        "variant_id": 31,
        "mode": "add",
        "before": 8,
        "after": 32,
        "change": 24,
        "inventory": {
            "variant_id": 31,
            "product_id": 7,
            "product": "Sample Product",
            "size": "250 g",
            "sku": "SAMPLE-001-250",
            "on_hand": 32,
            "reserved": 0,
            "available": 32,
            "reorder_level": 10,
            "status": "in_stock",
            "counted_at": "2026-11-01T09:00:00Z",
            "updated_at": "2026-11-21T10:00:00Z"
        }
    },
    "meta": {}
}

Errors

StatusCodeWhen
401missing_api_key, invalid_api_key, revoked_api_key, expired_api_keyThe key is missing, not valid, revoked or expired.
403insufficient_scopeThe key does not have the write:inventory scope. error.required_scope names it. (api_key_disabled and ip_not_allowed also give 403.)
404not_foundThe size named by variant_id or sku does not exist.
422validation_failedA field is missing or wrong. error.fields says which and why.
422insufficient_stockYou tried to remove more stock than is available.
409stock_changedYou sent expected and the stock is no longer that number. Nothing was changed.
409idempotency_key_reuse, idempotency_in_progressThe Idempotency-Key was used for a different request, or the first request with it is still running.
429rate_limitedMore requests than the key's limit in a minute. Wait for Retry-After.

Example error answer (422):

{
    "error": {
        "code": "validation_failed",
        "message": "The request could not be accepted. See \"fields\" for what to fix.",
        "fields": {
            "mode": [
                "The mode field is required."
            ]
        }
    }
}