Hub Gateway API
Quote Delivery Quote the HomeiCloud delivery fee for a cart.
POST /api/hub/delivery-quote
Quote the HomeiCloud delivery fee for a cloud basket so Hub can show it before
the buyer pays. Currently a flat fee (HUB_DELIVERY_FEE_FLAT_CENTS, default
1500). The same value should be passed back to
Create Order , where it is re-validated
server-side. Response sets cache-control: no-store.
Parameter Data Type Required Description x-hub-api-keystring true Shared Hub service key. Content-Typestring true application/json.
Parameter Data Type Required Description itemsarray true Cart lines (≥ 1). items[].orderKeystring true The B2B variant.id. items[].qtyinteger true Positive quantity. recipientobject false Ship-to address; all fields optional. recipient.namestring false Recipient name. recipient.streetstring false Street address. recipient.citystring false City. recipient.statestring false State / region. recipient.postalCodestring false Postal / ZIP code. recipient.countrystring false Country. recipient.phonestring false Phone.
curl -X POST "https://<your-b2b-host>/api/hub/delivery-quote" \
-H "x-hub-api-key: $HUB_API_KEY " \
-H "Content-Type: application/json" \
-d '{
"items": [ { "orderKey": "var_abc", "qty": 2 } ],
"recipient": { "city": "Austin", "state": "TX", "country": "US" }
}'
Parameter Data Type Description feeCentsinteger Delivery fee in US cents. currencystring USD.
{ "feeCents" : 1500 , "currency" : "USD" }
Status Body When 400{ "error": "Invalid request body" }Schema validation failure. 401{ "error": "Unauthorized" }Bad or missing API key. 500{ "error": "Failed to quote delivery" }Unhandled server error.