Replace the order-routing rules
Upserts the ENTIRE routing policy. This is a full replacement, not a patch: the criteria array you send becomes the whole policy, in the order you send it. Read the rules first and send the full list back with your change applied. The criteria, and the ONLY ones that exist: stock-depth (with direction: deepest — spend the stock the network can most afford to spend — or shallowest — drain small positions); store-priority (with storeIds, best first); and region-priority (with regions, best first, matched on the store’s region). There is deliberately NO proximity/distance criterion: an order carries no address and a store carries no coordinates, so distance is not computable from anything in this system. Do not attempt to approximate it with region-priority — that is a STATIC merchant preference for certain regions, not a distance to the customer. A criterion kind may appear AT MOST ONCE — a second entry of the same kind could never break a tie the first did not, so it is rejected with a 400 rather than silently ignored. An EMPTY criteria array is legal and means ‘decide on the lowest store id alone’, which is deterministic but almost certainly not what an operator wants; confirm it before sending. This takes effect on the very next order routed anywhere in the network, so it can redirect live fulfilment mid-trading: do not call it speculatively, and confirm the intended policy with the operator first. Note that a store listed in storeIds that is DEACTIVATED is simply never a candidate — routing only ever considers trading stores — so prioritising a closed store has no effect rather than reopening it. Returns the policy exactly as persisted.
Authorizations
Authorization: Bearer <token>. Accepts EITHER a Keycloak access token (scopes-in-token) OR an opaque POS session token; both resolve to the same pos.* scope vocabulary the route guards enforce.
Body
- Option 1
- Option 2
- Option 3
Response
The routing policy as it was persisted (identical to the request body).
The routing policy as it was persisted (identical to the request body).
- Option 1
- Option 2
- Option 3

