API reference

Categories

On this page

Product categories, with how many products each holds. General is the protected default category. Categories are read only through the API.

The category object#

FieldTypeMeaning
idintegerThe category id.
namestringThe category name.
slugstringThe web address part of the category.
sortintegerPosition in lists (lower first).
archivedbooleantrue for an archived category.
generalbooleantrue for the protected default category (General).
products_countinteger or nullHow many products the category holds.
created_atstringWhen the category was created (ISO 8601, UTC).
updated_atstringWhen the category was last changed (ISO 8601, UTC).

List categories#

GET/api/v1/categoriesread:categories

All product categories, with how many products each holds. General is the protected default category.

Query parameters

NameTypeMeaning
archivedbooleantrue: only archived categories; false: only active ones. Left out: both.
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/categories?limit=50" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example answer (200 OK)

{
    "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": {
        "page": 1,
        "per_page": 25,
        "total": 1,
        "last_page": 1
    },
    "links": {
        "first": "https://yourstore.example.com/api/v1/categories?page=1",
        "last": "https://yourstore.example.com/api/v1/categories?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:categories 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:categories\" scope. Add it to the key in the admin (API & webhooks > API keys), or use a key that has it.",
        "required_scope": "read:categories"
    }
}

Get a category#

GET/api/v1/categories/{id}read:categories

One category by id.

Address parameters

NameTypeMeaning
idintegerThe category id (a whole number).

Example request

curl -s "https://yourstore.example.com/api/v1/categories/7" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example answer (200 OK)

{
    "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": {}
}

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:categories scope. error.required_scope names it. (api_key_disabled and ip_not_allowed also give 403.)
404not_foundThat category does not exist.
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:categories\" scope. Add it to the key in the admin (API & webhooks > API keys), or use a key that has it.",
        "required_scope": "read:categories"
    }
}