Hub Gateway API
Hub Gateway API
The API HomeiCloud B2B exposes to Homei Hub for catalog, inventory, and dropship orders.
The Hub Gateway (/api/hub/*) is the API HomeiCloud B2B exposes to
Homei Hub (the distributor storefront). It lets a Hub distributor browse the
B2B catalog, apply to list products, read live inventory, quote delivery, and
place, track, or cancel dropship orders — without ever learning which
fulfillment provider ships the goods.
Base URL
https://<your-b2b-host>/api/hubEndpoints
| Method | Path | Purpose |
|---|---|---|
| GET | /products | List the publish-gated catalog (paged) |
| GET | /products/:id | Full product detail with variants |
| GET | /categories | Category filter options |
| POST | /applications | Apply to list a product |
| DELETE | /applications | Withdraw a pending application |
| GET | /authorizations | Per-product authorization status |
| GET | /inventory | Live sellable stock for variants |
| POST | /delivery-quote | Quote the delivery fee for a cart |
| POST | /orders | Create a dropship order |
| GET | /orders/:reference | Order status, invoice, and items |
| DELETE | /orders/:reference | Cancel an order and release stock |
Conventions
- Money is always integer minor units (US cents).
currencyis"USD". - Dimensions are millimetres (
*Mm) and grams (weightGrams);nullwhere undeclared. - Caching: gateway responses set
cache-control: no-store— always read live, never cache stale price or stock. - Stock (
available): an integer sellable count, ornullfor an untracked (unlimited) variant.inStockis the boolean buyers care about. variant.idis the stable sellable key. Hub keys pricing, cart, inventory, and orders off the B2Bvariant.id; it is never recycled or regenerated. On the order endpoints this same id is passed asorderKey.- Publish gate. A product is only visible/orderable when it is
active, hasqcStatus = passed, comes from anapprovedsupplier, and has a priced primary variant. Items that fall out of the gate simply stop being returned — there is no explicit "removed" event, so consumers must reconcile on each read.
Error model
Errors return a JSON body with an error string and the relevant HTTP status.
Some 4xx responses include an extra field listing the offending keys (e.g.
unknown, unavailable, untracked, unauthorized, shortItems,
unpriced, expected).
| Status | Meaning |
|---|---|
400 | Invalid request body / missing query params / delivery-fee mismatch |
401 | Bad or missing API key |
403 | Distributor suspended, or not authorized for a product |
404 | Not found, or not owned by the calling distributor |
409 | State conflict (out of stock, untracked variant, un-cancellable order) |
500 | Unhandled server error |
503 | Gateway not configured |
Idempotency
- Orders are idempotent on
reference: a repeat POST re-reads the existing order group and returns it rather than double-creating. - Applications, withdrawals, and cancellations are idempotent — safe to retry.
Continue to Authentication to start making requests.