API docs: Categories
List categories
/api/v1/categoriesAny catalog readReturns all of your categories, sorted by name. A store has at most 25 categories, so this list is never paginated: has_more is always false. Deleted categories are never returned.
curl "https://e2c.store/api/v1/categories" \
-H "Authorization: Bearer $E2C_API_KEY"{
"data": [
{ "code": "markets", "name": "Markets", "status": "active", "counts": { "products": 0, "services": 0, "events": 2 } },
{ "code": "tops", "name": "Tops", "status": "active", "counts": { "products": 14, "services": 0, "events": 0 } }
],
"has_more": false,
"next_cursor": null
}Retrieve a category
/api/v1/categories/{code}Any catalog readReturns one category by its code. Category codes are unique within your store.
curl "https://e2c.store/api/v1/categories/tops" \
-H "Authorization: Bearer $E2C_API_KEY"{
"data": { "code": "tops", "name": "Tops", "status": "active", "counts": { "products": 14, "services": 0, "events": 0 } }
}Every product, service, and event also includes its category as { "code", "name" }, or null when it isn't in a category.
Create a category
/api/v1/categoriescategories:writeAdds a category. Only name is required. When you leave out code, one is made from the name, with a number added if it's taken. New categories are active unless you send "status": "inactive".
Body fields
| Field | Description |
|---|---|
namestring | Up to 25 characters, plain text. Unique within your store, and can't be "All". |
codestring | Up to 25 lowercase letters, numbers, and single hyphens, like summer-tops. Used in the category's URL. |
statusstring | active shows the category on your storefront; inactive hides it. |
curl -X POST "https://e2c.store/api/v1/categories" \
-H "Authorization: Bearer $E2C_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "name": "Summer Tops" }'{
"data": { "code": "summer-tops", "name": "Summer Tops", "status": "active", "counts": { "products": 0 } }
}Returns 201. A store has at most 25 categories; past that you get 409 limit_reached. A name or code that's already used returns 409 conflict. To put products in the category, set their category with Update a product.
Update a category
/api/v1/categories/{code}categories:writeRenames a category, changes its code, or shows or hides it. Only the fields you send change. Products in the category stay in it when its code changes.
Body fields
| Field | Description |
|---|---|
namestring | Up to 25 characters, plain text. Unique within your store, and can't be "All". |
codestring | Up to 25 lowercase letters, numbers, and single hyphens, like summer-tops. Used in the category's URL. |
statusstring | active shows the category on your storefront; inactive hides it. |
curl -X PATCH "https://e2c.store/api/v1/categories/summer-tops" \
-H "Authorization: Bearer $E2C_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "status": "inactive" }'{
"data": { "code": "summer-tops", "name": "Summer Tops", "status": "inactive", "counts": { "products": 6 } }
}counts in write responses follows the same rule as reads: it only includes listing types your key can read, so a key with only categories:write gets {}.