Items

Item (product/service) master records, with optional size variants.

GET/api/v1/items

List items

Scope: items.read

List rows do not include the `variants` array — fetch a single item for its variants.

Parameters

NameInTypeRequiredDescription
pagequerynumberOptional1-based page number.
limitquerynumberOptionalPage size, max 200.
qquerystringOptionalFree-text search.

Example request

curl "https://invoice.avscorp.in/api/v1/items" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example response

JSON
{
  "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

POST/api/v1/items

Create an item

Scope: items.create

Request body

FieldTypeRequiredConstraints
namestringRequiredmin length 1; max length 191
skuanyOptional—
hsnOrSacanyOptional—
typestringOptionalone of: GOODS, SERVICE, BUNDLE; default "GOODS"
groupIdanyOptional—
sizeModuleIdanyOptional—
unitstringOptionalmin length 1; max length 20; default "PCS"
masterUnitanyOptional—
piecesPerMasternumberOptionaldefault 1
sellingPricenumberOptionalmin 0; default 0
purchasePricenumberOptionalmin 0; default 0
isPriceInclusivestringOptionalone of: inherit, true, false; default "inherit"
taxRateIdanyOptional—
barcodeanyOptional—
descriptionanyOptional—
trackInventorybooleanOptionaldefault false
primaryVendorIdanyOptional—
variantsarrayOptionaldefault []
axesarrayOptionaldefault []
pricingModestringOptionalone of: PCS, AREA; default "PCS"
defaultLengthUnitanyOptionaldefault null

Example request

curl -X POST "https://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

JSON
{
  "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

GET/api/v1/items/{id}

Get an item

Scope: items.read

Includes the item's `variants` array.

Parameters

NameInTypeRequiredDescription
idpathstringRequiredItem ID.

Example request

curl "https://invoice.avscorp.in/api/v1/items/clx3itm000000000000000001" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example response

JSON
{
  "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

PATCH/api/v1/items/{id}

Update an item

Scope: items.update

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

Parameters

NameInTypeRequiredDescription
idpathstringRequiredItem ID.

Request body

FieldTypeRequiredConstraints
namestringRequiredmin length 1; max length 191
skuanyOptional—
hsnOrSacanyOptional—
typestringOptionalone of: GOODS, SERVICE, BUNDLE; default "GOODS"
groupIdanyOptional—
sizeModuleIdanyOptional—
unitstringOptionalmin length 1; max length 20; default "PCS"
masterUnitanyOptional—
piecesPerMasternumberOptionaldefault 1
sellingPricenumberOptionalmin 0; default 0
purchasePricenumberOptionalmin 0; default 0
isPriceInclusivestringOptionalone of: inherit, true, false; default "inherit"
taxRateIdanyOptional—
barcodeanyOptional—
descriptionanyOptional—
trackInventorybooleanOptionaldefault false
primaryVendorIdanyOptional—
variantsarrayOptionaldefault []
axesarrayOptionaldefault []
pricingModestringOptionalone of: PCS, AREA; default "PCS"
defaultLengthUnitanyOptionaldefault null

Example request

curl -X PATCH "https://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

JSON
{
  "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

DELETE/api/v1/items/{id}

Delete an item

Scope: items.delete

Parameters

NameInTypeRequiredDescription
idpathstringRequiredItem ID.

Example request

curl -X DELETE "https://invoice.avscorp.in/api/v1/items/clx3itm000000000000000001" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example response

JSON
{
  "deleted": true
}

Possible errors: unauthorized, insufficient_scope, forbidden, not_found

PATCH/api/v1/items/{id}/core

Update an item's core scalar fields

Scope: items.update

Additive, 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

NameInTypeRequiredDescription
idpathstringRequiredItem ID.

Request body

FieldTypeRequiredConstraints
namestringRequiredmin length 1; max length 191
skuanyOptional—
hsnOrSacanyOptional—
typestringOptionalone of: GOODS, SERVICE, BUNDLE; default "GOODS"
unitstringOptionalmin length 1; max length 20; default "PCS"
sellingPricenumberOptionalmin 0; default 0
purchasePricenumberOptionalmin 0; default 0
barcodeanyOptional—
descriptionanyOptional—
trackInventorybooleanOptionaldefault false

Example request

curl -X PATCH "https://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

JSON
{
  "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