GET
/
catalog
/
categories
curl --request GET \
  --url https://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/categories \
  --header 'Authorization: Bearer <token>'
{
  "message": "all categories",
  "success": true,
  "content": {
    "categories": [
      {
        "id": "<string>",
        "name": "<string>",
        "slug": "<string>",
        "description": "<string>",
        "parent_category_id": "<string>",
        "product_count": 123,
        "active": true,
        "child_categories": [
          {
            "id": "<string>",
            "name": "<string>",
            "slug": "<string>",
            "description": "<string>",
            "parent_category_id": "<string>",
            "product_count": 123,
            "active": true
          }
        ]
      }
    ],
    "pagination": {
      "total_records": 252,
      "total_pages": 26,
      "previous_page": null,
      "next_page": 2,
      "limit": 10
    }
  }
}

Authorizations

Authorization
string
header
required

Access token

Query Parameters

parent_category_id
string

To return child categories

Example:

"a847641353e947d3bed69a4eea975634"

nested_level
integer
default:0

return child categories up to nesting level

Required range: 0 <= x <= 4

search keyword

sort_by
string

JSON string format: {"field1":"asc", "field2":"desc"}

Example:

"{\"country\":\"asc\",\"city\":\"asc\",\"population\":\"desc\"}"

Response

200 - application/json
OK
message
string
required
Example:

"all categories"

success
boolean
required
content
object
required