Skip to main content

Proxy Mode

A tenant whose orders live only in its own order system (OMS) can have the Customer Order service read them from there, instead of holding a copy. The service then acts as a middleman between the till and the external service, while the data is still reached through the Hii Retail APIs and front ends.

Configuration​

Proxy mode is set up in the logistics proxy configuration service, under the service key customer-order: the address of your system and the credentials to call it, with HTTP Basic or OAuth 2.0 client credentials.

PUT https://logistics-proxy-config.retailsvc.com/api/v1/proxy-config?service=customer-order
{
"type": "basic",
"config": { "username": "hii-retail", "password": "s3cret" },
"apiConfig": { "url": "https://oms.example.com" }
}

Proxy mode is on for a tenant once a configuration with an address is stored, and off again when the address is removed, within the 10 minutes a change takes to reach every instance. apiConfig.url is the base address that the endpoints in External Service Configuration are appended to, so https://oms.example.com receives GET https://oms.example.com/business-units/{businessUnitId}/customer-orders/{customerOrderId}.

See Proxy configuration for both authentication forms, what authUrl may be, how secrets are masked when read back, and when a change takes effect. It is the same configuration the other logistics services read, so a tenant that also proxies stock sets it up the same way.

Outgoing Events (PosLog)​

When using the proxy approach, the external OMS must subscribe to PosLogs to receive updates about customer orders from the store -- for example, when an order is picked up by the customer.

PosLogs are delivered via WebHook through the Hii Retail ExternalEvents framework. Note that PosLogs are emitted for a variety of POS activities, including login, regular sales, and refunds, not only customer order events. The external system must filter the PosLog stream to identify the entries relevant to customer orders and take appropriate action based on those events.

note

When using the Events approach, dedicated customer order events are available via WebHook in addition to PosLogs, removing the need for filtering.

What proxy mode allows​

While in proxy mode, the Customer Order service serves reads only. Anything that changes an order must go to the external service directly — Hii Retail is not the owner of the data and will not accept a write it cannot honour. Responses coming back from the external service are mapped to the Hii Retail API shape, so a caller sees the same contract either way.

The read endpoints that work in proxy mode:

EndpointWhat it answers
GET /api/v2/business-units/{businessUnitId}/customer-orders/{customerOrderId}one order
GET /api/v2/business-units/{businessUnitId}/customer-orders:searchfind orders

Everything else returns 405 Method Not Allowed while proxy mode is on.

In proxy mode Customer Order passes reads on and refuses writes. Reading one order and searching are forwarded to your system with the credentials you configured, and the answer comes back in the Hii Retail shape. Every other call returns 405 Method Not Allowed. If your system answers with an error, the caller gets an error: there is no copy in Hii Retail to fall back to.

When your system cannot answer​

🛑 Proxy mode fails closed. Hii Retail holds no copy of the orders, so there is nothing to fall back to: if your system cannot answer, the caller gets an error.

Your system answersThe caller gets
2xx with a valid bodythe order or the search result, in the Hii Retail shape
4xxthe same status and body, passed on (answer 404 for an unknown order)
5xx, or a body that does not match the contract502 Bad Gateway
nothing within the time limit504 Gateway Timeout

The same time limit applies to fetching an OAuth token from your identity provider; a token that cannot be fetched in time gives 502 Bad Gateway.

⚠ Use the v2 endpoints. The v1 order-read and order-search endpoints still work in proxy mode, but both are deprecated in the API reference. A new integration should not be built on them. Note also that search changed verb between versions — v1 search is a POST, v2 search is a GET.

⚠ Staging does not enforce the read-only rule. The 405 is applied in production but skipped in staging, so a write that succeeds in your test environment will be refused in production. Do not take a successful staging write as evidence that proxy mode permits it.