Hub Gateway API
Get Product
Full detail for one publish-gated product, including all variants.
GET /api/hub/products/:idUse Case
Fetch full detail for a single product — all active variants with SKUs,
options, dimensions, and resolved cost. Returns 404 when the product fails
the publish gate (inactive, QC not passed, supplier not approved, or the primary
variant is unpriced). Response sets cache-control: no-store.
Header Parameters
| Parameter | Data Type | Required | Description |
|---|---|---|---|
x-hub-api-key | string | true | Shared Hub service key. |
Path Parameters
| Parameter | Data Type | Required | Description |
|---|---|---|---|
id | string | true | The product id. |
Example Request
curl "https://<your-b2b-host>/api/hub/products/prod_123" \
-H "x-hub-api-key: $HUB_API_KEY"Response Parameters
Product-level fields: id, title, subtitle, description, brand,
category, material, originCountry, supplierName, images[], and
variants[].
Each variants[] entry:
| Field | Data Type | Description |
|---|---|---|
id | string | Variant id (the stable orderKey). |
title | string | null | Variant title. |
thumbnail | string | null | Variant image URL. |
sku | string | Variant SKU. |
warehouseSku | string | null | Warehouse SKU. |
options | string | null | JSON string of the option selection (parse it). |
unit | string | Selling unit (e.g. each). |
dimensions | object | Packaged size { weightGrams, lengthMm, widthMm, heightMm }. |
assembledDimensions | object | Assembled (in-use) size, same shape. |
costPrice | object | null | { unitAmount, currency } in cents; null if unpriced. |
available | integer | null | Sellable stock; null when untracked. |
inStock | boolean | Whether this variant is sellable. |
Barcodes, freight, and customs codes are intentionally not exposed.
Example Response
{
"id": "prod_123",
"title": "Oak Dining Table",
"subtitle": "Solid wood",
"description": "…",
"brand": "Homei",
"category": "Dining",
"material": "Oak",
"originCountry": "VN",
"supplierName": "Homei Furniture Co.",
"images": ["https://…/1.jpg", "https://…/2.jpg"],
"variants": [
{
"id": "var_abc",
"title": "Oak / Queen",
"thumbnail": "https://…/v.jpg",
"sku": "OAK-DT-Q",
"warehouseSku": "OAK-DT-01",
"options": "{\"Color\":\"Oak\",\"Size\":\"Queen\"}",
"unit": "each",
"dimensions": {
"weightGrams": 42000, "lengthMm": 1800, "widthMm": 900, "heightMm": 150
},
"assembledDimensions": {
"weightGrams": 42000, "lengthMm": 1800, "widthMm": 900, "heightMm": 750
},
"costPrice": { "unitAmount": 12900, "currency": "USD" },
"available": 42,
"inStock": true
}
]
}Error Responses
| Status | Body | Description |
|---|---|---|
401 | { "error": "Unauthorized" } | Bad or missing API key. |
404 | { "error": "Not found" } | Product fails the publish gate. |
500 | { "error": "Failed to load product" } | Unhandled server error. |