Item Groups

Hierarchical grouping/category tree for items. Uses the items.* permission scope.

GET/api/v1/item-groups

List item groups

Scope: items.read

Parameters

NameInTypeRequiredDescription
pagequerynumberOptional1-based page number.
limitquerynumberOptionalPage 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-groups

Create an item group

Scope: items.create

Request body

FieldTypeRequiredConstraints
namestringRequiredmin length 1; max length 191
parentGroupIdanyOptional—
sortOrderintegerOptionalmin -9007199254740991; max 9007199254740991; default 0
descriptionanyOptional—

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.read

Parameters

NameInTypeRequiredDescription
idpathstringRequiredItem 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.update

PATCH validates against the full item group schema (same as create) — name is required in every update, not just changed fields.

Parameters

NameInTypeRequiredDescription
idpathstringRequiredItem group ID.

Request body

FieldTypeRequiredConstraints
namestringRequiredmin length 1; max length 191
parentGroupIdanyOptional—
sortOrderintegerOptionalmin -9007199254740991; max 9007199254740991; default 0
descriptionanyOptional—

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.delete

Parameters

NameInTypeRequiredDescription
idpathstringRequiredItem 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