Customer category
INFO
Every response arrives in the shared envelope — code, message, messages, status_code, time — with the payload in data. The tables below describe what is inside data.
POST /customer-category/create
This method allows adding customer-category into the account.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | |
parent_id | string | No | |
organization_ids | string[] | No | |
image | string | No |
{
"name": "string",
"parent_id": "string",
"organization_ids": [
"string"
],
"image": "string"
}Response
| Field | Type | Description |
|---|---|---|
_id | string | id of customer-category |
name | string | |
child_count | number | |
item_count | number | |
image | string | |
organization_ids | string[] | |
parent | object | |
parent._id | string | |
parent.name | string |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"_id": "string",
"name": "string",
"child_count": 0,
"item_count": 0,
"image": "string",
"organization_ids": [
"string"
],
"parent": {
"_id": "string",
"name": "string"
}
},
"time": "2025-05-01T12:00:00Z"
}PUT /customer-category/update
This method allows updating customer-category in the account.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | |
parent_id | string | No | |
organization_ids | string[] | No | |
image | string | No | |
_id | string | Yes | id of customer-category |
{
"name": "string",
"parent_id": "string",
"organization_ids": [
"string"
],
"image": "string",
"_id": "string"
}Response
Same response shape as POST /customer-category/create.
DELETE /customer-category/delete/{id}
Delete a customer-category
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes |
Request body
No request body.
Response
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": "ok",
"time": "2025-05-01T12:00:00Z"
}GET /customer-category/get-by-id/{id}
Get customer-category using its _id
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes |
Request body
No request body.
Response
Same response shape as POST /customer-category/create.
POST /customer-category/get-paging
Get customer-categories by paging
Request body
| Field | Type | Required | Description |
|---|---|---|---|
page | number | Yes | Default: 1 |
limit | number | Yes | Default: 20 |
updated_at | string | No | |
organization_id | string | No | |
organization_ids | string[] | No |
{
"page": 1,
"limit": 20,
"updated_at": "string",
"organization_id": "string",
"organization_ids": [
"string"
]
}Response
data.total is the total number of records and data.data[] holds the current page. The table below describes one record.
| Field | Type | Description |
|---|---|---|
_id | string | id of customer-category |
name | string | |
child_count | number | |
item_count | number | |
image | string | |
organization_ids | string[] | |
parent | object | |
parent._id | string | |
parent.name | string |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"total": 0,
"data": [
{
"_id": "string",
"name": "string",
"child_count": 0,
"item_count": 0,
"image": "string",
"organization_ids": [
"string"
],
"parent": {
"_id": "string",
"name": "string"
}
}
]
},
"time": "2025-05-01T12:00:00Z"
}GET /customer-category/get-deleted
Get deleted customer-category ids
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
deleted_at | string | Yes |
Request body
No request body.
Response
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": [
"string"
],
"time": "2025-05-01T12:00:00Z"
}This page is generated from the OpenAPI spec.