Item Groups
Hierarchical grouping/category tree for items. Uses the items.* permission scope.
GET
/api/v1/item-groupsList item groups
Scope:
items.readParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
page | query | number | Optional | 1-based page number. |
limit | query | number | Optional | Page size, max 200. |
Example request
curl "https://invoice.avscorp.in/api/v1/item-groups" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
JSON
{
"id": "clx4grp000000000000000001",
"organizationId": "clx0org000000000000000001",
"name": "Bedsheets",
"parentGroupId": "clx4grp000000000000000000",
"sortOrder": 2,
"description": "All bedsheet SKUs, printed and plain.",
"createdBy": "clxusr0000000000000000001",
"updatedBy": "clxusr0000000000000000001",
"createdAt": "2026-04-01T05:00:00.000Z",
"updatedAt": "2026-04-01T05:00:00.000Z"
}Possible errors: unauthorized, insufficient_scope, forbidden
POST
/api/v1/item-groupsCreate an item group
Scope:
items.createRequest body
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | Required | min length 1; max length 191 |
parentGroupId | any | Optional | — |
sortOrder | integer | Optional | min -9007199254740991; max 9007199254740991; default 0 |
description | any | Optional | — |
Example request
curl -X POST "https://invoice.avscorp.in/api/v1/item-groups" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Bedsheets"
}'Example response
JSON
{
"id": "clx4grp000000000000000001",
"organizationId": "clx0org000000000000000001",
"name": "Bedsheets",
"parentGroupId": "clx4grp000000000000000000",
"sortOrder": 2,
"description": "All bedsheet SKUs, printed and plain.",
"createdBy": "clxusr0000000000000000001",
"updatedBy": "clxusr0000000000000000001",
"createdAt": "2026-04-01T05:00:00.000Z",
"updatedAt": "2026-04-01T05:00:00.000Z"
}Possible errors: unauthorized, insufficient_scope, forbidden, validation_error
GET
/api/v1/item-groups/{id}Get an item group
Scope:
items.readParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Item group ID. |
Example request
curl "https://invoice.avscorp.in/api/v1/item-groups/clx4grp000000000000000001" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
JSON
{
"id": "clx4grp000000000000000001",
"organizationId": "clx0org000000000000000001",
"name": "Bedsheets",
"parentGroupId": "clx4grp000000000000000000",
"sortOrder": 2,
"description": "All bedsheet SKUs, printed and plain.",
"createdBy": "clxusr0000000000000000001",
"updatedBy": "clxusr0000000000000000001",
"createdAt": "2026-04-01T05:00:00.000Z",
"updatedAt": "2026-04-01T05:00:00.000Z"
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found
PATCH
/api/v1/item-groups/{id}Update an item group
Scope:
items.updatePATCH validates against the full item group schema (same as create) — name is required in every update, not just changed fields.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Item group ID. |
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | Required | min length 1; max length 191 |
parentGroupId | any | Optional | — |
sortOrder | integer | Optional | min -9007199254740991; max 9007199254740991; default 0 |
description | any | Optional | — |
Example request
curl -X PATCH "https://invoice.avscorp.in/api/v1/item-groups/clx4grp000000000000000001" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Bedsheets",
"sortOrder": 3
}'Example response
JSON
{
"id": "clx4grp000000000000000001",
"organizationId": "clx0org000000000000000001",
"name": "Bedsheets",
"parentGroupId": "clx4grp000000000000000000",
"sortOrder": 2,
"description": "All bedsheet SKUs, printed and plain.",
"createdBy": "clxusr0000000000000000001",
"updatedBy": "clxusr0000000000000000001",
"createdAt": "2026-04-01T05:00:00.000Z",
"updatedAt": "2026-04-01T05:00:00.000Z"
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found, validation_error
DELETE
/api/v1/item-groups/{id}Delete an item group
Scope:
items.deleteParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Item group ID. |
Example request
curl -X DELETE "https://invoice.avscorp.in/api/v1/item-groups/clx4grp000000000000000001" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
JSON
{
"deleted": true
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found