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#
| Field | Type | Meaning |
|---|---|---|
id | integer | The category id. |
name | string | The category name. |
slug | string | The web address part of the category. |
sort | integer | Position in lists (lower first). |
archived | boolean | true for an archived category. |
general | boolean | true for the protected default category (General). |
products_count | integer or null | How many products the category holds. |
created_at | string | When the category was created (ISO 8601, UTC). |
updated_at | string | When 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
| Name | Type | Meaning |
|---|---|---|
archived | boolean | true: only archived categories; false: only active ones. Left out: both. |
limit | integer | Rows per page, 1 to 100 (default 25). per_page works too. |
page | integer | Page number, starting at 1. |
updated_since | string | Only 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"<?php
$ch = curl_init('https://yourstore.example.com/api/v1/categories?limit=50');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY',
],
]);
$response = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) {
// $response['error']['code'] and $response['error']['message'] say what to fix
}// Node.js 18 or newer (fetch is built in). Save as call.mjs and run: node call.mjs
const res = await fetch('https://yourstore.example.com/api/v1/categories?limit=50', {
headers: {
Authorization: 'Bearer YOUR_API_KEY',
},
});
const json = await res.json();
if (!res.ok) {
// json.error.code and json.error.message say what to fix
}# Python 3 with the requests library (pip install requests)
import requests
res = requests.get(
"https://yourstore.example.com/api/v1/categories?limit=50",
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=30,
)
data = res.json()
if not res.ok:
# data["error"]["code"] and data["error"]["message"] say what to fix
print(data["error"])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
| Status | Code | When |
|---|---|---|
| 401 | missing_api_key, invalid_api_key, revoked_api_key, expired_api_key | The key is missing, not valid, revoked or expired. |
| 403 | insufficient_scope | The key does not have the read:categories scope. error.required_scope names it. (api_key_disabled and ip_not_allowed also give 403.) |
| 422 | validation_failed | updated_since could not be read as a date or time. |
| 429 | rate_limited | More 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
| Name | Type | Meaning |
|---|---|---|
id | integer | The category id (a whole number). |
Example request
curl -s "https://yourstore.example.com/api/v1/categories/7" \
-H "Authorization: Bearer YOUR_API_KEY"<?php
$ch = curl_init('https://yourstore.example.com/api/v1/categories/7');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY',
],
]);
$response = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) {
// $response['error']['code'] and $response['error']['message'] say what to fix
}// Node.js 18 or newer (fetch is built in). Save as call.mjs and run: node call.mjs
const res = await fetch('https://yourstore.example.com/api/v1/categories/7', {
headers: {
Authorization: 'Bearer YOUR_API_KEY',
},
});
const json = await res.json();
if (!res.ok) {
// json.error.code and json.error.message say what to fix
}# Python 3 with the requests library (pip install requests)
import requests
res = requests.get(
"https://yourstore.example.com/api/v1/categories/7",
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=30,
)
data = res.json()
if not res.ok:
# data["error"]["code"] and data["error"]["message"] say what to fix
print(data["error"])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
| Status | Code | When |
|---|---|---|
| 401 | missing_api_key, invalid_api_key, revoked_api_key, expired_api_key | The key is missing, not valid, revoked or expired. |
| 403 | insufficient_scope | The key does not have the read:categories scope. error.required_scope names it. (api_key_disabled and ip_not_allowed also give 403.) |
| 404 | not_found | That category does not exist. |
| 429 | rate_limited | More 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"
}
}