Skip to main content

Inventory Batches

Overview

Batches let you track stock by manufacturing date, expiry date, manufacturer, and other batch-level attributes, for inventory items where trackingMethod is set to BATCH. See the Inventory page for managing the items themselves.


List Inventory Batches

get /api/v1/businesses/:urlKey/inventories/:sku/inventory-batches

This endpoint allows you to retrieve a paginated list of batches for a batch-tracked inventory item.

Path Params

urlKey - The unique identifier of the business.
sku - The SKU of the batch-tracked inventory item.

Headers

NameTypeValue Description
Content-Type *stringapplication-json
Authorization *stringBearer <jwt>

Query Params

Optional - Can be used for filtering and limiting results

NameTypeValue Description
batchCodestringFilter by batch code
batchNamestringFilter by batch name
manufacturerNamestringFilter by manufacturer name
manufacturerBatchNumberstringFilter by manufacturer's batch number
manufacturingDatestringFilter by manufacturing date, format YYYY-MM-DD
expiryDatestringFilter by expiry date, format YYYY-MM-DD
$limitnumberNumber of results to return (default 10, max 50)
$skipnumberNumber of results to skip (default 0, max 10000)
$sortobjectSort order, e.g. $sort[createdAt]=-1
$selectarray[string]Limit the fields returned per batch

Get Inventory Batch by Code

get /api/v1/businesses/:urlKey/inventories/:sku/inventory-batches/:batchCode

This endpoint allows you to retrieve a single batch by its batch code.

Path Params

urlKey - The unique identifier of the business.
sku - The SKU of the batch-tracked inventory item.
batchCode - The batch code to retrieve.

Headers

NameTypeValue Description
Content-Type *stringapplication-json
Authorization *stringBearer <jwt>

Create Inventory Batch

post /api/v1/businesses/:urlKey/inventories/:sku/inventory-batches

This endpoint allows you to register a new batch under a batch-tracked inventory item.

Path Params

urlKey - The unique identifier of the business.
sku - The SKU of the batch-tracked inventory item.

Headers

NameTypeValue Description
Content-Type *stringapplication-json
Authorization *stringBearer <jwt>

Body

NameTypeValue Description
batchCode *stringBatch code — must be unique within this inventory item
batchNamestringBatch name
manufacturerNamestringManufacturer name
manufacturerBatchNumberstringManufacturer's batch number
manufacturingDatestringManufacturing date, format YYYY-MM-DD
expiryDatestringExpiry date, format YYYY-MM-DD
costPricenumberBatch cost price
sellingPricenumberBatch selling price
initialStocknumberInitial stock for this batch
vendorstringuniqueKey of the supplying vendor — must be an existing client
warehouses[]array[object]Per-warehouse initial stock for this batch — only applicable when Warehouse Management is enabled
warehouses[].warehouseId *stringWarehouse code
warehouses[].quantitynumberInitial stock for this batch in this warehouse
customFields[]array[object]Custom fields — label must be pre-configured for the Inventory Batches category in Business Settings
customFields[].labelstringCustom field label
customFields[].valuestringCustom field value

Update Inventory Batch

patch /api/v1/businesses/:urlKey/inventories/:sku/inventory-batches/:batchCode

This endpoint allows you to update an existing batch.

Path Params

urlKey - The unique identifier of the business.
sku - The SKU of the batch-tracked inventory item.
batchCode - The batch code to update.

Headers

NameTypeValue Description
Content-Type *stringapplication-json
Authorization *stringBearer <jwt>

Body

Accepts any of the fields listed under Create Inventory Batch above (including batchCode, to rename the batch).