Get Categories
Use this API to retrieve a full list of Categories.
Query Parameters
- page number
Default value:
1
By default first page will be listed. For navigating through pages, use the page parameter.
- limit number
Default value:
20
The number of results to return per request.
- id number[]
Unique identifier of the category.
- slug string[]
A common or friendly name for the category, should be in lowercase.
- parentCategoryId number[]
Unique identifier of the parent category.
- active string
Possible values: [
true
,false
]The current state of the category.
Example: true - search string
The query string to be searched for the category.
- level number
Default value:
5
The number of sub-category level to filter.
Responses
- 200
Success response
- application/json
- Example
{
"statusCode": 200,
"data": {
"results": [
{
"_id": 34258,
"name": "Pizza",
"parentCategoryId": null,
"slug": "pizza",
"parentCategories": [],
"parentCategory": null,
"subCategories": [],
"itemsCount": 4
}
],
"pagination": {
"currentPage": 1,
"lastPage": 1,
"perPage": 20,
"totalResults": 1
}
}
}
GET /ecommerce/v1/categories
Authorization
type: oauth2flow: clientCredentialsscopes: category:read
Request
Request
curl -L -X GET 'https://posbytz.github.io/ecommerce/v1/categories' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>'
curl -L -X GET 'https://posbytz.github.io/ecommerce/v1/categories' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>'
curl -L -X GET 'https://posbytz.github.io/ecommerce/v1/categories' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>'
curl -L -X GET 'https://posbytz.github.io/ecommerce/v1/categories' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>'
curl -L -X GET 'https://posbytz.github.io/ecommerce/v1/categories' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>'
curl -L -X GET 'https://posbytz.github.io/ecommerce/v1/categories' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>'
curl -L -X GET 'https://posbytz.github.io/ecommerce/v1/categories' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>'