Skip to main content

Add Inventory

Add inventory to a product. Behavior differs based on the product's inventory tracking type.

Endpointโ€‹

POST /v1/products/{id}/inventory

Authenticationโ€‹

Requires an API key with the products:write scope.

Parametersโ€‹

ParameterTypeLocationDescription
idintegerpathThe product ID

Request Bodyโ€‹

FieldTypeRequiredDescription
variation_idintegerConditionalRequired if product has variations enabled
identifierstringConditionalItem-level: the starting code for a numbered run. Required unless identifiers is provided; optional for group
identifiersstring[]ConditionalItem-level only: an array of exact codes, one record each (saved verbatim). Use instead of identifier + quantity
quantityintegerConditionalNumber of items to add. Required unless identifiers is provided
locationstringNoFree-text storage location
location_idintegerNoSupplier location ID (see Locations)
available_fromstringNoDate when item becomes available (ISO 8601)
available_untilstringNoDate when item is no longer available (ISO 8601)

Tracking Type Behaviorโ€‹

Group-Level Trackingโ€‹

For products with inventory_tracking: "group":

  • Creates a single inventory record with the specified quantity
  • Merges into existing record if same variation + location + available dates match
  • identifier is optional

Item-Level Trackingโ€‹

For products with inventory_tracking: "item", creates individual records (each with total_quantity: 1). Provide either identifier + quantity or an identifiers array:

  • Numbered run (identifier + quantity): continues the number at the end of the code you send, preserving its zero-padding. identifier: "EXO-0001", quantity: 17 creates EXO-0001 โ€ฆ EXO-0017. A quantity of 1 saves the code exactly as sent (no suffix). A code with no trailing number falls back to {identifier}-1, {identifier}-2, ...
  • Exact list (identifiers): each string is saved verbatim as its own item โ€” use this for serial numbers.
  • The -N suffix only ever appears to avoid a clash. Numbers already in use are skipped; an exact code that already exists returns a 422 validation error and nothing is created.

Responseโ€‹

Group-Level Tracking (201 Created)โ€‹

{
"data": {
"id": 5,
"variation": {
"id": 1,
"sku": "BIKE-L-RED",
"values": "Large, Red"
},
"identifier": null,
"unique_identifier": null,
"increment": null,
"total_quantity": 10,
"location": "Warehouse A",
"supplier_location": {
"id": 1,
"name": "Main Store"
},
"available_from": null,
"available_until": null,
"status": "current",
"created_at": "2026-02-01T10:00:00+00:00",
"updated_at": "2026-02-01T10:00:00+00:00"
},
"meta": {
"request_id": "req_abc123",
"timestamp": "2026-02-01T10:00:00+00:00"
}
}

Item-Level Tracking (201 Created)โ€‹

Returns array of created items:

{
"data": {
"message": "Created 3 inventory item(s).",
"items": [
{
"id": 10,
"variation": null,
"identifier": "BIKE-1",
"unique_identifier": "BIKE",
"increment": 1,
"total_quantity": 1,
"location": "Main Store",
"supplier_location": {
"id": 1,
"name": "Main Store"
},
"available_from": null,
"available_until": null,
"status": "current",
"created_at": "2026-02-01T10:00:00+00:00",
"updated_at": "2026-02-01T10:00:00+00:00"
},
{
"id": 11,
"identifier": "BIKE-2",
"unique_identifier": "BIKE",
"increment": 2,
...
},
{
"id": 12,
"identifier": "BIKE-3",
"unique_identifier": "BIKE",
"increment": 3,
...
}
]
},
"meta": {
"request_id": "req_abc123",
"timestamp": "2026-02-01T10:00:00+00:00"
}
}

Example Requestsโ€‹

Group-Level: Add Stock Quantityโ€‹

curl -X POST "https://app.equipdash.com/api/v1/products/1/inventory" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"variation_id": 1,
"quantity": 10,
"location": "Warehouse A",
"location_id": 1
}'

Group-Level: Add Expected Stockโ€‹

curl -X POST "https://app.equipdash.com/api/v1/products/1/inventory" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"variation_id": 1,
"quantity": 5,
"available_from": "2026-03-01T00:00:00Z"
}'

Item-Level: Add Individual Itemsโ€‹

curl -X POST "https://app.equipdash.com/api/v1/products/2/inventory" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"identifier": "KAYAK",
"quantity": 3,
"location": "Dock Storage"
}'

This creates 3 items: KAYAK-1, KAYAK-2, KAYAK-3

Item-Level: With Variationโ€‹

curl -X POST "https://app.equipdash.com/api/v1/products/2/inventory" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"variation_id": 5,
"identifier": "KAYAK-RED",
"quantity": 2
}'

Errorsโ€‹

StatusCodeDescription
401authentication_requiredNo API key provided
403insufficient_scopeAPI key lacks products:write scope
404resource_not_foundProduct not found
422validation_errorInvalid request data

Common Validation Errorsโ€‹

ErrorDescription
product: Inventory tracking not enabledEnable inventory tracking on the product first
variation_id: requiredProduct has variations - must specify which variation
identifier: requiredItem-level tracking requires an identifier
variation_id: does not belong to productThe variation ID doesn't exist for this product
quantity: requiredMust specify quantity
available_until: must be after available_fromEnd date must be after start date