API introduction

Responses and errors

On this page

Every answer is JSON and has the same shape.

Success#

A success answer has data and meta. A list also has links.

{
    "data": {
        "id": 3,
        "name": "Sample Category",
        "slug": "sample-category",
        "sort": 1,
        "archived": false,
        "general": false,
        "products_count": 12,
        "created_at": "2026-10-01T09:00:00Z",
        "updated_at": "2026-10-01T09:00:00Z"
    },
    "meta": {}
}
  • In a list, meta has page, per_page, total and last_page, and links has first, last, prev and next (null when there is none). See Pagination.
  • In every other answer meta is an empty object {}.
  • Creating a product can add meta.warnings: a list of points that did not stop the product from being created.
  • Dates are ISO 8601 in UTC (for example 2026-11-21T10:00:00Z); the created_at of an order is written with its UTC offset. Money is in whole units of the store's currency. Ids are whole numbers and never change.
  • Adding ?expand=full to the original product and order calls adds more fields. See Versioning.

HTTP status codes#

StatusMeaning
200OK: the call worked.
201Created: something new was made. These calls answer 201 when they succeed: POST /products, POST /products/{id}/variants, POST /inventory/adjustments, POST /orders/{number}/notes. (Adjusting stock answers 200 instead when the adjustment changed nothing.)
401No key, or a key that is not valid, revoked or expired.
403The key is paused, used from a blocked address, or lacks the scope for this call.
404No such address, or no such product, order, size or other resource.
405That method does not exist on that address.
409Idempotency-Key problem, or a change that conflicts with the current state (for example the stock is not the number you expected).
422The request was understood but refused: a field is missing or wrong, or a rule of the store stops it. error.fields says what to fix.
429Too many requests. Wait for the Retry-After seconds.
500Something went wrong on our side. Nothing is recorded as done unless a success answer says so; try again later.
503The store could not reach its database for a moment (service_busy). Wait the seconds in the Retry-After header (10) and send the same request again. For POST and PATCH, send the same Idempotency-Key.

Errors#

Every error has the same shape:

{
    "error": {
        "code": "validation_failed",
        "message": "The request could not be accepted. See \"fields\" for what to fix.",
        "fields": {
            "hsn": [
                "HSN 1234567 has 7 digits, so a leading zero was probably lost. Send it as 01234567 (an HSN code is 4, 6 or 8 digits). It is never padded automatically."
            ]
        }
    }
}
  • code is short and stable. Check it in your code.
  • message says what went wrong in plain words. Show it to a person, not to your logic.
  • fields appears for 422 and lists, for each field, what to fix.
  • required_scope appears for 403 insufficient_scope and names the scope the key is missing.

Good to know

One answer is shaped differently. When the store cannot reach its database for a moment, the answer is 503 with a Retry-After: 10 header and the body {"error": "service_busy", "message": "..."}: here error is a plain word, not an object. Read the HTTP status first; treat any 503 as "try again shortly".

Error codes#

CodeHTTP statusMeaning
missing_api_key401No key was sent. Use "Authorization: Bearer KEY" or the X-Api-Key header.
invalid_api_key401The key is not valid. Check you copied all of it.
revoked_api_key401The key was revoked in the admin. Create a new one.
expired_api_key401The key passed its expiry date.
api_key_disabled403The key is paused in the admin.
ip_not_allowed403The key has an IP allow-list and your address is not on it.
insufficient_scope403The key does not have the scope this call needs. error.required_scope names it.
not_found404No such address, product, order, size or other resource.
method_not_allowed405That method does not exist on that address (for example DELETE on an order: nothing is deleted through the API).
idempotency_key_reuse409The Idempotency-Key was already used for a different request.
idempotency_in_progress409The first request with this Idempotency-Key is still running. Retry in a moment.
stock_changed409You sent expected and the stock is no longer that number. Nothing was changed.
validation_failed422A field is missing or wrong. error.fields says which and why.
transition_not_allowed422The order cannot move to that status (cancelled orders are final; online orders must be paid first). The message is the admin's.
order_not_cancellable422A delivered or already cancelled order cannot be cancelled.
insufficient_stock422You tried to remove more stock than is available.
cannot_publish422The product failed the import's checks, so it was not published.
product_archived422An archived product cannot be published through the API.
rate_limited429The key sent more requests than its per-minute limit. Wait for Retry-After.
too_many_failed_attempts429Too many invalid keys from your address. Wait for Retry-After.
server_error500Something went wrong on our side; nothing is recorded as done unless a success answer says so.
service_busy503The store could not reach its database for a moment. Wait the seconds in Retry-After (10) and send the same request again. Here the whole answer is {"error": "service_busy", "message": "..."}: error is plain text, not an object.

Rare errors can also use the codes forbidden (403) or http_error with the matching HTTP status.

Response headers#

HeaderWhenMeaning
X-RateLimit-LimitEvery answer to an authenticated requestThe requests per minute this key may send.
X-RateLimit-RemainingSameHow many are left in the current minute.
X-RateLimit-ResetSameA Unix time: when the count starts again.
Retry-AfterOn 429 and 503 (and on a 409 that says the first request is still running)Seconds to wait before you try again.
Idempotent-ReplayedWhen a stored answer is returnedThe value is true.
WWW-AuthenticateOn 401The value is Bearer.
AllowOn 405The methods that exist on that address.