Inventory
Stock-on-hand positions (item variant × warehouse). Read-only via the API; uses the stock.read scope (items.read tokens keep working).
/api/v1/inventoryList stock positions
stock.readParameters
| 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 on item/variant/warehouse name or code. |
Example request
curl "https://pre-invoice.avscorp.in/api/v1/inventory" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"id": "clx2soh001000000000000001",
"itemVariantId": "clx2var001000000000000001",
"warehouseId": "clx2wh0001000000000000001",
"itemId": "clx2itm001000000000000001",
"itemName": "Cotton Fabric",
"variantSize": "Blue - 44in",
"variantSku": "CF-BLUE-44",
"warehouseName": "Main Warehouse",
"warehouseCode": "MAIN",
"quantityOnHand": 40,
"quantityReserved": 5,
"quantityAvailable": 35,
"averageCost": 480.5,
"lowStockThreshold": 10,
"lastMovementAt": "2026-08-12T09:30:00.000Z",
"updatedAt": "2026-08-12T09:30:00.000Z"
}Possible errors: unauthorized, insufficient_scope, forbidden
/api/v1/inventory/{id}Get a stock position
stock.readAdds up to 100 recent inventory movements for this item variant + warehouse, newest first.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Stock-on-hand position ID. |
Example request
curl "https://pre-invoice.avscorp.in/api/v1/inventory/clx2soh001000000000000001" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"id": "clx2soh001000000000000001",
"itemVariantId": "clx2var001000000000000001",
"warehouseId": "clx2wh0001000000000000001",
"itemId": "clx2itm001000000000000001",
"itemName": "Cotton Fabric",
"variantSize": "Blue - 44in",
"variantSku": "CF-BLUE-44",
"warehouseName": "Main Warehouse",
"warehouseCode": "MAIN",
"quantityOnHand": 40,
"quantityReserved": 5,
"quantityAvailable": 35,
"averageCost": 480.5,
"lowStockThreshold": 10,
"lastMovementAt": "2026-08-12T09:30:00.000Z",
"updatedAt": "2026-08-12T09:30:00.000Z",
"movements": [
{
"id": "clx2mov001000000000000001",
"movementType": "PURCHASE_RETURN_OUT",
"quantity": 10,
"unitCost": 480,
"totalCost": 4800,
"balanceAfter": 40,
"avgCostAfter": 480.5,
"sourceDocType": "DEBIT_NOTE",
"sourceDocId": "clx2dn0001000000000000001",
"notes": null,
"createdAt": "2026-08-12T09:30:00.000Z"
}
]
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found
/api/v1/inventory/lotsList stock lots
stock.readThe Lots page. A member with a warehouse list sees only lots in those warehouses. unitCost needs costPrice.read and value needs stockValue.read; without them the keys are absent.
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 | Lot barcode or item name contains. |
status | query | string | Optional | OPEN, EXHAUSTED or VOID. Repeat to match several. |
warehouseId | query | string | Optional | Only lots in this warehouse. |
Example request
curl "https://pre-invoice.avscorp.in/api/v1/inventory/lots" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"id": "clx2lot001000000000000001",
"barcode": "OPN-000012",
"itemName": "Cotton Fabric",
"variantLabel": "Blue - 44in",
"warehouseName": "Main Warehouse",
"vendorName": null,
"receivedAt": "2026-08-01T00:00:00.000Z",
"remaining": 40,
"total": 50,
"unit": "MTR",
"unitCost": 480.5,
"value": 19220,
"status": "OPEN"
}Possible errors: unauthorized, insufficient_scope, forbidden, validation_error
/api/v1/inventory/lots/lookupFind a lot by barcode
stock.readResolves a scanned or typed lot barcode to the lot id. 404 "No lot with code X" when none matches or the lot is outside the member's warehouses.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
code | query | string | Required | The lot barcode. |
Example request
curl "https://pre-invoice.avscorp.in/api/v1/inventory/lots/lookup" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"id": "clx2lot001000000000000001"
}Possible errors: unauthorized, insufficient_scope, forbidden, validation_error, not_found
/api/v1/inventory/lots/{id}Get a stock lot
stock.readThe lot with its source (BILL, OPENING, PRODUCTION, ...), lineage and movements. unitCost needs costPrice.read and value needs stockValue.read; without them the keys are absent.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Lot ID. |
Example request
curl "https://pre-invoice.avscorp.in/api/v1/inventory/lots/clx2lot001000000000000001" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"id": "clx2lot001000000000000001",
"barcode": "OPN-000012",
"itemName": "Cotton Fabric",
"variantLabel": "Blue - 44in",
"warehouseName": "Main Warehouse",
"vendorName": null,
"receivedAt": "2026-08-01T00:00:00.000Z",
"remaining": 40,
"total": 50,
"unit": "MTR",
"unitCost": 480.5,
"value": 19220,
"status": "OPEN",
"billNumber": null,
"source": "OPENING",
"lineage": {
"mintedBy": null,
"movedFrom": [],
"movedTo": [
"TRF-000003"
]
},
"movements": [
{
"at": "2026-08-01T00:00:00.000Z",
"type": "OPENING",
"qty": 50,
"docNumber": null,
"note": null
}
]
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found
/api/v1/inventory/valuationStock valuation by warehouse
stock.readStock value per warehouse, with each warehouse's share of the total (percent). Also needs stockValue.read: 403 without it. Scoped to the member's warehouses.
Example request
curl "https://pre-invoice.avscorp.in/api/v1/inventory/valuation" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"totalQty": 40,
"totalValue": 19220,
"rows": [
{
"warehouseId": "clx2wh0001000000000000001",
"warehouseName": "Main Warehouse",
"qty": 40,
"value": 19220,
"share": 100
}
]
}Possible errors: unauthorized, insufficient_scope, forbidden
/api/v1/inventory/labelsList barcode label candidates
stock.readThe Label Studio's pickers: active item variants (up to 500) and, unless groupId is given, open lots with stock left (up to 200). A plain list under data, no paging. Each row has itemVariantId or lotId; barcode is null when barcodes must be generated on the web first. Lots are only those in the member's warehouses. price and mrp are absent without sellingPrice.read. No cost data.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
q | query | string | Optional | Item name, SKU or barcode contains; lots match on lot barcode, item name or SKU. |
groupId | query | string | Optional | Only variants of items in this group (and its direct child groups); lots are left out. |
Example request
curl "https://pre-invoice.avscorp.in/api/v1/inventory/labels" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
[
{
"itemVariantId": "clx2var001000000000000001",
"name": "Cotton Fabric",
"variantLabel": "Blue",
"barcode": "00000012",
"price": 450,
"mrp": 500
},
{
"lotId": "clx2lot001000000000000001",
"name": "Cotton Fabric",
"variantLabel": "Blue",
"barcode": "OPN-000012",
"price": 450,
"mrp": 450
}
]Possible errors: unauthorized, insufficient_scope, forbidden, validation_error
/api/v1/inventory/labelsRender barcode labels as a PDF
stock.readThe Label Studio's labels, rendered server-side with the same layout (CODE128 barcode, field order, cost-code cipher, price format). preset is godex-3up-33x25 (three across, 33 x 25 mm), 38x25, 50x25, 50x30 or 50x50 (one across); each page is one strip. fields.name is the product name. Each item has exactly one of itemVariantId or lotId, and copies from 1 to 999; at most 2000 labels per request (422). Any row without a barcode is a 422 "Generate barcodes on the web first". An item or lot outside the organization or the member's warehouses is a 404. fields.costCode needs costPrice.read, and fields.price or fields.mrp need sellingPrice.read (403 without them). A barcode CODE128 cannot encode (for example non-Latin text) is a 422 "Barcode X can't be printed". storeName prints when fields.storeName is on, else the organization name.
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
preset | string | Required | one of: godex-3up-33x25, 38x25, 50x25, 50x30, 50x50 |
fields | object | Required | — |
name | boolean | Required | — |
size | boolean | Required | — |
barcode | boolean | Required | — |
price | boolean | Required | — |
mrp | boolean | Required | — |
costCode | boolean | Required | — |
storeName | boolean | Required | — |
storeName | any | Optional | — |
items | array | Required | — |
Example request
curl -X POST "https://pre-invoice.avscorp.in/api/v1/inventory/labels" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"preset": "godex-3up-33x25",
"fields": {
"name": true,
"size": true,
"barcode": true,
"price": true,
"mrp": true,
"costCode": false,
"storeName": false
},
"storeName": "Main Store",
"items": [
{
"itemVariantId": "clx2var001000000000000001",
"copies": 3
},
{
"lotId": "clx2lot001000000000000001",
"copies": 1
}
]
}'Example response
application/pdf. The labels as a PDF (one page per strip of labels), streamed inline as labels.pdf.Possible errors: unauthorized, insufficient_scope, forbidden, validation_error, not_found
/api/v1/inventory/adjustmentsList stock adjustments
stock.readThe Stock Adjustments page, newest first: one row per stock movement an adjustment wrote. Scoped to the member's warehouses.
Parameters
| 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://pre-invoice.avscorp.in/api/v1/inventory/adjustments" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"id": "clx2mov001000000000000001",
"date": "2026-08-12T09:30:00.000Z",
"itemName": "Cotton Fabric",
"variantLabel": "Blue - 44in",
"warehouseName": "Main Warehouse",
"direction": "IN",
"qty": 10,
"reason": "RECOUNT",
"notes": "Found a box in the back room"
}Possible errors: unauthorized, insufficient_scope, forbidden
/api/v1/inventory/adjustmentsRecord a stock adjustment
inventory.createAdds (IN) or removes (OUT) stock at one warehouse. reason is SHRINKAGE, DAMAGE, RECOUNT, CORRECTION or OTHER. unitCost is required on IN lines for a member with costPrice.read (0 uses the current average cost); without costPrice.read it is ignored. Answers the ids of the movements written. 404 when the warehouse is unknown or outside the member's scope; 409 when an OUT would take stock below zero.
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
warehouseId | string | Required | min length 1; max length 30 |
reason | string | Required | one of: SHRINKAGE, DAMAGE, RECOUNT, CORRECTION, OTHER |
notes | any | Optional | — |
lines | array | Required | — |
Example request
curl -X POST "https://pre-invoice.avscorp.in/api/v1/inventory/adjustments" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"warehouseId": "clx2wh0001000000000000001",
"reason": "RECOUNT",
"notes": "Found a box in the back room",
"lines": [
{
"itemVariantId": "clx2var001000000000000001",
"direction": "IN",
"qty": 10,
"unitCost": 480
}
]
}'Example response
{
"ids": [
"clx2mov001000000000000001"
]
}Possible errors: unauthorized, insufficient_scope, forbidden, validation_error, not_found, conflict
/api/v1/inventory/opening-stockList variants to seed with opening stock
inventory.createThe Opening Stock page: inventory-tracked variants with their placeholder cost (purchasePrice). Needs costPrice.read as well as inventory.create: 404 without it. 404 when the warehouse is unknown or outside the member's scope.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
warehouseId | query | string | Required | The warehouse to seed. |
q | query | string | Optional | Item name, SKU or size contains. |
page | query | number | Optional | 1-based page number. |
limit | query | number | Optional | Page size, max 200. |
Example request
curl "https://pre-invoice.avscorp.in/api/v1/inventory/opening-stock" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"itemVariantId": "clx2var001000000000000001",
"itemName": "Cotton Fabric",
"variantLabel": "Blue - 44in",
"sku": "CF-BLUE-44",
"purchasePrice": 480
}Possible errors: unauthorized, insufficient_scope, forbidden, validation_error, not_found
/api/v1/inventory/opening-stockSeed opening stock
inventory.createOne-time seeding of quantity and per-unit cost (0 or more) at a warehouse; answers { seeded }, the number of lines. Needs costPrice.read as well as inventory.create: 403 without it. 409 when a variant already has stock in that warehouse, so a repeated request cannot seed twice. 404 when the warehouse is unknown or outside the member's scope.
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
warehouseId | string | Required | min length 1; max length 30 |
lines | array | Required | — |
Example request
curl -X POST "https://pre-invoice.avscorp.in/api/v1/inventory/opening-stock" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"warehouseId": "clx2wh0001000000000000001",
"lines": [
{
"itemVariantId": "clx2var001000000000000001",
"qty": 50,
"unitCost": 480
}
]
}'Example response
{
"seeded": 1
}Possible errors: unauthorized, insufficient_scope, forbidden, validation_error, not_found, conflict
/api/v1/inventory/transfersList stock transfers
stock.readThe Transfers page, newest first. A transfer shows when either end is one of the member's warehouses.
Parameters
| 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://pre-invoice.avscorp.in/api/v1/inventory/transfers" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"id": "clx2trf001000000000000001",
"number": "TR-MFD1X2-AB12CD",
"fromName": "Main Warehouse",
"toName": "Chennai Store",
"status": "IN_TRANSIT",
"dispatchedAt": "2026-08-12T09:30:00.000Z",
"receivedAt": null
}Possible errors: unauthorized, insufficient_scope, forbidden
/api/v1/inventory/transfersCreate a stock transfer
inventory.createCreates a DRAFT transfer; nothing moves until it is dispatched. 404 when a warehouse is unknown or outside the member's scope.
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
fromWarehouseId | string | Required | min length 1; max length 30 |
toWarehouseId | string | Required | min length 1; max length 30 |
notes | any | Optional | — |
lines | array | Required | — |
Example request
curl -X POST "https://pre-invoice.avscorp.in/api/v1/inventory/transfers" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"fromWarehouseId": "clx2wh0001000000000000001",
"toWarehouseId": "clx2wh0002000000000000001",
"notes": "Restock the Chennai store",
"lines": [
{
"itemVariantId": "clx2var001000000000000001",
"qty": 10
}
]
}'Example response
{
"id": "clx2trf001000000000000001",
"number": "TR-MFD1X2-AB12CD"
}Possible errors: unauthorized, insufficient_scope, forbidden, validation_error, not_found
/api/v1/inventory/transfers/{id}Get a stock transfer
stock.readThe transfer with its lines, whether it crosses GST registrations (dispatch then takes e-way details), the self-supply invoice, and the actions (dispatch, receive, cancel) the member may take now.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Transfer ID. |
Example request
curl "https://pre-invoice.avscorp.in/api/v1/inventory/transfers/clx2trf001000000000000001" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"id": "clx2trf001000000000000001",
"number": "TR-MFD1X2-AB12CD",
"fromName": "Main Warehouse",
"toName": "Chennai Store",
"status": "IN_TRANSIT",
"dispatchedAt": "2026-08-12T09:30:00.000Z",
"receivedAt": null,
"crossGstin": true,
"selfSupplyInvoice": {
"id": "clx2inv001000000000000001",
"number": "INV-0042"
},
"lines": [
{
"itemName": "Cotton Fabric",
"variantLabel": "Blue - 44in",
"sku": "CF-BLUE-44",
"qty": 10
}
],
"actions": [
"receive",
"cancel"
]
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found
/api/v1/inventory/transfers/{id}/dispatchDispatch a stock transfer
inventory.updateDRAFT to IN_TRANSIT: stock leaves the source warehouse. eway is optional, including between GST registrations; mode is ROAD, RAIL, AIR or SHIP and distanceKm is 1 to 4000. Answers with the refreshed detail, including the recomputed actions. 409 when the transfer's status doesn't allow it; 404 when the transfer or its warehouse is outside the member's scope.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Transfer ID. |
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
eway | any | Optional | — |
Example request
curl -X POST "https://pre-invoice.avscorp.in/api/v1/inventory/transfers/clx2trf001000000000000001/dispatch" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"eway": {
"distanceKm": 350,
"mode": "ROAD",
"vehicleNumber": "TN01AB1234",
"transporterName": "Fast Cargo"
}
}'Example response
{
"id": "clx2trf001000000000000001",
"number": "TR-MFD1X2-AB12CD",
"fromName": "Main Warehouse",
"toName": "Chennai Store",
"status": "IN_TRANSIT",
"dispatchedAt": "2026-08-12T09:30:00.000Z",
"receivedAt": null,
"crossGstin": true,
"selfSupplyInvoice": {
"id": "clx2inv001000000000000001",
"number": "INV-0042"
},
"lines": [
{
"itemName": "Cotton Fabric",
"variantLabel": "Blue - 44in",
"sku": "CF-BLUE-44",
"qty": 10
}
],
"actions": [
"receive",
"cancel"
]
}Possible errors: unauthorized, insufficient_scope, forbidden, validation_error, not_found, conflict
/api/v1/inventory/transfers/{id}/receiveReceive a stock transfer
inventory.updateIN_TRANSIT to RECEIVED: stock lands in the destination warehouse. No body. Answers with the refreshed detail, including the recomputed actions. 409 when the transfer's status doesn't allow it; 404 when the transfer or its warehouse is outside the member's scope.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Transfer ID. |
Example request
curl -X POST "https://pre-invoice.avscorp.in/api/v1/inventory/transfers/clx2trf001000000000000001/receive" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"id": "clx2trf001000000000000001",
"number": "TR-MFD1X2-AB12CD",
"fromName": "Main Warehouse",
"toName": "Chennai Store",
"status": "RECEIVED",
"dispatchedAt": "2026-08-12T09:30:00.000Z",
"receivedAt": "2026-08-14T10:00:00.000Z",
"crossGstin": true,
"selfSupplyInvoice": {
"id": "clx2inv001000000000000001",
"number": "INV-0042"
},
"lines": [
{
"itemName": "Cotton Fabric",
"variantLabel": "Blue - 44in",
"sku": "CF-BLUE-44",
"qty": 10
}
],
"actions": []
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found, conflict
/api/v1/inventory/transfers/{id}/cancelCancel a stock transfer
inventory.updateDRAFT or IN_TRANSIT to CANCELLED; in-transit stock returns to the source warehouse. No body. Answers with the refreshed detail, including the recomputed actions. 409 when the transfer's status doesn't allow it; 404 when the transfer or its warehouse is outside the member's scope.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Transfer ID. |
Example request
curl -X POST "https://pre-invoice.avscorp.in/api/v1/inventory/transfers/clx2trf001000000000000001/cancel" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"id": "clx2trf001000000000000001",
"number": "TR-MFD1X2-AB12CD",
"fromName": "Main Warehouse",
"toName": "Chennai Store",
"status": "CANCELLED",
"dispatchedAt": "2026-08-12T09:30:00.000Z",
"receivedAt": null,
"crossGstin": true,
"selfSupplyInvoice": {
"id": "clx2inv001000000000000001",
"number": "INV-0042"
},
"lines": [
{
"itemName": "Cotton Fabric",
"variantLabel": "Blue - 44in",
"sku": "CF-BLUE-44",
"qty": 10
}
],
"actions": []
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found, conflict
/api/v1/inventory/assembly-ordersList assembly orders
manufacturing.readThe Assembly Orders page, newest production date first, limited to the member's warehouses. status is DRAFT, COMPLETED or VOIDED; type is ASSEMBLY, REPACK or DISASSEMBLY. 404 when the Manufacturing module is off. Cost fields (unitCost, totalCost, cost, value, estCost, estCostPerUnit) need costPrice.read; without it the keys are absent.
Parameters
| 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://pre-invoice.avscorp.in/api/v1/inventory/assembly-orders" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"id": "clx2aso001000000000000001",
"number": "AO-00012",
"date": "2026-08-12T00:00:00.000Z",
"type": "ASSEMBLY",
"outputName": "Cotton Shirt",
"qty": 50,
"unitCost": 262,
"totalCost": 13100,
"warehouseName": "Main Warehouse",
"status": "COMPLETED"
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found
/api/v1/inventory/assembly-ordersCreate an assembly order from a recipe
manufacturing.createSaves a DRAFT ASSEMBLY order built from an active recipe exactly as the web form prefills it: each material's actual is planned plus the allowance. materials, when present, overrides the actual per itemVariantId (422 for a variant that is not a component of the recipe). A recipe for an item with several variants needs outputItemVariantId, one of the recipe's outputVariants (422 for anything else, and for a recipe with nothing to choose). productionDate cannot be in the future. 404 for an unknown recipe or a warehouse outside the member's scope; 422 for a draft or archived recipe. 404 when the Manufacturing module is off. Cost fields (unitCost, totalCost, cost, value, estCost, estCostPerUnit) need costPrice.read; without it the keys are absent.
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
bomId | string | Required | min length 1; max length 30 |
warehouseId | string | Required | min length 1; max length 30 |
productionDate | string | Required | — |
goodQty | number | Required | — |
outputItemVariantId | any | Optional | — |
materials | any | Optional | — |
Example request
curl -X POST "https://pre-invoice.avscorp.in/api/v1/inventory/assembly-orders" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"bomId": "clx2bom001000000000000001",
"warehouseId": "clx2wh0001000000000000001",
"productionDate": "2026-08-12",
"goodQty": 50,
"outputItemVariantId": "clx2var003000000000000001",
"materials": [
{
"itemVariantId": "clx2var001000000000000001",
"actual": 64
}
]
}'Example response
{
"id": "clx2aso001000000000000001"
}Possible errors: unauthorized, insufficient_scope, forbidden, validation_error, not_found
/api/v1/inventory/assembly-orders/{id}Get an assembly order
manufacturing.readOne order with its materials (planned, allowancePct, actual, variancePct, overAllowance), outputs, void reason and the actions the member may take now (complete, void). 404 when the Manufacturing module is off. Cost fields (unitCost, totalCost, cost, value, estCost, estCostPerUnit) need costPrice.read; without it the keys are absent.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Assembly order ID. |
Example request
curl "https://pre-invoice.avscorp.in/api/v1/inventory/assembly-orders/clx2aso001000000000000001" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"id": "clx2aso001000000000000001",
"number": "AO-00012",
"date": "2026-08-12T00:00:00.000Z",
"type": "ASSEMBLY",
"outputName": "Cotton Shirt",
"qty": 50,
"unitCost": 262,
"totalCost": 13100,
"warehouseName": "Main Warehouse",
"status": "COMPLETED",
"recipe": {
"id": "clx2bom001000000000000001",
"label": "v1 · Standard"
},
"materials": [
{
"itemName": "Cotton Fabric",
"planned": 60,
"allowancePct": 5,
"actual": 63,
"variancePct": 5,
"overAllowance": false,
"unitCost": 150,
"cost": 9450
}
],
"outputs": [
{
"itemName": "Cotton Shirt",
"type": "Main output",
"lotBarcode": "PRD-0000012",
"qty": 50,
"unitCost": 262,
"value": 13100,
"mrp": 999
}
],
"voidReason": null,
"actions": [
"void"
]
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found
/api/v1/inventory/assembly-orders/{id}/completeComplete an assembly order
manufacturing.approveDRAFT to COMPLETED: materials are consumed oldest lots first and the outputs are minted at the cost of what was used. No body. A second request is a 409 and posts nothing; 409 also when a material is short. Answers with the refreshed detail, including the recomputed actions. 409 when the order's status doesn't allow it; 404 when the order or its warehouse is outside the member's scope. 404 when the Manufacturing module is off. Cost fields (unitCost, totalCost, cost, value, estCost, estCostPerUnit) need costPrice.read; without it the keys are absent.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Assembly order ID. |
Example request
curl -X POST "https://pre-invoice.avscorp.in/api/v1/inventory/assembly-orders/clx2aso001000000000000001/complete" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"id": "clx2aso001000000000000001",
"number": "AO-00012",
"date": "2026-08-12T00:00:00.000Z",
"type": "ASSEMBLY",
"outputName": "Cotton Shirt",
"qty": 50,
"unitCost": 262,
"totalCost": 13100,
"warehouseName": "Main Warehouse",
"status": "COMPLETED",
"recipe": {
"id": "clx2bom001000000000000001",
"label": "v1 · Standard"
},
"materials": [
{
"itemName": "Cotton Fabric",
"planned": 60,
"allowancePct": 5,
"actual": 63,
"variancePct": 5,
"overAllowance": false,
"unitCost": 150,
"cost": 9450
}
],
"outputs": [
{
"itemName": "Cotton Shirt",
"type": "Main output",
"lotBarcode": "PRD-0000012",
"qty": 50,
"unitCost": 262,
"value": 13100,
"mrp": 999
}
],
"voidReason": null,
"actions": [
"void"
]
}Possible errors: unauthorized, insufficient_scope, forbidden, validation_error, not_found, conflict
/api/v1/inventory/assembly-orders/{id}/voidVoid an assembly order
manufacturing.deleteCOMPLETED to VOIDED: stock is reversed. reason is required (trimmed, not blank, at most 255 characters). Refused with 409 when any of the output was already sold or used. Answers with the refreshed detail, including the recomputed actions. 409 when the order's status doesn't allow it; 404 when the order or its warehouse is outside the member's scope. 404 when the Manufacturing module is off. Cost fields (unitCost, totalCost, cost, value, estCost, estCostPerUnit) need costPrice.read; without it the keys are absent.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Assembly order ID. |
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
reason | string | Required | min length 1; max length 255 |
Example request
curl -X POST "https://pre-invoice.avscorp.in/api/v1/inventory/assembly-orders/clx2aso001000000000000001/void" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"reason": "Wrong quantity entered"
}'Example response
{
"id": "clx2aso001000000000000001",
"number": "AO-00012",
"date": "2026-08-12T00:00:00.000Z",
"type": "ASSEMBLY",
"outputName": "Cotton Shirt",
"qty": 50,
"unitCost": 262,
"totalCost": 13100,
"warehouseName": "Main Warehouse",
"status": "VOIDED",
"recipe": {
"id": "clx2bom001000000000000001",
"label": "v1 · Standard"
},
"materials": [
{
"itemName": "Cotton Fabric",
"planned": 60,
"allowancePct": 5,
"actual": 63,
"variancePct": 5,
"overAllowance": false,
"unitCost": 150,
"cost": 9450
}
],
"outputs": [
{
"itemName": "Cotton Shirt",
"type": "Main output",
"lotBarcode": "PRD-0000012",
"qty": 50,
"unitCost": 262,
"value": 13100,
"mrp": 999
}
],
"voidReason": "Wrong quantity entered",
"actions": []
}Possible errors: unauthorized, insufficient_scope, forbidden, validation_error, not_found, conflict
/api/v1/inventory/bomsList recipes (bills of materials)
manufacturing.readThe Bills of Materials page, most recently changed first. status is DRAFT, ACTIVE or ARCHIVED; batchSize is the output quantity the recipe lines are written for. 404 when the Manufacturing module is off. Cost fields (unitCost, totalCost, cost, value, estCost, estCostPerUnit) need costPrice.read; without it the keys are absent.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
status | query | string | Optional | Only recipes in this status: DRAFT, ACTIVE or ARCHIVED. |
page | query | number | Optional | 1-based page number. |
limit | query | number | Optional | Page size, max 200. |
Example request
curl "https://pre-invoice.avscorp.in/api/v1/inventory/boms" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"id": "clx2bom001000000000000001",
"itemName": "Cotton Shirt",
"version": 1,
"label": "Standard",
"status": "ACTIVE",
"batchSize": 10,
"componentCount": 2,
"estCostPerUnit": 262
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found
/api/v1/inventory/boms/{id}Get a recipe
manufacturing.readOne recipe. components holds every line with its kind (COMPONENT, CO_PRODUCT, BY_PRODUCT or SCRAP), itemVariantId and unitFactor; byProducts is always empty. outputVariants lists {id, label} of the output item's active variants when the recipe is item-level and the item has several (pick one for outputItemVariantId when creating an order); otherwise it is empty. actions lists activate (draft) or archive (active). 404 when the Manufacturing module is off. Cost fields (unitCost, totalCost, cost, value, estCost, estCostPerUnit) need costPrice.read; without it the keys are absent.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Recipe (BOM) ID. |
Example request
curl "https://pre-invoice.avscorp.in/api/v1/inventory/boms/clx2bom001000000000000001" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"id": "clx2bom001000000000000001",
"itemName": "Cotton Shirt",
"version": 1,
"label": "Standard",
"status": "ACTIVE",
"batchSize": 10,
"componentCount": 2,
"estCostPerUnit": 262,
"components": [
{
"itemName": "Cotton Fabric",
"qtyPerBatch": 12,
"unit": "M",
"wastagePct": 5,
"drawFromName": null,
"estCost": 1890,
"itemVariantId": "clx2var001000000000000001",
"kind": "COMPONENT",
"unitFactor": 1
},
{
"itemName": "Fabric Waste",
"qtyPerBatch": 0.5,
"unit": "KG",
"wastagePct": 0,
"drawFromName": null,
"itemVariantId": "clx2var002000000000000001",
"kind": "SCRAP",
"unitFactor": 1
}
],
"outputVariants": [],
"byProducts": [],
"actions": [
"archive"
]
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found
/api/v1/inventory/boms/{id}/activateActivate a recipe
manufacturing.approveDRAFT to ACTIVE: the version freezes. No body. 409 when not a draft; 422 when the recipe cannot be produced (no components, an untracked item). Answers with the refreshed detail. 404 when the Manufacturing module is off. Cost fields (unitCost, totalCost, cost, value, estCost, estCostPerUnit) need costPrice.read; without it the keys are absent.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Recipe (BOM) ID. |
Example request
curl -X POST "https://pre-invoice.avscorp.in/api/v1/inventory/boms/clx2bom001000000000000001/activate" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"id": "clx2bom001000000000000001",
"itemName": "Cotton Shirt",
"version": 1,
"label": "Standard",
"status": "ACTIVE",
"batchSize": 10,
"componentCount": 2,
"estCostPerUnit": 262,
"components": [
{
"itemName": "Cotton Fabric",
"qtyPerBatch": 12,
"unit": "M",
"wastagePct": 5,
"drawFromName": null,
"estCost": 1890,
"itemVariantId": "clx2var001000000000000001",
"kind": "COMPONENT",
"unitFactor": 1
},
{
"itemName": "Fabric Waste",
"qtyPerBatch": 0.5,
"unit": "KG",
"wastagePct": 0,
"drawFromName": null,
"itemVariantId": "clx2var002000000000000001",
"kind": "SCRAP",
"unitFactor": 1
}
],
"outputVariants": [],
"byProducts": [],
"actions": [
"archive"
]
}Possible errors: unauthorized, insufficient_scope, forbidden, validation_error, not_found, conflict
/api/v1/inventory/boms/{id}/archiveArchive a recipe
manufacturing.updateACTIVE to ARCHIVED. No body. 409 when not active. Answers with the refreshed detail. 404 when the Manufacturing module is off. Cost fields (unitCost, totalCost, cost, value, estCost, estCostPerUnit) need costPrice.read; without it the keys are absent.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Recipe (BOM) ID. |
Example request
curl -X POST "https://pre-invoice.avscorp.in/api/v1/inventory/boms/clx2bom001000000000000001/archive" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"id": "clx2bom001000000000000001",
"itemName": "Cotton Shirt",
"version": 1,
"label": "Standard",
"status": "ARCHIVED",
"batchSize": 10,
"componentCount": 2,
"estCostPerUnit": 262,
"components": [
{
"itemName": "Cotton Fabric",
"qtyPerBatch": 12,
"unit": "M",
"wastagePct": 5,
"drawFromName": null,
"estCost": 1890,
"itemVariantId": "clx2var001000000000000001",
"kind": "COMPONENT",
"unitFactor": 1
},
{
"itemName": "Fabric Waste",
"qtyPerBatch": 0.5,
"unit": "KG",
"wastagePct": 0,
"drawFromName": null,
"itemVariantId": "clx2var002000000000000001",
"kind": "SCRAP",
"unitFactor": 1
}
],
"outputVariants": [],
"byProducts": [],
"actions": []
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found, conflict
/api/v1/inventory/challansList delivery challans
challans.readThe Delivery Challans page, newest first, limited to the member's source warehouses. date and expectedReturn are calendar days (YYYY-MM-DD, IST); status is DRAFT, ISSUED, CLOSED or CANCELLED; purpose is JOB_WORK, ON_APPROVAL, EXHIBITION, SAMPLES, REPAIR or OTHER; linesOut counts lines with goods still out. 404 when the Delivery challans module is off, or the challan's source warehouse is outside the member's scope. value (and each line's value) needs sellingPrice.read; without it the keys are absent.
Parameters
| 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://pre-invoice.avscorp.in/api/v1/inventory/challans" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"id": "clx2chl001000000000000001",
"number": "DC-00012",
"date": "2026-11-01",
"purpose": "ON_APPROVAL",
"partyName": "Ravi Stores",
"value": 3600,
"expectedReturn": "2026-11-30",
"linesOut": 1,
"status": "ISSUED"
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found
/api/v1/inventory/challansCreate a delivery challan
challans.createSaves a DRAFT exactly as the web form validates it: JOB_WORK and REPAIR go to a VENDOR; ON_APPROVAL and SAMPLES to a CUSTOMER; EXHIBITION to a CUSTOMER or NONE; OTHER to any. partyId is the customer or vendor ID (required unless partyType is NONE). expectedReturnDate cannot be before challanDate. mode (at most 20 characters) is independent of transporter and vehicleNumber. Nothing moves until it is issued. 404 for a source warehouse outside the member's scope; 403 when the plan lacks challans. 404 when the Delivery challans module is off, or the challan's source warehouse is outside the member's scope. value (and each line's value) needs sellingPrice.read; without it the keys are absent.
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
purpose | string | Required | one of: JOB_WORK, ON_APPROVAL, EXHIBITION, SAMPLES, REPAIR, OTHER |
partyType | string | Required | one of: CUSTOMER, VENDOR, NONE |
partyId | any | Optional | — |
sourceWarehouseId | string | Required | min length 1; max length 30 |
challanDate | string | Required | min length 1 |
expectedReturnDate | string | null | Optional | — |
transporter | any | Optional | — |
vehicleNumber | any | Optional | — |
mode | any | Optional | — |
notes | any | Optional | — |
lines | array | Required | — |
Example request
curl -X POST "https://pre-invoice.avscorp.in/api/v1/inventory/challans" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"purpose": "ON_APPROVAL",
"partyType": "CUSTOMER",
"partyId": "clx2cus001000000000000001",
"sourceWarehouseId": "clx2wh0001000000000000001",
"challanDate": "2026-11-01",
"expectedReturnDate": "2026-11-30",
"transporter": "Fast Cargo",
"vehicleNumber": "TN01AB1234",
"mode": "ROAD",
"notes": "Show the new range",
"lines": [
{
"itemVariantId": "clx2var001000000000000001",
"qty": 6
}
]
}'Example response
{
"id": "clx2chl001000000000000001"
}Possible errors: unauthorized, insufficient_scope, forbidden, validation_error, not_found
/api/v1/inventory/challans/{id}Get a delivery challan
challans.readThe row fields plus sourceWarehouseId, progress (sent, returned, invoiced, writtenOff, stillOut, summed over the lines), lines (id is what return and write-off address a line by), returns, invoices, the e-way bill (read-only: {number, validUntil} or null) and the actions (issue, return, convert, writeOff, cancel) the member may take now (convert is absent while its draft invoice is waiting). ewayBill.validUntil is an ISO datetime. 404 when the Delivery challans module is off, or the challan's source warehouse is outside the member's scope. value (and each line's value) needs sellingPrice.read; without it the keys are absent.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Delivery challan ID. |
Example request
curl "https://pre-invoice.avscorp.in/api/v1/inventory/challans/clx2chl001000000000000001" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"id": "clx2chl001000000000000001",
"number": "DC-00012",
"date": "2026-11-01",
"purpose": "ON_APPROVAL",
"partyName": "Ravi Stores",
"value": 3600,
"expectedReturn": "2026-11-30",
"linesOut": 1,
"status": "ISSUED",
"sourceWarehouseId": "clx2wh0001000000000000001",
"progress": {
"sent": 6,
"returned": 2,
"invoiced": 0,
"writtenOff": 0,
"stillOut": 4
},
"lines": [
{
"id": "clx2cli001000000000000001",
"itemName": "Cotton Fabric",
"sent": 6,
"returned": 2,
"invoiced": 0,
"writtenOff": 0,
"stillOut": 4,
"value": 3600
}
],
"returns": [
{
"number": "DC-00012/R1",
"date": "2026-11-05",
"lines": 1
}
],
"invoices": [],
"ewayBill": null,
"actions": [
"return",
"convert",
"writeOff",
"cancel"
]
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found
/api/v1/inventory/challans/{id}/issueIssue a delivery challan
challans.updateDRAFT to ISSUED: stock moves out of the source warehouse to Out on challan and the challan number is assigned. No body. A second request is a 409 and moves nothing; 409 also when a line is short. Answers with the refreshed detail, including the recomputed actions. 409 when the challan's status doesn't allow it. 404 when the Delivery challans module is off, or the challan's source warehouse is outside the member's scope. value (and each line's value) needs sellingPrice.read; without it the keys are absent.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Delivery challan ID. |
Example request
curl -X POST "https://pre-invoice.avscorp.in/api/v1/inventory/challans/clx2chl001000000000000001/issue" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"id": "clx2chl001000000000000001",
"number": "DC-00012",
"date": "2026-11-01",
"purpose": "ON_APPROVAL",
"partyName": "Ravi Stores",
"value": 3600,
"expectedReturn": "2026-11-30",
"linesOut": 1,
"status": "ISSUED",
"sourceWarehouseId": "clx2wh0001000000000000001",
"progress": {
"sent": 6,
"returned": 2,
"invoiced": 0,
"writtenOff": 0,
"stillOut": 4
},
"lines": [
{
"id": "clx2cli001000000000000001",
"itemName": "Cotton Fabric",
"sent": 6,
"returned": 2,
"invoiced": 0,
"writtenOff": 0,
"stillOut": 4,
"value": 3600
}
],
"returns": [
{
"number": "DC-00012/R1",
"date": "2026-11-05",
"lines": 1
}
],
"invoices": [],
"ewayBill": null,
"actions": [
"return",
"convert",
"writeOff",
"cancel"
]
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found, conflict
/api/v1/inventory/challans/{id}/returnRecord a return against a challan
challans.updateTakes goods back into warehouseId (404 when unknown or outside the member's scope). lines[].lineId is the challan line id from the detail; qty is in the line's unit and cannot exceed its stillOut (422); lines with qty 0 are ignored and at least one must be above 0. damaged defaults to false. date is not before the challan date. The party challan number and date are optional. Answers with the refreshed detail, including the recomputed actions. 409 when the challan's status doesn't allow it. 404 when the Delivery challans module is off, or the challan's source warehouse is outside the member's scope. value (and each line's value) needs sellingPrice.read; without it the keys are absent.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Delivery challan ID. |
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
date | string | Required | min length 1 |
warehouseId | string | Required | min length 1; max length 30 |
partyChallanNumber | any | Optional | — |
partyChallanDate | string | null | Optional | — |
lines | array | Required | — |
Example request
curl -X POST "https://pre-invoice.avscorp.in/api/v1/inventory/challans/clx2chl001000000000000001/return" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"date": "2026-11-05",
"warehouseId": "clx2wh0001000000000000001",
"lines": [
{
"lineId": "clx2cli001000000000000001",
"qty": 2,
"damaged": false
}
]
}'Example response
{
"id": "clx2chl001000000000000001",
"number": "DC-00012",
"date": "2026-11-01",
"purpose": "ON_APPROVAL",
"partyName": "Ravi Stores",
"value": 3600,
"expectedReturn": "2026-11-30",
"linesOut": 1,
"status": "ISSUED",
"sourceWarehouseId": "clx2wh0001000000000000001",
"progress": {
"sent": 6,
"returned": 2,
"invoiced": 0,
"writtenOff": 0,
"stillOut": 4
},
"lines": [
{
"id": "clx2cli001000000000000001",
"itemName": "Cotton Fabric",
"sent": 6,
"returned": 2,
"invoiced": 0,
"writtenOff": 0,
"stillOut": 4,
"value": 3600
}
],
"returns": [
{
"number": "DC-00012/R1",
"date": "2026-11-05",
"lines": 1
}
],
"invoices": [],
"ewayBill": null,
"actions": [
"return",
"convert",
"writeOff",
"cancel"
]
}Possible errors: unauthorized, insufficient_scope, forbidden, validation_error, not_found, conflict
/api/v1/inventory/challans/{id}/convertConvert a challan to an invoice
challans.updateConverts every line still out into a DRAFT invoice for the challan's customer and answers { invoiceId }. Needs challans.update and invoices.create (403 without). 409 when the purpose is not convertible (job work, repair, other), the challan is not issued, nothing is still out, or it was already converted. No body.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Delivery challan ID. |
Example request
curl -X POST "https://pre-invoice.avscorp.in/api/v1/inventory/challans/clx2chl001000000000000001/convert" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"invoiceId": "clx2inv001000000000000001"
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found, conflict
/api/v1/inventory/challans/{id}/write-offWrite off goods that will not come back
challans.approveWrites off part of what is still out. reason is 3 to 255 characters after trimming; qty per line cannot exceed its stillOut (422), lines with qty 0 are ignored and at least one must be above 0. Needs challans.approve. Answers with the refreshed detail, including the recomputed actions. 409 when the challan's status doesn't allow it. 404 when the Delivery challans module is off, or the challan's source warehouse is outside the member's scope. value (and each line's value) needs sellingPrice.read; without it the keys are absent.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Delivery challan ID. |
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
reason | string | Required | — |
lines | array | Required | — |
Example request
curl -X POST "https://pre-invoice.avscorp.in/api/v1/inventory/challans/clx2chl001000000000000001/write-off" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"reason": "Lost in transit",
"lines": [
{
"lineId": "clx2cli001000000000000001",
"qty": 1
}
]
}'Example response
{
"id": "clx2chl001000000000000001",
"number": "DC-00012",
"date": "2026-11-01",
"purpose": "ON_APPROVAL",
"partyName": "Ravi Stores",
"value": 3600,
"expectedReturn": "2026-11-30",
"linesOut": 1,
"status": "ISSUED",
"sourceWarehouseId": "clx2wh0001000000000000001",
"progress": {
"sent": 6,
"returned": 2,
"invoiced": 0,
"writtenOff": 0,
"stillOut": 4
},
"lines": [
{
"id": "clx2cli001000000000000001",
"itemName": "Cotton Fabric",
"sent": 6,
"returned": 2,
"invoiced": 0,
"writtenOff": 0,
"stillOut": 4,
"value": 3600
}
],
"returns": [
{
"number": "DC-00012/R1",
"date": "2026-11-05",
"lines": 1
}
],
"invoices": [],
"ewayBill": null,
"actions": [
"return",
"convert",
"writeOff",
"cancel"
]
}Possible errors: unauthorized, insufficient_scope, forbidden, validation_error, not_found, conflict
/api/v1/inventory/challans/{id}/cancelCancel an issued challan
challans.approveISSUED to CANCELLED: all goods go back to the source warehouse. No body. 409 when anything was returned, invoiced or written off, or a live e-way bill exists (the e-way bill is managed on the web). Needs challans.approve. Answers with the refreshed detail, including the recomputed actions. 409 when the challan's status doesn't allow it. 404 when the Delivery challans module is off, or the challan's source warehouse is outside the member's scope. value (and each line's value) needs sellingPrice.read; without it the keys are absent.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Delivery challan ID. |
Example request
curl -X POST "https://pre-invoice.avscorp.in/api/v1/inventory/challans/clx2chl001000000000000001/cancel" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"id": "clx2chl001000000000000001",
"number": "DC-00012",
"date": "2026-11-01",
"purpose": "ON_APPROVAL",
"partyName": "Ravi Stores",
"value": 3600,
"expectedReturn": "2026-11-30",
"linesOut": 0,
"status": "CANCELLED",
"sourceWarehouseId": "clx2wh0001000000000000001",
"progress": {
"sent": 6,
"returned": 2,
"invoiced": 0,
"writtenOff": 0,
"stillOut": 4
},
"lines": [
{
"id": "clx2cli001000000000000001",
"itemName": "Cotton Fabric",
"sent": 6,
"returned": 2,
"invoiced": 0,
"writtenOff": 0,
"stillOut": 4,
"value": 3600
}
],
"returns": [
{
"number": "DC-00012/R1",
"date": "2026-11-05",
"lines": 1
}
],
"invoices": [],
"ewayBill": null,
"actions": []
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found, conflict