Skip to content

Batches API

POST /api/v1/integration/batches

Bulk upsert product batches. Each batch must reference a previously synced product by productExternalId.

Required scope: integration:batches:write

{
"batches": [
{
"externalId": "string (required)",
"productExternalId": "string (required)",
"batchNumber": "string (required in data)",
"quantity": "number",
"unit": "string",
"receivedDate": "string (ISO date)",
"expiryDate": "string (ISO date)"
}
],
"autoCreateDDS": false
}
  • Maximum 500 batches per request

Batches depend on products, which optionally depend on suppliers. Sync in this order:

  1. Suppliers (via POST /suppliers)
  2. Products (via POST /products, optionally with supplierExternalId)
  3. Batches (via POST /batches, with productExternalId)
{
"success": true,
"created": 1,
"updated": 0,
"errors": [],
"records": [
{ "externalId": "BATCH-001", "internalId": "clx...", "status": "CREATED" }
],
"ddsCreated": []
}
FieldTypeRequiredDescription
externalIdstring✅Unique batch ID in your system
productExternalIdstring✅External ID of the parent product
batchNumberstring✅Batch or lot number
quantitynumberQuantity received
unitstringUnit of measure
receivedDatestringISO date when batch was received
expiryDatestringISO date for batch expiry

If a batch references a productExternalId that hasn’t been synced yet, you’ll get:

{
"externalId": "BATCH-001",
"error": "Product with externalId \"ITEM-999\" not found. Sync products first."
}

GET /api/v1/integration/batches

Required scope: integration:batches:read

ParameterTypeDefaultDescription
pagenumber1Page number
limitnumber50Items per page (max 100)
sincestringISO date filter

Same format as supplier and product listing.