Cancel a resting paper order
post/v1/me/paper/trades/{id}/cancel
https://data.decryptr.ai/v1/me/paper/trades/{id}/cancel
- API planFree, and every plan above it. Data is 60 minutes behind live on this plan.
- Scope
paper:trade - Cost1 unit of quota. Also counts against the per-key write limit (60 a minute). How units are counted
Rate limits by plan
| Plan | Units a month | Per second | Per minute | Most per request |
|---|---|---|---|---|
| Free | 1,000 | 2 | 20 | 10 |
| Pay as you go | Agreed | 15 | 300 | 50 |
| Enterprise | Agreed | Agreed | Agreed | Agreed |
A 429 carries the full rate-limit header set and a Retry-After. Rate limits
Errors
- 400The request was refused before any data was read. Nothing is charged.
- 401No usable key. Nothing is charged.
- 402The account cannot use the API until billing is sorted. Nothing is charged.
- 403The key may not use this endpoint. Nothing is charged.
- 404No such item. A lookup is still charged what it asked for.
- 409The request was understood but refused, or repeated with a different body. Nothing was changed.
- 429A limit was reached (calls or streams). Nothing was read and nothing is charged. Wait Retry-After seconds, back off with jitter, or ask for fewer items.
- 500Something failed on our side. Nothing is charged. Retry with backoff.
- 503The API is switched off, busy, or a query ran too long. Nothing is charged. Retry after Retry-After seconds.
Errors follow RFC 9457. Every error code
Cancels a resting limit or stop order. Its margin is released and it is kept in your history as cancelled. An open trade cannot be cancelled: close it instead. No body is needed. Send an Idempotency-Key header to make a retry safe: repeating the same request with the same key within 24 hours returns the first answer (with Idempotent-Replayed: true) and changes nothing more.
Cost: 1 unit of quota. Also counts against the per-key write limit (60 a minute).
Needs scope paper:trade, which is off unless you switch it on for this key in the developer portal. Any plan.
AuthorizationBearer <dcr_live_<8 hex>_<43 base64url> or dcr_test_...>Your API key as a Bearer token: Authorization: Bearer dcr_live_....
id*stringPaper trade id.
uuidIdempotency-Key?stringA unique string (1 to 64 letters, digits, dots, colons, dashes or underscores) that makes this write safe to retry. Repeating the same request with the same key within 24 hours returns the first answer, with the header Idempotent-Replayed: true, and changes nothing more. The same key with a different request is refused with 409 idempotency_conflict.
^[A-Za-z0-9_.:-]{1,64}$1 <= length <= 64application/json- body
No fields. An empty body, or none, is fine.
OK.
application/json- response
The trade after the change, the account's figures after it, and what the fill paid.
data*as_of*stringWhen the response was made.
date-timecurl -X POST 'https://data.decryptr.ai/v1/me/paper/trades/00000000-0000-4000-b000-000000000002/cancel' \
-H 'Idempotency-Key: order-2026-10-30-0001' \
-H 'Content-Type: application/json' \
-d '{}'{ "data": { "trade": { "id": "00000000-0000-4000-b000-000000000003", "account_id": "00000000-0000-4000-b000-000000000001", "account_name": "Logged", "coin": "BTC", "venue": "hyperliquid", "market": "BTC", "side": "long", "leverage": 5, "status": "cancelled", "order_type": "limit", "trigger_px": 64000, "expires_at": null, "opened_at": "2026-10-30T11:45:10.123456+00:00", "closed_at": null, "ended_at": "2026-10-30T12:00:00.000000+00:00", "close_reason": null, "cancel_reason": "user", "open_px": 65000, "close_px": null, "entry_px": null, "exit_px": null, "size": null, "max_size": null, "entry_notional": null, "stop": 62000, "initial_stop": 62000, "targets": [ 68000, 70000 ], "target_fractions": [ 0.5, 0.5 ], "targets_hit": 0, "trail_pct": null, "trail_stop": null, "high_px": null, "low_px": null, "fees_usd": 0, "funding_usd": null, "realised_usd": 0, "pnl_usd": null, "pnl_pct": null, "order_size_usd": 1000, "runup_pct": null, "drawdown_pct": null, "r_multiple": null, "duration_s": 920 }, "account": { "id": "00000000-0000-4000-b000-000000000001", "name": "Logged", "is_paper": false, "is_default": true, "created_at": "2026-10-01T09:00:00.000000+00:00", "start_balance": 10000, "balance": 10000, "realised_usd": 0, "fees_usd": 0, "margin_used": 200, "available": 9800, "open_sized": 1, "pending_orders": 0, "pending_margin": 0, "balance_from": "2026-10-01T09:00:00.000000+00:00", "costs": { "fee_kind": "none", "fee_value": 0, "slippage_pct": 0, "max_leverage": null, "currency": null } }, "fill": null }, "as_of": "2026-10-30T12:00:30.000Z"}One paper trade with its events GET
One of your paper trades with every event on it, oldest first: the order, the fill, adds, partial closes, stop and target hits, trailing stop moves and the close. Cost: 1 unit of quota, also when not found. Needs scope `paper:read`, which is off unless you switch it on for this key in the developer portal. Any plan.
Close an open paper trade POST
Closes the whole of an open paper trade at the market. The account's fees and slippage apply. No body is needed. The fill price is read by Decryptr from the venue at the moment of the request. You cannot send a price. Send an `Idempotency-Key` header to make a retry safe: repeating the same request with the same key within 24 hours returns the first answer (with `Idempotent-Replayed: true`) and changes nothing more. Cost: 1 unit of quota. Also counts against the per-key write limit (60 a minute). Needs scope `paper:trade`, which is off unless you switch it on for this key in the developer portal. Any plan.