Hub Gateway API
Get Order Status, invoice, and line items for a distributor's cloud order.
GET /api/hub/orders/:reference
Return the status of a distributor's cloud order (the B2B order group keyed by
externalRef = reference), plus its delivery fee, linked invoice, and line
items. Scoped to the calling distributor — a reference owned by another
distributor returns 404 . 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 referencestring true The order reference used at creation.
Parameter Data Type Required Description hubCustomerIdstring true The owning distributor's Hub customer id.
curl "https://<your-b2b-host>/api/hub/orders/hub-order-9f2a?hubCustomerId=hub_cust_1" \
-H "x-hub-api-key: $HUB_API_KEY "
Parameter Data Type Description referencestring Echoed reference. statusstring Group status: pending | confirmed | processing | shipped | delivered | completed | cancelled (least-progressed sub-order). deliveryFeeCentsinteger Total delivery fee across sub-orders. invoiceobject | null { number, status, total } — status is issued | paid | voided; null until issued.itemsarray Line items { sku, title, quantity, unitAmount, currency }.
{
"reference" : "hub-order-9f2a" ,
"status" : "pending" ,
"deliveryFeeCents" : 1500 ,
"invoice" : { "number" : "INV-2001" , "status" : "issued" , "total" : 27300 },
"items" : [
{
"sku" : "OAK-DT-Q" ,
"title" : "Oak Dining Table" ,
"quantity" : 2 ,
"unitAmount" : 12900 ,
"currency" : "USD"
}
]
}
Status Body When 400{ "error": "hubCustomerId is required" }Missing query param. 404{ "error": "Not found" }Unknown reference, or not owned by the caller. 401{ "error": "Unauthorized" }Bad or missing API key. 500{ "error": "Failed to load order" }Unhandled server error.