Skip to main content
The Admin Inventory API lets you inspect real-time stock levels for any product variant and make surgical adjustments without touching pending order allocations. The system tracks stock using a reservation model: units move through distinct states as orders are placed, confirmed, shipped, and fulfilled. Understanding which state each unit is in is essential before issuing any manual adjustment.
All endpoints under /admin/inventory require an authenticated session with the ADMIN or SUPER_ADMIN role. For every PATCH request, first call GET /auth/csrf-token and pass the returned token in the x-csrf-token header.

The Reservation Model

Every inventory record tracks three quantities that together describe the full stock picture for a variant. The stock_status field is derived automatically from quantity_available and the variant’s reorder_level:
  • IN_STOCKquantity_available is above the reorder threshold (or no threshold is set)
  • LOW_STOCKquantity_available is at or below the reorder threshold
  • OUT_OF_STOCKquantity_available is zero or negative
Inventory transitions by order status

Get Inventory for a Variant

Retrieve the full inventory record for a single variant, including all quantity breakdowns, reorder level, stock status, and the timestamp of the last stock movement.

Path Parameters

string
required
The variant’s public ID. Must start with var_.

Response

boolean
Always true on a 200 response.
object
The inventory record for the requested variant.
Example — get inventory for a variant
200 Response

List Inventory

Retrieve a paginated list of inventory records across all variants. Filter by stock status, search by product name or SKU, and sort by any tracked quantity.

Query Parameters

integer
default:"1"
Page number (1-based).
integer
default:"20"
Results per page. Range: 1–100.
Free-text search across product name and SKU.
string
Filter by computed stock status. Accepted values: IN_STOCK, LOW_STOCK, OUT_OF_STOCK.
string
default:"false"
Pass "true" to include records for soft-deleted variants.
string
default:"product_name"
Sort field. Prefix with - for descending. Accepted values: product_name, -product_name, sku, -sku, quantity_on_hand, -quantity_on_hand, quantity_available, -quantity_available, last_stock_update, -last_stock_update.
Use stock_status=LOW_STOCK combined with sort=-quantity_available to surface the variants closest to going out of stock — ideal for daily reorder reviews.

Create Inventory Record

Create an inventory record for a variant. Each variant can have at most one inventory record — if one already exists, the API returns 409 Conflict. Call this endpoint after adding a new variant before it can be made available for purchase.

Request Body

string
required
The variant’s public ID, prefixed var_. The variant must exist and must not already have an inventory record.
integer
required
Initial on-hand stock count (≥ 0).
integer
Optional reorder threshold. When quantity_available falls to or below this value, stock_status becomes LOW_STOCK. Must be ≥ 0.

Example

Error Responses


Adjust Stock Level

Set an absolute stock level or apply a delta to quantity_on_hand for a variant. Use this endpoint after physical inventory counts, receiving new shipments, or writing off damaged goods.

Path Parameters

string
required
The variant’s public ID. Must start with var_.

Request Body

Provide either quantity_on_hand (absolute set) or quantity_change (delta). The two fields are mutually exclusive. At least one field is required.
integer
Set the on-hand quantity to this exact value (≥ 0). Mutually exclusive with quantity_change.
integer
Apply a non-zero delta to the current on-hand quantity. Use a negative value to reduce stock (e.g. -5 for five damaged units). Mutually exclusive with quantity_on_hand.
integer | null
Update the reorder threshold. Pass null to remove the threshold entirely.
string
Human-readable reason for the adjustment, stored in the audit log. Maximum 255 characters.
200 Response

Reserve or Release Stock Manually

Adjust the quantity_reserved counter for a variant using a signed delta. A positive change reserves additional units; a negative change releases them back to quantity_available. Both operations are validated against current stock levels to prevent over-reservation.
The checkout flow automatically reserves stock when a customer places an order and releases it if the order is cancelled. Use this endpoint only for exceptional cases — for example, holding units for a photoshoot, a VIP customer pre-order, or correcting a reservation discrepancy caused by a failed webhook.

Path Parameters

string
required
The variant’s public ID. Must start with var_.

Request Body

integer
required
Non-zero delta applied to quantity_reserved. Positive to reserve; negative to release. The API rejects a request if the resulting quantity_available would drop below zero.
string
Human-readable reason stored in the audit log. Maximum 255 characters.
200 Response
Passing a change value that would push quantity_available below zero returns a 400 Bad Request. Always fetch the current inventory record first to verify you have sufficient available stock before reserving.