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โ
| Parameter | Type | Location | Description |
|---|---|---|---|
id | integer | path | The product ID |
Request Bodyโ
| Field | Type | Required | Description |
|---|---|---|---|
variation_id | integer | Conditional | Required if product has variations enabled |
identifier | string | Conditional | Item-level: the starting code for a numbered run. Required unless identifiers is provided; optional for group |
identifiers | string[] | Conditional | Item-level only: an array of exact codes, one record each (saved verbatim). Use instead of identifier + quantity |
quantity | integer | Conditional | Number of items to add. Required unless identifiers is provided |
location | string | No | Free-text storage location |
location_id | integer | No | Supplier location ID (see Locations) |
available_from | string | No | Date when item becomes available (ISO 8601) |
available_until | string | No | Date 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
identifieris 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: 17createsEXO-0001 โฆ EXO-0017. Aquantityof 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
-Nsuffix only ever appears to avoid a clash. Numbers already in use are skipped; an exact code that already exists returns a422validation 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โ
| Status | Code | Description |
|---|---|---|
| 401 | authentication_required | No API key provided |
| 403 | insufficient_scope | API key lacks products:write scope |
| 404 | resource_not_found | Product not found |
| 422 | validation_error | Invalid request data |
Common Validation Errorsโ
| Error | Description |
|---|---|
product: Inventory tracking not enabled | Enable inventory tracking on the product first |
variation_id: required | Product has variations - must specify which variation |
identifier: required | Item-level tracking requires an identifier |
variation_id: does not belong to product | The variation ID doesn't exist for this product |
quantity: required | Must specify quantity |
available_until: must be after available_from | End date must be after start date |