Items
Item (product/service) master records, with optional size variants.
/api/v1/itemsList items
items.readList rows do not include the `variants` array — fetch a single item for its variants.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
page | query | number | Optional | 1-based page number. |
limit | query | number | Optional | Page size, max 200. |
q | query | string | Optional | Free-text search. |
Example request
curl "https://pre-invoice.avscorp.in/api/v1/items" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"id": "clx3itm000000000000000001",
"organizationId": "clx0org000000000000000001",
"name": "Cotton Bedsheet - Printed",
"sku": "BSH-COT-001",
"hsnOrSac": "6304",
"type": "GOODS",
"groupId": "clx4grp000000000000000001",
"sizeModuleId": "clx5szm000000000000000001",
"unit": "PCS",
"pricingMode": "PCS",
"defaultLengthUnit": null,
"masterUnit": "BOX",
"piecesPerMaster": 12,
"sellingPrice": 899,
"purchasePrice": 550,
"isPriceInclusive": false,
"taxRateId": "clx6tax000000000000000001",
"description": "100% cotton printed double bedsheet with 2 pillow covers.",
"reorderQuantity": 20,
"barcode": "8901234567890",
"trackInventory": true,
"isActive": true,
"primaryVendorId": "clx2v1e2n3d4o5r6a7b8c9d0",
"createdBy": "clxusr0000000000000000001",
"updatedBy": "clxusr0000000000000000001",
"createdAt": "2026-05-10T06:00:00.000Z",
"updatedAt": "2026-08-28T10:12:00.000Z"
}Possible errors: unauthorized, insufficient_scope, forbidden
/api/v1/itemsCreate an item
items.createRequest body
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | Required | min length 1; max length 191 |
sku | any | Optional | — |
hsnOrSac | any | Optional | — |
type | string | Optional | one of: GOODS, SERVICE, BUNDLE; default "GOODS" |
groupId | any | Optional | — |
sizeModuleId | any | Optional | — |
unit | string | Optional | min length 1; max length 20; default "PCS" |
masterUnit | any | Optional | — |
piecesPerMaster | number | Optional | default 1 |
sellingPrice | number | Optional | min 0; default 0 |
purchasePrice | number | Optional | min 0; default 0 |
isPriceInclusive | string | Optional | one of: inherit, true, false; default "inherit" |
taxRateId | any | Optional | — |
barcode | any | Optional | — |
description | any | Optional | — |
trackInventory | boolean | Optional | default false |
primaryVendorId | any | Optional | — |
variants | array | Optional | default [] |
axes | array | Optional | default [] |
pricingMode | string | Optional | one of: PCS, AREA; default "PCS" |
defaultLengthUnit | any | Optional | default null |
Example request
curl -X POST "https://pre-invoice.avscorp.in/api/v1/items" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Cotton Bedsheet - Printed",
"sellingPrice": 899
}'Example response
{
"id": "clx3itm000000000000000001",
"organizationId": "clx0org000000000000000001",
"name": "Cotton Bedsheet - Printed",
"sku": "BSH-COT-001",
"hsnOrSac": "6304",
"type": "GOODS",
"groupId": "clx4grp000000000000000001",
"sizeModuleId": "clx5szm000000000000000001",
"unit": "PCS",
"pricingMode": "PCS",
"defaultLengthUnit": null,
"masterUnit": "BOX",
"piecesPerMaster": 12,
"sellingPrice": 899,
"purchasePrice": 550,
"isPriceInclusive": false,
"taxRateId": "clx6tax000000000000000001",
"description": "100% cotton printed double bedsheet with 2 pillow covers.",
"reorderQuantity": 20,
"barcode": "8901234567890",
"trackInventory": true,
"isActive": true,
"primaryVendorId": "clx2v1e2n3d4o5r6a7b8c9d0",
"createdBy": "clxusr0000000000000000001",
"updatedBy": "clxusr0000000000000000001",
"createdAt": "2026-05-10T06:00:00.000Z",
"updatedAt": "2026-08-28T10:12:00.000Z",
"variants": [
{
"id": "clx7var000000000000000001",
"organizationId": "clx0org000000000000000001",
"itemId": "clx3itm000000000000000001",
"size": "Queen",
"sku": "BSH-COT-001-Q",
"barcode": "8901234567891",
"sellingPrice": 899,
"purchasePrice": 550,
"isActive": true,
"sortOrder": 0,
"createdAt": "2026-05-10T06:00:00.000Z",
"updatedAt": "2026-05-10T06:00:00.000Z"
}
]
}Possible errors: unauthorized, insufficient_scope, forbidden, validation_error
/api/v1/items/{id}Get an item
items.readIncludes the item's `variants` array.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Item ID. |
Example request
curl "https://pre-invoice.avscorp.in/api/v1/items/clx3itm000000000000000001" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"id": "clx3itm000000000000000001",
"organizationId": "clx0org000000000000000001",
"name": "Cotton Bedsheet - Printed",
"sku": "BSH-COT-001",
"hsnOrSac": "6304",
"type": "GOODS",
"groupId": "clx4grp000000000000000001",
"sizeModuleId": "clx5szm000000000000000001",
"unit": "PCS",
"pricingMode": "PCS",
"defaultLengthUnit": null,
"masterUnit": "BOX",
"piecesPerMaster": 12,
"sellingPrice": 899,
"purchasePrice": 550,
"isPriceInclusive": false,
"taxRateId": "clx6tax000000000000000001",
"description": "100% cotton printed double bedsheet with 2 pillow covers.",
"reorderQuantity": 20,
"barcode": "8901234567890",
"trackInventory": true,
"isActive": true,
"primaryVendorId": "clx2v1e2n3d4o5r6a7b8c9d0",
"createdBy": "clxusr0000000000000000001",
"updatedBy": "clxusr0000000000000000001",
"createdAt": "2026-05-10T06:00:00.000Z",
"updatedAt": "2026-08-28T10:12:00.000Z",
"variants": [
{
"id": "clx7var000000000000000001",
"organizationId": "clx0org000000000000000001",
"itemId": "clx3itm000000000000000001",
"size": "Queen",
"sku": "BSH-COT-001-Q",
"barcode": "8901234567891",
"sellingPrice": 899,
"purchasePrice": 550,
"isActive": true,
"sortOrder": 0,
"createdAt": "2026-05-10T06:00:00.000Z",
"updatedAt": "2026-05-10T06:00:00.000Z"
}
]
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found
/api/v1/items/{id}Update an item
items.updatePATCH validates against the full item 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 ID. |
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | Required | min length 1; max length 191 |
sku | any | Optional | — |
hsnOrSac | any | Optional | — |
type | string | Optional | one of: GOODS, SERVICE, BUNDLE; default "GOODS" |
groupId | any | Optional | — |
sizeModuleId | any | Optional | — |
unit | string | Optional | min length 1; max length 20; default "PCS" |
masterUnit | any | Optional | — |
piecesPerMaster | number | Optional | default 1 |
sellingPrice | number | Optional | min 0; default 0 |
purchasePrice | number | Optional | min 0; default 0 |
isPriceInclusive | string | Optional | one of: inherit, true, false; default "inherit" |
taxRateId | any | Optional | — |
barcode | any | Optional | — |
description | any | Optional | — |
trackInventory | boolean | Optional | default false |
primaryVendorId | any | Optional | — |
variants | array | Optional | default [] |
axes | array | Optional | default [] |
pricingMode | string | Optional | one of: PCS, AREA; default "PCS" |
defaultLengthUnit | any | Optional | default null |
Example request
curl -X PATCH "https://pre-invoice.avscorp.in/api/v1/items/clx3itm000000000000000001" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Cotton Bedsheet - Printed",
"sellingPrice": 949
}'Example response
{
"id": "clx3itm000000000000000001",
"organizationId": "clx0org000000000000000001",
"name": "Cotton Bedsheet - Printed",
"sku": "BSH-COT-001",
"hsnOrSac": "6304",
"type": "GOODS",
"groupId": "clx4grp000000000000000001",
"sizeModuleId": "clx5szm000000000000000001",
"unit": "PCS",
"pricingMode": "PCS",
"defaultLengthUnit": null,
"masterUnit": "BOX",
"piecesPerMaster": 12,
"sellingPrice": 899,
"purchasePrice": 550,
"isPriceInclusive": false,
"taxRateId": "clx6tax000000000000000001",
"description": "100% cotton printed double bedsheet with 2 pillow covers.",
"reorderQuantity": 20,
"barcode": "8901234567890",
"trackInventory": true,
"isActive": true,
"primaryVendorId": "clx2v1e2n3d4o5r6a7b8c9d0",
"createdBy": "clxusr0000000000000000001",
"updatedBy": "clxusr0000000000000000001",
"createdAt": "2026-05-10T06:00:00.000Z",
"updatedAt": "2026-08-28T10:12:00.000Z",
"variants": [
{
"id": "clx7var000000000000000001",
"organizationId": "clx0org000000000000000001",
"itemId": "clx3itm000000000000000001",
"size": "Queen",
"sku": "BSH-COT-001-Q",
"barcode": "8901234567891",
"sellingPrice": 899,
"purchasePrice": 550,
"isActive": true,
"sortOrder": 0,
"createdAt": "2026-05-10T06:00:00.000Z",
"updatedAt": "2026-05-10T06:00:00.000Z"
}
]
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found, validation_error
/api/v1/items/{id}Delete an item
items.deleteParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Item ID. |
Example request
curl -X DELETE "https://pre-invoice.avscorp.in/api/v1/items/clx3itm000000000000000001" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"deleted": true
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found
/api/v1/items/{id}/coreUpdate an item's core scalar fields
items.updateAdditive, mobile-safe update of core fields only (name/sku/hsnOrSac/type/unit/prices/barcode/description/trackInventory). Never touches variants, price-list entries, taxRateId, groupId/sizeModuleId, masterUnit/piecesPerMaster, isPriceInclusive, primaryVendorId, or area-pricing fields. This is a full replace of the core columns — an omitted core field resets to its default, so send the complete current core-field set, not just what changed.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Item ID. |
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | Required | min length 1; max length 191 |
sku | any | Optional | — |
hsnOrSac | any | Optional | — |
type | string | Optional | one of: GOODS, SERVICE, BUNDLE; default "GOODS" |
unit | string | Optional | min length 1; max length 20; default "PCS" |
sellingPrice | number | Optional | min 0; default 0 |
purchasePrice | number | Optional | min 0; default 0 |
barcode | any | Optional | — |
description | any | Optional | — |
trackInventory | boolean | Optional | default false |
Example request
curl -X PATCH "https://pre-invoice.avscorp.in/api/v1/items/clx3itm000000000000000001/core" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Cotton Bedsheet - Printed",
"sku": "BSH-COT-001",
"hsnOrSac": "6304",
"type": "GOODS",
"unit": "PCS",
"sellingPrice": 949,
"purchasePrice": 550,
"barcode": "8901234567890",
"description": "100% cotton printed double bedsheet with 2 pillow covers.",
"trackInventory": true
}'Example response
{
"id": "clx3itm000000000000000001",
"organizationId": "clx0org000000000000000001",
"name": "Cotton Bedsheet - Printed",
"sku": "BSH-COT-001",
"hsnOrSac": "6304",
"type": "GOODS",
"groupId": "clx4grp000000000000000001",
"sizeModuleId": "clx5szm000000000000000001",
"unit": "PCS",
"pricingMode": "PCS",
"defaultLengthUnit": null,
"masterUnit": "BOX",
"piecesPerMaster": 12,
"sellingPrice": 899,
"purchasePrice": 550,
"isPriceInclusive": false,
"taxRateId": "clx6tax000000000000000001",
"description": "100% cotton printed double bedsheet with 2 pillow covers.",
"reorderQuantity": 20,
"barcode": "8901234567890",
"trackInventory": true,
"isActive": true,
"primaryVendorId": "clx2v1e2n3d4o5r6a7b8c9d0",
"createdBy": "clxusr0000000000000000001",
"updatedBy": "clxusr0000000000000000001",
"createdAt": "2026-05-10T06:00:00.000Z",
"updatedAt": "2026-08-28T10:12:00.000Z",
"variants": [
{
"id": "clx7var000000000000000001",
"organizationId": "clx0org000000000000000001",
"itemId": "clx3itm000000000000000001",
"size": "Queen",
"sku": "BSH-COT-001-Q",
"barcode": "8901234567891",
"sellingPrice": 899,
"purchasePrice": 550,
"isActive": true,
"sortOrder": 0,
"createdAt": "2026-05-10T06:00:00.000Z",
"updatedAt": "2026-05-10T06:00:00.000Z"
}
]
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found, validation_error