Inventory

Get variant balance

Gets on-hand, reserved, and available inventory for a Variant, in total and per warehouse.

GET
/v1/variants/{variantId}/inventory

available is publishable quantity. The response has the Variant totals (onHand, reserved, available) and the warehouses list, with one line per warehouse. The totals are always the sum of the lines.

curl "$BACKEND_URL/v1/variants/$VARIANT_ID/inventory" \
  -H "Authorization: Bearer mk_your_api_key"

Example: 6 units in the default warehouse and 4 in the branch give onHand: 10 in total.

The warehouses list

  • It has every active warehouse of the seller, including the ones where the Variant never had a movement (all zero). An archived warehouse does not show up.
  • The default warehouse comes first. The others follow by name.
  • For the balance of one warehouse, look for its warehouseId in the list.

Derived kits

For derived kits, available is calculated at read time, warehouse by warehouse: in each one, it is the smallest whole-unit ratio of the active components that are there. The totals sum the warehouses, and the kit's reserved is always 0. Parts in different warehouses do not make a kit.

What the marketplace says it has (external)

external[] has one row per target and marketplace location: connectionId, marketplace, locationId, locationType, and the target (listingId and bindingId, or marketplaceProductVariantId). The numbers are what the marketplace says it has:

  • available: what it sells.
  • reserved: set aside for a campaign or promotion.
  • inTransit: on its way to the location.
  • unfulfillable: at the location, but not sellable.

publishedQuantity and publishedAt are marketapi's last publication. publishedAt is when we sent it (the start of the call), not when the marketplace answered; if another publication of the same target may have crossed it, it is when the answer came back. A number above 0 counts from the start of the call, even after a failure with no answer (timeout, 5xx), because it may have arrived; a definite refusal (4xx) restores the previous value. A 0 counts only once the marketplace accepts it. They are null for marketplace_fulfillment locations (read-only) and for kits the marketplace computes. observedAt is when the marketplace was last read: by notification or by the reconciliation every 6 hours. See Locations at the marketplace.

Authorization

api_key
headerAuthorizationBearer <token>

API key (mk_...)

Path Parameters

variantId*string
Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid

Response Body

Current on-hand, reserved and available inventory: the totals of the variant and the split by warehouse.

application/json
  1. response

Current inventory balance of one variant: the total, and its split by warehouse.

variantId*string

Variant whose stock this is.

Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid
onHand*integer

Physical or owned units on hand, summed over every warehouse in warehouses.

Range-9007199254740991 <= value <= 9007199254740991
reserved*integer

Units reserved for open commitments, summed over every warehouse in warehouses.

Range0 <= value <= 9007199254740991
available*integer

Publishable units: onHand minus reserved, summed over every warehouse in warehouses.

Range-9007199254740991 <= value <= 9007199254740991
updatedAt*string

When this balance last changed, in any warehouse.

Match^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
Formatdate-time
warehouses*array<>

The balance in each active warehouse of the seller, including the ones where this variant has no stock yet (zeros). The default warehouse comes first, then the others by name. The totals above are the sum of these lines.

external*array<>

What the marketplaces hold for this variant, one line per listing line (or marketplace product variation, where the marketplace keeps the stock per variation) and stock location. Empty before any read. It does not change the totals above: those are the stock you hold.

curl -X GET "https://example.com/v1/variants/497f6eca-6276-4993-bfeb-53cbbbba6f08/inventory"
{  "variantId": "47c9f819-fcf6-4478-b21a-678ecc594a11",  "onHand": 10,  "reserved": 2,  "available": 8,  "updatedAt": "2026-10-10T12:00:00.000Z",  "warehouses": [    {      "warehouseId": "b7e2a1c4-5d3f-4e8a-9b6c-2f1d0a8e7c35",      "onHand": 7,      "reserved": 0,      "available": 7,      "updatedAt": "2026-10-10T12:00:00.000Z"    },    {      "warehouseId": "e41c9a07-26b8-4d53-a0f1-8c3b7d5e9a12",      "onHand": 3,      "reserved": 2,      "available": 1,      "updatedAt": "2026-10-09T08:00:00.000Z"    }  ],  "external": [    {      "connectionId": "9a1b2c3d-4e5f-4a6b-8c7d-0e1f2a3b4c5d",      "marketplace": "mock",      "locationId": "5d0c8e2a-7b41-4f36-9a58-1c2e3f4a5b6c",      "locationType": "seller_location",      "listingId": "0e2ce906-a6ab-4101-9461-4168c8b6b902",      "bindingId": "cb064b64-2f63-4c3e-aa42-f11ea0f82b17",      "marketplaceProductVariantId": null,      "available": 7,      "reserved": 0,      "inTransit": 0,      "unfulfillable": 0,      "publishedQuantity": 7,      "publishedAt": "2026-10-12T06:00:00.000Z",      "observedAt": "2026-10-12T06:01:00.000Z"    }  ]}