Cancel Trade
DELETE /api/v1/trades/{tradeID}Scope: trades:write
Cancel a trade. Always allowed, even during maintenance.
Response
Two variants depending on how far the trade got:
Trade still pending (no execution started yet) — canceled directly:
200 OK
{
"status": "canceled",
"trade_id": "00000000-0000-0000-0000-000000000000"
}Trade already executing — a cancel command is dispatched:
202 Accepted
{
"status": "cancel_sent",
"trade_id": "00000000-0000-0000-0000-000000000000"
}On receiving the command, execution stops immediately: quoting halts and the
trade's open orders are canceled on the venue. The trade's status then moves
to canceled.
Cancel does not exit your position. Whatever filled before the cancel stays open on both venues. A hedge that was already sent for a maker fill completes independently on the exchange. To flatten the position, submit a reverse spread (the terminal's Close button does this).
Behavior notes
- Idempotent in effect — canceling an already-canceled or completed trade
is harmless; the command is a no-op and the response is still
202 {"status": "cancel_sent"}. - Maintenance — cancels are allowed even when the system or an exchange is in maintenance mode (amendments are not). This is intentional: you should always be able to stop a trade.
Example
curl -X DELETE -H "X-API-Key: sprdr_..." \
https://api.spreadr.xyz/api/v1/trades/00000000-0000-0000-0000-000000000000To verify the cancellation completed (rather than just being queued):
curl -H "X-API-Key: sprdr_..." \
https://api.spreadr.xyz/api/v1/trades/00000000-0000-0000-0000-000000000000
# status should be "canceled" within a few seconds