error.slug and error.code next to its human-readable text in body, on the Order Management Stream, whether the order was sent over WebSocket or over HTTP: the HTTP routes answer 202 once the order is queued, and the engine reports its decision on the stream. The Error Reference describes the shape per transport and the codes 0001–0014 shared by every route; HTTP responses use only those.
Options codes are five digits: 100xx can answer any order command, 101xx belongs to createOrder, 102xx to cancelOrder, and 103xx to modifyOrder. A condition shared by create and modify takes the same last two digits in both blocks. To send a refused request again, give it a new clientRequestId: the gateway answers a reused one with 409 for 60 seconds.
Any Order Command
createOrder
cancelOrder
modifyOrder
A refused modify leaves the original order unchanged.
cancelAllOrders
A sweep is refused only with10005, 10006 or 10007, and a refused sweep cancels nothing. The cancels a sweep expands into report as cancelOrder with the codes above; an order that fills before its cancel reports 10004.
Shared Codes
The order routes also answer with these codes from the Error Reference:
A snapshot request (
emit*) that fails answers under its response resultType with 0006 for a pageToken it cannot read, or 0002 SERVER_ERROR otherwise. A snapshot changes nothing, so sending it again is safe.