Appearance
Product Categories List
Product Categories are the list of Categories for products. You can use this endpoint to get the list of all active categories.
Endpoint
sh
> GET ${BASE_URL}/product-categories-listSample Request
sh
$ curl -H 'Content-Type: application/json' \
-H 'x-api-token: ACCESS_TOKEN' \
"BASE_URL/product-categories-list"Typescript
import * as axios from "axios";
axios
.get("BASE_URL/product-categories-list", {
headers: {
"Content-Type": "application/json",
"x-api-token": "ACCESS_TOKEN"
},
})
.then((response) => {
console.log("Success:", response.data);
})
.catch((error) => {
console.error(
"Error:",
error.response ? error.response.data : error.message,
);
});Response Schema
Success: 200
ts
{
success: boolean;
message: string;
statusCode: number;
data: Array<{
id: number
createdAt: string
updatedAt: string
categoryName: string
categoryDescription: string
status: string
}>;
meta: {
itemsPerPage: number;
totalItems: number;
currentPage: number;
totalPages: number;
sortBy: Array<Array<string>>;
filter: {
'allowedProducts.partnerCompanyId': string;
};
};
links: {
current: string;
};
};Error: 404
ts
{
statusCode: number;
success: boolean;
message: string;
data: any;
}Sample Response
json
{
"success": true,
"message": "Successful",
"statusCode": 200,
"data": [
{
"id": 1,
"createdAt": "2025-01-10T13:36:16.075Z",
"updatedAt": "2025-02-08T04:21:58.593Z",
"categoryName": "Airtime",
"categoryDescription": "Enables customers to pay postpaid bills or settle dues via direct or auto debit payments 2",
"status": "ACTIVE"
}
],
"meta": {
"itemsPerPage": 10,
"totalItems": 1,
"currentPage": 1,
"totalPages": 1,
"sortBy": [["id", "DESC"]]
}
}