Hub Gateway API
Get Inventory Live sellable stock for a set of B2B variants.
Return live sellable stock for a set of B2B variants, keyed by variant.id. No
price is ever returned here — retail pricing is the distributor's own decision on
Hub. Response sets cache-control: no-store.
Parameter Data Type Required Description x-hub-api-keystring true Shared Hub service key.
Parameter Data Type Required Description variantIdsstring true Comma-separated B2B variant.ids. Max 100 per call (extras ignored; duplicates de-duped).
curl "https://<your-b2b-host>/api/hub/inventory?variantIds=var_abc,var_def" \
-H "x-hub-api-key: $HUB_API_KEY "
Parameter Data Type Description itemsarray One entry per known variant (unknown ids are omitted). items[].variantIdstring The B2B variant id. items[].availableinteger | null Sellable count, or null for an untracked (unlimited) variant. items[].inStockboolean true for untracked; otherwise available > 0.
{
"items" : [
{ "variantId" : "var_abc" , "available" : 42 , "inStock" : true },
{ "variantId" : "var_def" , "available" : null , "inStock" : true }
]
}
available: null ⇒ untracked (unlimited) variant, always inStock: true.
Unknown / de-published variant ids are omitted , not errored.
Status Body When 400{ "error": "variantIds is required" }The param is empty. 401{ "error": "Unauthorized" }Bad or missing API key. 500{ "error": "Failed to load inventory" }Unhandled server error.