Cancel a quote

View as MarkdownOpen in Claude

Drops an open quote. Idempotent — cancelling an already-cancelled trade returns it unchanged with 200.

Only an open quote can be cancelled. Once approved, the order is being worked and there is nothing to withdraw; that is a 409. A quote you simply never approve lapses on its own.

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 quote is cancelled.

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
404
Not Found Error
409
Conflict Error