Approve a quote

View as MarkdownOpen in Claude
Accepts an `open` quote and works the order. This is the committing step. The quote you were shown was indicative. Approving **prices the order again**, holding the leg you fixed and moving the derived one, and the confirmed numbers come back on the top-level `cryptoAmount` / `fiatAmount` / `price`. The original stays under `quote`, so you can show the user what moved. A trade you have already approved is not approved twice. The outcomes: - already `completed` → the original result is **replayed**. Nothing trades again. - still `executing` → `409`. The order is placed and the outcome is not yet confirmed — poll `/trade`, never re-approve. - `expired`, `failed` or `cancelled` → `409`. Request a new quote. Approving an order whose quote has lapsed marks it `expired` and answers `409` — that holds for a trade you already approved but never settled, not just an untouched one. A `502` or `504` means the order was rejected or the outcome is unknown. Poll `/trade` before doing anything else: a trade sitting at `executing` has not been abandoned, and re-approving it is the one thing that could trade twice.

Authentication

AuthorizationBearer

A 15-minute token from /auth. Required on every endpoint except /auth.

Headers

X-Request-IdstringOptional

Correlation id. Generated if omitted, echoed on every response, and written to the audit log. /send is the exception — there it is required, and it doubles as the idempotency key.

X-USER-IDstringOptionalformat: "^[0-9a-fA-F]{24}$"

Optional. When present it overrides any userId in the body.

Request

This endpoint expects an object.
userIdstringRequiredformat: "^[0-9a-fA-F]{24}$"

24-character hex id, returned by /create.

tradeIdstringRequiredformat: "^[0-9a-fA-F]{24}$"

24-character hex id of a trade, returned by /order and /sell.

Response

OK — the order settled, or was accepted and is being worked.

resultobject

One trade, whichever side it is.

cryptoAmount, fiatAmount and price are the best known figures: what executed if it has, else what you approved, else what was quoted. quote always holds the original quoted leg, so you can show both. Every amount and price is cut — not rounded — to at most 6 decimal places, with trailing zeros trimmed, so 100.00 is returned as 100.

requestIdstring

Echo of the inbound X-Request-Id, or a generated one.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
502
Bad Gateway Error
503
Service Unavailable Error
504
Gateway Timeout Error