{"openapi":"3.2.0","info":{"title":"One Trading Exchange REST API","version":"1.0.0","description":"Market data, trading, futures and funding endpoints of the One Trading exchange."},"servers":[{"url":"https://api.onetrading.com/fast","description":"Production"}],"tags":[{"name":"Futures"},{"name":"Public"},{"name":"Trading"},{"name":"Funding"}],"paths":{"/v1/account/futures/funding-payments":{"$ref":"#/x-ext/6cace39"},"/v1/funding-rate":{"$ref":"#/x-ext/773f9f4"},"/v1/funding-rate/history":{"$ref":"#/x-ext/421b038"},"/v1/funding-rate/schedule":{"$ref":"#/x-ext/a703658"},"/v1/account/futures/positions":{"$ref":"#/x-ext/9c7d941"},"/v1/account/futures/positions-history":{"$ref":"#/x-ext/6047c32"},"/v1/account/futures/positions/{position_id}/funding-payments":{"$ref":"#/x-ext/8b61014"},"/v1/account/futures/positions/{position_id}/trades":{"$ref":"#/x-ext/0ff0add"},"/v1/account/futures/summary":{"$ref":"#/x-ext/0049c6e"},"/v1/funding-rate/index-prices":{"$ref":"#/x-ext/786d47b"},"/v1/funding-rate/settings":{"$ref":"#/x-ext/436cb42"},"/v1/currencies":{"$ref":"#/x-ext/8dc6e51"},"/v1/instruments":{"$ref":"#/x-ext/75d23eb"},"/v1/candlesticks/{instrument_code}":{"$ref":"#/x-ext/b7eb64e"},"/v1/fees":{"$ref":"#/x-ext/1cc227f"},"/v1/order-book/{instrument_code}":{"$ref":"#/x-ext/161c2e1"},"/v1/market-ticker":{"$ref":"#/x-ext/5cfed0d"},"/v1/market-ticker/{instrument_code}":{"$ref":"#/x-ext/6d8c108"},"/v1/time":{"$ref":"#/x-ext/983246e"},"/v1/terms-and-conditions":{"$ref":"#/x-ext/d909b24"},"/v1/mark-prices":{"$ref":"#/x-ext/d23ac64"},"/v1/countries":{"$ref":"#/x-ext/a5f7f19"},"/v1/account/orders":{"$ref":"#/x-ext/b5f1085"},"/v1/account/orders/client/{client_id}":{"$ref":"#/x-ext/a676059"},"/v1/account/orders/{order_id}":{"$ref":"#/x-ext/5ff0eea"},"/v1/account/balances":{"$ref":"#/x-ext/f34386d"},"/v1/subaccounts":{"$ref":"#/x-ext/9c79b9e"},"/v1/account/fees":{"$ref":"#/x-ext/a366675"},"/v1/account/orders/{order_id}/trades":{"$ref":"#/x-ext/73abb7d"},"/v1/account/trade/{trade_id}":{"$ref":"#/x-ext/86e6c02"},"/v1/account/trades":{"$ref":"#/x-ext/67d8dc2"},"/v2/account/exotic-orders":{"$ref":"#/x-ext/fc76365"},"/v1/transfers/payout-accounts":{"$ref":"#/x-ext/b2dc3c0"},"/v1/subaccounts/transfers":{"$ref":"#/x-ext/780cd0b"},"/v1/account/transactions":{"$ref":"#/x-ext/8c22f32"},"/v1/account/deposit-addresses":{"$ref":"#/x-ext/7a68e35"},"/v1/transfers/withdrawal-to-payout-account":{"$ref":"#/x-ext/b5f2cbe"}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key created in the One Trading UI, sent as `Authorization: Bearer <token>`. Each endpoint lists the key permission it needs."}}},"x-ext":{"b911ea8":{"title":"FuturesFundingPayment","type":"object","properties":{"account_id":{"type":"string","description":"The account ID the funding payment belongs to","format":"uuid"},"instrument_code":{"type":"string","description":"Instrument code of the futures market."},"time":{"type":"string","description":"Time of the funding payment (ISO 8601 UTC). Microsecond precision on `GET /v1/account/futures/funding-payments` (see `time_nanos` there for nanoseconds); nanosecond precision on the per-position endpoint.","format":"date-time"},"funding_payment":{"type":"string","description":"The funding payment amount in the settlement currency (positive = received, negative = paid), up to 4 decimal places."},"cash_balance":{"type":"string","description":"Cash balance after the payment, up to 4 decimal places."},"funding_rate":{"type":["string","null"],"description":"Funding rate applied (up to 10 decimal places). `null` if no funding rate record is found within 2 minutes of the payment."},"mark_price":{"type":["string","null"],"description":"Mark price used for the funding calculation. `null` if no funding rate record is found within 2 minutes of the payment."}},"required":["time","instrument_code","funding_payment","cash_balance","account_id","funding_rate","mark_price"]},"bd75d4a":{"title":"ErrorResponse","type":"object","description":"Error body. `error` is a machine-readable code (e.g. `INVALID_INSTRUMENT_CODE`) on most endpoints; a few older endpoints return a human-readable message in `error` instead and omit `error_message`.","properties":{"error":{"type":"string","description":"Error code (or, on older endpoints, a human-readable message)."},"error_message":{"type":"string","description":"Human-readable detail. Present on endpoints that return an error code in `error`."}},"required":["error"]},"c08d6ea":{"content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"}}},"description":"Bad Request"},"39f3a7e":{"title":"GatewayError","type":"object","description":"Returned by the API gateway itself when the bearer token is missing, invalid, expired or revoked, or the calling IP is not on the API key's allowlist.","properties":{"message":{"type":"string","enum":["Forbidden","Unauthorized"]}},"required":["message"]},"6cace39":{"get":{"summary":"Funding Payments","description":"Returns a paginated list of funding payments for the account, sorted by timestamp (newest first by default, see `order`). If no instrument code is provided, funding payments are returned for all futures markets.\n\n**Authentication:** Bearer token; any valid API key (no specific scope required). This endpoint is rate-limited.\n\nDefault Behaviour for `from` and `to` parameters\n\n| Parameters Provided | Behaviour |\n|-------------------|----------|\n| **Neither `from` nor `to`** | Returns last 7 days from UTC midnight to current time |\n| **Only `from`** | Returns 7 days starting from the provided `from` date (capped at the current time) |\n| **Only `to`** | Returns 7 days ending at the provided `to` date (starting from UTC midnight 7 days prior) |\n| **Both `from` and `to`** | Returns funding payments within the specified date range (max 92 days) |\n\n`from`/`to` accept epoch (s, ms, µs or ns) or an ISO 8601 UTC timestamp ending in `Z` (or `YYYY-MM-DD`). `from` must be on or after 2024-01-01, not in the future, and strictly before `to`; `to` is exclusive.\n\n`cursor` is an opaque string. Pass the value from the previous response unchanged; it is `null` (or absent) on the last page.\n\nUnknown query parameters are rejected with `400 UNEXPECTED_PARAMETERS`.\n\n### Parameter Specification\n\n| Parameter       | Accepted Formats | Example Values |\n|-----------------|----------------|----------------|\n| `from`          | ISO 8601        | `2025-09-25T13:45:30Z` (s), `2025-09-25T13:45:30.123Z` (ms), `2025-09-25T13:45:30.123456Z` (us) |\n|                 | Epoch           | `1695647130` (s), `1695647130123` (ms), `1695647130123456` (us), `1695647130123456789` (ns) |\n|                 | Date            | `2025-09-25` |\n| `to`            | ISO 8601        | `2025-09-26T18:00:00Z` (s), `2025-09-26T18:00:00.456Z` (ms), `2025-09-26T18:00:00.456789Z` (us) |\n|                 | Epoch           | `1695734400` (s), `1695734400456` (ms), `1695734400456789` (us), `1695734400456789012` (ns) |\n|                 | Date            | `2025-09-26` |\n| `instrument_code` | String         | `BTC_USD_P` (single) |\n|                  | List           | `BTC_USD_P,ETH_USD_P` (comma-separated list) |\n| `limit`          | Integer        | `50` |\n| `order`          | String         | `DESC` or `ASC` |\n| `cursor`         | String         | `eyJlcG9jaCI6IjE3Njk2MDE2MDEwNTQzNzk0NTciLCJjcW8iOiIyMTExMjMyMjkwMTU1ODc3In0=` |\n\n### Parameter Limits\n\n| Parameter        | Constraints / Range |\n|------------------|-------------------|\n| `from`           | Date between **2024-01-01** and **present** |\n| `to`             | Strictly **after** `from`; the period between `from` and `to` **must not exceed 92 days** |\n| `limit`          | Integer between **1** and **200** (`max_page_size` is accepted as a deprecated alias; `limit` wins if both are sent) |\n| `order`          | `DESC` or `ASC` |\n| `instrument_code`| Optional; must be valid futures market code(s) |\n| `cursor`         | Optional; string returned by previous response |\n\n### Parameter Defaults\n\n| Parameter(s)    | Default Behaviour |\n|-----------------|-----------------|\n| `from` / `to`   | Neither provided: `from` = 7 days ago at midnight UTC, `to` = present time |\n| `from` / `to`   | Only `from` provided: `to` = 7 days later or present time, whichever is smaller |\n| `from` / `to`   | Only `to` provided: `from` = midnight UTC, 7 days earlier |\n| `instrument_code`| Defaults to all futures markets |\n| `limit` | Defaults to 200 |\n| `order` | Defaults to `DESC` |","tags":["Futures"],"parameters":[{"name":"from","in":"query","description":"Specifies the start of the period (inclusive). Accepts date strings (YYYY-MM-DD), ISO 8601 UTC strings ending in `Z`, or numeric timestamps in seconds, milliseconds, microseconds or nanoseconds.","required":false,"example":"2026-01-22","schema":{"type":"string"}},{"name":"to","in":"query","description":"Specifies the end of the period (exclusive); the range between start and end cannot exceed 92 days. Same formats as `from`.","required":false,"example":"2026-01-29T00:00:00Z","schema":{"type":"string"}},{"name":"instrument_code","in":"query","description":"Instrument(s) to filter by: a single futures instrument code or a comma-separated list. Codes are case-insensitive; duplicates are rejected. Defaults to all futures markets.","required":false,"example":"BTC_USD_P","schema":{"type":"string"}},{"name":"cursor","in":"query","description":"Opaque pointer to the next page, taken unchanged from the `cursor` of the previous response.","required":false,"example":"","schema":{"type":"string"}},{"name":"max_page_size","in":"query","description":"Deprecated alias of `limit`. Maximum number of results per page, 1 to 200 (default 200). Ignored if `limit` is also sent.","required":false,"example":100,"schema":{"type":"integer","minimum":1,"maximum":200,"default":200}},{"name":"limit","in":"query","description":"Maximum number of results per page, 1 to 200. Defaults to 200.","required":false,"example":50,"schema":{"type":"integer","minimum":1,"maximum":200,"default":200}},{"name":"order","in":"query","description":"Sort order by timestamp: `ASC` or `DESC` (case-insensitive). Defaults to `DESC` (newest first).","required":false,"example":"DESC","schema":{"type":"string","enum":["ASC","DESC"],"default":"DESC"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"funding_payments":{"type":"array","items":{"allOf":[{"$ref":"#/x-ext/b911ea8"},{"type":"object","properties":{"position_id":{"type":["string","null"],"description":"The position ID the funding payment belongs to (numeric string), or `null` if not linked to a position."},"time_nanos":{"type":"string","format":"date-time","description":"Time of the funding payment (ISO 8601, nanosecond precision)."}},"required":["position_id","time_nanos"]}]},"description":"Funding payments, as a flat list sorted by timestamp in the requested `order`."},"account_id":{"type":"string","description":"The unique identifier for the futures account.","format":"uuid"},"max_page_size":{"type":"integer","description":"Deprecated; same value as `limit`.","deprecated":true},"cursor":{"type":"string","description":"Opaque cursor for the next page. Absent on the last page. Pass it unchanged into the next request to fetch the following batch of funding payments."},"from":{"type":"string","description":"Start of the queried range (ISO 8601, nanosecond precision)."},"to":{"type":"string","description":"End of the queried range, exclusive (ISO 8601, nanosecond precision)."},"limit":{"type":"integer","description":"The page size applied."}},"required":["account_id","funding_payments","from","to","limit","max_page_size"]},"example":{"account_id":"aaaba8bd-3195-4f72-87ff-98720a940f23","funding_payments":[{"account_id":"aaaba8bd-3195-4f72-87ff-98720a940f23","position_id":"2111199765938682","instrument_code":"BTC_USD_P","funding_rate":"0.0000179051","mark_price":"89361.93","funding_payment":"-0.0144","cash_balance":"106628.0604","time":"2026-01-28T20:00:01.055392Z","time_nanos":"2026-01-28T20:00:01.055392483Z"},{"account_id":"aaaba8bd-3195-4f72-87ff-98720a940f23","position_id":"2111199765938682","instrument_code":"BTC_USD_P","funding_rate":"0.0000179029","mark_price":"89390.01","funding_payment":"-0.0144","cash_balance":"106655.4032","time":"2026-01-28T16:00:01.055094Z","time_nanos":"2026-01-28T16:00:01.055094817Z"}],"from":"2026-01-22T00:00:00.000000000Z","to":"2026-01-29T00:00:00.000000000Z","limit":2,"max_page_size":2,"cursor":"eyJlcG9jaCI6IjE3Njk2MDE2MDEwNTQzNzk0NTciLCJjcW8iOiIyMTExMjMyMjkwMTU1ODc3In0="}}}},"400":{"$ref":"#/x-ext/c08d6ea","description":"Invalid request. Possible `error` codes: `UNEXPECTED_PARAMETERS`, `INVALID_FROM_TIMESTAMP`, `INVALID_TO_TIMESTAMP`, `INVALID_DATE_RANGE`, `INVALID_LIMIT`, `INVALID_ORDER`, `INVALID_CURSOR`, `MISSING_INSTRUMENT_CODE`, `INVALID_INSTRUMENT_CODE`, `DUPLICATE_INSTRUMENT_CODES`."},"401":{"description":"Unauthorized. The token was accepted by the gateway but rejected by the endpoint: `UNAUTHORIZED`, or `INVALID_REQUEST_SIGNATURE` when the API key requires signed requests and the signature is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"1":{"summary":"Unauthorized","value":{"error":"UNAUTHORIZED","error_message":"Unauthorized access"}},"2":{"summary":"Invalid signature","value":{"error":"INVALID_REQUEST_SIGNATURE","error_message":"The request signature is missing or invalid"}}}}}},"403":{"description":"Forbidden. Either the gateway rejected the token (`{\"message\":\"Forbidden\"}`), or the endpoint denied the request, e.g. `PERMISSION_DENIED` (API key lacks the required scope, or account not permitted) or `EXCHANGE_ACCOUNT_NOT_PROVISIONED`.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/x-ext/bd75d4a"},{"$ref":"#/x-ext/39f3a7e"}]},"examples":{"3":{"summary":"Gateway","value":{"message":"Forbidden"}},"4":{"summary":"Permission denied","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}},"5":{"summary":"Not provisioned","value":{"error":"EXCHANGE_ACCOUNT_NOT_PROVISIONED","error_message":"The account is authenticated but has no exchange account yet"}}}}}},"429":{"description":"Rate limit exceeded. Limits are per account holder per minute: 600 (retail), 2,000 (institutional), 10,000 (market maker).","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"TOO_MANY_REQUESTS","error_message":"Too many requests"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}},"security":[{"bearerAuth":[]}],"operationId":"fundingPayments"}},"42d028b":{"title":"FundingRateCurrent","type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"Timestamp of the latest update in ISO 8601 format with nanosecond precision."},"instrument_code":{"type":"string","description":"The unique identifier for the instrument"},"funding_rate":{"type":"string","description":"The current funding rate for the specified instrument in fractional form. Negative rates indicate shorts paying longs, and positive rates indicate longs paying shorts. Returned as a plain decimal string without trailing zeros; very small magnitudes (below 0.000001) may be returned in exponent notation, e.g. `1e-7`."},"mark_price":{"type":"string","description":"The current mark price of the instrument, used as the reference price for funding rate calculation."},"time":{"type":"integer","description":"Unix timestamp (in milliseconds) indicating when the funding rate was last calculated.","deprecated":true}},"required":["instrument_code","funding_rate","mark_price","time","timestamp"]},"773f9f4":{"get":{"summary":"Current Funding Rate","description":"Retrieve the latest preliminary funding rate for one or more futures instruments, or for all active futures instruments. The rate is recalculated every minute and settled at the end of each funding period (every 4 hours, 24/7, for all ONEX futures). Use the Funding Schedule endpoint (`GET /v1/funding-rate/schedule`) for each instrument's next funding time.\n\nThe timestamp indicates when the most recent funding rate update was received. Responses may be cached for up to 5 seconds.\nAn instrument code is the `id` property from the [Instruments](/docs/exchange/rest/public/instruments) endpoint.\n\nUnknown query parameters are rejected with `400 UNEXPECTED_PARAMETERS`.\n\n\n> **Info:** Funding rates are only available for futures markets.","tags":["Futures"],"parameters":[{"name":"instrument_code","in":"query","description":"Instrument code (e.g. `BTC_USD_P`), or a comma-separated list of codes, to fetch the funding rate for. Codes must be active futures instruments. If not provided, returns funding rates for all active futures instruments.","required":false,"example":"BTC_USD_P","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/x-ext/42d028b"}},"examples":{"1":{"summary":"Single Instrument Code","value":[{"instrument_code":"BTC_USD_P","funding_rate":"0.000017902243428335654","mark_price":"67812.73","time":1771575120000,"timestamp":"2026-02-20T08:12:00.000000000Z"}]},"2":{"summary":"Multiple Instruments","value":[{"instrument_code":"BTC_USD_P","funding_rate":"0.000017902243428335654","mark_price":"67812.73","time":1771575120000,"timestamp":"2026-02-20T08:12:00.000000000Z"},{"instrument_code":"ETH_USD_P","funding_rate":"0.00000214","mark_price":"3726.58","time":1771575120000,"timestamp":"2026-02-20T08:12:00.000000000Z"}]}}}}},"400":{"description":"Invalid request. Possible codes: `INVALID_INSTRUMENT_CODE` (unknown or inactive code), `DUPLICATE_INSTRUMENT_CODES`, `MISSING_INSTRUMENT_CODE` (list contains no codes, e.g. `,`), `UNEXPECTED_PARAMETERS`.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"3":{"summary":"INVALID_INSTRUMENT_CODE","value":{"error":"INVALID_INSTRUMENT_CODE","error_message":"Invalid instrument codes: FOO_USD_P. Valid codes: BTC_USD_P, ETH_USD_P"}},"4":{"summary":"DUPLICATE_INSTRUMENT_CODES","value":{"error":"DUPLICATE_INSTRUMENT_CODES","error_message":"Duplicate instrument codes: BTC_USD_P"}},"5":{"summary":"MISSING_INSTRUMENT_CODE","value":{"error":"MISSING_INSTRUMENT_CODE","error_message":"Instrument code is required and must be a string or comma-separated strings"}},"6":{"summary":"UNEXPECTED_PARAMETERS","value":{"error":"UNEXPECTED_PARAMETERS","error_message":"Unsupported parameter: foo. Allowed: instrument_code"}}}}}},"404":{"description":"No funding rates are available for the requested instruments.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"NOT_FOUND","error_message":"No funding rates are currently available"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}},"security":[],"operationId":"currentFundingRate"}},"6fcea64":{"title":"FundingRateSettled","type":"object","properties":{"instrument_code":{"type":"string","description":"The unique identifier for the instrument"},"funding_rate":{"type":"string","description":"The funding rate applied at the time of settlement in fractional form. Negative rates indicate shorts paying longs, and positive rates indicate longs paying shorts."},"mark_price":{"type":"string","description":"The mark price of the instrument at the time the funding rate was settled."},"time":{"type":"string","description":"Millisecond Unix timestamp, as a numeric string, indicating the end of the funding period (deprecated; will be removed in future versions). Use `timestamp` instead.","deprecated":true},"timestamp":{"type":"string","description":"Timestamp indicating the end of the funding period (ISO 8601 format, seconds precision)."}},"required":["instrument_code","funding_rate","mark_price","time","timestamp"]},"421b038":{"get":{"summary":"Funding Rate History","description":"Retrieve the historical settled funding rates for one or more futures instruments. This endpoint provides the settled funding rates, updated at the end of each funding period (every 4 hours, 24/7, for all ONEX futures).\n\nAn instrument code is the `id` property from the [Instruments](/docs/exchange/rest/public/instruments) endpoint.\n\n`from`/`to` accept epoch (s, ms, µs or ns) or an ISO 8601 UTC timestamp ending in `Z` (or `YYYY-MM-DD`). `from` must be on or after 2024-01-01, not in the future, and strictly before `to`; `to` is exclusive. If neither is given, the window is the last 7 days (starting at 00:00 UTC). If only `from` is given, `to` is `from` + 7 days (capped at now); if only `to` is given, `from` is 7 days earlier (at 00:00 UTC). The range is applied to each record's `timestamp`.\n\n`cursor` is an opaque string. Pass the value from the previous response unchanged; it is `null` on the last page.\n\nUnknown query parameters are rejected with `400 UNEXPECTED_PARAMETERS`.\n\n\n> **Info:** Funding rates are only available for futures markets.","tags":["Futures"],"parameters":[{"name":"instrument_code","in":"query","description":"Instrument code (e.g. `BTC_USD_P`), or a comma-separated list of codes, to fetch settled funding rates for. If not provided, returns settled funding rates for all futures instruments.","required":false,"example":"BTC_USD_P","schema":{"type":"string"}},{"name":"from","in":"query","description":"Start of the time range (inclusive). Epoch (s, ms, µs or ns), ISO 8601 UTC timestamp ending in `Z`, or `YYYY-MM-DD`.","required":false,"example":"1733397387858","schema":{"type":"string"}},{"name":"to","in":"query","description":"End of the time range (exclusive). Same formats as `from`. The range may span at most 366 days.","required":false,"example":"1733411787858","schema":{"type":"string"}},{"name":"limit","in":"query","description":"Maximum number of funding rate history records to return per page.","required":false,"example":100,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10}},{"name":"cursor","in":"query","description":"Opaque pagination cursor from the previous response's `cursor` field.","required":false,"schema":{"type":"string"}},{"name":"order","in":"query","description":"Sort order by timestamp. Case-insensitive.","required":false,"example":"DESC","schema":{"type":"string","enum":["ASC","DESC"],"default":"DESC"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"funding_rates":{"type":"array","items":{"$ref":"#/x-ext/6fcea64"}},"from":{"type":"string","format":"date-time","description":"Effective start of the queried range (ISO 8601, nanosecond precision)."},"to":{"type":"string","format":"date-time","description":"Effective end of the queried range (ISO 8601, nanosecond precision)."},"cursor":{"type":["string","null"],"description":"Opaque cursor for the next page; `null` on the last page."}},"required":["funding_rates","from","to","cursor"]},"example":{"funding_rates":[{"instrument_code":"BTC_USD_P","funding_rate":"0.000017909161806883844","mark_price":"87829.7","time":"1766491200000","timestamp":"2025-12-23T12:00:00Z"},{"instrument_code":"BTC_USD_P","funding_rate":"0.00002311127","mark_price":"87612.4","time":"1766476800000","timestamp":"2025-12-23T08:00:00Z"}],"from":"2025-12-17T00:00:00.000000000Z","to":"2025-12-24T09:30:00.000000000Z","cursor":"eyJlcG9jaCI6MTc2NjQ3NjgwMDAwMDAwMX0="}}}},"400":{"description":"Invalid request. Possible codes: `INVALID_INSTRUMENT_CODE` (returned for any unknown, duplicated or empty `instrument_code` value; rely on `error` rather than `error_message` for this case), `INVALID_PAGE_SIZE` (`limit` not an integer between 1 and 100), `INVALID_FROM_TIMESTAMP` / `INVALID_TO_TIMESTAMP` (unparseable, before 2024-01-01, or `from` in the future), `INVALID_DATE_RANGE` (`from` not before `to`, or range longer than 366 days), `INVALID_ORDER`, `INVALID_CURSOR`, `UNEXPECTED_PARAMETERS`.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"2":{"summary":"INVALID_INSTRUMENT_CODE","value":{"error":"INVALID_INSTRUMENT_CODE"}},"3":{"summary":"INVALID_PAGE_SIZE","value":{"error":"INVALID_PAGE_SIZE","error_message":"limit must be between 1 and 100, got: 500"}},"4":{"summary":"INVALID_FROM_TIMESTAMP","value":{"error":"INVALID_FROM_TIMESTAMP","error_message":"From date cannot be before 2024-01-01"}},"5":{"summary":"INVALID_TO_TIMESTAMP","value":{"error":"INVALID_TO_TIMESTAMP","error_message":"To date must be a valid date format"}},"6":{"summary":"INVALID_DATE_RANGE","value":{"error":"INVALID_DATE_RANGE","error_message":"Date range cannot exceed 366 days. Provided range was greater than 400 days"}},"7":{"summary":"INVALID_ORDER","value":{"error":"INVALID_ORDER","error_message":"order must be 'ASC' or 'DESC', got: UP"}},"8":{"summary":"INVALID_CURSOR","value":{"error":"INVALID_CURSOR","error_message":"The cursor parameter is invalid or malformed"}},"9":{"summary":"UNEXPECTED_PARAMETERS","value":{"error":"UNEXPECTED_PARAMETERS","error_message":"Unsupported parameter: foo. Allowed: from, to, instrument_code, cursor, limit, order"}}}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}},"security":[],"operationId":"fundingRateHistory"}},"c7312c1":{"title":"FixedIntervalFundingSchedule","type":"object","properties":{"type":{"type":"string","const":"FIXED_INTERVAL","description":"Funding runs on a fixed clock interval."},"period_minutes":{"type":"integer","description":"Funding cycle length in minutes (e.g. 240 = every 4 hours)."}},"required":["type","period_minutes"]},"565d528":{"title":"SessionBasedFundingSchedule","type":"object","properties":{"type":{"type":"string","const":"SESSION_BASED","description":"Funding periods follow the trading sessions of a market calendar."},"calendar":{"type":"string","description":"Market calendar governing session hours","enum":["NASDAQ"]},"max_periods_per_day":{"type":"integer","description":"Periods on a full session (early closes yield fewer)"},"split":{"type":"string","description":"How a full session is divided into periods","enum":["SESSION_MIDPOINT"]}},"required":["type","calendar","max_periods_per_day","split"]},"a703658":{"get":{"summary":"Funding Schedule","description":"Returns the funding schedule for futures instruments, sorted alphabetically by instrument code.\n\n- `FIXED_INTERVAL` instruments (all ONEX crypto and equity futures) fund at the end of each 240-minute period (00:00, 04:00, 08:00, 12:00, 16:00 and 20:00 UTC), 24/7 including weekends and holidays. Only `next_funding_time` is given, on the bare period boundary: the market offset only times the index price sample, not the funding. `sessions` is `null`.\n- For equity futures, funding still happens every 4 hours while the underlying US equity market is closed (weekends and NASDAQ holidays), but the premium counts as zero for every closed minute. A funding period that falls entirely within a closure is therefore funded at the interest component only; a period that spans the market open or close combines a reduced premium with the interest component. See [Funding Rate Methodology](/docs/exchange/funding-rate-methodology).\n- `SESSION_BASED` instruments fund only during the trading sessions of a market calendar (e.g. NASDAQ). `sessions` lists the upcoming sessions with their concrete funding periods, which vary with early closes and holidays. No instrument currently uses a session-based schedule; equity futures moved to funding every 4 hours.\n\nAn instrument code is the `id` property from the [Instruments](/docs/exchange/rest/public/instruments) endpoint.\n\n> **Info:** Funding is only available for futures markets.","tags":["Futures"],"parameters":[{"name":"instrument_code","in":"query","description":"Instrument code (e.g. `BTC_USD_P`), or a comma-separated list of codes. If not provided, returns the schedule for all futures instruments.","required":false,"example":"BTC_USD_P","schema":{"type":"string"}},{"name":"days","in":"query","description":"Number of upcoming sessions to return for `SESSION_BASED` instruments. No instrument currently uses a session-based schedule, so this has no effect.","required":false,"example":2,"schema":{"type":"integer","minimum":1,"maximum":14,"default":2}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"instrument_code":{"type":"string","description":"The unique identifier for the instrument."},"funding_schedule":{"description":"How funding is scheduled for the instrument; `null` if the instrument has no explicit schedule.","oneOf":[{"$ref":"#/x-ext/c7312c1"},{"$ref":"#/x-ext/565d528"},{"type":"null"}]},"next_funding_time":{"type":["string","null"],"format":"date-time","description":"Next funding time (ISO 8601, UTC). For `FIXED_INTERVAL` instruments, the next boundary of the funding period, without any market offset. `null` if it cannot be determined (no funding period is known, or no session period remains within the requested `days`)."},"sessions":{"type":["array","null"],"items":{"type":"object","properties":{"date":{"type":"string","format":"date","description":"New York session calendar date (YYYY-MM-DD)."},"periods":{"type":"array","items":{"type":"object","properties":{"period_number":{"type":"integer","enum":[1,2],"description":"Period within the session (a full session is split into two; early closes have one)."},"start":{"type":"string","format":"date-time","description":"Period start (ISO 8601, UTC), including the instrument's market offset."},"end":{"type":"string","format":"date-time","description":"Period end, i.e. the funding time (ISO 8601, UTC), including the instrument's market offset."},"duration_minutes":{"type":"integer","description":"Length of the period in minutes."}},"required":["period_number","start","end","duration_minutes"]}}},"required":["date","periods"]},"description":"Upcoming trading sessions and their funding periods for `SESSION_BASED` instruments; `null` for all other instruments. Currently always `null`, as all instruments are `FIXED_INTERVAL`."}},"required":["instrument_code","funding_schedule","next_funding_time","sessions"]}},"examples":{"1":{"summary":"Success Example","value":[{"instrument_code":"BTC_USD_P","funding_schedule":{"type":"FIXED_INTERVAL","period_minutes":240},"next_funding_time":"2026-09-28T12:00:00.000Z","sessions":null},{"instrument_code":"ONEX100_USD_P","funding_schedule":{"type":"FIXED_INTERVAL","period_minutes":240},"next_funding_time":"2026-09-28T12:00:00.000Z","sessions":null}]}}}}},"400":{"description":"Invalid request. Possible codes: `INVALID_PARAMETERS` (`days` not an integer between 1 and 14), `INVALID_INSTRUMENT_CODE`, `DUPLICATE_INSTRUMENT_CODES`, `MISSING_INSTRUMENT_CODE`. Unknown query parameters are ignored.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"3":{"summary":"INVALID_PARAMETERS","value":{"error":"INVALID_PARAMETERS","error_message":"days: Too big: expected number to be <=14"}},"4":{"summary":"INVALID_INSTRUMENT_CODE","value":{"error":"INVALID_INSTRUMENT_CODE","error_message":"Invalid instrument codes: FOO_USD_P. Valid codes: BTC_USD_P, ETH_USD_P"}},"5":{"summary":"DUPLICATE_INSTRUMENT_CODES","value":{"error":"DUPLICATE_INSTRUMENT_CODES","error_message":"Duplicate instrument codes: BTC_USD_P"}}}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}},"security":[],"operationId":"fundingSchedule"}},"2960e45":{"title":"FuturesAccountPosition","type":"object","description":"A live open futures position.","properties":{"instrument_code":{"type":"string","description":"The unique identifier for the futures market, e.g. `BTC_USD_P`."},"direction":{"type":"string","enum":["LONG","SHORT"],"description":"Indicates whether the position is `LONG` or `SHORT`."},"open_volume":{"type":"string","description":"The current open contract volume for the position."},"open_position":{"type":"string","description":"The notional value of the open position (absolute value), expressed in the settlement currency."},"realised_pnl":{"type":"string","description":"The total realised profit or loss for this position, in the quote currency."},"settlement_currency":{"type":"string","description":"The currency in which profits and losses for this position are settled (the quote currency of the instrument)."},"last_settlement":{"type":["string","null"],"description":"The profit or loss settled for this position in the last minute settlement cycle, in the quote currency. `null` if there has been no settlement for the position in the last 2 minutes (e.g. a newly opened position)."},"last_settlement_timestamp":{"type":["string","null"],"format":"date-time","description":"The timestamp of the last settlement applied to this position (ISO 8601, millisecond precision). `null` under the same conditions as `last_settlement`."},"mark_price":{"type":["string","null"],"description":"The mark price used for calculating the last minutely settlement. `null` under the same conditions as `last_settlement`."},"type":{"type":"string","enum":["PERP","DATED_FUTURE","EQUITY_FUTURE","EQUITY_INDEX_FUTURE"],"description":"Instrument type."},"contract_expiry_date":{"type":"string","description":"Expiry date of the contract (YYYY-MM-DD). Present for `DATED_FUTURE`, `EQUITY_FUTURE` and `EQUITY_INDEX_FUTURE`."},"contract_duration":{"type":"string","description":"Contract duration (e.g., 5Y for five years). Present for `DATED_FUTURE`, `EQUITY_FUTURE` and `EQUITY_INDEX_FUTURE`."}},"required":["instrument_code","direction","open_volume","open_position","realised_pnl","settlement_currency","last_settlement","last_settlement_timestamp","mark_price"]},"9c7d941":{"get":{"summary":"Get Futures Open Positions","description":"Provides all open futures positions for the authenticated user. It provides detailed information about each position, including size, direction, notional value, realised PnL, and the most recent settlement (profit or loss, mark price and timestamp). Designed for users who want a consolidated view of their active positions, this endpoint ensures that real-time data is available, reflecting the platform’s minute-level settlements.\n\nThe settlement fields (`last_settlement`, `last_settlement_timestamp`, `mark_price`) are `null` when the position has not been settled in the last 2 minutes, e.g. for a newly opened position.\n\n**Authentication:** Bearer token; any valid API key (no specific scope required). This endpoint is rate-limited.\n\nUnknown query parameters are rejected with `400 UNEXPECTED_PARAMETERS`.","tags":["Futures"],"parameters":[{"name":"instrument_code","in":"query","description":"Optional single instrument code to get open futures positions for (case-sensitive). Must be an existing instrument code.","required":false,"example":"BTC_USD_P","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"positions":{"type":"array","items":{"$ref":"#/x-ext/2960e45"}}},"required":["positions"]},"example":{"positions":[{"instrument_code":"BTC_USD_P","direction":"LONG","open_volume":"0.00186","open_position":"149.2689804","last_settlement":"0.0461466","mark_price":"80252.14","realised_pnl":"-0.496713","settlement_currency":"USD","last_settlement_timestamp":"2026-01-27T15:50:00.000Z","type":"DATED_FUTURE","contract_expiry_date":"2031-04-20","contract_duration":"5Y"}]}}}},"400":{"description":"Invalid request. Possible `error` codes: `UNEXPECTED_PARAMETERS`, `INVALID_PARAMETERS` (unknown `instrument_code`; `error_message` is `INVALID_INSTRUMENT_CODE`).","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"2":{"summary":"UNEXPECTED_PARAMETERS","value":{"error":"UNEXPECTED_PARAMETERS","error_message":"Unsupported parameter: foo. Allowed: instrument_code"}},"Invalid instrument code":{"summary":"INVALID_PARAMETERS","value":{"error":"INVALID_PARAMETERS","error_message":"INVALID_INSTRUMENT_CODE"}}}}}},"401":{"description":"Unauthorized. The token was accepted by the gateway but rejected by the endpoint: `UNAUTHORIZED`, or `INVALID_REQUEST_SIGNATURE` when the API key requires signed requests and the signature is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"4":{"summary":"Unauthorized","value":{"error":"UNAUTHORIZED","error_message":"Unauthorized access"}},"5":{"summary":"Invalid signature","value":{"error":"INVALID_REQUEST_SIGNATURE","error_message":"The request signature is missing or invalid"}}}}}},"403":{"description":"Forbidden. Either the gateway rejected the token (`{\"message\":\"Forbidden\"}`), or the endpoint denied the request, e.g. `PERMISSION_DENIED` (API key lacks the required scope, or account not permitted) or `EXCHANGE_ACCOUNT_NOT_PROVISIONED`.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/x-ext/bd75d4a"},{"$ref":"#/x-ext/39f3a7e"}]},"examples":{"6":{"summary":"Gateway","value":{"message":"Forbidden"}},"7":{"summary":"Permission denied","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}},"8":{"summary":"Not provisioned","value":{"error":"EXCHANGE_ACCOUNT_NOT_PROVISIONED","error_message":"The account is authenticated but has no exchange account yet"}}}}}},"429":{"description":"Rate limit exceeded. Limits are per account holder per minute: 600 (retail), 2,000 (institutional), 10,000 (market maker).","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"TOO_MANY_REQUESTS","error_message":"Too many requests"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}},"security":[{"bearerAuth":[]}],"operationId":"getFuturesOpenPositions"}},"2ccb5bd":{"title":"ClosedDatedFuturePosition","type":"object","properties":{"position_id":{"type":"string","description":"Unique identifier for the position (numeric string)."},"account_id":{"type":"string","format":"uuid","description":"The account ID the position belongs to"},"instrument_code":{"type":"string","description":"Instrument code of the futures market."},"open_timestamp":{"type":"string","description":"When the position was opened (ISO 8601, nanosecond precision)"},"close_timestamp":{"type":"string","description":"When the position was closed (ISO 8601, nanosecond precision)."},"direction":{"type":"string","enum":["LONG","SHORT"],"description":"Position direction."},"total_entry_amount":{"type":"string","description":"Total entry trade amount in base currency"},"total_exit_amount":{"type":"string","description":"Total exit trade amount in base currency"},"is_open":{"type":"boolean","description":"Whether the position is currently open. Always `false`: only closed positions are returned."},"entry_trade_count":{"type":"integer","description":"Number of entry trades"},"exit_trade_count":{"type":"integer","description":"Number of exit trades"},"average_entry_price":{"type":"string","description":"Volume weighted average entry price"},"average_exit_price":{"type":["string","null"],"description":"Volume weighted average exit price"},"total_trade_fees":{"type":"string","description":"Total trading fees for entry and exit trades"},"total_funding_payments":{"type":"string","description":"Sum of funding payments received (positive) or paid (negative) while the position was open."},"closing_pnl":{"type":"string","description":"Profit or loss from the position’s trades, excluding fees and funding payments."},"realised_pnl":{"type":"string","description":"Net profit or loss: `closing_pnl` + `total_funding_payments` − `total_trade_fees`."},"has_liquidation_events":{"type":"boolean","description":"Whether the position has any liquidation trades"},"max_position_amount":{"type":"string","description":"Largest absolute position size reached while the position was open, in base currency."},"entry_notional":{"type":"string","description":"Total notional value of the entry trades, in the settlement currency."},"exit_notional":{"type":"string","description":"Total notional value of the exit trades, in the settlement currency."},"funding_payment_count":{"type":"integer","description":"Number of funding payments applied to the position."},"type":{"type":"string","description":"Instrument type, always `DATED_FUTURE` (positions opened on or after 2026-04-23T11:00:00Z).","const":"DATED_FUTURE"},"contract_duration":{"type":"string","description":"Contract duration (e.g., 5Y for five years)."},"contract_expiry_date":{"type":"string","description":"Expiry date of the dated futures contract (YYYY-MM-DD)."}},"required":["position_id","account_id","instrument_code","open_timestamp","close_timestamp","direction","total_entry_amount","total_exit_amount","is_open","entry_trade_count","exit_trade_count","average_entry_price","average_exit_price","total_trade_fees","total_funding_payments","closing_pnl","realised_pnl","has_liquidation_events","max_position_amount","entry_notional","exit_notional","funding_payment_count","type","contract_duration","contract_expiry_date"]},"1da4555":{"title":"ClosedPerpPosition","type":"object","properties":{"position_id":{"type":"string","description":"Unique identifier for the position (numeric string)."},"account_id":{"type":"string","format":"uuid","description":"The account ID the position belongs to"},"instrument_code":{"type":"string","description":"Instrument code of the futures market."},"open_timestamp":{"type":"string","description":"When the position was opened (ISO 8601, nanosecond precision)"},"close_timestamp":{"type":"string","description":"When the position was closed (ISO 8601, nanosecond precision)."},"direction":{"type":"string","enum":["LONG","SHORT"],"description":"Position direction."},"total_entry_amount":{"type":"string","description":"Total entry trade amount in base currency"},"total_exit_amount":{"type":"string","description":"Total exit trade amount in base currency"},"is_open":{"type":"boolean","description":"Whether the position is currently open. Always `false`: only closed positions are returned."},"entry_trade_count":{"type":"integer","description":"Number of entry trades"},"exit_trade_count":{"type":"integer","description":"Number of exit trades"},"average_entry_price":{"type":"string","description":"Volume weighted average entry price"},"average_exit_price":{"type":["string","null"],"description":"Volume weighted average exit price"},"total_trade_fees":{"type":"string","description":"Total trading fees for entry and exit trades"},"total_funding_payments":{"type":"string","description":"Sum of funding payments received (positive) or paid (negative) while the position was open."},"closing_pnl":{"type":"string","description":"Profit or loss from the position’s trades, excluding fees and funding payments."},"realised_pnl":{"type":"string","description":"Net profit or loss: `closing_pnl` + `total_funding_payments` − `total_trade_fees`."},"has_liquidation_events":{"type":"boolean","description":"Whether the position has any liquidation trades"},"max_position_amount":{"type":"string","description":"Largest absolute position size reached while the position was open, in base currency."},"entry_notional":{"type":"string","description":"Total notional value of the entry trades, in the settlement currency."},"exit_notional":{"type":"string","description":"Total notional value of the exit trades, in the settlement currency."},"funding_payment_count":{"type":"integer","description":"Number of funding payments applied to the position."},"type":{"type":"string","const":"PERP","description":"Instrument type. `PERP` for perpetual markets, and for dated futures positions opened before 2026-04-23T11:00:00Z, which keep the legacy `PERP` classification."}},"required":["position_id","account_id","instrument_code","open_timestamp","close_timestamp","direction","total_entry_amount","total_exit_amount","is_open","entry_trade_count","exit_trade_count","average_entry_price","average_exit_price","total_trade_fees","total_funding_payments","closing_pnl","realised_pnl","has_liquidation_events","max_position_amount","entry_notional","exit_notional","funding_payment_count","type"]},"3781a46":{"title":"ClosedEquityPerpPosition","type":"object","properties":{"position_id":{"type":"string","description":"Unique identifier for the position (numeric string)."},"account_id":{"type":"string","format":"uuid","description":"The account ID the position belongs to"},"instrument_code":{"type":"string","description":"Instrument code of the futures market."},"open_timestamp":{"type":"string","description":"When the position was opened (ISO 8601, nanosecond precision)"},"close_timestamp":{"type":"string","description":"When the position was closed (ISO 8601, nanosecond precision)."},"direction":{"type":"string","enum":["LONG","SHORT"],"description":"Position direction."},"total_entry_amount":{"type":"string","description":"Total entry trade amount in base currency"},"total_exit_amount":{"type":"string","description":"Total exit trade amount in base currency"},"is_open":{"type":"boolean","description":"Whether the position is currently open. Always `false`: only closed positions are returned."},"entry_trade_count":{"type":"integer","description":"Number of entry trades"},"exit_trade_count":{"type":"integer","description":"Number of exit trades"},"average_entry_price":{"type":"string","description":"Volume weighted average entry price"},"average_exit_price":{"type":["string","null"],"description":"Volume weighted average exit price"},"total_trade_fees":{"type":"string","description":"Total trading fees for entry and exit trades"},"total_funding_payments":{"type":"string","description":"Sum of funding payments received (positive) or paid (negative) while the position was open."},"closing_pnl":{"type":"string","description":"Profit or loss from the position’s trades, excluding fees and funding payments."},"realised_pnl":{"type":"string","description":"Net profit or loss: `closing_pnl` + `total_funding_payments` − `total_trade_fees`."},"has_liquidation_events":{"type":"boolean","description":"Whether the position has any liquidation trades"},"max_position_amount":{"type":"string","description":"Largest absolute position size reached while the position was open, in base currency."},"entry_notional":{"type":"string","description":"Total notional value of the entry trades, in the settlement currency."},"exit_notional":{"type":"string","description":"Total notional value of the exit trades, in the settlement currency."},"funding_payment_count":{"type":"integer","description":"Number of funding payments applied to the position."}},"required":["position_id","account_id","instrument_code","open_timestamp","close_timestamp","direction","total_entry_amount","total_exit_amount","is_open","entry_trade_count","exit_trade_count","average_entry_price","average_exit_price","total_trade_fees","total_funding_payments","closing_pnl","realised_pnl","has_liquidation_events","max_position_amount","entry_notional","exit_notional","funding_payment_count"]},"6047c32":{"get":{"summary":"Positions","description":"Retrieves closed futures positions that were opened within a requested date range. Only closed positions are returned.\n\n**Authentication:** Bearer token; any valid API key (no specific scope required). This endpoint is rate-limited.\n\n### P&L Calculation\n\n-  `closing_pnl` = profit or loss from all exit trades, based on notional values (exclusive of fees and funding payments)\n- `realised_pnl` = `closing_pnl` + `total_funding_payments` − `total_trade_fees`\n\n> Note: Liquidation fees are calculated at account level and are therefore not linked to individual positions.\n\n### Instrument type\n\nEach position carries a `type`: `DATED_FUTURE` (with `contract_expiry_date` and `contract_duration`), `EQUITY_FUTURE`, `EQUITY_INDEX_FUTURE`, or `PERP`. Dated futures positions opened before 2026-04-23T11:00:00Z are reported as `PERP`.\n\n`from`/`to` accept epoch (s, ms, µs or ns) or an ISO 8601 UTC timestamp ending in `Z` (or `YYYY-MM-DD`). `from` must be on or after 2024-01-01, not in the future, and strictly before `to`; `to` is exclusive.\n\n`cursor` is an opaque string. Pass the value from the previous response unchanged; it is `null` (or absent) on the last page. If a position's statistics cannot be computed it is omitted, so a page can contain fewer than `limit` positions while `cursor` is not `null`.\n\nUnknown query parameters are rejected with `400 UNEXPECTED_PARAMETERS`.\n\n### Parameter Specification\n\n| Parameter       | Accepted Formats | Example Values |\n|-----------------|----------------|----------------|\n| `from`          | ISO 8601        | `2025-09-25T13:45:30Z` (s), `2025-09-25T13:45:30.123Z` (ms), `2025-09-25T13:45:30.123456Z` (us) |\n|                 | Epoch           | `1695647130` (s), `1695647130123` (ms), `1695647130123456` (us), `1695647130123456789` (ns) |\n|                 | Date            | `2025-09-25` |\n| `to`            | ISO 8601        | `2025-09-26T18:00:00Z` (s), `2025-09-26T18:00:00.456Z` (ms), `2025-09-26T18:00:00.456789Z` (us) |\n|                 | Epoch           | `1695734400` (s), `1695734400456` (ms), `1695734400456789` (us), `1695734400456789012` (ns) |\n|                 | Date            | `2025-09-26` |\n| `instrument_code` | String         | `BTC_USD_P` (single) |\n|                  | List           | `BTC_USD_P,ETH_USD_P` (comma-separated list) |\n| `order`  | String        | `DESC` or `ASC` |\n| `limit`  | Integer        | `3` |\n| `cursor`         | String         | `eyJlcG9jaCI6IjE3NjgzMTczNzUxMjA2MDM0ODQiLCJjcW8iOiIyMTA5NjgzNjQxNTIyNTc2In0=` |\n\n### Parameter Constraints\n\n| Parameter       | Constraints |\n|-----------------|-------------------|\n| `from`          | Must be between **2024-01-01** and **present** |\n| `to`            | Must be strictly after `from`; the period between `from` and `to` **must not exceed 31 days** |\n| `limit`  | Integer between **1** and **10** |\n| `order`  | `DESC` or `ASC` |\n| `instrument_code` | Optional; must be valid futures market code(s) |\n| `cursor`         | Optional; string returned by previous response |\n\n### Parameter Defaults\n\n| Parameter(s)    | Default Behaviour |\n|-----------------|-----------------|\n| `from` / `to`   | Neither provided: `from` = 7 days ago at midnight UTC, `to` = present time |\n| `from` / `to`   | Only `from` provided: `to` = 7 days later or present time, whichever is smaller |\n| `from` / `to`   | Only `to` provided: `from` = midnight UTC, 7 days earlier |\n| `instrument_code`| Defaults to all futures markets |\n| `limit` | Defaults to 5 |\n| `order` | Defaults to `DESC` |","tags":["Futures"],"parameters":[{"name":"from","in":"query","description":"Specifies the start of the period (inclusive), matched against the position open time. Accepts date strings (YYYY-MM-DD), ISO 8601 UTC strings ending in `Z`, or numeric timestamps in seconds, milliseconds, microseconds or nanoseconds.","required":false,"example":"2026-01-02","schema":{"type":"string"}},{"name":"to","in":"query","description":"Specifies the end of the period (exclusive). The range between start and end cannot exceed 31 days. Same formats as `from`.","required":false,"example":"2026-02-01","schema":{"type":"string"}},{"name":"instrument_code","in":"query","description":"Instrument(s) to filter by: a single futures instrument code or a comma-separated list. Codes are case-insensitive; duplicates are rejected. Defaults to all futures markets.","required":false,"example":"","schema":{"type":"string"}},{"name":"limit","in":"query","description":"Sets the maximum number of results per page, 1 to 10 (default 5).","required":false,"example":"10","schema":{"type":"string"}},{"name":"cursor","in":"query","description":"Opaque pointer to the next page, taken unchanged from the `cursor` of the previous response.","required":false,"example":"eyJlcG9jaCI6IjE3NjgzMTczNzUxMjA2MDM0ODQiLCJjcW8iOiIyMTA5NjgzNjQxNTIyNTc2In0=","schema":{"type":"string"}},{"name":"order","in":"query","description":"Sort order by timestamp: `ASC` or `DESC` (case-insensitive). Defaults to `DESC` (newest first).","required":false,"example":"DESC","schema":{"type":"string","enum":["ASC","DESC"],"default":"DESC"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"positions":{"type":"array","items":{"anyOf":[{"$ref":"#/x-ext/2ccb5bd"},{"$ref":"#/x-ext/1da4555"},{"$ref":"#/x-ext/3781a46"}]}},"from":{"type":"string","description":"Start of the queried range (ISO 8601, nanosecond precision)."},"to":{"type":"string","description":"End of the queried range, exclusive (ISO 8601, nanosecond precision)."},"cursor":{"type":["string","null"],"description":"Opaque cursor for the next page, or `null` on the last page."}},"required":["positions","cursor","from","to"]},"example":{"positions":[{"account_id":"aaaba8bd-3195-4f72-87ff-98720a940f23","position_id":"2111199765938682","instrument_code":"BTC_USD_P","is_open":false,"open_timestamp":"2026-01-28T08:19:25.380629346Z","close_timestamp":"2026-02-13T10:27:14.886985638Z","direction":"LONG","max_position_amount":"0.01","total_entry_amount":"0.01","total_exit_amount":"0.01","entry_trade_count":1,"exit_trade_count":2,"average_entry_price":"89075.95","average_exit_price":"69107.489","entry_notional":"890.7595","exit_notional":"691.0749","closing_pnl":"-199.6846","realised_pnl":"-199.2591","total_trade_fees":"0","funding_payment_count":93,"total_funding_payments":"0.4255","has_liquidation_events":false,"type":"PERP"},{"account_id":"aaaba8bd-3195-4f72-87ff-98720a940f23","position_id":"2109683641526368","instrument_code":"BTC_USD_P","is_open":false,"open_timestamp":"2026-01-13T15:16:26.038074298Z","close_timestamp":"2026-01-13T15:16:36.081981640Z","direction":"SHORT","max_position_amount":"0.2","total_entry_amount":"0.2","total_exit_amount":"0.2","entry_trade_count":1,"exit_trade_count":1,"average_entry_price":"92432.75","average_exit_price":"92479.01","entry_notional":"18486.55","exit_notional":"18495.802","closing_pnl":"-9.252","realised_pnl":"-9.252","total_trade_fees":"0","funding_payment_count":0,"total_funding_payments":"0","has_liquidation_events":false,"type":"PERP"}],"from":"2026-01-01T00:00:00.000000000Z","to":"2026-02-01T00:00:00.000000000Z","cursor":"eyJlcG9jaCI6IjE3NjgzMTczNzUxMjA2MDM0ODQiLCJjcW8iOiIyMTA5NjgzNjQxNTIyNTc2In0="}}}},"400":{"$ref":"#/x-ext/c08d6ea","description":"Invalid request. Possible `error` codes: `UNEXPECTED_PARAMETERS`, `INVALID_FROM_TIMESTAMP`, `INVALID_TO_TIMESTAMP`, `INVALID_DATE_RANGE`, `INVALID_LIMIT`, `INVALID_ORDER`, `INVALID_CURSOR`, `MISSING_INSTRUMENT_CODE`, `INVALID_INSTRUMENT_CODE`, `DUPLICATE_INSTRUMENT_CODES`."},"401":{"description":"Unauthorized. The token was accepted by the gateway but rejected by the endpoint: `UNAUTHORIZED`, or `INVALID_REQUEST_SIGNATURE` when the API key requires signed requests and the signature is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"1":{"summary":"Unauthorized","value":{"error":"UNAUTHORIZED","error_message":"Unauthorized access"}},"2":{"summary":"Invalid signature","value":{"error":"INVALID_REQUEST_SIGNATURE","error_message":"The request signature is missing or invalid"}}}}}},"403":{"description":"Forbidden. Either the gateway rejected the token (`{\"message\":\"Forbidden\"}`), or the endpoint denied the request, e.g. `PERMISSION_DENIED` (API key lacks the required scope, or account not permitted) or `EXCHANGE_ACCOUNT_NOT_PROVISIONED`.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/x-ext/bd75d4a"},{"$ref":"#/x-ext/39f3a7e"}]},"examples":{"3":{"summary":"Gateway","value":{"message":"Forbidden"}},"4":{"summary":"Permission denied","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}},"5":{"summary":"Not provisioned","value":{"error":"EXCHANGE_ACCOUNT_NOT_PROVISIONED","error_message":"The account is authenticated but has no exchange account yet"}}}}}},"429":{"description":"Rate limit exceeded. Limits are per account holder per minute: 600 (retail), 2,000 (institutional), 10,000 (market maker).","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"TOO_MANY_REQUESTS","error_message":"Too many requests"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}},"security":[{"bearerAuth":[]}],"operationId":"positions"}},"2dd14e3":{"title":"FundingPaymentPosition","type":"object","properties":{"position_id":{"type":"string","description":"The position ID the funding payment belongs to (numeric string)."},"account_id":{"type":"string","description":"The account ID the funding payment belongs to","format":"uuid"},"instrument_code":{"type":"string","description":"Instrument code of the futures market."},"time":{"type":"string","description":"Time of the funding payment (ISO 8601 UTC). Microsecond precision on `GET /v1/account/futures/funding-payments` (see `time_nanos` there for nanoseconds); nanosecond precision on the per-position endpoint.","format":"date-time"},"funding_payment":{"type":"string","description":"The funding payment amount in the settlement currency (positive = received, negative = paid), up to 4 decimal places."},"cash_balance":{"type":"string","description":"Cash balance after the payment, up to 4 decimal places."},"funding_rate":{"type":["string","null"],"description":"Funding rate applied (up to 10 decimal places). `null` if no funding rate record is found within 2 minutes of the payment."},"mark_price":{"type":["string","null"],"description":"Mark price used for the funding calculation. `null` if no funding rate record is found within 2 minutes of the payment."}},"required":["position_id","account_id","instrument_code","time","funding_payment","cash_balance","funding_rate","mark_price"]},"8b61014":{"get":{"summary":"Position Funding Payments","description":"Returns an array of funding payment records for the specified position, sorted by timestamp in ascending order (oldest first). The endpoint is not paginated and returns at most 1,000 records. An unknown position ID returns an empty list.\n\n**Authentication:** Bearer token; any valid API key (no specific scope required). This endpoint is rate-limited.","tags":["Futures"],"parameters":[{"name":"position_id","in":"path","description":"The position ID to fetch funding payments for (numeric string).","required":true,"example":"2111199765938682","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"funding_payments":{"type":"array","items":{"$ref":"#/x-ext/2dd14e3"},"description":"The position's funding payments, oldest first"}},"required":["funding_payments"]},"example":{"funding_payments":[{"account_id":"aaaba8bd-3195-4f72-87ff-98720a940f23","position_id":"2111199765938682","instrument_code":"BTC_USD_P","funding_rate":"0.0000179038","mark_price":"89925.04","funding_payment":"-0.0161","cash_balance":"106882.4305","time":"2026-01-28T12:00:01.054379456Z"},{"account_id":"aaaba8bd-3195-4f72-87ff-98720a940f23","position_id":"2111199765938682","instrument_code":"BTC_USD_P","funding_rate":"0.0000179029","mark_price":"89390.01","funding_payment":"-0.0144","cash_balance":"106655.4032","time":"2026-01-28T16:00:01.055094817Z"},{"account_id":"aaaba8bd-3195-4f72-87ff-98720a940f23","position_id":"2111199765938682","instrument_code":"BTC_USD_P","funding_rate":"0.0000179051","mark_price":"89361.93","funding_payment":"-0.0144","cash_balance":"106628.0604","time":"2026-01-28T20:00:01.055392483Z"}]}}}},"400":{"$ref":"#/x-ext/c08d6ea","description":"Invalid request. `error` is `INVALID_PARAMETERS` when the position ID is not numeric."},"401":{"description":"Unauthorized. The token was accepted by the gateway but rejected by the endpoint: `UNAUTHORIZED`, or `INVALID_REQUEST_SIGNATURE` when the API key requires signed requests and the signature is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"1":{"summary":"Unauthorized","value":{"error":"UNAUTHORIZED","error_message":"Unauthorized access"}},"2":{"summary":"Invalid signature","value":{"error":"INVALID_REQUEST_SIGNATURE","error_message":"The request signature is missing or invalid"}}}}}},"403":{"description":"Forbidden. Either the gateway rejected the token (`{\"message\":\"Forbidden\"}`), or the endpoint denied the request, e.g. `PERMISSION_DENIED` (API key lacks the required scope, or account not permitted) or `EXCHANGE_ACCOUNT_NOT_PROVISIONED`.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/x-ext/bd75d4a"},{"$ref":"#/x-ext/39f3a7e"}]},"examples":{"3":{"summary":"Gateway","value":{"message":"Forbidden"}},"4":{"summary":"Permission denied","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}},"5":{"summary":"Not provisioned","value":{"error":"EXCHANGE_ACCOUNT_NOT_PROVISIONED","error_message":"The account is authenticated but has no exchange account yet"}}}}}},"429":{"description":"Rate limit exceeded. Limits are per account holder per minute: 600 (retail), 2,000 (institutional), 10,000 (market maker).","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"TOO_MANY_REQUESTS","error_message":"Too many requests"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}},"security":[{"bearerAuth":[]}],"operationId":"positionFundingPayments"}},"8203c07":{"title":"PositionFee","type":"object","properties":{"fee_amount":{"type":"string","description":"The amount paid in the fee currency"},"fee_amount_position":{"type":"string","description":"The portion of the fee amount that counts toward this position. (A single trade can contribute to two positions if it causes a side flip.)"},"fee_currency":{"type":"string","description":"The currency the fee was paid in"}},"required":["fee_amount_position","fee_amount","fee_currency"]},"4070f8e":{"title":"PositionTrade","type":"object","properties":{"account_id":{"type":"string","format":"uuid","description":"The account ID the trade belongs to"},"position_id":{"type":"string","description":"The position ID the trade belongs to (numeric string)"},"order_id":{"type":"string","format":"uuid","description":"The order ID the trade belongs to"},"trade_id":{"type":"string","format":"uuid","description":"The trade ID"},"time":{"type":"string","format":"date-time","description":"The time the trade was matched (ISO 8601, nanosecond precision)"},"instrument_code":{"type":"string","description":"The market identifier for the trade"},"side":{"type":"string","enum":["BUY","SELL"],"description":"Trade side"},"matched_as":{"type":"string","enum":["MAKER","TAKER"],"description":"Whether the account was the maker or taker"},"price":{"type":"string","description":"The price at which the trade was matched. For TAKER trades, this may represent the average price"},"amount":{"type":"string","description":"The amount matched in this trade. Always equal to `filled_amount`."},"filled_amount":{"type":"string","description":"The amount matched in this trade."},"filled_amount_position":{"type":"string","description":"The portion of the matched amount in this trade that counts toward this position. (A single trade can contribute to two positions if it causes a side flip.)"},"open_position_amount":{"type":"string","description":"Open position size after matching. Signed: negative for a short position."},"order_type":{"type":"string","description":"Type of order, in upper case, e.g. `UI`, `API`, `STOP_LOSS`, `TAKE_PROFIT`, `INSTANT_TRADE`, `LIQUIDATION`, `SPOT_LEGACY` or `UNKNOWN`."},"sequence":{"type":"string","description":"An incremental counter indicating the sequence of events."}},"required":["position_id","order_id","trade_id","account_id","time","instrument_code","side","matched_as","price","filled_amount","amount","filled_amount_position","sequence","open_position_amount","order_type"]},"0ff0add":{"get":{"summary":"Position Trades","description":"Returns an array of trade records for the specified position, newest first by default (see `order`). An unknown position ID returns an empty `trade_history`.\n\nMAKER trades represent single fill events at a single price level, whereas TAKER trades may include multiple fill events executed while sweeping through the order book. As a result, the price shown on TAKER trades may represent a volume-weighted average fill price across executed fills.\n\n**Authentication:** Bearer token; any valid API key (no specific scope required). This endpoint is rate-limited.\n\n`cursor` is an opaque string. Pass the value from the previous response unchanged; it is `null` (or absent) on the last page.\n\nUnknown query parameters are rejected with `400 UNEXPECTED_PARAMETERS`.","tags":["Futures"],"parameters":[{"name":"position_id","in":"path","description":"The position ID to fetch trades for (numeric string).","required":true,"example":"2111199765938682","schema":{"type":"string"}},{"name":"limit","in":"query","description":"Sets the maximum number of results per page, 1 to 100 (default 50).","required":false,"example":"3","schema":{"type":"string"}},{"name":"order","in":"query","description":"The order in which to return records by timestamp: `ASC` or `DESC` (case-insensitive). Defaults to `DESC`.","required":false,"example":"ASC","schema":{"type":"string","enum":["ASC","DESC"],"default":"DESC"}},{"name":"cursor","in":"query","description":"Opaque pointer to the next page, taken unchanged from the `cursor` of the previous response.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"trade_history":{"type":"array","items":{"type":"object","properties":{"fee":{"$ref":"#/x-ext/8203c07"},"trade":{"$ref":"#/x-ext/4070f8e"}},"required":["fee","trade"]}},"cursor":{"type":["string","null"],"description":"Opaque cursor. If more records are available, pass it unchanged into the next request to fetch the following batch of trades; `null` on the last page."}},"required":["trade_history","cursor"]},"example":{"trade_history":[{"fee":{"fee_amount":"0","fee_currency":"USD","fee_amount_position":"0"},"trade":{"account_id":"aaaba8bd-3195-4f72-87ff-98720a940f23","position_id":"2111199765938682","order_id":"c5991660-d05a-4d96-1b8f-bbc1a9ff787e","trade_id":"655b635f-e515-57bb-bc03-269d80b77a38","time":"2026-02-13T10:27:14.886985638Z","instrument_code":"BTC_USD_P","side":"SELL","matched_as":"TAKER","price":"66769.78","amount":"1","filled_amount":"1","filled_amount_position":"0.009","open_position_amount":"-0.991","sequence":"98359452946","order_type":"UI"}},{"fee":{"fee_amount":"0","fee_currency":"USD","fee_amount_position":"0"},"trade":{"account_id":"aaaba8bd-3195-4f72-87ff-98720a940f23","position_id":"2111199765938682","order_id":"c433d41a-38c9-45f4-06f2-d314ca2f6991","trade_id":"7edf24a8-c72e-57ae-8594-c4a5e54c8f98","time":"2026-01-28T13:40:57.902580242Z","instrument_code":"BTC_USD_P","side":"SELL","matched_as":"TAKER","price":"90146.87","amount":"0.001","filled_amount":"0.001","filled_amount_position":"0.001","open_position_amount":"0.009","sequence":"97075273971","order_type":"UI"}},{"fee":{"fee_amount":"0","fee_currency":"USD","fee_amount_position":"0"},"trade":{"account_id":"aaaba8bd-3195-4f72-87ff-98720a940f23","position_id":"2111199765938682","order_id":"1a9d62c5-72bb-490f-2035-4377663366ad","trade_id":"f90fac7c-9f8e-5d3d-a40e-7f6c91299e58","time":"2026-01-28T08:19:25.380629346Z","instrument_code":"BTC_USD_P","side":"BUY","matched_as":"TAKER","price":"89075.95","amount":"0.01","filled_amount":"0.01","filled_amount_position":"0.01","open_position_amount":"0.01","sequence":"97011492091","order_type":"UI"}}],"cursor":null}}}},"400":{"description":"Invalid request. Possible `error` codes: `INVALID_PARAMETERS` (non-numeric position ID), `UNEXPECTED_PARAMETERS`, `INVALID_ORDER`, `INVALID_LIMIT`, `INVALID_CURSOR`.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"3":{"summary":"UNEXPECTED_PARAMETERS","value":{"error":"UNEXPECTED_PARAMETERS","error_message":"Unsupported parameter: foo. Allowed: cursor, limit, order"}},"4":{"summary":"INVALID_LIMIT","value":{"error":"INVALID_LIMIT","error_message":"limit must not exceed 100, got: 150"}},"5":{"summary":"INVALID_ORDER","value":{"error":"INVALID_ORDER","error_message":"order must be 'ASC' or 'DESC', got: UP"}},"6":{"summary":"INVALID_CURSOR","value":{"error":"INVALID_CURSOR","error_message":"The cursor parameter is invalid or malformed"}},"Invalid position ID":{"summary":"INVALID_PARAMETERS","value":{"error":"INVALID_PARAMETERS","error_message":"Position_id must be a numeric ID"}}}}}},"401":{"description":"Unauthorized. The token was accepted by the gateway but rejected by the endpoint: `UNAUTHORIZED`, or `INVALID_REQUEST_SIGNATURE` when the API key requires signed requests and the signature is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"7":{"summary":"Unauthorized","value":{"error":"UNAUTHORIZED","error_message":"Unauthorized access"}},"8":{"summary":"Invalid signature","value":{"error":"INVALID_REQUEST_SIGNATURE","error_message":"The request signature is missing or invalid"}}}}}},"403":{"description":"Forbidden. Either the gateway rejected the token (`{\"message\":\"Forbidden\"}`), or the endpoint denied the request, e.g. `PERMISSION_DENIED` (API key lacks the required scope, or account not permitted) or `EXCHANGE_ACCOUNT_NOT_PROVISIONED`.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/x-ext/bd75d4a"},{"$ref":"#/x-ext/39f3a7e"}]},"examples":{"9":{"summary":"Gateway","value":{"message":"Forbidden"}},"10":{"summary":"Permission denied","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}},"11":{"summary":"Not provisioned","value":{"error":"EXCHANGE_ACCOUNT_NOT_PROVISIONED","error_message":"The account is authenticated but has no exchange account yet"}}}}}},"429":{"description":"Rate limit exceeded. Limits are per account holder per minute: 600 (retail), 2,000 (institutional), 10,000 (market maker).","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"TOO_MANY_REQUESTS","error_message":"Too many requests"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}},"security":[{"bearerAuth":[]}],"operationId":"positionTrades"}},"0049c6e":{"get":{"summary":"Futures Portfolio Summary","description":"This endpoint provides a real-time summary of a user's futures portfolio on the exchange. It returns details about the current portfolio, including the user's account equity, available margin, margin used and positions. The summary is updated with settlements every minute, ensuring users have the most accurate and up-to-date information about their portfolio.\n\nEach position has the same shape as in `GET /v1/account/futures/positions`.\n\n**Authentication:** Bearer token; any valid API key (no specific scope required). This endpoint is rate-limited.","tags":["Futures"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","format":"uuid","description":"The unique identifier for the futures account."},"account_ratio":{"type":["number","null"],"description":"Account ratio reported by the exchange. `null` when the exchange reports none (or 0)."},"equity":{"type":"string","description":"Total asset value in USD that can be used as margin for futures positions."},"maintenance_margin":{"type":"string","description":"Maintenance margin in USD."},"margin_available":{"type":"string","description":"Margin available in USD, calculated as `equity` − `margin_used`."},"margin_used":{"type":"string","description":"Margin currently used by open positions, in USD."},"positions":{"type":"array","items":{"$ref":"#/x-ext/2960e45"}}},"required":["account_id","equity","margin_available","margin_used","positions","account_ratio","maintenance_margin"]},"example":{"account_id":"aaaba8bd-3195-4f72-87ff-98720a940f23","account_ratio":24.38,"equity":"93844.36992069","maintenance_margin":"3848.680365","margin_available":"86147.00919069","margin_used":"7697.36073","positions":[{"instrument_code":"ETH_USD_P","direction":"SHORT","open_volume":"0.01","open_position":"23.1518","realised_pnl":"-0.647418","settlement_currency":"USD","last_settlement":"-0.0101","last_settlement_timestamp":"2026-04-24T10:47:02.000Z","mark_price":"2315.18","type":"DATED_FUTURE","contract_expiry_date":"2031-04-20","contract_duration":"5Y"},{"instrument_code":"BTC_USD_P","direction":"SHORT","open_volume":"0.991","open_position":"76950.46621","realised_pnl":"-10432.8894161","settlement_currency":"USD","last_settlement":"0.52523","last_settlement_timestamp":"2026-04-24T10:47:00.000Z","mark_price":"77649.31","type":"DATED_FUTURE","contract_expiry_date":"2031-04-20","contract_duration":"5Y"}]}}}},"401":{"description":"Unauthorized. The token was accepted by the gateway but rejected by the endpoint: `UNAUTHORIZED`, or `INVALID_REQUEST_SIGNATURE` when the API key requires signed requests and the signature is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"2":{"summary":"Unauthorized","value":{"error":"UNAUTHORIZED","error_message":"Unauthorized access"}},"3":{"summary":"Invalid signature","value":{"error":"INVALID_REQUEST_SIGNATURE","error_message":"The request signature is missing or invalid"}}}}}},"403":{"description":"Forbidden. Either the gateway rejected the token (`{\"message\":\"Forbidden\"}`), or the endpoint denied the request, e.g. `PERMISSION_DENIED` (API key lacks the required scope, or account not permitted) or `EXCHANGE_ACCOUNT_NOT_PROVISIONED`.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/x-ext/bd75d4a"},{"$ref":"#/x-ext/39f3a7e"}]},"examples":{"4":{"summary":"Gateway","value":{"message":"Forbidden"}},"5":{"summary":"Permission denied","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}},"6":{"summary":"Not provisioned","value":{"error":"EXCHANGE_ACCOUNT_NOT_PROVISIONED","error_message":"The account is authenticated but has no exchange account yet"}}}}}},"429":{"description":"Rate limit exceeded. Limits are per account holder per minute: 600 (retail), 2,000 (institutional), 10,000 (market maker).","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"TOO_MANY_REQUESTS","error_message":"Too many requests"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}},"security":[{"bearerAuth":[]}],"operationId":"futuresPortfolioSummary"}},"786d47b":{"get":{"summary":"Index Prices","description":"Retrieve the history of index prices for USD perpetuals (`_USD_P`), together with the mark price and preliminary funding rate calculated at the same time. A record is produced each time the funding rate is recalculated (roughly every minute).\n\nAn instrument code is the `id` property from the [Instruments](/docs/exchange/rest/public/instruments) endpoint.\n\n`from`/`to` accept epoch (s, ms, µs or ns) or an ISO 8601 UTC timestamp ending in `Z` (or `YYYY-MM-DD`). `from` must be on or after 2024-01-01, not in the future, and strictly before `to`; `to` is exclusive. If neither is given, the window is the last 7 days (starting at 00:00 UTC). If only `from` is given, `to` is `from` + 7 days (capped at now); if only `to` is given, `from` is 7 days earlier (at 00:00 UTC).\n\n`cursor` is an opaque string. Pass the value from the previous response unchanged; it is `null` on the last page.\n\nUnknown query parameters are rejected with `400 UNEXPECTED_PARAMETERS`.","tags":["Futures"],"parameters":[{"name":"instrument_code","in":"query","description":"Instrument code (e.g. `BTC_USD_P`), or a comma-separated list of codes. Only USD-quoted futures instruments are accepted, but only USD perpetuals (`_USD_P`) have records; a USD dated future returns an empty list. If not provided, returns records for all USD perpetuals.","required":false,"example":"BTC_USD_P","schema":{"type":"string"}},{"name":"order","in":"query","description":"Sort order by timestamp. Case-insensitive.","required":false,"example":"DESC","schema":{"type":"string","enum":["ASC","DESC"],"default":"DESC"}},{"name":"from","in":"query","description":"Start of the time range (inclusive). Epoch (s, ms, µs or ns), ISO 8601 UTC timestamp ending in `Z`, or `YYYY-MM-DD`.","required":false,"example":"2026-09-01T00:00:00Z","schema":{"type":"string"}},{"name":"to","in":"query","description":"End of the time range (exclusive). Same formats as `from`. The range may span at most 366 days.","required":false,"example":"2026-09-08T00:00:00Z","schema":{"type":"string"}},{"name":"cursor","in":"query","description":"Opaque pagination cursor from the previous response's `cursor` field.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Maximum number of records to return per page.","required":false,"example":100,"schema":{"type":"integer","minimum":1,"maximum":1000,"default":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"index_prices":{"type":"array","items":{"type":"object","properties":{"instrument_code":{"type":"string","description":"The unique identifier for the instrument."},"timestamp":{"type":"string","format":"date-time","description":"Time of the calculation (ISO 8601, microsecond precision)."},"index_price":{"type":"string","description":"Index price at that time. The value `\"null\"` is returned when no index price was recorded."},"mark_price":{"type":"string","description":"Mark price at that time."},"funding_rate":{"type":"string","description":"Preliminary funding rate at that time, in fractional form."}},"required":["instrument_code","timestamp","index_price","mark_price","funding_rate"]}},"from":{"type":"string","format":"date-time","description":"Effective start of the queried range (ISO 8601, microsecond precision)."},"to":{"type":"string","format":"date-time","description":"Effective end of the queried range (ISO 8601, microsecond precision)."},"cursor":{"type":["string","null"],"description":"Opaque cursor for the next page; `null` on the last page."}},"required":["index_prices","from","to","cursor"]},"example":{"index_prices":[{"instrument_code":"BTC_USD_P","timestamp":"2026-09-28T10:01:00.000000Z","index_price":"109412.35","mark_price":"109420.1","funding_rate":"0.0000125"},{"instrument_code":"ETH_USD_P","timestamp":"2026-09-28T10:01:00.000000Z","index_price":"4012.18","mark_price":"4012.9","funding_rate":"0.0000087"}],"from":"2026-09-21T00:00:00.000000Z","to":"2026-09-28T10:01:30.123456Z","cursor":"eyJlcG9jaCI6IjE3NTkwNTM2MDAwMDAwMDEifQ=="}}}},"400":{"description":"Invalid request. Possible codes: `INVALID_INSTRUMENT_CODE` (unknown code, or not a USD-quoted futures instrument), `DUPLICATE_INSTRUMENT_CODES`, `MISSING_INSTRUMENT_CODE`, `INVALID_LIMIT` (not an integer between 1 and 1000), `INVALID_FROM_TIMESTAMP` / `INVALID_TO_TIMESTAMP` (unparseable, before 2024-01-01, or `from` in the future), `INVALID_DATE_RANGE` (`from` not before `to`, or range longer than 366 days), `INVALID_ORDER`, `INVALID_CURSOR`, `UNEXPECTED_PARAMETERS`.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"2":{"summary":"INVALID_INSTRUMENT_CODE","value":{"error":"INVALID_INSTRUMENT_CODE","error_message":"Invalid instrument codes: BTC_EUR_P. Valid codes: BTC_USD_P, ETH_USD_P"}},"3":{"summary":"DUPLICATE_INSTRUMENT_CODES","value":{"error":"DUPLICATE_INSTRUMENT_CODES","error_message":"Duplicate instrument codes: BTC_USD_P"}},"4":{"summary":"INVALID_LIMIT","value":{"error":"INVALID_LIMIT","error_message":"limit must not exceed 1000, got: 5000"}},"5":{"summary":"INVALID_FROM_TIMESTAMP","value":{"error":"INVALID_FROM_TIMESTAMP","error_message":"From date cannot be before 2024-01-01"}},"6":{"summary":"INVALID_TO_TIMESTAMP","value":{"error":"INVALID_TO_TIMESTAMP","error_message":"To date must be a valid date format"}},"7":{"summary":"INVALID_DATE_RANGE","value":{"error":"INVALID_DATE_RANGE","error_message":"Date range cannot exceed 366 days. Provided range was greater than 400 days"}},"8":{"summary":"INVALID_ORDER","value":{"error":"INVALID_ORDER","error_message":"order must be 'ASC' or 'DESC', got: UP"}},"9":{"summary":"INVALID_CURSOR","value":{"error":"INVALID_CURSOR","error_message":"The cursor parameter is invalid or malformed"}},"10":{"summary":"UNEXPECTED_PARAMETERS","value":{"error":"UNEXPECTED_PARAMETERS","error_message":"Unsupported parameter: foo. Allowed: instrument_code, order, from, to, cursor, limit"}}}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}},"security":[],"operationId":"indexPrices"}},"3e222b4":{"title":"FundingRateSetting","type":"object","properties":{"instrument_code":{"type":"string","description":"Instrument code for the futures market"},"state":{"type":"string","description":"Whether funding is currently active for the instrument. ACTIVE or INACTIVE.","enum":["ACTIVE","INACTIVE"]},"market_offset":{"type":"number","description":"Settlement offset in seconds from the minute mark."},"clamp_threshold":{"description":"Clamp threshold for the funding rate. Either a single number, or an object with a weekly schedule of thresholds.","oneOf":[{"type":"number","description":"Fixed clamp threshold (e.g. `0.0005` = 0.05%)."},{"type":"object","description":"Scheduled clamp thresholds.","properties":{"schedules":{"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":1,"maximum":7,"description":"Day of the week (1 = Monday, 7 = Sunday)."},"hour":{"type":"integer","minimum":0,"maximum":23,"description":"Hour of the day (UTC)."},"clamp_threshold":{"type":"number","description":"Clamp threshold that applies from this day and hour."}},"required":["day","hour","clamp_threshold"]}}},"required":["schedules"]}]},"clamp_threshold_non_core":{"type":["number","null"],"description":"Clamp threshold applied outside the core trading session (equity futures only). `null` when not set."},"annual_interest_rate":{"type":"number","description":"Annual interest rate component. Paid by long position holders to short position holders when positive."},"cap":{"type":"number","description":"Maximum absolute funding rate per period"},"period":{"type":"integer","description":"Funding period in minutes (240 = every 4 hours)."}},"required":["instrument_code","state","market_offset","clamp_threshold","annual_interest_rate","cap","period"]},"436cb42":{"get":{"summary":"Funding Rate Settings","description":"Returns an array of funding rate settings, sorted alphabetically by instrument code. Refer to the funding rate methodology for a detailed explanation of the calculation logic.\nhttps://docs.onetrading.com/futures/funding-rate-methodology\n\nSettings may be cached for up to 30 seconds. Unknown query parameters are rejected with `400 UNEXPECTED_PARAMETERS`.","tags":["Futures"],"parameters":[{"name":"instrument_code","in":"query","description":"Instrument(s) to filter by. Can be a single pair or a comma-separated string of pairs. Defaults to all instruments with funding rate settings, including those whose `state` is `INACTIVE`.","required":false,"example":"BTC_USD_P,ETH_USD_P","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/x-ext/3e222b4"}},"examples":{"1":{"summary":"Success Example","value":{"instrument_code":"ADA_USD_P","state":"ACTIVE","market_offset":6,"clamp_threshold":0.0005,"annual_interest_rate":0.04,"cap":0.001,"period":240}},"2":{"summary":"Success Example","value":{"instrument_code":"BTC_USD_P","state":"ACTIVE","market_offset":0,"clamp_threshold":0.0005,"annual_interest_rate":0.04,"cap":0.001,"period":240}},"3":{"summary":"Success Example","value":{"instrument_code":"DOGE_USD_P","state":"ACTIVE","market_offset":5,"clamp_threshold":0.0005,"annual_interest_rate":0.04,"cap":0.001,"period":240}},"4":{"summary":"Success Example","value":{"instrument_code":"ETH_USD_P","state":"ACTIVE","market_offset":2,"clamp_threshold":0.0005,"annual_interest_rate":0.04,"cap":0.001,"period":240}},"5":{"summary":"Success Example","value":{"instrument_code":"LINK_USD_P","state":"ACTIVE","market_offset":7,"clamp_threshold":0.0005,"annual_interest_rate":0.04,"cap":0.001,"period":240}},"6":{"summary":"Success Example","value":{"instrument_code":"LTC_USD_P","state":"ACTIVE","market_offset":9,"clamp_threshold":0.0005,"annual_interest_rate":0.04,"cap":0.001,"period":240}},"7":{"summary":"Success Example","value":{"instrument_code":"SOL_USD_P","state":"ACTIVE","market_offset":4,"clamp_threshold":0.0005,"annual_interest_rate":0.04,"cap":0.001,"period":240}},"8":{"summary":"Success Example","value":{"instrument_code":"SUI_USD_P","state":"ACTIVE","market_offset":8,"clamp_threshold":0.0005,"annual_interest_rate":0.04,"cap":0.001,"period":240}},"9":{"summary":"Success Example","value":{"instrument_code":"TAO_USD_P","state":"ACTIVE","market_offset":10,"clamp_threshold":0.0005,"annual_interest_rate":0.04,"cap":0.001,"period":240}},"10":{"summary":"Success Example","value":{"instrument_code":"XRP_USD_P","state":"ACTIVE","market_offset":3,"clamp_threshold":0.0005,"annual_interest_rate":0.04,"cap":0.001,"period":240}}}}}},"400":{"description":"Invalid request. Possible codes: `INVALID_INSTRUMENT_CODE` (no funding rate settings exist for the code), `DUPLICATE_INSTRUMENT_CODES`, `MISSING_INSTRUMENT_CODE`, `UNEXPECTED_PARAMETERS`.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"11":{"summary":"INVALID_INSTRUMENT_CODE","value":{"error":"INVALID_INSTRUMENT_CODE","error_message":"Invalid instrument codes: FOO_USD_P. Valid codes: BTC_USD_P, ETH_USD_P"}},"12":{"summary":"DUPLICATE_INSTRUMENT_CODES","value":{"error":"DUPLICATE_INSTRUMENT_CODES","error_message":"Duplicate instrument codes: BTC_USD_P"}},"13":{"summary":"UNEXPECTED_PARAMETERS","value":{"error":"UNEXPECTED_PARAMETERS","error_message":"Unsupported parameter: foo. Allowed: instrument_code"}}}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}},"security":[],"operationId":"fundingRateSettings"}},"1b2472a":{"title":"Currency","type":"object","properties":{"code":{"type":"string","description":"Currency code (e.g. `BTC`)."},"precision":{"type":"integer","description":"Number of decimal places used for the currency."},"unified_cryptoasset_id":{"type":"integer","description":"CoinMarketCap unified crypto-asset ID; `0` for fiat currencies."},"name":{"type":"string"},"collateral_percentage":{"type":"integer","minimum":0,"maximum":100,"description":"The percentage of the asset's value that can be used as collateral for futures positions. Omitted for some assets; treat a missing value as 0."}},"required":["code","precision","unified_cryptoasset_id","name"],"description":"Currency"},"8dc6e51":{"get":{"summary":"Currencies","description":"Get a list of all available currencies. Use `type` to return only fiat or only crypto currencies.\n\nEach crypto currency lists the `networks` it can be deposited on, the default first. Use a network's `network` id with `GET` and `POST /v1/account/deposit-addresses`.\n\n- `contract_address` and `token_standard` identify the token on that network (e.g. USDC is the ERC-20 at `0xA0b8…eB48` on `ETHEREUM`). Both are `null` for the network's own coin, such as BTC on `BITCOIN` or BNB on `BNB_SMART_CHAIN`. Only the listed token is credited: a different token with the same name sent to your address can't be.\n- `destination_tag_type` is set on networks where every deposit needs a tag as well as the address (`destinationTag` on `XRP_LEDGER`; `memo` on `STELLAR`, `COSMOS_HUB` and `EOS`; `message` on `NEM`).\n\n`networks` is empty for fiat currencies and for crypto currencies that can't be deposited.","operationId":"currencies","tags":["Public"],"parameters":[{"name":"type","in":"query","description":"Filters the currencies: `fiat` returns EUR, GBP, USD, CHF and TRY; `crypto` returns every other currency (including stablecoins such as USDC). Lowercase only.","required":false,"schema":{"type":"string","enum":["crypto","fiat"]}}],"responses":{"200":{"description":"The request was successful, and the server has returned the requested resource in the response body.","content":{"application/json":{"schema":{"type":"array","items":{"allOf":[{"$ref":"#/x-ext/1b2472a"},{"type":"object","required":["networks"],"properties":{"networks":{"type":"array","description":"The networks the currency can be deposited on, the default first. Empty for fiat and for currencies that can't be deposited.","items":{"type":"object","required":["network","name","is_default","token_standard","contract_address","destination_tag_type"],"properties":{"network":{"type":"string","description":"Network id, e.g. `ETHEREUM`, `BITCOIN`, `SOLANA`. Stable; use it in the deposit address endpoints."},"name":{"type":"string","description":"Display name, e.g. `Ethereum`."},"is_default":{"type":"boolean","description":"The network used when a request names none. Exactly one per currency."},"token_standard":{"type":["string","null"],"description":"The standard the token follows on this network, e.g. `ERC20`, `BEP20`, `SPL`. `null` for the network's own coin."},"contract_address":{"type":["string","null"],"description":"The token's contract address (an SPL token's mint) on this network. `null` for the network's own coin."},"destination_tag_type":{"type":["string","null"],"enum":["memo","message","destinationTag",null],"description":"Set when deposits on this network need a tag as well as the address; the tag itself comes with the deposit address."}}}}}}]}},"examples":{"1":{"summary":"BTC","value":{"code":"BTC","precision":8,"unified_cryptoasset_id":1,"name":"Bitcoin","collateral_percentage":0,"networks":[{"network":"BITCOIN","name":"Bitcoin","is_default":true,"token_standard":null,"contract_address":null,"destination_tag_type":null}]}},"2":{"summary":"ETH","value":{"code":"ETH","precision":8,"unified_cryptoasset_id":1027,"name":"Ethereum","collateral_percentage":0,"networks":[{"network":"ETHEREUM","name":"Ethereum","is_default":true,"token_standard":null,"contract_address":null,"destination_tag_type":null}]}},"3":{"summary":"EUR (fiat, no networks)","value":{"code":"EUR","precision":2,"unified_cryptoasset_id":0,"name":"Euro","collateral_percentage":99,"networks":[]}},"4":{"summary":"USDC (token, with contract address)","value":{"code":"USDC","precision":6,"unified_cryptoasset_id":3408,"name":"USDC","collateral_percentage":0,"networks":[{"network":"ETHEREUM","name":"Ethereum","is_default":true,"token_standard":"ERC20","contract_address":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","destination_tag_type":null}]}},"5":{"summary":"XRP (tagged network)","value":{"code":"XRP","precision":8,"unified_cryptoasset_id":52,"name":"XRP","collateral_percentage":0,"networks":[{"network":"XRP_LEDGER","name":"XRP Ledger","is_default":true,"token_standard":null,"contract_address":null,"destination_tag_type":"destinationTag"}]}}}}}},"400":{"description":"Invalid `type` value.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"INVALID_TYPE"}}}},"500":{"description":"Unexpected server error. `error` is a human-readable message.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"7":{"summary":"Server error","value":{"error":"Server error."}},"8":{"summary":"Server configuration error","value":{"error":"Server configuration error."}}}}}}},"security":[]}},"a329300":{"title":"SpotInstrument","type":"object","properties":{"base":{"type":"object","properties":{"code":{"type":"string","description":"The symbol for the base asset (e.g., `BTC`)."},"precision":{"type":"integer","description":"The number of decimal places allowed for the base asset (currently always 8)."}},"required":["code","precision"],"description":"An object representing the base asset in the trading pair."},"quote":{"type":"object","properties":{"code":{"type":"string","description":"The symbol for the quote asset (e.g., `EUR`)."},"precision":{"type":"integer","description":"The number of decimal places allowed for the quote asset (currently always 8)."}},"required":["code","precision"],"description":"An object representing the quote asset in the trading pair."},"amount_precision":{"type":"integer","description":"The number of decimal places allowed when specifying the trade amount (quantity of the base asset)."},"market_precision":{"type":"integer","description":"The number of decimal places allowed when specifying the price of the instrument."},"min_size":{"type":"string","description":"The minimum allowable order value for the instrument, expressed in the quote asset (e.g., 10 EUR or 10 USDC). This is calculated as price × amount and ensures the order meets the required notional value."},"min_price":{"type":"string","description":"The minimum allowable price for the instrument, expressed in the quote asset."},"max_price":{"type":"string","description":"The maximum allowable price for the instrument, expressed in the quote asset."},"id":{"type":"string","description":"The unique identifier for the trading pair (e.g., `BTC_USDC`). This is used when creating / cancelling orders as `instrument_code`."},"state":{"type":"string","enum":["ACTIVE","SUSPENDED","POST_ONLY","CLOSED"],"description":"The current state of the instrument. `ACTIVE` markets are tradable; `CLOSED` markets are still listed by this endpoint but cannot be traded."},"type":{"type":"string","description":"Instrument type, always `SPOT`.","enum":["SPOT"]}},"required":["type","base","quote","amount_precision","market_precision","min_size","min_price","max_price","id","state"]},"b493e78":{"title":"DatedFutureInstrument","type":"object","properties":{"base":{"type":"object","properties":{"code":{"type":"string","description":"The symbol for the base asset (e.g., `BTC`)."},"precision":{"type":"integer","description":"The number of decimal places allowed for the base asset (currently always 8)."}},"required":["code","precision"],"description":"An object representing the base asset in the trading pair."},"quote":{"type":"object","properties":{"code":{"type":"string","description":"The symbol for the quote asset (e.g., `EUR`)."},"precision":{"type":"integer","description":"The number of decimal places allowed for the quote asset (currently always 8)."}},"required":["code","precision"],"description":"An object representing the quote asset in the trading pair."},"amount_precision":{"type":"integer","description":"The number of decimal places allowed when specifying the trade amount (quantity of the base asset)."},"market_precision":{"type":"integer","description":"The number of decimal places allowed when specifying the price of the instrument."},"min_size":{"type":"string","description":"The minimum allowable order value for the instrument, expressed in the quote asset (e.g., 10 EUR or 10 USDC). This is calculated as price × amount and ensures the order meets the required notional value."},"min_price":{"type":"string","description":"The minimum allowable price for the instrument, expressed in the quote asset."},"max_price":{"type":"string","description":"The maximum allowable price for the instrument, expressed in the quote asset."},"id":{"type":"string","description":"The unique identifier for the trading pair (e.g., `BTC_USDC`). This is used when creating / cancelling orders as `instrument_code`."},"state":{"type":"string","enum":["ACTIVE","SUSPENDED","POST_ONLY","CLOSED"],"description":"The current state of the instrument. `ACTIVE` markets are tradable; `CLOSED` markets are still listed by this endpoint but cannot be traded."},"contract_duration":{"type":"string","description":"Contract duration (e.g., `5Y` for five years)."},"contract_expiry_date":{"type":"string","description":"Expiration date of the dated futures contract (`YYYY-MM-DD`)."},"funding_period":{"type":["integer","null"],"description":"Funding period duration in minutes (e.g., 240 represents 4 hours); mirrors `funding_schedule.period_minutes`. `null` when the market uses a session-based schedule. Use `funding_schedule` instead.","deprecated":true},"type":{"type":"string","description":"Instrument type, always `DATED_FUTURE`.","enum":["DATED_FUTURE"]},"funding_schedule":{"anyOf":[{"$ref":"#/x-ext/c7312c1"},{"$ref":"#/x-ext/565d528"}],"description":"How and when funding is paid on this market."},"price_collar_percentage":{"type":["string","null"],"description":"Price collar, in percent, that the exchange applies to orders on this market around the mark price (e.g. `\"10\"` = 10%). `null` when the market is not loaded on the exchange (typically a `CLOSED` market), so no collar is enforced."},"max_leverage":{"type":"integer","description":"Maximum leverage offered on this market. Omitted where one leverage applies to every market."},"market_offset":{"type":"integer","description":"Offset, in seconds, applied to this market's funding times."},"max_order_value":{"type":["string","null"],"description":"Maximum value (in the quote asset) of a single order. `null` means no cap is enforced."},"max_position_size":{"type":["object","null"],"description":"Maximum position size on this market per customer segment, as notional value in the quote asset. Each value is the cap the exchange enforces for that segment: the segment's own cap, or the market default when none is set. `null` when the exchange reports no position limits for the market.","properties":{"RETAIL":{"type":"string","description":"Maximum position size, as notional value in the quote asset, for accounts in the `RETAIL` segment."},"INSTITUTIONAL":{"type":"string","description":"Maximum position size, as notional value in the quote asset, for accounts in the `INSTITUTIONAL` segment."},"MARKET_MAKER":{"type":"string","description":"Maximum position size, as notional value in the quote asset, for accounts in the `MARKET_MAKER` segment."}},"required":["RETAIL","INSTITUTIONAL","MARKET_MAKER"]}},"required":["contract_duration","contract_expiry_date","funding_period","type","funding_schedule","price_collar_percentage","market_offset","max_order_value","max_position_size","base","quote","amount_precision","market_precision","min_size","min_price","max_price","id","state"]},"537496b":{"title":"EquityFutureInstrument","type":"object","description":"Equity index / single-stock future. Funding is paid on the NASDAQ session calendar.","properties":{"base":{"type":"object","properties":{"code":{"type":"string","description":"The symbol for the base asset (e.g., `BTC`)."},"precision":{"type":"integer","description":"The number of decimal places allowed for the base asset (currently always 8)."}},"required":["code","precision"],"description":"An object representing the base asset in the trading pair."},"quote":{"type":"object","properties":{"code":{"type":"string","description":"The symbol for the quote asset (e.g., `EUR`)."},"precision":{"type":"integer","description":"The number of decimal places allowed for the quote asset (currently always 8)."}},"required":["code","precision"],"description":"An object representing the quote asset in the trading pair."},"amount_precision":{"type":"integer","description":"The number of decimal places allowed when specifying the trade amount (quantity of the base asset)."},"market_precision":{"type":"integer","description":"The number of decimal places allowed when specifying the price of the instrument."},"min_size":{"type":"string","description":"The minimum allowable order value for the instrument, expressed in the quote asset (e.g., 10 EUR or 10 USDC). This is calculated as price × amount and ensures the order meets the required notional value."},"min_price":{"type":"string","description":"The minimum allowable price for the instrument, expressed in the quote asset."},"max_price":{"type":"string","description":"The maximum allowable price for the instrument, expressed in the quote asset."},"id":{"type":"string","description":"The unique identifier for the trading pair (e.g., `BTC_USDC`). This is used when creating / cancelling orders as `instrument_code`."},"state":{"type":"string","enum":["ACTIVE","SUSPENDED","POST_ONLY","CLOSED"],"description":"The current state of the instrument. `ACTIVE` markets are tradable; `CLOSED` markets are still listed by this endpoint but cannot be traded."},"contract_duration":{"type":"string","description":"Contract duration (e.g., `5Y` for five years)."},"contract_expiry_date":{"type":"string","description":"Expiration date of the dated futures contract (`YYYY-MM-DD`)."},"funding_period":{"type":["integer","null"],"description":"Funding period duration in minutes (240 = 4 hours); mirrors `funding_schedule.period_minutes`. `null` when the market uses a session-based schedule. Use `funding_schedule` instead.","deprecated":true},"type":{"type":"string","description":"Instrument type: `EQUITY_FUTURE` for a single stock, `EQUITY_INDEX_FUTURE` for an equity index.","enum":["EQUITY_FUTURE","EQUITY_INDEX_FUTURE"]},"funding_schedule":{"anyOf":[{"$ref":"#/x-ext/c7312c1"},{"$ref":"#/x-ext/565d528"}],"description":"How and when funding is paid on this market. All equity futures currently use a fixed-interval schedule: every 240 minutes, 24/7, including weekends and holidays."},"price_collar_percentage":{"type":["string","null"],"description":"Price collar, in percent, that the exchange applies to orders on this market around the mark price (e.g. `\"10\"` = 10%). `null` when the market is not loaded on the exchange (typically a `CLOSED` market), so no collar is enforced."},"max_leverage":{"type":"integer","description":"Maximum leverage offered on this market. Omitted where one leverage applies to every market."},"market_offset":{"type":"integer","description":"Offset, in seconds, applied to this market's funding times."},"max_order_value":{"type":["string","null"],"description":"Maximum value (in the quote asset) of a single order. `null` means no cap is enforced."},"max_position_size":{"type":["object","null"],"description":"Maximum position size on this market per customer segment, as notional value in the quote asset. Each value is the cap the exchange enforces for that segment: the segment's own cap, or the market default when none is set. `null` when the exchange reports no position limits for the market.","properties":{"RETAIL":{"type":"string","description":"Maximum position size, as notional value in the quote asset, for accounts in the `RETAIL` segment."},"INSTITUTIONAL":{"type":"string","description":"Maximum position size, as notional value in the quote asset, for accounts in the `INSTITUTIONAL` segment."},"MARKET_MAKER":{"type":"string","description":"Maximum position size, as notional value in the quote asset, for accounts in the `MARKET_MAKER` segment."}},"required":["RETAIL","INSTITUTIONAL","MARKET_MAKER"]}},"required":["base","quote","amount_precision","market_precision","min_size","min_price","max_price","id","state","price_collar_percentage","market_offset","max_order_value","funding_period","funding_schedule","type","contract_duration","contract_expiry_date","max_position_size"]},"0c9e3ef":{"title":"PerpInstrument","type":"object","description":"Legacy perpetual future. These markets are no longer traded and are listed with state `CLOSED`.","properties":{"base":{"type":"object","properties":{"code":{"type":"string","description":"The symbol for the base asset (e.g., `BTC`)."},"precision":{"type":"integer","description":"The number of decimal places allowed for the base asset (currently always 8)."}},"required":["code","precision"],"description":"An object representing the base asset in the trading pair."},"quote":{"type":"object","properties":{"code":{"type":"string","description":"The symbol for the quote asset (e.g., `EUR`)."},"precision":{"type":"integer","description":"The number of decimal places allowed for the quote asset (currently always 8)."}},"required":["code","precision"],"description":"An object representing the quote asset in the trading pair."},"amount_precision":{"type":"integer","description":"The number of decimal places allowed when specifying the trade amount (quantity of the base asset)."},"market_precision":{"type":"integer","description":"The number of decimal places allowed when specifying the price of the instrument."},"min_size":{"type":"string","description":"The minimum allowable order value for the instrument, expressed in the quote asset (e.g., 10 EUR or 10 USDC). This is calculated as price × amount and ensures the order meets the required notional value."},"min_price":{"type":"string","description":"The minimum allowable price for the instrument, expressed in the quote asset."},"max_price":{"type":"string","description":"The maximum allowable price for the instrument, expressed in the quote asset."},"id":{"type":"string","description":"The unique identifier for the trading pair (e.g., `BTC_USDC`). This is used when creating / cancelling orders as `instrument_code`."},"state":{"type":"string","enum":["ACTIVE","SUSPENDED","POST_ONLY","CLOSED"],"description":"The current state of the instrument. `ACTIVE` markets are tradable; `CLOSED` markets are still listed by this endpoint but cannot be traded."},"funding_period":{"type":"integer","description":"Funding period duration in minutes (e.g., 240 represents 4 hours); mirrors `funding_schedule.period_minutes`. Use `funding_schedule` instead.","deprecated":true},"type":{"type":"string","description":"Instrument type, always `PERP`.","enum":["PERP"]},"funding_schedule":{"$ref":"#/x-ext/c7312c1","description":"Fixed-interval funding schedule."},"price_collar_percentage":{"type":["string","null"],"description":"Price collar, in percent, that the exchange applies to orders on this market around the mark price (e.g. `\"10\"` = 10%). `null` when the market is not loaded on the exchange (typically a `CLOSED` market), so no collar is enforced."},"max_leverage":{"type":"integer","description":"Maximum leverage offered on this market. Omitted where one leverage applies to every market."},"market_offset":{"type":"integer","description":"Offset, in seconds, applied to this market's funding times."},"max_order_value":{"type":["string","null"],"description":"Maximum value (in the quote asset) of a single order. `null` means no cap is enforced."},"max_position_size":{"type":["object","null"],"description":"Maximum position size on this market per customer segment, as notional value in the quote asset. Each value is the cap the exchange enforces for that segment: the segment's own cap, or the market default when none is set. `null` when the exchange reports no position limits for the market.","properties":{"RETAIL":{"type":"string","description":"Maximum position size, as notional value in the quote asset, for accounts in the `RETAIL` segment."},"INSTITUTIONAL":{"type":"string","description":"Maximum position size, as notional value in the quote asset, for accounts in the `INSTITUTIONAL` segment."},"MARKET_MAKER":{"type":"string","description":"Maximum position size, as notional value in the quote asset, for accounts in the `MARKET_MAKER` segment."}},"required":["RETAIL","INSTITUTIONAL","MARKET_MAKER"]}},"required":["base","quote","amount_precision","market_precision","min_size","min_price","max_price","id","state","price_collar_percentage","market_offset","max_order_value","funding_period","funding_schedule","type","max_position_size"]},"75d23eb":{"get":{"summary":"Instruments","description":"Retrieves a list of instrument pairs on the exchange, including details about the base and quote assets, precision levels, minimum and maximum trading limits, and the market type. The response provides key information needed for trading, such as instrument unique IDs, pricing, and state. Instruments in every state are listed, including `CLOSED` markets that can no longer be traded. Futures instruments additionally carry their funding schedule, leverage, price collar, maximum order value and maximum position size per customer segment. Optionally, the results can be filtered by market type using the `type` query parameter.\n","tags":["Public"],"parameters":[{"name":"type","in":"query","description":"Filters the instruments by market type (case-insensitive): `SPOT` for spot markets, `DATED_FUTURE` for crypto futures, `EQUITY_FUTURE` for single stock futures, `EQUITY_INDEX_FUTURE` for equity index futures and `PERP` for legacy perpetual markets (all `CLOSED`).","required":false,"example":"","schema":{"type":["string","null"],"enum":["SPOT","DATED_FUTURE","EQUITY_FUTURE","EQUITY_INDEX_FUTURE","PERP"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"anyOf":[{"$ref":"#/x-ext/a329300"},{"$ref":"#/x-ext/b493e78"},{"$ref":"#/x-ext/537496b"},{"$ref":"#/x-ext/0c9e3ef"}]}},"examples":{"1":{"summary":"Success Example","value":{"base":{"code":"BTC","precision":8},"quote":{"code":"USDC","precision":8},"amount_precision":5,"market_precision":2,"min_size":"10.0","min_price":"1000","max_price":"10000000","id":"BTC_USDC","type":"SPOT","state":"ACTIVE"}},"2":{"summary":"Success Example","value":{"base":{"code":"ONEX100","precision":8},"quote":{"code":"USD","precision":8},"amount_precision":3,"market_precision":2,"min_size":"10.0","min_price":"10","max_price":"1000000","id":"ONEX100_USD_P","price_collar_percentage":"10","type":"EQUITY_INDEX_FUTURE","state":"ACTIVE","funding_period":240,"market_offset":11,"funding_schedule":{"type":"FIXED_INTERVAL","period_minutes":240},"contract_expiry_date":"2031-04-20","contract_duration":"5Y","max_order_value":"200000","max_position_size":{"RETAIL":"100000","INSTITUTIONAL":"1000000","MARKET_MAKER":"1000000"}}},"3":{"summary":"Success Example","value":{"base":{"code":"BTC","precision":8},"quote":{"code":"USD","precision":8},"amount_precision":5,"market_precision":2,"min_size":"10.0","min_price":"1000","max_price":"10000000","id":"BTC_USD_P","price_collar_percentage":"10","type":"DATED_FUTURE","state":"ACTIVE","funding_period":240,"market_offset":0,"funding_schedule":{"type":"FIXED_INTERVAL","period_minutes":240},"contract_expiry_date":"2031-04-20","contract_duration":"5Y","max_order_value":"1000000","max_position_size":{"RETAIL":"250000","INSTITUTIONAL":"2500000","MARKET_MAKER":"10000000"}}}}}}},"400":{"description":"Invalid `type` value. `error` is a human-readable message.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"Invalid type parameter. Must be one of: SPOT, PERP, EQUITY_FUTURE, EQUITY_INDEX_FUTURE, DATED_FUTURE."}}}},"404":{"description":"No instrument data is available.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"Not found."}}}},"500":{"description":"Unexpected server error. `error` is a human-readable message.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"6":{"summary":"Server error","value":{"error":"Server error."}},"7":{"summary":"Server configuration error","value":{"error":"Server configuration error."}}}}}}},"security":[],"operationId":"instruments"}},"a752494":{"title":"Candlestick","type":"object","properties":{"last_sequence":{"type":"integer","description":"Nanosecond timestamp of the last trade or tick included in the candle. The value exceeds 2^53 and the server converts it to an IEEE-754 double, so it reaches you already rounded (the last few digits are not exact)."},"instrument_code":{"type":"string","description":"The instrument the candle belongs to."},"granularity":{"type":"object","properties":{"unit":{"type":"string","enum":["MINUTES","HOURS","DAYS","WEEKS","MONTHS"]},"period":{"type":"integer","description":"Number of units per candle."}},"required":["unit","period"]},"high":{"type":"string","description":"Highest price in the candle."},"low":{"type":"string","description":"Lowest price in the candle."},"open":{"type":"string","description":"Opening price."},"close":{"type":"string","description":"Closing price."},"volume":{"type":"string","description":"Traded volume in the candle. `0` for candles derived from mid prices."},"time":{"type":"string","format":"date-time","description":"End of the candle period (start + granularity − 1 ms). For `MONTHS`, a month is counted as 30 days."},"start_time":{"type":"string","format":"date-time","description":"Start of the candle period."}},"required":["last_sequence","instrument_code","granularity","high","low","open","close","volume","time","start_time"]},"b7eb64e":{"get":{"summary":"Candlesticks","description":"Get instrument candlesticks. The response contains up to `countBack` candles (default and maximum 5000), newest first, ending at the last complete candle before `to`. `from` is validated (it must be a valid timestamp, not in the future and not after `to`) but does not limit the results: to receive only the candles in a range, set `countBack` to the number of candles you need. Fewer candles than requested may be returned where there are gaps in the history.\nIf there is trading volume in a candle's period, it is based on trades. If there is no volume in a candle's period, it is based on the mid price (bid/ask average).\nWhen no candles are found, `status` is `no_data` and `candlesticks` is omitted; `next_bar` then gives the start time of the most recent candle before `from`, if there is one.","tags":["Public"],"parameters":[{"name":"instrument_code","in":"path","description":"The instrument code, e.g. `BTC_USDC`.","required":true,"example":"BTC_USDC","schema":{"type":"string"}},{"name":"unit","in":"query","description":"Defines the unit of candlestick time granularity (case-insensitive).","required":true,"example":"MINUTES","schema":{"type":"string","enum":["MINUTES","HOURS","DAYS","WEEKS","MONTHS"]}},{"name":"period","in":"query","description":"Defines the period of candlestick time granularity.\n\nCombined with the unit, supported resolutions are 1, 5, 15, 30 MINUTES & 1, 4 HOURS & 1 DAYS & 1 WEEKS & 1 MONTHS.","required":true,"example":"30","schema":{"type":"string"}},{"name":"from","in":"query","description":"ISO 8601 timestamp. Must be a valid date, not in the future, and not after `to`. It does not limit the candles returned (see description).","required":true,"example":"2026-02-11T16:42:33.450Z","schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","description":"ISO 8601 timestamp. Candles are returned ending at the last complete candle before this time.","required":true,"example":"2026-12-12T16:42:33.450Z","schema":{"type":"string","format":"date-time"}},{"name":"countBack","in":"query","description":"Number of candles to return, newest first. Integer between 1 and 5000; defaults to 5000.","required":false,"schema":{"type":"string","default":"5000","pattern":"^[0-9]+$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","description":"`data` when candles were found, otherwise `no_data`.","enum":["data","no_data"]},"candlesticks":{"type":"array","items":{"$ref":"#/x-ext/a752494"},"description":"Candles, newest first. Present only when `status` is `data`."},"next_bar":{"type":"string","format":"date-time","description":"Only when `status` is `no_data`: start time of the most recent candle before `from`, if any."}},"required":["status"]},"example":{"status":"data","candlesticks":[{"last_sequence":1730900885466242800,"instrument_code":"BTC_EUR","granularity":{"unit":"MINUTES","period":30},"high":"100000","low":"100000","open":"100000","close":"100000","volume":"2000.00","time":"2024-11-06T13:59:59.999Z","start_time":"2024-11-06T13:30:00.000Z"},{"last_sequence":1730369352914576100,"instrument_code":"BTC_EUR","granularity":{"unit":"MINUTES","period":30},"high":"100000","low":"100000","open":"100000","close":"100000","volume":"100.00","time":"2024-10-31T10:29:59.999Z","start_time":"2024-10-31T10:00:00.000Z"},{"last_sequence":1730368016064669000,"instrument_code":"BTC_EUR","granularity":{"unit":"MINUTES","period":30},"high":"10000","low":"10000","open":"10000","close":"10000","volume":"20.00","time":"2024-10-31T09:59:59.999Z","start_time":"2024-10-31T09:30:00.000Z"},{"last_sequence":1730362835479252000,"instrument_code":"BTC_EUR","granularity":{"unit":"MINUTES","period":30},"high":"100000","low":"100000","open":"100000","close":"100000","volume":"100.00","time":"2024-10-31T08:29:59.999Z","start_time":"2024-10-31T08:00:00.000Z"},{"last_sequence":1730330727170770700,"instrument_code":"BTC_EUR","granularity":{"unit":"MINUTES","period":30},"high":"100000","low":"100000","open":"100000","close":"100000","volume":"200.00","time":"2024-10-30T23:29:59.999Z","start_time":"2024-10-30T23:00:00.000Z"},{"last_sequence":1730328614342880500,"instrument_code":"BTC_EUR","granularity":{"unit":"MINUTES","period":30},"high":"100000","low":"100000","open":"100000","close":"100000","volume":"100.00","time":"2024-10-30T22:59:59.999Z","start_time":"2024-10-30T22:30:00.000Z"}]}}}},"400":{"description":"Invalid request. `error` is a human-readable message describing the problem.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"2":{"summary":"Unknown market","value":{"error":"The requested market BTC_XYZ is not available."}},"3":{"summary":"Missing unit","value":{"error":"No unit parameter."}},"4":{"summary":"Missing period","value":{"error":"No period parameter."}},"5":{"summary":"Invalid resolution","value":{"error":"Invalid unit and period combination."}},"6":{"summary":"Missing from","value":{"error":"No from parameter."}},"7":{"summary":"Invalid from","value":{"error":"From date: yesterday is not a valid date."}},"8":{"summary":"From in the future","value":{"error":"From date: 2099-01-01T00:00:00.000Z is in the future."}},"9":{"summary":"Missing to","value":{"error":"No to parameter."}},"10":{"summary":"Invalid to","value":{"error":"To date: tomorrow is not a valid date."}},"11":{"summary":"From after to","value":{"error":"From date: 2026-02-12T00:00:00.000Z is greater than To date: 2026-02-11T00:00:00.000Z"}},"12":{"summary":"Invalid countBack","value":{"error":"Countback must be an integer, between 1 and 5000"}}}}}},"500":{"description":"Unexpected server error. `error` is a human-readable message.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"13":{"summary":"Server error","value":{"error":"Server error."}},"14":{"summary":"Server configuration error","value":{"error":"Server configuration error."}}}}}}},"security":[],"operationId":"candlesticks"}},"45ce4ed":{"title":"FeeTier","type":"object","properties":{"volume":{"type":"integer","description":"Volume beyond which this fee tier is activated"},"fee_group_id":{"type":"string","description":"Identifier of the fee group"},"maker_fee":{"type":"string","description":"Percentage fee rate that will be used for fee calculation when trade is settled as MAKER."},"taker_fee":{"type":"string","description":"Percentage fee rate that will be used for fee calculation when trade is settled as TAKER."}},"required":["volume","fee_group_id","maker_fee","taker_fee"]},"18cee31":{"title":"FeeGroup","type":"object","properties":{"fee_group_id":{"type":"string","description":"Unique identifier of a FeeGroup","enum":["SPOT","FUTURES"]},"display_text":{"type":"string","description":"Textual description of a Fee Group"},"volume_currency":{"type":"string","description":"The code of the currency volume is denoted in."},"fee_tiers":{"type":"array","items":{"$ref":"#/x-ext/45ce4ed"}}},"required":["fee_group_id","display_text","volume_currency","fee_tiers"]},"1cc227f":{"get":{"summary":"Fee Groups","description":"Returns details of all fee groups. Fee groups are separated into product types.","tags":["Public"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/x-ext/18cee31"}},"examples":{"1":{"summary":"Success","value":[{"fee_group_id":"SPOT","display_text":"The fee plan for spot trading.","volume_currency":"USD","fee_tiers":[{"volume":0,"fee_group_id":"SPOT","maker_fee":"0.1000","taker_fee":"0.2000"},{"volume":10000,"fee_group_id":"SPOT","maker_fee":"0.0400","taker_fee":"0.0600"},{"volume":100000,"fee_group_id":"SPOT","maker_fee":"0.0200","taker_fee":"0.0500"},{"volume":1000000,"fee_group_id":"SPOT","maker_fee":"0.0190","taker_fee":"0.0450"},{"volume":5000000,"fee_group_id":"SPOT","maker_fee":"0.0180","taker_fee":"0.0400"},{"volume":25000000,"fee_group_id":"SPOT","maker_fee":"0.0130","taker_fee":"0.0350"},{"volume":100000000,"fee_group_id":"SPOT","maker_fee":"0.0025","taker_fee":"0.0300"},{"volume":500000000,"fee_group_id":"SPOT","maker_fee":"0.0000","taker_fee":"0.0300"},{"volume":1000000000,"fee_group_id":"SPOT","maker_fee":"0.0000","taker_fee":"0.0280"},{"volume":10000000000,"fee_group_id":"SPOT","maker_fee":"0.0000","taker_fee":"0.0250"}]},{"fee_group_id":"FUTURES","display_text":"The fee plan for futures trading.","volume_currency":"USD","fee_tiers":[{"volume":0,"fee_group_id":"FUTURES","maker_fee":"0.1000","taker_fee":"0.2000"},{"volume":10000,"fee_group_id":"FUTURES","maker_fee":"0.0400","taker_fee":"0.0600"},{"volume":100000,"fee_group_id":"FUTURES","maker_fee":"0.0200","taker_fee":"0.0500"},{"volume":1000000,"fee_group_id":"FUTURES","maker_fee":"0.0190","taker_fee":"0.0450"},{"volume":5000000,"fee_group_id":"FUTURES","maker_fee":"0.0180","taker_fee":"0.0400"},{"volume":25000000,"fee_group_id":"FUTURES","maker_fee":"0.0130","taker_fee":"0.0350"},{"volume":100000000,"fee_group_id":"FUTURES","maker_fee":"0.0025","taker_fee":"0.0300"},{"volume":500000000,"fee_group_id":"FUTURES","maker_fee":"0.0000","taker_fee":"0.0300"},{"volume":1000000000,"fee_group_id":"FUTURES","maker_fee":"0.0000","taker_fee":"0.0280"},{"volume":10000000000,"fee_group_id":"FUTURES","maker_fee":"0.0000","taker_fee":"0.0250"}]}]}}}}},"404":{"description":"Fee data is not available.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"NO_FEES_AVAILABLE"}}}},"500":{"description":"Unexpected server error. `error` is a human-readable message.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"3":{"summary":"Server error","value":{"error":"Server error."}},"4":{"summary":"Server configuration error","value":{"error":"Server configuration error."}}}}}}},"security":[],"operationId":"feeGroups"}},"161c2e1":{"get":{"summary":"Order Book","description":"Get the specified instrument's order book. At most the top 16 price levels per side are returned. When `depth` is supplied it takes precedence over `level`; `level` is still validated. Snapshots are cached for 1 second, so consecutive requests within a second can return the same book. Only markets in state `ACTIVE` or `POST_ONLY` have an order book.","tags":["Public"],"parameters":[{"name":"instrument_code","in":"path","description":"The instrument code, e.g. `BTC_USDC`.","required":true,"example":"BTC_USDC","schema":{"type":"string"}},{"name":"level","in":"query","description":"Deprecated; use `depth`.\nLevel 1 = best bid and ask\nLevel 2 and Level 3 = top 16 price levels per side","required":false,"example":"1","schema":{"type":"string","enum":["1","2","3"],"deprecated":true,"default":"3"},"deprecated":true},{"name":"depth","in":"query","description":"The number of price levels per side to return (maximum 16). Depth of 1 will return top of book.","required":false,"example":"16","schema":{"type":"string","enum":["1","2","4","8","16"],"default":"16"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"asks":{"type":"array","items":{"type":"object","properties":{"price":{"type":"string"},"amount":{"type":"string"}},"required":["price","amount"]},"description":"Ask price levels, best (lowest) first."},"bids":{"type":"array","items":{"type":"object","properties":{"price":{"type":"string"},"amount":{"type":"string"}},"required":["price","amount"]},"description":"Bid price levels, best (highest) first."},"instrument_code":{"type":"string","description":"The instrument code."},"time":{"type":"integer","description":"Nanosecond timestamp of the order-book snapshot. The value exceeds 2^53 and the server reads it as an IEEE-754 double, so it reaches you already rounded (the last few digits are not exact)."},"unum_bids":{"type":"integer","description":"Count of bids in the full book."},"unum_asks":{"type":"integer","description":"Count of asks in the full book."}},"required":["asks","bids","instrument_code","time"]},"examples":{"1":{"summary":"Success","value":{"instrument_code":"BTC_USDC","time":1730900885466242800,"asks":[{"price":"100000","amount":"6"}],"bids":[{"price":"10000","amount":"6"}],"unum_bids":1,"unum_asks":1}}}}}},"400":{"description":"Invalid request. Possible codes: `INVALID_INSTRUMENT_CODE` (unknown instrument), `MARKET_SUSPENDED` (the market is suspended), `MARKET_CLOSED` (the market is in any other state without a live book), `INVALID_DEPTH`, `INVALID_LEVEL`.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"2":{"summary":"Invalid instrument code","value":{"error":"INVALID_INSTRUMENT_CODE"}},"3":{"summary":"Invalid depth","value":{"error":"INVALID_DEPTH"}},"4":{"summary":"Invalid level","value":{"error":"INVALID_LEVEL"}},"5":{"summary":"Market suspended","value":{"error":"MARKET_SUSPENDED"}},"6":{"summary":"Market closed","value":{"error":"MARKET_CLOSED"}}}}}},"500":{"description":"Unexpected server error. `error` is a human-readable message.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"Error fetching order book snapshot for BTC_USDC"}}}}},"security":[],"operationId":"orderBook"}},"fd13fc9":{"title":"MarketTicker","type":"object","properties":{"base_volume":{"type":"string","description":"Traded volume in the base asset over the last 24 hours."},"high":{"type":"string","description":"Highest trade price over the last 24 hours."},"highest_bid":{"type":"string","description":"Best bid price. `0` when unavailable."},"instrument_code":{"type":"string","description":"The instrument code."},"last_price":{"type":"string","description":"Price of the most recent trade. `0` if there have been no trades in the last 24 hours."},"low":{"type":"string","description":"Lowest trade price over the last 24 hours."},"lowest_ask":{"type":"string","description":"Best ask price. `0` when unavailable."},"price_change_percentage":{"type":"string","description":"Percentage change between the first trade in the 24-hour window and the last price."},"price_change":{"type":"string","description":"Absolute change between the first trade in the 24-hour window and the last price."},"quote_volume":{"type":"string","description":"Traded volume in the quote asset over the last 24 hours."},"sequence":{"type":"integer","description":"Nanosecond timestamp of the order-book snapshot used for `highest_bid`/`lowest_ask`; `0` when no snapshot is available. It is set whether or not the market has traded in the last 24 hours. The value exceeds 2^53 and the server reads it as an IEEE-754 double, so it reaches you already rounded (the last few digits are not exact). Use it for ordering, not as an exact timestamp."},"state":{"type":"string","description":"Market state. Only `ACTIVE`, `POST_ONLY` and `SUSPENDED` markets appear in the ticker.","enum":["ACTIVE","POST_ONLY","SUSPENDED"]},"type":{"type":"string","description":"Market type.","enum":["SPOT","PERP","EQUITY_FUTURE","EQUITY_INDEX_FUTURE","DATED_FUTURE"]},"global_volume":{"type":"string","description":"Global 24-hour trading volume of the base asset across all venues (from CoinGecko). `0` when unavailable."},"open_interest":{"type":"string","description":"Futures only. Open interest in the base asset."},"open_interest_usd":{"type":["string","null"],"description":"Futures only. Open interest converted to USD, or `null` when no USD price is available for the base asset."},"mark_price":{"type":["string","null"],"description":"Futures only. Current mark price; `null` when unavailable."},"funding_rate":{"type":["string","null"],"description":"Futures only. Current funding rate; `null` when unavailable."},"next_funding_payment":{"type":["string","null"],"format":"date-time","description":"Futures only. Time of the next funding payment; `null` when unknown."}},"required":["base_volume","high","highest_bid","instrument_code","last_price","low","lowest_ask","price_change_percentage","price_change","quote_volume","sequence","state","type","global_volume"]},"5cfed0d":{"get":{"summary":"Market Ticker","description":"The market ticker provides information about the current state of a market and summary statistics on activity within the last 24 hours. Volume, low, high and price change are calculated over a rolling 24-hour window of trades. If a market has had no trades in the last 24 hours, its statistics and `last_price` are `0`. Only markets in state `ACTIVE`, `POST_ONLY` or `SUSPENDED` are included. Ticker data is cached and may be up to a minute old. Futures markets additionally return `open_interest`, `open_interest_usd`, `mark_price`, `funding_rate` and `next_funding_payment`.","tags":["Public"],"parameters":[{"name":"type","in":"query","description":"Filters the tickers by market type. Case-sensitive.","required":false,"schema":{"type":"string","enum":["SPOT","DATED_FUTURE","EQUITY_FUTURE","EQUITY_INDEX_FUTURE","PERP"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/x-ext/fd13fc9"}},"examples":{"1":{"summary":"Success Example","value":{"base_volume":"0.90000","high":"100000.00","highest_bid":"99950.00","instrument_code":"BTC_USDC","last_price":"100000.00","low":"99000.00","lowest_ask":"100050.00","price_change_percentage":"1.01","price_change":"1000.00","quote_volume":"89550.00","sequence":1731326923439826000,"state":"ACTIVE","type":"SPOT","global_volume":"41234567890.12"}},"2":{"summary":"Success Example","value":{"base_volume":"1.20000","high":"101000.00","highest_bid":"100010.00","instrument_code":"BTC_USD_P","last_price":"100020.00","low":"99500.00","lowest_ask":"100030.00","price_change_percentage":"0.52","price_change":"520.00","quote_volume":"120024.00","sequence":1731326923439826000,"state":"ACTIVE","type":"DATED_FUTURE","global_volume":"41234567890.12","open_interest":"3.50000","open_interest_usd":"350070.00","mark_price":"100015.00","funding_rate":"0.0001","next_funding_payment":"2024-11-11T16:00:00.000Z"}},"3":{"summary":"Success Example","value":{"base_volume":"0","high":"0","highest_bid":"0","instrument_code":"ETH_USDC","last_price":"0","low":"0","lowest_ask":"0","price_change_percentage":"0","price_change":"0","quote_volume":"0","sequence":0,"state":"ACTIVE","type":"SPOT","global_volume":"0"}}}}}},"400":{"description":"Invalid `type` value.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"INVALID_TYPE"}}}},"500":{"description":"Unexpected server error. `error` is a human-readable message.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"Server error."}}}}},"security":[],"operationId":"marketTicker"}},"6d8c108":{"get":{"summary":"Market Ticker For Instrument","description":"Get market statistics on a single market. Only markets in state `ACTIVE`, `POST_ONLY` or `SUSPENDED` are available; the statistics are calculated as for the all-markets ticker. Ticker data is cached and may be up to a minute old.","tags":["Public"],"parameters":[{"name":"instrument_code","in":"path","description":"The market to get the market ticker data for, e.g. `BTC_USDC`.","required":true,"example":"BTC_EUR","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/x-ext/fd13fc9"},"examples":{"1":{"summary":"Success","value":{"base_volume":"0.90000","high":"100000.00","highest_bid":"99950.00","instrument_code":"BTC_USDC","last_price":"100000.00","low":"99000.00","lowest_ask":"100050.00","price_change_percentage":"1.01","price_change":"1000.00","quote_volume":"89550.00","sequence":1731326923439826000,"state":"ACTIVE","type":"SPOT","global_volume":"41234567890.12"}},"2":{"summary":"Futures market","value":{"base_volume":"1.20000","high":"101000.00","highest_bid":"100010.00","instrument_code":"BTC_USD_P","last_price":"100020.00","low":"99500.00","lowest_ask":"100030.00","price_change_percentage":"0.52","price_change":"520.00","quote_volume":"120024.00","sequence":1731326923439826000,"state":"ACTIVE","type":"DATED_FUTURE","global_volume":"41234567890.12","open_interest":"3.50000","open_interest_usd":"350070.00","mark_price":"100015.00","funding_rate":"0.0001","next_funding_payment":"2024-11-11T16:00:00.000Z"}}}}}},"400":{"description":"The instrument does not exist (`error` is a human-readable message), or the market is not in state `ACTIVE`, `POST_ONLY` or `SUSPENDED` (`MARKET_CLOSED`).","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"1":{"summary":"Unknown market","value":{"error":"The requested market INVALID_MARKET is not available."}},"2":{"summary":"Market closed","value":{"error":"MARKET_CLOSED"}}}}}},"500":{"description":"Unexpected server error. `error` is a human-readable message.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"Server error."}}}}},"security":[],"operationId":"marketTickerForInstrument"}},"983246e":{"get":{"summary":"Time","description":"Returns the current server time in UTC.","tags":["Public"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"iso":{"type":"string","format":"date-time"},"epoch_millis":{"type":"integer"}},"required":["iso","epoch_millis"]},"example":{"iso":"2024-11-12T13:43:12.237Z","epoch_millis":1731418992237}}}}},"security":[],"operationId":"time"}},"d909b24":{"get":{"summary":"Terms and Conditions","description":"Returns the latest terms and conditions version and markdown version of the content. Use `language` to request a translation and `version` to request an earlier version. If a translation has not been published for the latest version, the latest version available in that language is returned.","tags":["Public"],"parameters":[{"name":"language","in":"query","description":"Language of the terms (case-insensitive). Defaults to `EN`. The latest version is published in `EN`, `LT`, `PO` (Polish), `PT` and `RO`; `DE` and `IT` are available for versions up to 2025-06-04.","required":false,"schema":{"type":"string","default":"EN"}},{"name":"version","in":"query","description":"Version (effective date, `YYYY-MM-DD`) to return. Matched as a prefix: the latest version starting with this value is returned, e.g. `2025` returns the latest 2025 version.","required":false,"example":"2026-06-15","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string","description":"Effective date of the version (`YYYY-MM-DD`)."},"terms":{"type":"string","description":"The terms and conditions in Markdown."}},"required":["version","terms"]},"example":{"version":"2026-06-15","terms":"# General Terms and Conditions\n\nVersion 1.7..."}}}},"404":{"description":"No terms and conditions match the requested language and version.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"NO_TERMS_AND_CONDITIONS_FOUND"}}}},"500":{"description":"Unexpected server error. `error` is a human-readable message.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"ERROR_FETCHING_TERMS_AND_CONDITIONS"}}}}},"security":[],"operationId":"termsAndConditions"}},"d23ac64":{"get":{"summary":"Mark Prices","description":"Retrieves mark prices of futures instruments within the specified date range. Mark prices are those recorded at futures position settlement, one record per instrument and settlement time.\n\nAn instrument code is the `id` property from the [Instruments](/docs/exchange/rest/public/instruments) endpoint.\n\n`from`/`to` accept epoch (s, ms, µs or ns) or an ISO 8601 UTC timestamp ending in `Z` (or `YYYY-MM-DD`). `from` must be on or after 2024-01-01, not in the future, and strictly before `to`; `to` is exclusive. If neither is given, the window is the last 7 days (starting at 00:00 UTC). If only `from` is given, `to` is `from` + 7 days (capped at now); if only `to` is given, `from` is 7 days earlier (at 00:00 UTC).\n\n`cursor` is an opaque string. Pass the value from the previous response unchanged; it is `null` on the last page.\n\nUnknown query parameters are rejected with `400 UNEXPECTED_PARAMETERS`.","tags":["Public"],"parameters":[{"name":"instrument_code","in":"query","description":"Futures instrument code (e.g. `BTC_USD_P`), or a comma-separated list of codes. If not provided, returns records for all futures instruments.","required":false,"example":"BTC_USD_P","schema":{"type":"string"}},{"name":"order","in":"query","description":"Sort order by timestamp. Case-insensitive.","required":false,"example":"DESC","schema":{"type":"string","enum":["ASC","DESC"],"default":"DESC"}},{"name":"from","in":"query","description":"Start of the time range (inclusive). Epoch (s, ms, µs or ns), ISO 8601 UTC timestamp ending in `Z`, or `YYYY-MM-DD`.","required":false,"example":"2026-09-01T00:00:00Z","schema":{"type":"string"}},{"name":"to","in":"query","description":"End of the time range (exclusive). Same formats as `from`. The range may span at most 366 days.","required":false,"example":"2026-09-08T00:00:00Z","schema":{"type":"string"}},{"name":"cursor","in":"query","description":"Opaque pagination cursor from the previous response's `cursor` field.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Maximum number of records to return per page.","required":false,"example":2,"schema":{"type":"integer","minimum":1,"maximum":1000,"default":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"mark_prices":{"type":"array","items":{"type":"object","properties":{"instrument_code":{"type":"string","description":"The unique identifier for the instrument."},"timestamp":{"type":"string","format":"date-time","description":"Settlement time (ISO 8601, nanosecond precision)."},"mark_price":{"type":"string","description":"Mark price at that settlement. The value `\"null\"` is returned when no mark price was recorded."}},"required":["instrument_code","timestamp","mark_price"]}},"from":{"type":"string","format":"date-time","description":"Effective start of the queried range (ISO 8601, nanosecond precision)."},"to":{"type":"string","format":"date-time","description":"Effective end of the queried range (ISO 8601, nanosecond precision)."},"cursor":{"type":["string","null"],"description":"Opaque cursor for the next page; `null` on the last page."}},"required":["mark_prices","from","to","cursor"]},"example":{"mark_prices":[{"instrument_code":"BTC_USD_P","timestamp":"2026-09-28T08:00:00.000000000Z","mark_price":"109420.1"},{"instrument_code":"ETH_USD_P","timestamp":"2026-09-28T08:00:00.000000000Z","mark_price":"4012.9"}],"from":"2026-09-21T00:00:00.000000000Z","to":"2026-09-28T10:01:30.123456789Z","cursor":"eyJlcG9jaCI6IjE3NTkwNDY0MDAwMDAwMDAwMDEifQ=="}}}},"400":{"description":"Invalid request. Possible codes: `INVALID_INSTRUMENT_CODE`, `DUPLICATE_INSTRUMENT_CODES`, `MISSING_INSTRUMENT_CODE`, `INVALID_LIMIT` (not an integer between 1 and 1000), `INVALID_FROM_TIMESTAMP` / `INVALID_TO_TIMESTAMP` (unparseable, before 2024-01-01, or `from` in the future), `INVALID_DATE_RANGE` (`from` not before `to`, or range longer than 366 days), `INVALID_ORDER`, `INVALID_CURSOR`, `UNEXPECTED_PARAMETERS`.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"2":{"summary":"INVALID_INSTRUMENT_CODE","value":{"error":"INVALID_INSTRUMENT_CODE","error_message":"Invalid instrument codes: FOO_USD_P. Valid codes: BTC_USD_P, ETH_USD_P"}},"3":{"summary":"DUPLICATE_INSTRUMENT_CODES","value":{"error":"DUPLICATE_INSTRUMENT_CODES","error_message":"Duplicate instrument codes: BTC_USD_P"}},"4":{"summary":"INVALID_LIMIT","value":{"error":"INVALID_LIMIT","error_message":"limit must not exceed 1000, got: 5000"}},"5":{"summary":"INVALID_FROM_TIMESTAMP","value":{"error":"INVALID_FROM_TIMESTAMP","error_message":"From date cannot be before 2024-01-01"}},"6":{"summary":"INVALID_TO_TIMESTAMP","value":{"error":"INVALID_TO_TIMESTAMP","error_message":"To date must be a valid date format"}},"7":{"summary":"INVALID_DATE_RANGE","value":{"error":"INVALID_DATE_RANGE","error_message":"Date range cannot exceed 366 days. Provided range was greater than 400 days"}},"8":{"summary":"INVALID_ORDER","value":{"error":"INVALID_ORDER","error_message":"order must be 'ASC' or 'DESC', got: UP"}},"9":{"summary":"INVALID_CURSOR","value":{"error":"INVALID_CURSOR","error_message":"The cursor parameter is invalid or malformed"}},"10":{"summary":"UNEXPECTED_PARAMETERS","value":{"error":"UNEXPECTED_PARAMETERS","error_message":"Unsupported parameter: foo. Allowed: instrument_code, order, from, to, cursor, limit"}}}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}},"security":[],"operationId":"markPrices"}},"b291166":{"title":"Country","type":"object","properties":{"name":{"type":"string","description":"The English name of the country."},"alpha3":{"type":"string","description":"ISO 3166-1 alpha-3 country code (three uppercase letters, e.g. AFG)."},"phoneCode":{"type":"array","items":{"type":"string"},"description":"International dialling codes for the country, including the leading '+' (e.g. '+93'). An array because some territories have more than one."},"allowedResidency":{"type":"boolean","description":"Whether residents of this country are permitted to onboard and trade on the platform."},"allowedCitizenship":{"type":"boolean","description":"Whether citizens of this country are permitted to onboard and trade, irrespective of where they reside."},"noFiatTransfers":{"type":"boolean","description":"When true, fiat deposits and withdrawals are not supported for this country."},"name_de":{"type":"string","description":"The German-language name of the country, used for localised display.","deprecated":true},"amlRisk":{"type":"string","description":"Anti-money-laundering risk rating assigned to the country, used to drive onboarding and monitoring rules (e.g. 'low', 'medium', 'high', 'prohibited').","enum":["low","medium","high","prohibited"]},"eea":{"type":"boolean","description":"Whether the country is part of the European Economic Area."},"eu":{"type":"boolean","description":"Whether the country is a member state of the European Union."},"requiredDocumentIds":{"type":"array","items":{"type":"string","enum":["tax"]},"description":"Identifiers of additional documents a user from this country must provide during onboarding."},"nciPriority":{"type":"array","items":{"type":"string","enum":["CCPT","NIDN","CONCAT"]},"description":"Ordered preference list of national client identifier types accepted for this country for regulatory reporting (CCPT = passport, NIDN = national identifier, CONCAT = concatenated fallback). Order signals priority."},"allowedProducts":{"type":"object","properties":{"retail":{"type":"array","items":{"type":"string","enum":["SPOT","DATED_FUTURE","EQUITY_FUTURE","EQUITY_INDEX_FUTURE"]},"description":"Product types available to retail clients in this country. Empty means no products are offered to retail clients."},"professional":{"type":"array","items":{"type":"string","enum":["SPOT","DATED_FUTURE","EQUITY_FUTURE","EQUITY_INDEX_FUTURE"]},"description":"Product types available to professional clients in this country. Empty means no products are offered to professional clients."}},"required":["retail","professional"],"description":"Tradable product types available in this country, split by client classification."},"postalCodeUse":{"type":"string","description":"Whether a postal code is part of a valid address in this country: `required`, `optional` (codes exist but an address is valid without one) or `none` (no postal code system). May be absent on older records; treat a missing value as `required`.","enum":["required","optional","none"]}},"required":["name","alpha3","phoneCode","allowedResidency","allowedCitizenship","noFiatTransfers","name_de","amlRisk","eea","eu","requiredDocumentIds","nciPriority","allowedProducts"]},"a5f7f19":{"get":{"summary":"Countries","description":"Lists countries with their respective product availability, EEA status, and other useful fields relevant to the One Trading platform. The response is an object keyed by ISO 3166-1 alpha-2 country code.","tags":["Public"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","description":"Map of ISO 3166-1 alpha-2 country code (e.g. `AT`) to country details.","propertyNames":{"pattern":"^[A-Z]{2}$"},"additionalProperties":{"$ref":"#/x-ext/b291166"},"properties":{}},"example":{"AF":{"name":"Afghanistan","alpha3":"AFG","phoneCode":["+93"],"allowedResidency":false,"allowedCitizenship":true,"noFiatTransfers":true,"name_de":"Afghanistan","amlRisk":"prohibited","eea":false,"eu":false,"requiredDocumentIds":["tax"],"nciPriority":["CCPT","CONCAT"],"allowedProducts":{"retail":[],"professional":[]},"postalCodeUse":"optional"},"AX":{"name":"Åland Islands","alpha3":"ALA","phoneCode":["+358"],"allowedResidency":true,"allowedCitizenship":true,"noFiatTransfers":false,"name_de":"Åland Islands","amlRisk":"low","eea":false,"eu":false,"requiredDocumentIds":["tax"],"nciPriority":["CCPT","CONCAT"],"allowedProducts":{"retail":["SPOT"],"professional":["SPOT"]},"postalCodeUse":"required"},"AL":{"name":"Albania","alpha3":"ALB","phoneCode":["+355"],"allowedResidency":false,"allowedCitizenship":true,"noFiatTransfers":true,"name_de":"Albania","amlRisk":"prohibited","eea":false,"eu":false,"requiredDocumentIds":["tax"],"nciPriority":["CCPT","CONCAT"],"allowedProducts":{"retail":[],"professional":[]},"postalCodeUse":"optional"}}}}},"404":{"description":"Country data is not available.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"NOT_FOUND","error_message":"The requested resource was not found"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}},"security":[],"operationId":"countries"}},"947b261":{"title":"OrderStatus","type":"string","enum":["OPEN","BOOKED","FILL","MOVED","MOVE_SELF_TRADE","FILLED_FULLY","FILLED_CLOSED","FILLED_REJECTED","CANCELLED","INSUFFICIENT_FUNDS","INSUFFICIENT_LIQUIDITY","MATCHING_MOVE_FAILED_PRICE_OVER_RISK_LIMIT","MATCHING_POST_ONLY_RESULTS_IN_MATCH","REJECTED","SELF_TRADE","RISK_FAILED_OVER_MAX_POSITION","RISK_INVALID_RESERVE_BID_PRICE","RISK_MARGIN_TRADING_DISABLED","RISK_REDUCE_ONLY_NO_POSITION","RISK_REDUCE_ONLY_WRONG_SIDE","RISK_REDUCE_ONLY_NO_CAPACITY","USER_MGMT_USER_IN_DERISK"]},"124f69b":{"title":"Order","type":"object","properties":{"account_id":{"type":"string","format":"uuid","description":"The account ID the order belongs to"},"order_id":{"type":"string","format":"uuid","description":"Unique identifier of the order"},"client_id":{"type":"string","format":"uuid","description":"Unique client identifier for the order. This can be specified at time of booking the order by the client, otherwise is randomly generated"},"amount":{"type":"string","description":"The amount of currency for this order"},"side":{"type":"string","enum":["BUY","SELL"],"description":"BUY or SELL"},"instrument_code":{"type":"string","description":"The market identifier for the order"},"price":{"type":"string","description":"The price at which the order is set to execute"},"time":{"type":"string","format":"date-time","description":"The time the order was booked at (ISO 8601, millisecond precision)"},"sequence":{"type":"string","description":"An incremental identifier for tracking the order in the exchange"},"total_fee":{"type":"string","description":"The total cumulative fee paid for the order. This is a sum of fees for all trades executed for this order. Not present if there are no fees for this order."},"fee_currency":{"type":"string","description":"The currency code that the fee was paid in. Not present if there are no trades for this order."},"time_last_updated":{"type":"string","format":"date-time","description":"Time of the last activity on the order (ISO 8601, millisecond precision)"},"order_book_sequence":{"type":"string","description":"DEPRECATED - This will be removed soon, use sequence instead"},"filled_amount":{"type":"string","description":"The already filled amount of currency for this order"},"status":{"$ref":"#/x-ext/947b261","description":"The current state of the order. When it enters the book it has a status of *OPEN* (*BOOKED* is a deprecated alias); as trades are executed it changes to *FILL* or *FILLED_FULLY* depending on how much of the order is filled. *MOVED* and *MOVE_SELF_TRADE* are also open states.\nIf the order is cancelled before any trades are executed, it has a status of *CANCELLED*. If there were already trades on the order when it was cancelled, the status is *FILLED_CLOSED*.\nIf the order is rejected by the exchange, the status is the rejection reason (e.g. *INSUFFICIENT_FUNDS*, *SELF_TRADE*, *MATCHING_POST_ONLY_RESULTS_IN_MATCH*), or *FILLED_REJECTED* if it had already been partially filled."},"average_price":{"type":"string","description":"Weighed average price of all trades belonging to this order. Not present if there are no trades for this order."},"time_nanos":{"type":"string","format":"date-time","description":"The time the order was booked at (ISO 8601, nanosecond precision)"},"time_last_updated_nanos":{"type":"string","format":"date-time","description":"Time of the last activity on the order (ISO 8601, nanosecond precision)"},"order_type":{"type":"string","enum":["API","UI","LIQUIDATION","TAKE_PROFIT","STOP_LOSS","INSTANT_TRADE","SPOT_LEGACY","UNKNOWN"],"description":"How the order was placed: API, UI, LIQUIDATION, TAKE_PROFIT, STOP_LOSS, INSTANT_TRADE, SPOT_LEGACY or UNKNOWN."},"liquidation":{"type":"boolean","enum":[true],"description":"Present (and `true`) only on liquidation orders. Absent otherwise."}},"required":["account_id","order_id","client_id","amount","side","instrument_code","price","time","sequence","time_last_updated","filled_amount","status","time_nanos","time_last_updated_nanos","order_type"]},"fa3eb14":{"title":"Fee","type":"object","properties":{"fee_amount":{"type":"string","description":"The amount paid in the fee currency"},"fee_currency":{"type":"string","description":"The currency the fee was paid in"}},"required":["fee_amount","fee_currency"]},"a5fea06":{"title":"Trade","type":"object","properties":{"account_id":{"type":"string","format":"uuid","description":"Account ID the trade belongs to"},"order_id":{"type":"string","format":"uuid","description":"Unique identifier of the order the trade belongs to"},"trade_id":{"type":"string","format":"uuid","description":"Unique identifier of the trade"},"time":{"type":"string","description":"The time the trade was executed (ISO 8601, millisecond precision)","format":"date-time","deprecated":true},"time_nanos":{"type":"string","format":"date-time","description":"The time the trade was executed (ISO 8601, nanosecond precision)"},"instrument_code":{"type":"string","description":"The market identifier for the trade"},"side":{"type":"string","enum":["BUY","SELL"],"description":"BUY or SELL"},"matched_as":{"type":"string","enum":["MAKER","TAKER"],"description":"MAKER or TAKER"},"amount":{"type":"string","description":"The quantity that has been executed, expressed in the base currency.","deprecated":true},"filled_amount":{"type":"string","description":"The quantity that has been executed, expressed in the base currency."},"price":{"type":"string","description":"The price at which the trade matched at"},"sequence":{"type":"string","description":"An incremental identifier for tracking the trade in the exchange"},"position_id":{"type":"string","description":"Numeric ID (as a string) of the position associated with this trade. Present only on futures trades returned by the trades endpoints and `GET /v1/account/orders/{order_id}/trades`; never included in trades nested in order responses."},"prev_position_id":{"type":"string","description":"Numeric ID (as a string) of the position closed by this trade when it causes a position flip (long to short or short to long). Present only on futures trades returned by the trades endpoints and `GET /v1/account/orders/{order_id}/trades`; never included in trades nested in order responses."},"open_position_amount":{"type":"string","description":"The post-execution open position amount. Present only on futures trades returned by the trades endpoints and `GET /v1/account/orders/{order_id}/trades`; never included in trades nested in order responses."},"order_type":{"type":"string","enum":["API","UI","LIQUIDATION","TAKE_PROFIT","STOP_LOSS","INSTANT_TRADE","SPOT_LEGACY","UNKNOWN"],"description":"How the order was placed: API, UI, LIQUIDATION, TAKE_PROFIT, STOP_LOSS, INSTANT_TRADE, SPOT_LEGACY or UNKNOWN. Returned by every endpoint that returns trades."},"time_in_force":{"type":["string","null"],"description":"Time in force of the order the trade belongs to. Returned by the trades endpoints and `GET /v1/account/orders/{order_id}/trades`; not included in trades nested in order responses."},"liquidation":{"type":"boolean","enum":[true],"description":"Present (and `true`) only on trades of liquidation orders nested in order responses (`GET /v1/account/orders`, `GET /v1/account/orders/{order_id}`, `GET /v1/account/orders/client/{client_id}`). Absent otherwise."}},"required":["trade_id","order_id","account_id","amount","side","instrument_code","price","time","sequence","matched_as","time_nanos","filled_amount","order_type"]},"35cc10f":{"title":"CreateOrder","type":"object","properties":{"instrument_code":{"type":"string","description":"The id of the market to create the order on. Use the /instruments endpoint to get the ids of ACTIVE markets to trade on"},"type":{"type":"string","enum":["LIMIT"],"description":"The type of order you wish to create"},"side":{"type":"string","enum":["BUY","SELL"],"description":"BUY or SELL"},"amount":{"type":"string","description":"The amount of currency for this order, as a positive decimal string within the instrument's amount precision"},"price":{"type":"string","description":"The price at which the order is set to execute, as a positive decimal string within the instrument's price precision and between its `min_price` and `max_price`"},"client_id":{"type":"string","format":"uuid","description":"Unique client identifier for the order. Must be a version 4 UUID. If omitted, one is generated. It is your responsibility for the uniqueness of the client_id, if you create multiple orders with the same client_id, any subsequent operation performed using this client_id will only apply to the latest"},"time_in_force":{"type":"string","description":"Defines the duration and conditions under which an order is considered valid in the market. Defaults to GOOD_TILL_CANCELLED","enum":["GOOD_TILL_CANCELLED","IMMEDIATE_OR_CANCELLED","FILL_OR_KILL","POST_ONLY"]},"reserve_price":{"type":"string","description":"Used for MOVE orders and is the max we can move to"},"take_profit":{"type":"object","description":"Take profit level attached to the order. Requires `tpsl_mode`. Unknown keys are rejected.","properties":{"value":{"type":"string","pattern":"^\\d+(\\.\\d+)?$","description":"The level, as a positive decimal string"},"type":{"type":"string","enum":["MID","BBO"],"default":"MID","description":"The price the level is watched against. `MID`: the midpoint of the best bid and the best ask. `BBO`: the side of the book the close hits, the best bid for a long, the best ask for a short"}},"required":["value"],"additionalProperties":false},"stop_loss":{"type":"object","description":"Stop loss level attached to the order. Requires `tpsl_mode`. Unknown keys are rejected.","properties":{"value":{"type":"string","pattern":"^\\d+(\\.\\d+)?$","description":"The level, as a positive decimal string"},"type":{"type":"string","enum":["MID","BBO"],"default":"MID","description":"The price the level is watched against. `MID`: the midpoint of the best bid and the best ask. `BBO`: the side of the book the close hits, the best bid for a long, the best ask for a short"}},"required":["value"],"additionalProperties":false},"tpsl_mode":{"type":"string","enum":["order","position"],"description":"Required when `take_profit` or `stop_loss` is sent. `order`: the TP/SL closes this order's filled amount. `position`: it closes the whole position on this instrument, as it is when a level is reached (futures only)."},"tpsl_force":{"type":"boolean","default":false,"description":"With `tpsl_mode: position`, replace the existing position take profit / stop loss on this instrument once this order fills, instead of failing with `POSITION_TPSL_EXISTS`."},"tpsl_slippage_bps":{"type":"integer","minimum":1,"maximum":9999,"description":"How far from its level the take profit / stop loss close may trade, in basis points. At most the instrument's price collar (`price_collar_percentage` × 100 on Instruments; 1000 for an instrument without one). Defaults to 500 (5%), or the collar if that is less. It cannot be changed later."}},"required":["instrument_code","type","side","amount","price"]},"b5f1085":{"get":{"summary":"Get Orders","description":"Returns a paginated list of orders, most recently updated first. Requires any valid API key. This endpoint is rate-limited per account holder.\n\nBy default, if no params are provided, will return all open orders. In this mode `from` and `to` are ignored.\n\nIf `with_cancelled_and_rejected` and/or `with_just_filled_inactive` is set to `true` and no `from`/`to` is given, the lookback starts at the beginning (00:00 UTC) of the previous day.\n\nA `from` and a `to` date can be provided. The **maximum** window size is 31 days. If a larger window is provided, you will receive a `400 INVALID_DATE_RANGE` error.\n\n`from`/`to` accept epoch (s, ms, µs or ns) or an ISO 8601 UTC timestamp ending in `Z` (or `YYYY-MM-DD`). `from` must be on or after 2024-01-01, not in the future, and strictly before `to`; `to` is inclusive.\n\n`cursor` is an opaque string. Pass the value from the previous response unchanged; it is absent on the last page.\n\nUnknown query parameters are rejected with `400 UNEXPECTED_PARAMETERS`.","tags":["Trading"],"parameters":[{"name":"from","in":"query","description":"Defines start of a query search. Ignored when returning open orders.","required":false,"example":"2025-02-13T16:00:00.000Z","schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","description":"Defines end of a query search (inclusive). Ignored when returning open orders.","required":false,"example":"2025-11-14T10:00:00.000Z","schema":{"type":"string","format":"date-time"}},{"name":"instrument_code","in":"query","description":"Instrument code to get orders for, e.g. BTC_EUR","required":false,"example":"BTC_EUR","schema":{"type":"string"}},{"name":"with_cancelled_and_rejected","in":"query","description":"Return orders which have been cancelled by the user before being filled or rejected by the system as invalid. Additionally, all inactive filled orders which would return with \"with_just_filled_inactive\".","required":false,"example":"false","schema":{"type":"boolean","default":false}},{"name":"with_just_filled_inactive","in":"query","description":"Return order history for orders which have been filled and are no longer open. Use of \"with_cancelled_and_rejected\" extends \"with_just_filled_inactive\" and in case both are specified the latter is ignored.","required":false,"example":"false","schema":{"type":"boolean","default":false}},{"name":"with_just_orders","in":"query","description":"Returns order history for orders but does not return any trades corresponding to the orders. It may be significantly faster and should be used if user is not interesting in trade information. Can be combined with any other filter.","required":false,"example":"true","schema":{"type":"boolean","default":false}},{"name":"max_page_size","in":"query","description":"Set max desired page size, from 1 to 100. If no value is provided, 100 results per page are returned. Values above 100 are rejected with `400 INVALID_PAGE_SIZE`.","required":false,"example":5,"schema":{"type":"integer","minimum":1,"maximum":100,"default":100}},{"name":"cursor","in":"query","description":"Opaque pagination cursor. Pass the `cursor` value from the previous response unchanged to get the next page.","required":false,"example":"eyJlcG9jaCI6IjE3MzE0ODg1NDE4NzY1NzAwMDAifQ==","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"order_history":{"type":"array","items":{"type":"object","properties":{"order":{"$ref":"#/x-ext/124f69b"},"trades":{"type":"array","items":{"type":"object","properties":{"fee":{"$ref":"#/x-ext/fa3eb14"},"trade":{"$ref":"#/x-ext/a5fea06"}},"required":["fee","trade"]}}},"required":["order","trades"]},"description":"The order history based on the specified request criteria"},"max_page_size":{"type":"integer","description":"The amount of items requested"},"cursor":{"type":"string","description":"Opaque cursor for the next page. Pass it unchanged as `cursor` in the next request. Absent on the last page."},"from":{"type":["string","null"],"format":"date-time","description":"Start of the queried window (ISO 8601, nanosecond precision), or null when none applies. Not present when there are no open orders."},"to":{"type":["string","null"],"format":"date-time","description":"End of the queried window (ISO 8601, nanosecond precision), or null when none applies. Not present when there are no open orders."}},"required":["order_history","max_page_size"]},"example":{"order_history":[{"order":{"account_id":"726288e6-a463-4f88-9068-024ae8f97a34","order_id":"74eaf796-869b-4d49-ab39-2bc4fe10daeb","client_id":"b8854ae6-4077-404b-ae0c-52a1fe318440","amount":"1","side":"SELL","instrument_code":"SOL_EUR","order_type":"API","price":"140","time":"2024-11-13T17:34:55.514Z","time_nanos":"2024-11-13T17:34:55.514123456Z","sequence":"58894260661","total_fee":"0.29","fee_currency":"EUR","time_last_updated":"2024-11-13T17:34:55.514Z","time_last_updated_nanos":"2024-11-13T17:34:55.514123456Z","order_book_sequence":"58894260661","filled_amount":"1","status":"FILLED_FULLY","average_price":"145.00"},"trades":[{"fee":{"fee_amount":"0.29","fee_currency":"EUR"},"trade":{"trade_id":"f99a7e64-5478-44f3-b404-19aac53f2062","order_id":"74eaf796-869b-4d49-ab39-2bc4fe10daeb","account_id":"726288e6-a463-4f88-9068-024ae8f97a34","amount":"1","filled_amount":"1","side":"SELL","instrument_code":"SOL_EUR","price":"145","time":"2024-11-13T17:34:55.514Z","time_nanos":"2024-11-13T17:34:55.514123456Z","sequence":"58894260661","matched_as":"MAKER","order_type":"API"}}]},{"order":{"account_id":"726288e6-a463-4f88-9068-024ae8f97a34","order_id":"d8e8e090-a142-4574-a875-36ef769eafe3","client_id":"89e6b540-2497-4d08-b777-9cf363940cab","amount":"3.3333","side":"BUY","instrument_code":"SOL_EUR","order_type":"API","price":"150","time":"2024-11-13T15:40:04.430Z","time_nanos":"2024-11-13T15:40:04.430981234Z","sequence":"58894259835","time_last_updated":"2024-11-13T15:40:04.430Z","time_last_updated_nanos":"2024-11-13T15:40:04.430981234Z","order_book_sequence":"58894259835","filled_amount":"0","status":"OPEN"},"trades":[]}],"from":"2024-11-12T00:00:00.000000000Z","to":"2024-11-13T18:00:00.000000000Z","max_page_size":2,"cursor":"eyJlcG9jaCI6IjE3MzE1MTY4MDQ0MzA5ODEyMzQifQ=="}}}},"400":{"description":"Invalid query. `error` is one of `UNEXPECTED_PARAMETERS`, `INVALID_PAGE_SIZE`, `INVALID_CURSOR`, `INVALID_FROM_TIMESTAMP`, `INVALID_TO_TIMESTAMP`, `INVALID_DATE_RANGE`, `INVALID_INSTRUMENT_CODE` or `INVALID_PARAMETERS` (invalid boolean).","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"2":{"summary":"Date range too large","value":{"error":"INVALID_DATE_RANGE","error_message":"Date range cannot exceed 31 days. Provided range was greater than 45 days"}},"3":{"summary":"Invalid cursor","value":{"error":"INVALID_CURSOR","error_message":"The cursor parameter is invalid or malformed"}},"4":{"summary":"Invalid page size","value":{"error":"INVALID_PAGE_SIZE","error_message":"max_page_size must be between 1 and 100, got: 500"}},"5":{"summary":"Unexpected parameter","value":{"error":"UNEXPECTED_PARAMETERS","error_message":"Unsupported parameter: limit. Allowed: from, to, instrument_code, max_page_size, cursor, with_cancelled_and_rejected, with_just_filled_inactive, with_just_orders"}}}}}},"401":{"description":"Unauthorized. The token was accepted by the gateway but rejected by the endpoint: `UNAUTHORIZED`, or `INVALID_REQUEST_SIGNATURE` when the API key requires signed requests and the signature is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"6":{"summary":"Unauthorized","value":{"error":"UNAUTHORIZED","error_message":"Unauthorized access"}},"7":{"summary":"Invalid signature","value":{"error":"INVALID_REQUEST_SIGNATURE","error_message":"The request signature is missing or invalid"}}}}}},"403":{"description":"Forbidden. Either the gateway rejected the token (`{\"message\":\"Forbidden\"}`), or the endpoint denied the request, e.g. `PERMISSION_DENIED` (API key lacks the required scope, or account not permitted) or `EXCHANGE_ACCOUNT_NOT_PROVISIONED`.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/x-ext/bd75d4a"},{"$ref":"#/x-ext/39f3a7e"}]},"examples":{"8":{"summary":"Gateway","value":{"message":"Forbidden"}},"9":{"summary":"Permission denied","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}},"10":{"summary":"Not provisioned","value":{"error":"EXCHANGE_ACCOUNT_NOT_PROVISIONED","error_message":"The account is authenticated but has no exchange account yet"}}}}}},"429":{"description":"Rate limit exceeded. Limits are per account holder per minute: 600 (retail), 2,000 (institutional), 10,000 (market maker).","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"TOO_MANY_REQUESTS","error_message":"Too many requests"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}},"security":[{"bearerAuth":[]}],"operationId":"getOrders"},"post":{"summary":"Create Order","description":"## Create a New Order\n\n> **Warning:** Ensure your API key has the `TRADE` scope. You can generate an API key through the One Trading UI.\n\nThis endpoint is rate-limited per account holder (see `429`).\n\nThis endpoint allows you to create a new order of type **LIMIT**.\n\n### Time in Force Options\nFor **LIMIT** orders, you can specify one of the following `time_in_force` options:\n- **GOOD_TILL_CANCELLED** (default): The order remains open until canceled.\n- **IMMEDIATE_OR_CANCELLED**: The order is filled immediately, either in full or partially, with any unfilled portion canceled.\n- **FILL_OR_KILL**: The order must be filled in full immediately; otherwise, it is canceled.\n- **POST_ONLY**: Ensures the order is added to the order book as a maker order and will be rejected if it would execute immediately as a taker order.\n\nIf no `time_in_force` is specified, **GOOD_TILL_CANCELLED** is assumed.\n\n### Order Size and Precision\nEach order must meet a minimum size requirement. You can retrieve this minimum, along with precision limitations, by querying the `/instruments` endpoint.\n\n**Note:** There is a global limit of 200 open orders per user across all markets.\n\n### Client ID for Order Tracking\nOptionally, you can set a `client_id` to track orders without waiting for the assigned `order_id`.\n\n**Important:** You are responsible for ensuring the uniqueness of each `client_id`. If multiple orders share the same `client_id`, only the newest order can be canceled via `client_id`; older orders will require the specific `order_id` or use of the \"Cancel All Orders\" endpoint.\n\n### Take Profit / Stop Loss\nYou can attach a take profit and/or stop loss (TP/SL) to the order. It is held in a separate service, not on the exchange itself, and when the price reaches a level, a reduce-only limit order is placed on the exchange to close for you.\n\n- `take_profit` and `stop_loss` are each `{ \"value\": \"<price>\", \"type\": \"MID\" | \"BBO\" }` (`type` defaults to `MID`). Send at least one.\n- `tpsl_mode` is required with them. `order` closes this order's filled amount. `position` closes the whole position on the instrument, as it is when the level is reached (futures only).\n- `tpsl_force: true`, in position mode, replaces the instrument's existing position TP/SL. Without it a second position TP/SL is refused with `POSITION_TPSL_EXISTS`.\n- `tpsl_slippage_bps` bounds the price of the close: a limit order at the level less the slippage when selling, or plus it when buying. Defaults to 500 (5%), or the instrument's price collar if that is less.\n\nThe TP/SL is registered under the order's `client_id` before the order is placed, and is `PENDING` until the order fills:\n\n- When the order first fills, the TP/SL becomes `ACTIVE`. A position TP/SL sent with `tpsl_force` replaces the existing one at that moment, not before: until then the existing one stays `ACTIVE`.\n- If the order is rejected, or is cancelled or closes without a fill, the TP/SL is cancelled with it.\n- If a level has already been reached when the TP/SL becomes `ACTIVE`, it could never fire, so it is cancelled instead (`VALIDATION_FAILED_AT_ACTIVATION`).\n- Once `ACTIVE`, the TP/SL no longer depends on the order: cancelling what is left of the order, or Cancel All Orders, leaves it in place. It ends when a level fires, when you cancel it, or when its position is closed or flips.\n\nA TP/SL is not an exchange order, so it does not appear in Get Orders. Read it back with [Get Exotic Orders (TP/SL)](/docs/exchange/rest/trading/get-exotic-orders-tp-sl), change its levels with [Update Exotic Order (TP/SL)](/docs/exchange/rest/trading/update-exotic-order-tp-sl) and cancel it with [Cancel Exotic Order (TP/SL)](/docs/exchange/rest/trading/cancel-exotic-order-tp-sl): by the order's `client_id`, or for a position TP/SL by `instrument_code`. To add one to an order or position you already have, use [Create Exotic Order (TP/SL)](/docs/exchange/rest/trading/create-exotic-order-tp-sl). Every change of state is sent on the WebSocket `ACCOUNT` channel.\n\nA TP/SL that is not accepted rejects the whole request and the order is not placed: see `400`, `409` and `503`.\n","tags":["Trading"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/x-ext/35cc10f"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"order_id":{"type":"string","format":"uuid"},"client_id":{"type":"string","format":"uuid"},"account_id":{"type":"string","format":"uuid"},"instrument_code":{"type":"string"},"time":{"type":"string","format":"date-time"},"side":{"type":"string","enum":["BUY","SELL"]},"price":{"type":"string"},"amount":{"type":"string"},"type":{"type":"string","enum":["LIMIT"]},"time_in_force":{"type":"string","enum":["GOOD_TILL_CANCELLED","IMMEDIATE_OR_CANCELLED","FILL_OR_KILL","POST_ONLY"],"description":"The time in force applied to the order (the requested value, or GOOD_TILL_CANCELLED by default)"},"status":{"type":"string","description":"Status reported by the exchange when the order was accepted, e.g. OPEN, FILL or FILLED_FULLY. Rejections are returned as `422` instead."}},"required":["order_id","client_id","account_id","instrument_code","time","side","price","amount","type","time_in_force","status"]},"example":{"order_id":"dc3239e2-e808-433a-8875-12ab7c537ce4","client_id":"58503f2b-ca87-4816-9338-93c443e6fdde","account_id":"726288e6-a463-4f88-9068-024ae8f97a34","instrument_code":"SOL_EUR","time":"2024-11-14T14:36:36.286Z","side":"SELL","price":"150","amount":"1","type":"LIMIT","time_in_force":"GOOD_TILL_CANCELLED","status":"OPEN"}}}},"400":{"description":"The request was invalid. Order validation errors return a message in `error`, e.g. `Invalid order.` when the body fails validation for any other reason. Take profit / stop loss errors return a code in `error` with `error_message`:\n\n- the TP/SL fields: `INVALID_EXOTIC_ORDER_REQUEST`, `INVALID_TPSL_MODE` (also when `take_profit` or `stop_loss` is sent without `tpsl_mode`), `INVALID_TPSL_FORCE`, `INVALID_TPSL_SLIPPAGE_BPS`, `INVALID_TAKE_PROFIT`, `INVALID_STOP_LOSS` or `MISSING_TP_SL`;\n- the exotic orders service: `MARKET_CLOSED`, `MARKET_NOT_FOUND`, `TPSL_OUTSIDE_PRICE_BAND`, `SLIPPAGE_ABOVE_PRICE_COLLAR`, `BELOW_MIN_ORDER_VALUE`, `SPOT_POSITION_MODE_UNSUPPORTED`, `SPOT_SELL_UNSUPPORTED`, `EXCHANGE_LOOKUP_FAILED`, or `EXOTIC_ORDER_REJECTED` for any other refusal (its code follows in `error_message`).","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"2":{"summary":"Invalid JSON","value":{"error":"Invalid JSON."}},"3":{"summary":"Invalid instrument","value":{"error":"Invalid instrument code."}},"4":{"summary":"Invalid side","value":{"error":"Invalid side."}},"5":{"summary":"Invalid type","value":{"error":"Invalid type."}},"6":{"summary":"Invalid amount","value":{"error":"Invalid amount."}},"7":{"summary":"Invalid amount precision","value":{"error":"Invalid amount precision."}},"8":{"summary":"Invalid price","value":{"error":"Invalid price."}},"9":{"summary":"Invalid price precision","value":{"error":"Invalid price precision."}},"10":{"summary":"Price too low","value":{"error":"Price too low."}},"11":{"summary":"Price too high","value":{"error":"Price too high."}},"12":{"summary":"Invalid time in force","value":{"error":"Invalid time in force."}},"13":{"summary":"Invalid client ID","value":{"error":"Invalid client ID."}},"14":{"summary":"Client ID not v4","value":{"error":"Client ID must be a v4 UUID."}},"15":{"summary":"Invalid take profit","value":{"error":"INVALID_TAKE_PROFIT","error_message":"take_profit must be an object with a positive decimal string value no greater than 9007199254740991 and a type of MID or BBO"}},"16":{"summary":"Missing TP/SL","value":{"error":"MISSING_TP_SL","error_message":"At least one of take_profit or stop_loss must be provided"}},"17":{"summary":"Invalid or missing TP/SL mode","value":{"error":"INVALID_TPSL_MODE","error_message":"tpsl_mode must be order or position"}},"18":{"summary":"Invalid TP/SL slippage","value":{"error":"INVALID_TPSL_SLIPPAGE_BPS","error_message":"tpsl_slippage_bps must be an integer from 1 to 9999"}},"19":{"summary":"TP/SL slippage over the price collar","value":{"error":"SLIPPAGE_ABOVE_PRICE_COLLAR","error_message":"The slippage is over the instrument's price collar, so the close could never place (maximum 1000 bps)"}},"20":{"summary":"TP/SL close below the minimum order value","value":{"error":"BELOW_MIN_ORDER_VALUE","error_message":"A take profit or stop loss would place an order below the market's minimum order value (SL, minimum 10)"}},"21":{"summary":"Position TP/SL on spot","value":{"error":"SPOT_POSITION_MODE_UNSUPPORTED","error_message":"A spot market has no position; a spot take profit / stop loss must use tpsl_mode order"}},"35":{"summary":"Invalid order","value":{"error":"Invalid order."}},"36":{"summary":"Invalid stop loss","value":{"error":"INVALID_STOP_LOSS","error_message":"stop_loss must be an object with a positive decimal string value no greater than 9007199254740991 and a type of MID or BBO"}},"37":{"summary":"TP/SL level on the wrong side of the price","value":{"error":"TPSL_OUTSIDE_PRICE_BAND","error_message":"A take profit or stop loss level is on the wrong side of the current price (SL against reference 64250.5)"}},"38":{"summary":"Market closed","value":{"error":"MARKET_CLOSED","error_message":"The market is closed"}},"39":{"summary":"Spot sell with TP/SL","value":{"error":"SPOT_SELL_UNSUPPORTED","error_message":"A spot take profit / stop loss can only protect a buy"}},"40":{"summary":"TP/SL rejected","value":{"error":"EXOTIC_ORDER_REJECTED","error_message":"The exotic orders service rejected the request: HTTP_400"}}}}}},"401":{"description":"Unauthorized. The token was accepted by the gateway but rejected by the endpoint: `UNAUTHORIZED`, or `INVALID_REQUEST_SIGNATURE` when the API key requires signed requests and the signature is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"22":{"summary":"Unauthorized","value":{"error":"UNAUTHORIZED","error_message":"Unauthorized access"}},"23":{"summary":"Invalid signature","value":{"error":"INVALID_REQUEST_SIGNATURE","error_message":"The request signature is missing or invalid"}}}}}},"403":{"description":"Forbidden. Either the gateway rejected the token (`{\"message\":\"Forbidden\"}`), the API key lacks the `TRADE` scope (`PERMISSION_DENIED`), the account has no exchange account (`EXCHANGE_ACCOUNT_NOT_PROVISIONED`), or the account is not permitted to trade the product.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/x-ext/bd75d4a"},{"$ref":"#/x-ext/39f3a7e"}]},"examples":{"24":{"summary":"Gateway","value":{"message":"Forbidden"}},"25":{"summary":"Missing scope","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}},"26":{"summary":"Not provisioned","value":{"error":"EXCHANGE_ACCOUNT_NOT_PROVISIONED","error_message":"The account is authenticated but has no exchange account yet"}},"27":{"summary":"Product not permitted","value":{"error":"You do not have permission to trade spot."}}}}}},"409":{"description":"The attached take profit / stop loss conflicts with an existing one.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"28":{"summary":"Position TP/SL exists","value":{"error":"POSITION_TPSL_EXISTS","error_message":"An active position take profit / stop loss already exists for this instrument; set tpsl_force to replace it (existing client_id 0d0b1f0c-7f0e-4f55-9a53-6f6f3c1c2a10)"}},"29":{"summary":"Already registered","value":{"error":"ORDER_ALREADY_EXISTS","error_message":"A take profit / stop loss is already registered for this client_id"}}}}}},"422":{"description":"The exchange rejected the order. `error` is either the rejection status (see OrderStatus) or the exchange's error message.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"30":{"summary":"Insufficient funds","value":{"error":"INSUFFICIENT_FUNDS"}},"31":{"summary":"Post only would match","value":{"error":"MATCHING_POST_ONLY_RESULTS_IN_MATCH"}}}}}},"429":{"description":"Rate limit exceeded. Limits are per account holder per minute: 600 (retail), 2,000 (institutional), 10,000 (market maker).","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"Too many requests."}}}},"500":{"description":"The order could not be confirmed. `Order response timeout` means the exchange did not confirm the order in time; the order may still have been created, so check it by `client_id` before retrying.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"33":{"summary":"Timeout","value":{"error":"Order response timeout"}},"34":{"summary":"TP/SL registration failed","value":{"error":"Failed to create order. Please try again."}}}}}},"503":{"description":"The market could not be checked for the attached take profit / stop loss. The order was not placed: try again.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"INSTRUMENTS_UNAVAILABLE","error_message":"The market could not be checked; try again"}}}}},"security":[{"bearerAuth":[]}],"operationId":"createOrder"},"delete":{"summary":"Cancel All Orders","description":"Submits a cancel request for all open orders of an account.\n\nOptionally the user can specify a list of `ids` representing order ids **or** a list of `client_ids`, and an `instrument_code`, as query parameters:\n- `instrument_code` alone cancels every open order on that instrument.\n- `ids` cancels those orders, regardless of the market they belong to. With `instrument_code`, only those orders on that instrument are cancelled.\n- `client_ids` cancels those orders and requires `instrument_code`: a client id is unique per instrument, not per account, so every listed client id must be on that instrument. To cancel by client id on several instruments, send one request per instrument.\n\nCalling this endpoint without any of the optional parameters will cancel all orders across all markets for the account. Calling it with both `ids` and `client_ids` is not supported.\n\n\n> **Tip:** One Trading will always fill orders with best effort. Therefore, when attempting to close all orders, these orders may be in the process of being filled. In this case, One Trading will attempt to close the orders but the order may already be partially/fully filled.\nMake sure to have a valid API key with the scope TRADE, otherwise this operation will be rejected. This endpoint is not rate-limited.\n\n### Response\nThe response lists the cancellations the exchange confirmed within a short window, not every order submitted for cancellation:\n- Without parameters or with only `instrument_code`, it contains the order ids confirmed within about 100 ms. A successful request can therefore return a partial or empty list; use `GET /v1/account/orders` to check what remains open.\n- With `ids`, it contains the order ids confirmed within 2 seconds. IDs of orders that do not exist are skipped.\n- With `client_ids`, it contains the **client ids** (not order ids) confirmed within 2 seconds.\n\n`ids` and `client_ids` must be wrapped in square brackets, e.g. `[id1,id2]`.","tags":["Trading"],"parameters":[{"name":"instrument_code","in":"query","description":"The instrument to cancel orders on. On its own, cancels every open order on the instrument; with `ids`, narrows the cancel to those orders on the instrument. Required with `client_ids`.","required":false,"example":"BTC_EUR","schema":{"type":"string"}},{"name":"ids","in":"query","description":"Array of comma separated order ids to cancel orders for","required":false,"example":"[d1efc79d-f78d-4a9d-a4c0-dbe76c9a4e6f,8ada8f2d-56ea-4b24-bfd4-06723dfbb3be]","schema":{"type":"string"}},{"name":"client_ids","in":"query","description":"Array of comma separated client ids to cancel orders for, all on `instrument_code` (required with this parameter)","required":false,"example":"[d1efc79d-f78d-4a9d-a4c0-dbe76c9a4e6f,8ada8f2d-56ea-4b24-bfd4-06723dfbb3be]","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"string","format":"uuid","description":"Order ids (or client ids when cancelling by `client_ids`) whose cancellation the exchange confirmed within the response window"}},"examples":{"1":{"summary":"Success Example","value":["7749a0ff-9a5f-41ac-a1a5-dc031a70091c","737f07d9-1711-49d0-a834-80b88329c101"]},"2":{"summary":"Nothing confirmed in the window","value":[]}}}}},"400":{"description":"Invalid parameters. `error` is `INVALID_PARAMETERS_NUMBER` (both `ids` and `client_ids`), `MISSING_INSTRUMENT_CODE` (`client_ids` without `instrument_code`), `INVALID_IDS` or `INVALID_CLIENT_IDS` (not a bracketed list of UUIDs).","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"3":{"summary":"Both ids and client_ids","value":{"error":"INVALID_PARAMETERS_NUMBER"}},"4":{"summary":"Invalid ids","value":{"error":"INVALID_IDS"}},"5":{"summary":"Invalid client ids","value":{"error":"INVALID_CLIENT_IDS"}},"12":{"summary":"Missing instrument code","value":{"error":"MISSING_INSTRUMENT_CODE"}}}}}},"401":{"description":"Unauthorized. The token was accepted by the gateway but rejected by the endpoint: `UNAUTHORIZED`, or `INVALID_REQUEST_SIGNATURE` when the API key requires signed requests and the signature is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"6":{"summary":"Unauthorized","value":{"error":"UNAUTHORIZED","error_message":"Unauthorized access"}},"7":{"summary":"Invalid signature","value":{"error":"INVALID_REQUEST_SIGNATURE","error_message":"The request signature is missing or invalid"}}}}}},"403":{"description":"Forbidden. Either the gateway rejected the token (`{\"message\":\"Forbidden\"}`), or the endpoint denied the request, e.g. `PERMISSION_DENIED` (API key lacks the required scope, or account not permitted) or `EXCHANGE_ACCOUNT_NOT_PROVISIONED`.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/x-ext/bd75d4a"},{"$ref":"#/x-ext/39f3a7e"}]},"examples":{"8":{"summary":"Gateway","value":{"message":"Forbidden"}},"9":{"summary":"Permission denied","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}},"10":{"summary":"Not provisioned","value":{"error":"EXCHANGE_ACCOUNT_NOT_PROVISIONED","error_message":"The account is authenticated but has no exchange account yet"}}}}}},"500":{"description":"The exchange failed to process the cancellation. `error` carries the exchange's message.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"Failed to cancel orders"}}}}},"security":[{"bearerAuth":[]}],"operationId":"cancelAllOrders"}},"a676059":{"get":{"summary":"Get Order by Client ID","description":"Get information about an existing order using the user or exchange generated client_id.\n\nWill only return orders with activity in the last 24 hours; older orders return `404`. Use `GET /v1/account/orders` for order history.\n\nIf several orders share the same `client_id`, the response is not guaranteed to describe only the latest one, so keep your client_ids unique.\n\nRequires any valid API key. This endpoint is rate-limited per account holder.","tags":["Trading"],"parameters":[{"name":"client_id","in":"path","description":"The client ID to fetch order details for","required":true,"example":"","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"order":{"$ref":"#/x-ext/124f69b"},"trades":{"type":"array","items":{"type":"object","properties":{"fee":{"$ref":"#/x-ext/fa3eb14"},"trade":{"$ref":"#/x-ext/a5fea06"}},"required":["fee","trade"]}}},"required":["order","trades"]},"example":{"order":{"account_id":"726288e6-a463-4f88-9068-024ae8f97a34","order_id":"74eaf796-869b-4d49-ab39-2bc4fe10daeb","client_id":"b8854ae6-4077-404b-ae0c-52a1fe318440","amount":"1","side":"SELL","instrument_code":"SOL_EUR","order_type":"API","price":"140","time":"2024-11-13T17:34:55.514Z","time_nanos":"2024-11-13T17:34:55.514123456Z","sequence":"58894260661","total_fee":"0.29","fee_currency":"EUR","time_last_updated":"2024-11-13T17:34:55.514Z","time_last_updated_nanos":"2024-11-13T17:34:55.514123456Z","order_book_sequence":"58894260661","filled_amount":"1","status":"FILLED_FULLY","average_price":"145.00"},"trades":[{"fee":{"fee_amount":"0.29","fee_currency":"EUR"},"trade":{"trade_id":"f99a7e64-5478-44f3-b404-19aac53f2062","order_id":"74eaf796-869b-4d49-ab39-2bc4fe10daeb","account_id":"726288e6-a463-4f88-9068-024ae8f97a34","amount":"1","filled_amount":"1","side":"SELL","instrument_code":"SOL_EUR","price":"145","time":"2024-11-13T17:34:55.514Z","time_nanos":"2024-11-13T17:34:55.514123456Z","sequence":"58894260661","matched_as":"MAKER","order_type":"API"}}]}}}},"400":{"description":"Invalid client ID. `error` is `INVALID_PARAMETERS`.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"INVALID_PARAMETERS","error_message":"Client ID must be a valid UUID"}}}},"401":{"description":"Unauthorized. The token was accepted by the gateway but rejected by the endpoint: `UNAUTHORIZED`, or `INVALID_REQUEST_SIGNATURE` when the API key requires signed requests and the signature is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"3":{"summary":"Unauthorized","value":{"error":"UNAUTHORIZED","error_message":"Unauthorized access"}},"4":{"summary":"Invalid signature","value":{"error":"INVALID_REQUEST_SIGNATURE","error_message":"The request signature is missing or invalid"}}}}}},"403":{"description":"Forbidden. Either the gateway rejected the token (`{\"message\":\"Forbidden\"}`), or the endpoint denied the request, e.g. `PERMISSION_DENIED` (API key lacks the required scope, or account not permitted) or `EXCHANGE_ACCOUNT_NOT_PROVISIONED`.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/x-ext/bd75d4a"},{"$ref":"#/x-ext/39f3a7e"}]},"examples":{"5":{"summary":"Gateway","value":{"message":"Forbidden"}},"6":{"summary":"Permission denied","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}},"7":{"summary":"Not provisioned","value":{"error":"EXCHANGE_ACCOUNT_NOT_PROVISIONED","error_message":"The account is authenticated but has no exchange account yet"}}}}}},"404":{"description":"No matching order was found within the lookback window.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"ORDER_NOT_FOUND","error_message":"Order not found."}}}},"429":{"description":"Rate limit exceeded. Limits are per account holder per minute: 600 (retail), 2,000 (institutional), 10,000 (market maker).","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"TOO_MANY_REQUESTS","error_message":"Too many requests"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}},"security":[{"bearerAuth":[]}],"operationId":"getOrderByClientId"},"delete":{"summary":"Cancel Order by Client ID","description":"Submits a request to cancel an open order by providing a valid `client_id` and the `instrument_code` of the order.\n\nA `client_id` is unique per instrument, not per account, so `instrument_code` is required.\n\n> **Note:** If you have created multiple orders with the same `client_id` on an instrument, only the most recent will be cancelled with this request. It is your responsibility to ensure uniqueness in your client_ids.\n\nThe call waits for the exchange to confirm the cancellation (up to 2 seconds). `client_id` must be a standard (RFC 9562) UUID.\n\nRequires an API key with the `TRADE` scope. This endpoint is not rate-limited.","tags":["Trading"],"parameters":[{"name":"client_id","in":"path","required":true,"example":"","schema":{"type":"string","format":"uuid"}},{"name":"instrument_code","in":"query","description":"The instrument the order is on. Required: a `client_id` is unique per instrument, not per account.","required":true,"example":"BTC_USDC","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"order_id":{"type":"string","format":"uuid"},"client_id":{"type":"string","format":"uuid"},"account_id":{"type":"string","format":"uuid"},"instrument_code":{"type":"string"},"time":{"type":"string","format":"date-time"},"side":{"type":"string"},"price":{"type":"string"},"amount":{"type":"string"},"type":{"type":"string","enum":["LIMIT"],"description":"Always LIMIT"},"status":{"type":"string","description":"Status of the first event the exchange sends for the order after the cancel request. Usually `CANCELLED`, but it can be another status, e.g. a fill, when the order was matching as the cancel arrived; check the order before relying on it."}},"required":["order_id","client_id","account_id","instrument_code","time","side","price","amount","type","status"]},"example":{"order_id":"e4cc5059-b6dd-4e7e-9d22-2d3576333fab","client_id":"316d076d-76f7-49c6-beb1-7831e0f93a9e","account_id":"726288e6-a463-4f88-9068-024ae8f97a34","instrument_code":"SOL_EUR","time":"2024-11-14T15:56:37.417Z","side":"SELL","price":"150","amount":"1","type":"LIMIT","status":"CANCELLED"}}}},"400":{"description":"Invalid identifier, or no `instrument_code`.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"1":{"summary":"Invalid client id","value":{"error":"Invalid client ID."}},"2":{"summary":"Missing instrument code","value":{"error":"Missing instrument code."}}}}}},"401":{"description":"Unauthorized. The token was accepted by the gateway but rejected by the endpoint: `UNAUTHORIZED`, or `INVALID_REQUEST_SIGNATURE` when the API key requires signed requests and the signature is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"3":{"summary":"Unauthorized","value":{"error":"UNAUTHORIZED","error_message":"Unauthorized access"}},"4":{"summary":"Invalid signature","value":{"error":"INVALID_REQUEST_SIGNATURE","error_message":"The request signature is missing or invalid"}}}}}},"403":{"description":"Forbidden. Either the gateway rejected the token (`{\"message\":\"Forbidden\"}`), or the endpoint denied the request, e.g. `PERMISSION_DENIED` (API key lacks the required scope, or account not permitted) or `EXCHANGE_ACCOUNT_NOT_PROVISIONED`.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/x-ext/bd75d4a"},{"$ref":"#/x-ext/39f3a7e"}]},"examples":{"5":{"summary":"Gateway","value":{"message":"Forbidden"}},"6":{"summary":"Permission denied","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}},"7":{"summary":"Not provisioned","value":{"error":"EXCHANGE_ACCOUNT_NOT_PROVISIONED","error_message":"The account is authenticated but has no exchange account yet"}}}}}},"404":{"description":"The exchange has no matching open order on that instrument.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"Order not found."}}}},"422":{"description":"The exchange could not cancel the order.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"Order unprocessable."}}}},"500":{"description":"`Order response timeout` means the exchange did not confirm the cancellation in time; check the order status before retrying.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"10":{"summary":"Timeout","value":{"error":"Order response timeout"}},"11":{"summary":"Server error","value":{"error":"Server error."}}}}}}},"security":[{"bearerAuth":[]}],"operationId":"cancelOrderByClientId"}},"5ff0eea":{"get":{"summary":"Get Order by Order ID","description":"Get information about an existing order using the exchange generated order_id.\n\nWill only return orders with activity in the last 24 hours; older orders return `404`. Use `GET /v1/account/orders` for order history.\n\nRequires any valid API key. This endpoint is rate-limited per account holder.","tags":["Trading"],"parameters":[{"name":"order_id","in":"path","description":"The order ID to fetch order details for","required":true,"example":"83c81e54-7384-47d4-09d1-57af45314fa1","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"order":{"$ref":"#/x-ext/124f69b"},"trades":{"type":"array","items":{"type":"object","properties":{"fee":{"$ref":"#/x-ext/fa3eb14"},"trade":{"$ref":"#/x-ext/a5fea06"}},"required":["fee","trade"]}}},"required":["order","trades"]},"example":{"order":{"account_id":"726288e6-a463-4f88-9068-024ae8f97a34","order_id":"74eaf796-869b-4d49-ab39-2bc4fe10daeb","client_id":"b8854ae6-4077-404b-ae0c-52a1fe318440","amount":"1","side":"SELL","instrument_code":"SOL_EUR","order_type":"API","price":"140","time":"2024-11-13T17:34:55.514Z","time_nanos":"2024-11-13T17:34:55.514123456Z","sequence":"58894260661","total_fee":"0.29","fee_currency":"EUR","time_last_updated":"2024-11-13T17:34:55.514Z","time_last_updated_nanos":"2024-11-13T17:34:55.514123456Z","order_book_sequence":"58894260661","filled_amount":"1","status":"FILLED_FULLY","average_price":"145.00"},"trades":[{"fee":{"fee_amount":"0.29","fee_currency":"EUR"},"trade":{"trade_id":"f99a7e64-5478-44f3-b404-19aac53f2062","order_id":"74eaf796-869b-4d49-ab39-2bc4fe10daeb","account_id":"726288e6-a463-4f88-9068-024ae8f97a34","amount":"1","filled_amount":"1","side":"SELL","instrument_code":"SOL_EUR","price":"145","time":"2024-11-13T17:34:55.514Z","time_nanos":"2024-11-13T17:34:55.514123456Z","sequence":"58894260661","matched_as":"MAKER","order_type":"API"}}]}}}},"400":{"description":"Invalid order ID. `error` is `INVALID_PARAMETERS`.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"INVALID_PARAMETERS","error_message":"Order ID must be a valid UUID"}}}},"401":{"description":"Unauthorized. The token was accepted by the gateway but rejected by the endpoint: `UNAUTHORIZED`, or `INVALID_REQUEST_SIGNATURE` when the API key requires signed requests and the signature is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"3":{"summary":"Unauthorized","value":{"error":"UNAUTHORIZED","error_message":"Unauthorized access"}},"4":{"summary":"Invalid signature","value":{"error":"INVALID_REQUEST_SIGNATURE","error_message":"The request signature is missing or invalid"}}}}}},"403":{"description":"Forbidden. Either the gateway rejected the token (`{\"message\":\"Forbidden\"}`), or the endpoint denied the request, e.g. `PERMISSION_DENIED` (API key lacks the required scope, or account not permitted) or `EXCHANGE_ACCOUNT_NOT_PROVISIONED`.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/x-ext/bd75d4a"},{"$ref":"#/x-ext/39f3a7e"}]},"examples":{"5":{"summary":"Gateway","value":{"message":"Forbidden"}},"6":{"summary":"Permission denied","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}},"7":{"summary":"Not provisioned","value":{"error":"EXCHANGE_ACCOUNT_NOT_PROVISIONED","error_message":"The account is authenticated but has no exchange account yet"}}}}}},"404":{"description":"No matching order was found within the lookback window.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"ORDER_NOT_FOUND","error_message":"Order not found."}}}},"429":{"description":"Rate limit exceeded. Limits are per account holder per minute: 600 (retail), 2,000 (institutional), 10,000 (market maker).","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"TOO_MANY_REQUESTS","error_message":"Too many requests"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}},"security":[{"bearerAuth":[]}],"operationId":"getOrderByOrderId"},"delete":{"summary":"Cancel Order by Order ID","description":"Submits a request to close an open order by providing a valid `order_id`. Optionally pass the order's `instrument_code`.\n\nThe call waits for the exchange to confirm the cancellation (up to 2 seconds).\n\nRequires an API key with the `TRADE` scope. This endpoint is not rate-limited.","tags":["Trading"],"parameters":[{"name":"order_id","in":"path","description":"The order ID of the order to cancel","required":true,"example":"","schema":{"type":"string","format":"uuid"}},{"name":"instrument_code","in":"query","description":"Optional. The instrument the order is on; the exchange then looks for the order on this instrument only, and an order on another instrument is not found (`404`).","required":false,"example":"BTC_USDC","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"order_id":{"type":"string","format":"uuid"},"client_id":{"type":"string","format":"uuid"},"account_id":{"type":"string","format":"uuid"},"instrument_code":{"type":"string"},"time":{"type":"string","format":"date-time"},"side":{"type":"string"},"price":{"type":"string"},"amount":{"type":"string"},"type":{"type":"string","enum":["LIMIT"],"description":"Always LIMIT"},"status":{"type":"string","description":"Status of the first event the exchange sends for the order after the cancel request. Usually `CANCELLED`, but it can be another status, e.g. a fill, when the order was matching as the cancel arrived; check the order before relying on it."}},"required":["order_id","client_id","account_id","instrument_code","time","side","price","amount","type","status"]},"example":{"order_id":"e4cc5059-b6dd-4e7e-9d22-2d3576333fab","client_id":"316d076d-76f7-49c6-beb1-7831e0f93a9e","account_id":"726288e6-a463-4f88-9068-024ae8f97a34","instrument_code":"SOL_EUR","time":"2024-11-14T15:56:37.417Z","side":"SELL","price":"150","amount":"1","type":"LIMIT","status":"CANCELLED"}}}},"400":{"description":"Invalid identifier.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"Invalid order ID."}}}},"401":{"description":"Unauthorized. The token was accepted by the gateway but rejected by the endpoint: `UNAUTHORIZED`, or `INVALID_REQUEST_SIGNATURE` when the API key requires signed requests and the signature is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"3":{"summary":"Unauthorized","value":{"error":"UNAUTHORIZED","error_message":"Unauthorized access"}},"4":{"summary":"Invalid signature","value":{"error":"INVALID_REQUEST_SIGNATURE","error_message":"The request signature is missing or invalid"}}}}}},"403":{"description":"Forbidden. Either the gateway rejected the token (`{\"message\":\"Forbidden\"}`), or the endpoint denied the request, e.g. `PERMISSION_DENIED` (API key lacks the required scope, or account not permitted) or `EXCHANGE_ACCOUNT_NOT_PROVISIONED`.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/x-ext/bd75d4a"},{"$ref":"#/x-ext/39f3a7e"}]},"examples":{"5":{"summary":"Gateway","value":{"message":"Forbidden"}},"6":{"summary":"Permission denied","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}},"7":{"summary":"Not provisioned","value":{"error":"EXCHANGE_ACCOUNT_NOT_PROVISIONED","error_message":"The account is authenticated but has no exchange account yet"}}}}}},"404":{"description":"The exchange has no matching open order (on `instrument_code`, when given).","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"Order not found."}}}},"422":{"description":"The exchange could not cancel the order.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"Order unprocessable."}}}},"500":{"description":"`Order response timeout` means the exchange did not confirm the cancellation in time; check the order status before retrying.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"10":{"summary":"Timeout","value":{"error":"Order response timeout"}},"11":{"summary":"Server error","value":{"error":"Server error."}}}}}}},"security":[{"bearerAuth":[]}],"operationId":"cancelOrderByOrderId"}},"8bbd742":{"title":"Balance","type":"object","properties":{"currency_code":{"type":"string","description":"Currency of the balance"},"available":{"type":"string","description":"The amount of the currency available to trade or withdraw"},"locked":{"type":"string","description":"The amount of the currency locked in orders"},"time":{"type":"string","description":"Time the response was generated (current server time, ISO 8601). It is not the time the balance last changed.","format":"date-time"}},"required":["currency_code","available","locked","time"]},"f34386d":{"get":{"summary":"Balances","description":"Returns the balance details for the account the token acts on (the main account or a subaccount).\n\n`account_equity`, `margin_used` and `margin_available` are expressed in USD, the collateral currency for futures. If balances cannot be retrieved from the exchange, the request fails with `500`.\n\n**Required API scope:** any valid API key. This endpoint is rate-limited.\n\nThis endpoint takes no query parameters. Unknown query parameters are rejected with `400 UNEXPECTED_PARAMETERS`.","tags":["Trading"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","format":"uuid","description":"The account the balances belong to."},"account_equity":{"type":"string","description":"Account equity in USD, as a decimal string."},"margin_available":{"type":"string","description":"`account_equity` minus `margin_used`, in USD, as a decimal string."},"margin_used":{"type":"string","description":"Margin used by open futures positions and orders, in USD, as a decimal string."},"balances":{"type":"array","items":{"$ref":"#/x-ext/8bbd742"}}},"required":["account_id","balances","account_equity","margin_available","margin_used"]},"example":{"account_id":"50034b63-9607-4801-810a-6ab00d185eca","account_equity":"171.83539848","margin_available":"171.83539848","margin_used":"0","balances":[{"currency_code":"USDC","available":"50.5359915","locked":"0","time":"2026-01-19T10:35:32.227Z"},{"currency_code":"SOL","available":"0.22381479","locked":"0","time":"2026-01-19T10:35:32.227Z"},{"currency_code":"USD","available":"23.19951955","locked":"0","time":"2026-01-19T10:35:32.227Z"},{"currency_code":"USDT","available":"0","locked":"0","time":"2026-01-19T10:35:32.227Z"},{"currency_code":"BTC","available":"0.00015998","locked":"0","time":"2026-01-19T10:35:32.227Z"},{"currency_code":"EUR","available":"85.80718666","locked":"0","time":"2026-01-19T10:35:32.227Z"},{"currency_code":"SUI","available":"10.93207","locked":"0","time":"2026-01-19T10:35:32.227Z"},{"currency_code":"XRP","available":"0","locked":"0","time":"2026-01-19T10:35:32.227Z"}]}}}},"400":{"description":"Invalid request. `UNEXPECTED_PARAMETERS` when any query parameter is sent.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"UNEXPECTED_PARAMETERS","error_message":"Unsupported parameter: currency_code. Allowed: "}}}},"401":{"description":"Unauthorized. The token was accepted by the gateway but rejected by the endpoint: `UNAUTHORIZED`, or `INVALID_REQUEST_SIGNATURE` when the API key requires signed requests and the signature is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"3":{"summary":"Unauthorized","value":{"error":"UNAUTHORIZED","error_message":"Unauthorized access"}},"4":{"summary":"Invalid signature","value":{"error":"INVALID_REQUEST_SIGNATURE","error_message":"The request signature is missing or invalid"}}}}}},"403":{"description":"Forbidden. Either the gateway rejected the token (`{\"message\":\"Forbidden\"}`), or the endpoint denied the request, e.g. `PERMISSION_DENIED` (API key lacks the required scope, or account not permitted) or `EXCHANGE_ACCOUNT_NOT_PROVISIONED`.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/x-ext/bd75d4a"},{"$ref":"#/x-ext/39f3a7e"}]},"examples":{"5":{"summary":"Gateway","value":{"message":"Forbidden"}},"6":{"summary":"Permission denied","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}},"7":{"summary":"Not provisioned","value":{"error":"EXCHANGE_ACCOUNT_NOT_PROVISIONED","error_message":"The account is authenticated but has no exchange account yet"}}}}}},"429":{"description":"Rate limit exceeded. Limits are per account holder per minute: 600 (retail), 2,000 (institutional), 10,000 (market maker).","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"TOO_MANY_REQUESTS","error_message":"Too many requests"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}},"security":[{"bearerAuth":[]}],"operationId":"balances"}},"9c79b9e":{"get":{"summary":"Subaccounts","description":"Returns every account owned by the authenticated account holder: the main account first, then each subaccount, with each account's balances and futures margin totals.\n\nThe list always covers the whole account holder, even when the token acts on a subaccount. Subaccounts that have been closed are included with `state: CLOSED`. The main account is returned with `name: main`, `state: ACTIVE` and a placeholder `created` of `1970-01-01T00:00:00.000Z`.\n\n`account_equity`, `margin_used` and `margin_available` are expressed in USD, the collateral currency for futures. An account the exchange has no balances for (e.g. one not yet provisioned on the exchange) has an empty `balances` array and `\"0\"` for the account totals. If the balances cannot be read from the exchange at all, the request fails with `500`.\n\n**Required API scope:** any valid API key. This endpoint is not rate-limited and takes no query parameters.","operationId":"getSubaccounts","tags":["Trading"],"responses":{"200":{"description":"The main account followed by every subaccount of the account holder.","content":{"application/json":{"schema":{"type":"object","properties":{"account_holder":{"type":"string","format":"uuid","description":"ID of the account holder (the main account)."},"subaccounts":{"type":"array","items":{"type":"object","properties":{"account_id":{"type":"string","format":"uuid","description":"ID of the account. For the main account this is the account holder ID."},"state":{"type":"string","enum":["ACTIVE","CLOSED"],"description":"`ACTIVE` or `CLOSED`. The main account is always `ACTIVE`. Closed subaccounts are still listed."},"name":{"type":"string","description":"Name of the account. The main account is always `main`."},"created":{"type":"string","format":"date-time","description":"When the subaccount was created (ISO 8601). The main account always returns `1970-01-01T00:00:00.000Z`."},"account_equity":{"type":"string","description":"Account equity in USD, as a decimal string."},"margin_available":{"type":"string","description":"`account_equity` minus `margin_used`, in USD, as a decimal string."},"margin_used":{"type":"string","description":"Margin used by open futures positions and orders, in USD, as a decimal string."},"balances":{"type":"array","items":{"$ref":"#/x-ext/8bbd742"},"description":"Balance per currency held by the account."}},"required":["account_id","state","name","created","account_equity","margin_available","margin_used","balances"]},"description":"The main account first, then every subaccount."}},"required":["account_holder","subaccounts"]},"example":{"account_holder":"50034b63-9607-4801-810a-6ab00d185eca","subaccounts":[{"account_id":"50034b63-9607-4801-810a-6ab00d185eca","state":"ACTIVE","name":"main","created":"1970-01-01T00:00:00.000Z","account_equity":"171.83539848","margin_available":"171.83539848","margin_used":"0","balances":[{"currency_code":"EUR","available":"85.80718666","locked":"0","time":"2026-10-06T09:12:44.513Z"},{"currency_code":"BTC","available":"0.00015998","locked":"0","time":"2026-10-06T09:12:44.513Z"},{"currency_code":"USDC","available":"50.5359915","locked":"10","time":"2026-10-06T09:12:44.513Z"}]},{"account_id":"8f2b6c1e-0a9d-4c7e-9b21-2f5d3a1c4e6a","state":"ACTIVE","name":"market-making","created":"2026-03-14T08:21:05.112Z","account_equity":"2500.00","margin_available":"1875.40","margin_used":"624.60","balances":[{"currency_code":"USDC","available":"2500","locked":"0","time":"2026-10-06T09:12:44.513Z"}]},{"account_id":"3c7a1d40-6b2e-4f88-9a10-7e5c2b9f0d13","state":"CLOSED","name":"old-strategy","created":"2025-11-02T16:40:19.870Z","account_equity":"0","margin_available":"0","margin_used":"0","balances":[]}]}}}},"401":{"description":"Unauthorized. The token was accepted by the gateway but rejected by the endpoint: `UNAUTHORIZED`, or `INVALID_REQUEST_SIGNATURE` when the API key requires signed requests and the signature is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"unauthorized":{"summary":"Unauthorized","value":{"error":"UNAUTHORIZED","error_message":"Unauthorized access"}},"invalidSignature":{"summary":"Invalid signature","value":{"error":"INVALID_REQUEST_SIGNATURE","error_message":"The request signature is missing or invalid"}}}}}},"403":{"description":"Forbidden. Either the gateway rejected the token (`{\"message\":\"Forbidden\"}`), the account has no exchange account yet (`EXCHANGE_ACCOUNT_NOT_PROVISIONED`), or the token does not identify an account holder (`Permission denied.`).","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/x-ext/bd75d4a"},{"$ref":"#/x-ext/39f3a7e"}]},"examples":{"gateway":{"summary":"Gateway","value":{"message":"Forbidden"}},"notProvisioned":{"summary":"Not provisioned","value":{"error":"EXCHANGE_ACCOUNT_NOT_PROVISIONED","error_message":"The account is authenticated but has no exchange account yet"}},"permissionDenied":{"summary":"Permission denied","value":{"error":"Permission denied."}}}}}},"500":{"description":"Unexpected server error. `error` holds a human-readable message.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"Server error."}}}}},"security":[{"bearerAuth":[]}]}},"492a305":{"title":"FeeRunningVolume","type":"object","properties":{"fee_group_id":{"type":"string","description":"The ID of the fee group for this volume information","enum":["SPOT","FUTURES"]},"volume":{"type":"number","description":"The volume traded for this particular product type, rounded to 2 decimal places."},"currency":{"type":"string","description":"The currency representing the volume traded (always `USD`)."}},"required":["fee_group_id","volume","currency"]},"7cd90eb":{"title":"FeeActiveTier","type":"object","properties":{"fee_group_id":{"type":"string","description":"The ID of the fee group for this volume information","enum":["SPOT","FUTURES"]},"volume":{"type":"number","description":"The volume at which this fee tier became active"},"maker_fee":{"type":"string","description":"The percentage fee when a trade is executed as MAKER, as a string with 4 decimal places (e.g. `\"0.1000\"` is 0.1%)."},"taker_fee":{"type":"string","description":"The percentage fee when a trade is executed as TAKER, as a string with 4 decimal places (e.g. `\"0.2000\"` is 0.2%)."},"custom":{"type":"boolean","const":true,"description":"Present, and always `true`, when custom fee rates apply to the account. `maker_fee` and `taker_fee` then show the custom rates rather than the tier's."}},"required":["fee_group_id","volume","maker_fee","taker_fee"]},"a366675":{"get":{"summary":"Fees","description":"Current fees for the account. Traded volume is combined across the main account and all its subaccounts, so every account of the same account holder gets the same fee tier.\nThere are separate fee bands for each product type (`SPOT` and `FUTURES`).\n\n**Required API scope:** any valid API key.","tags":["Trading"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","format":"uuid","description":"The account id the fees have been requested for. Note, fees are calculated and applied across all accounts."},"running_volumes":{"type":"array","items":{"$ref":"#/x-ext/492a305"},"description":"The current traded volumes for each product type"},"active_fee_tiers":{"type":"array","items":{"$ref":"#/x-ext/7cd90eb"},"description":"The fee tier for each product type which is active for the account."}},"required":["account_id","running_volumes","active_fee_tiers"]},"example":{"account_id":"726288e6-a463-4f88-9068-024ae8f97a34","running_volumes":[{"fee_group_id":"SPOT","volume":349.68,"currency":"USD"},{"fee_group_id":"FUTURES","volume":149.31,"currency":"USD"}],"active_fee_tiers":[{"fee_group_id":"SPOT","volume":0,"maker_fee":"0.1000","taker_fee":"0.2000"},{"fee_group_id":"FUTURES","volume":0,"maker_fee":"0.1000","taker_fee":"0.2000"}]}}}},"401":{"description":"Unauthorized. The token was accepted by the gateway but rejected by the endpoint: `UNAUTHORIZED`, or `INVALID_REQUEST_SIGNATURE` when the API key requires signed requests and the signature is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"2":{"summary":"Unauthorized","value":{"error":"UNAUTHORIZED","error_message":"Unauthorized access"}},"3":{"summary":"Invalid signature","value":{"error":"INVALID_REQUEST_SIGNATURE","error_message":"The request signature is missing or invalid"}}}}}},"403":{"description":"Forbidden. Either the gateway rejected the token (`{\"message\":\"Forbidden\"}`), or the endpoint denied the request, e.g. `PERMISSION_DENIED` (API key lacks the required scope, or account not permitted) or `EXCHANGE_ACCOUNT_NOT_PROVISIONED`.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/x-ext/bd75d4a"},{"$ref":"#/x-ext/39f3a7e"}]},"examples":{"4":{"summary":"Gateway","value":{"message":"Forbidden"}},"5":{"summary":"Permission denied","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}},"6":{"summary":"Not provisioned","value":{"error":"EXCHANGE_ACCOUNT_NOT_PROVISIONED","error_message":"The account is authenticated but has no exchange account yet"}}}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}},"security":[{"bearerAuth":[]}],"operationId":"fees"}},"73abb7d":{"get":{"summary":"Get Trades for Order","description":"Get list of trades for a specific order, oldest first.\n\nAn unknown order ID, or an order without trades, returns `200` with an empty `trade_history`.\n\nRequires any valid API key. This endpoint is rate-limited per account holder.","tags":["Trading"],"parameters":[{"name":"order_id","in":"path","description":"The order ID to get trades for","required":true,"example":"e9765da8-1861-4cc8-1af3-6f89b079941a","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"trade_history":{"type":"array","items":{"type":"object","properties":{"fee":{"$ref":"#/x-ext/fa3eb14"},"trade":{"$ref":"#/x-ext/a5fea06"}},"required":["fee","trade"]}}},"required":["trade_history"]},"example":{"trade_history":[{"fee":{"fee_amount":"0.29","fee_currency":"EUR"},"trade":{"account_id":"726288e6-a463-4f88-9068-024ae8f97a34","order_id":"ff119f4e-7918-4bec-8816-75d5b57865d1","trade_id":"a7b6f4f8-0278-40a1-a435-7d02f93bafd0","time":"2024-11-14T10:26:57.241Z","time_nanos":"2024-11-14T10:26:57.241123456Z","instrument_code":"SOL_EUR","side":"SELL","matched_as":"MAKER","time_in_force":"GOOD_TILL_CANCELLED","order_type":"API","price":"145","amount":"1","filled_amount":"1","sequence":"58894265752"}}]}}}},"400":{"description":"Invalid order ID. `error` is `INVALID_PARAMETERS`.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"INVALID_PARAMETERS","error_message":"Order ID must be a valid UUID"}}}},"401":{"description":"Unauthorized. The token was accepted by the gateway but rejected by the endpoint: `UNAUTHORIZED`, or `INVALID_REQUEST_SIGNATURE` when the API key requires signed requests and the signature is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"3":{"summary":"Unauthorized","value":{"error":"UNAUTHORIZED","error_message":"Unauthorized access"}},"4":{"summary":"Invalid signature","value":{"error":"INVALID_REQUEST_SIGNATURE","error_message":"The request signature is missing or invalid"}}}}}},"403":{"description":"Forbidden. Either the gateway rejected the token (`{\"message\":\"Forbidden\"}`), or the endpoint denied the request, e.g. `PERMISSION_DENIED` (API key lacks the required scope, or account not permitted) or `EXCHANGE_ACCOUNT_NOT_PROVISIONED`.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/x-ext/bd75d4a"},{"$ref":"#/x-ext/39f3a7e"}]},"examples":{"5":{"summary":"Gateway","value":{"message":"Forbidden"}},"6":{"summary":"Permission denied","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}},"7":{"summary":"Not provisioned","value":{"error":"EXCHANGE_ACCOUNT_NOT_PROVISIONED","error_message":"The account is authenticated but has no exchange account yet"}}}}}},"429":{"description":"Rate limit exceeded. Limits are per account holder per minute: 600 (retail), 2,000 (institutional), 10,000 (market maker).","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"TOO_MANY_REQUESTS","error_message":"Too many requests"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}},"security":[{"bearerAuth":[]}],"operationId":"getTradesForOrder"}},"86e6c02":{"get":{"summary":"Get Trade by Trade ID","description":"Get information about an executed trade using the exchange generated trade_id. Only trades of the account the token acts on are found; a trade of another subaccount returns `404`.\n\n**Required API scope:** any valid API key. This endpoint is rate-limited.","tags":["Trading"],"parameters":[{"name":"trade_id","in":"path","description":"The trade ID to fetch trade details for","required":true,"example":"","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"fee":{"$ref":"#/x-ext/fa3eb14"},"trade":{"$ref":"#/x-ext/a5fea06"}},"required":["fee","trade"]},"example":{"fee":{"fee_amount":"0.0020505","fee_currency":"USD"},"trade":{"account_id":"aaaba8bd-3195-4f72-87ff-98720a940f23","order_id":"71912cd5-1df2-4c14-3e59-377765d23b01","trade_id":"aa765409-4719-5358-b27a-3fabedf27164","time":"2025-12-02T11:32:32.515Z","time_nanos":"2025-12-02T11:32:32.515915000Z","instrument_code":"DOGE_USD_P","side":"BUY","matched_as":"TAKER","time_in_force":"GOOD_TILL_CANCELLED","order_type":"API","price":"0.1367","amount":"100","filled_amount":"100","sequence":"92096745784","open_position_amount":"0","position_id":"1764675149939364"}}}}},"400":{"description":"`trade_id` is not a valid UUID.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"INVALID_PARAMETERS","error_message":"Invalid trade ID."}}}},"401":{"description":"Unauthorized. The token was accepted by the gateway but rejected by the endpoint: `UNAUTHORIZED`, or `INVALID_REQUEST_SIGNATURE` when the API key requires signed requests and the signature is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"3":{"summary":"Unauthorized","value":{"error":"UNAUTHORIZED","error_message":"Unauthorized access"}},"4":{"summary":"Invalid signature","value":{"error":"INVALID_REQUEST_SIGNATURE","error_message":"The request signature is missing or invalid"}}}}}},"403":{"description":"Forbidden. Either the gateway rejected the token (`{\"message\":\"Forbidden\"}`), or the endpoint denied the request, e.g. `PERMISSION_DENIED` (API key lacks the required scope, or account not permitted) or `EXCHANGE_ACCOUNT_NOT_PROVISIONED`.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/x-ext/bd75d4a"},{"$ref":"#/x-ext/39f3a7e"}]},"examples":{"5":{"summary":"Gateway","value":{"message":"Forbidden"}},"6":{"summary":"Permission denied","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}},"7":{"summary":"Not provisioned","value":{"error":"EXCHANGE_ACCOUNT_NOT_PROVISIONED","error_message":"The account is authenticated but has no exchange account yet"}}}}}},"404":{"description":"No trade with this ID exists for the account.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"TRADE_NOT_FOUND","error_message":"Trade not found."}}}},"429":{"description":"Rate limit exceeded. Limits are per account holder per minute: 600 (retail), 2,000 (institutional), 10,000 (market maker).","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"TOO_MANY_REQUESTS","error_message":"Too many requests"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}},"security":[{"bearerAuth":[]}],"operationId":"getTradeByTradeId"}},"67d8dc2":{"get":{"summary":"Get Trades","description":"Retrieves trades of the account the token acts on, executed within the specified date range, sorted by timestamp in descending order (use `order=ASC` for ascending).\n\n### Parameter Specification\n\n| Parameter       | Accepted Formats | Example Values |\n|-----------------|----------------|----------------|\n| `from`          | ISO 8601 (UTC, ending in `Z`) | `2025-09-25T13:45:30Z` (s), `2025-09-25T13:45:30.123Z` (ms), `2025-09-25T13:45:30.123456Z` (us) |\n|                 | Epoch           | `1695647130` (s), `1695647130123` (ms), `1695647130123456` (us), `1695647130123456789` (ns) |\n|                 | Date            | `2025-09-25` |\n| `to`            | ISO 8601 (UTC, ending in `Z`) | `2025-09-26T18:00:00Z` (s), `2025-09-26T18:00:00.456Z` (ms), `2025-09-26T18:00:00.456789Z` (us) |\n|                 | Epoch           | `1695734400` (s), `1695734400456` (ms), `1695734400456789` (us), `1695734400456789123` (ns) |\n|                 | Date            | `2025-09-26` |\n| `instrument_code` | String         | `BTC_EUR_P` (a single instrument code) |\n| `order`          | String         | `ASC` or `DESC` |\n| `max_page_size`  | Integer        | 3 |\n| `cursor`         | String         | `eyJlcG9jaCI6IjE3NjQ2NzUxNDk5MzkzNjQwMDEiLCJjcW8iOiIyMTA1MzM3MTM0NDYxMjU3In0=` |\n\n### Parameter Limits\n\n| Parameter         | Constraints / Range |\n|------------------|-------------------|\n| `from`           | On or after 2024-01-01; cannot be in the future |\n| `to`             | On or after 2024-01-01; must be strictly after `from` and no more than 30 days after `from`; exclusive |\n| `max_page_size`  | Integer between **1** and **100** |\n| `instrument_code` | Optional; must be a valid instrument code |\n| `order`          | Optional; `ASC` or `DESC` (case-insensitive) |\n\n### Parameter Defaults\n\n| Parameter(s)    | Default Behavior |\n|-----------------|-----------------|\n| `from` / `to`   | Neither provided: `from` = midnight UTC of the previous day, `to` = present time |\n| `from` / `to`   | Only `from` provided: `to` = 1 day later or present time, whichever is smaller |\n| `from` / `to`   | Only `to` provided: `from` = midnight UTC of the day before `to` |\n| `instrument_code`| Defaults to all instruments |\n| `order`         | Defaults to `DESC` |\n| `max_page_size` | Defaults to 100 |\n\n`from`/`to` accept epoch (s, ms, µs or ns) or an ISO 8601 UTC timestamp ending in `Z` (or `YYYY-MM-DD`). `from` must be on or after 2024-01-01, not in the future, and strictly before `to`; `to` is exclusive.\n\n`cursor` is an opaque string. Pass the value from the previous response unchanged; it is `null` on the last page.\n\nUnknown query parameters are rejected with `400 UNEXPECTED_PARAMETERS`.\n\n**Required API scope:** any valid API key. This endpoint is rate-limited.","tags":["Trading"],"parameters":[{"name":"from","in":"query","description":"Specifies the start of the period (inclusive). Accepts date strings (YYYY-MM-DD), ISO 8601 UTC strings ending in `Z`, or numeric timestamps in seconds, milliseconds, microseconds or nanoseconds.","required":false,"example":"2026-01-01","schema":{"type":"string"}},{"name":"to","in":"query","description":"Specifies the end of the period (exclusive). Accepts date strings (YYYY-MM-DD), ISO 8601 UTC strings ending in `Z`, or numeric timestamps in seconds, milliseconds, microseconds or nanoseconds.","required":false,"example":"2026-01-30","schema":{"type":"string"}},{"name":"instrument_code","in":"query","description":"Instrument code to filter by, e.g. `BTC_EUR_P`. Defaults to all instruments.","required":false,"schema":{"type":"string"}},{"name":"max_page_size","in":"query","description":"Set max desired page size, between 1 and 100. If no value is provided, by default a maximum of 100 results per page are returned.","required":false,"example":"2","schema":{"type":"string"}},{"name":"cursor","in":"query","description":"Opaque pointer to the next page, taken unchanged from the `cursor` of the previous response.","required":false,"schema":{"type":"string"}},{"name":"order","in":"query","description":"Sort order by trade time. `DESC` (default) or `ASC`, case-insensitive.","required":false,"schema":{"type":"string","enum":["ASC","DESC"],"default":"DESC"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"trade_history":{"type":"array","items":{"type":"object","properties":{"fee":{"$ref":"#/x-ext/fa3eb14"},"trade":{"$ref":"#/x-ext/a5fea06"}},"required":["fee","trade"]}},"max_page_size":{"type":"integer","description":"The page size applied to this request."},"cursor":{"type":["string","null"],"description":"Opaque cursor for the next page. Pass it unchanged as the `cursor` query parameter; `null` on the last page."},"from":{"type":"string","format":"date-time","description":"Start of the queried period (ISO 8601, nanosecond precision), after defaults are applied."},"to":{"type":"string","format":"date-time","description":"End of the queried period (ISO 8601, nanosecond precision, exclusive), after defaults are applied."}},"required":["trade_history","from","to","max_page_size","cursor"]},"example":{"trade_history":[{"fee":{"fee_amount":"0.0020505","fee_currency":"USD"},"trade":{"account_id":"aaaba8bd-3195-4f72-87ff-98720a940f23","order_id":"71912cd5-1df2-4c14-3e59-377765d23b01","trade_id":"aa765409-4719-5358-b27a-3fabedf27164","time":"2025-12-02T11:32:32.515Z","time_nanos":"2025-12-02T11:32:32.515915000Z","instrument_code":"DOGE_USD_P","side":"BUY","matched_as":"TAKER","time_in_force":"GOOD_TILL_CANCELLED","order_type":"API","price":"0.1367","amount":"100","filled_amount":"100","sequence":"92096745784","open_position_amount":"0","position_id":"1764675149939364"}},{"fee":{"fee_amount":"0.002052","fee_currency":"USD"},"trade":{"account_id":"aaaba8bd-3195-4f72-87ff-98720a940f23","order_id":"02f52442-066e-4ebb-3f85-fbe8010d2861","trade_id":"ed076827-96b9-52af-80fa-b516fd2c02c1","time":"2025-12-02T11:32:29.939Z","time_nanos":"2025-12-02T11:32:29.939364000Z","instrument_code":"DOGE_USD_P","side":"BUY","matched_as":"TAKER","time_in_force":"GOOD_TILL_CANCELLED","order_type":"API","price":"0.1368","amount":"100","filled_amount":"100","sequence":"92096745379","open_position_amount":"100","position_id":"1764675149939364"}}],"from":"2025-12-01T00:00:00.000000000Z","to":"2025-12-02T12:00:00.000000000Z","max_page_size":2,"cursor":"eyJlcG9jaCI6IjE3NjQ2NzUxNDk5MzkzNjQwMDEiLCJjcW8iOiIyMTA1MzM3MTM0NDYxMjU3In0="}}}},"400":{"description":"Invalid query parameters. Possible codes: `INVALID_FROM_TIMESTAMP`, `INVALID_TO_TIMESTAMP`, `INVALID_DATE_RANGE`, `INVALID_PAGE_SIZE`, `INVALID_ORDER`, `INVALID_CURSOR`, `INVALID_INSTRUMENT_CODE`, `UNEXPECTED_PARAMETERS`.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"2":{"summary":"INVALID_FROM_TIMESTAMP","value":{"error":"INVALID_FROM_TIMESTAMP","error_message":"From date cannot be in the future"}},"3":{"summary":"INVALID_TO_TIMESTAMP","value":{"error":"INVALID_TO_TIMESTAMP","error_message":"To date must be a valid date format"}},"4":{"summary":"INVALID_DATE_RANGE","value":{"error":"INVALID_DATE_RANGE","error_message":"Date range cannot exceed 30 days. Provided range was greater than 31 days"}},"5":{"summary":"INVALID_PAGE_SIZE","value":{"error":"INVALID_PAGE_SIZE","error_message":"max_page_size must be between 1 and 100, got: 200"}},"6":{"summary":"INVALID_ORDER","value":{"error":"INVALID_ORDER","error_message":"order must be 'ASC' or 'DESC', got: newest"}},"7":{"summary":"INVALID_CURSOR","value":{"error":"INVALID_CURSOR","error_message":"The cursor parameter is invalid or malformed"}},"8":{"summary":"INVALID_INSTRUMENT_CODE","value":{"error":"INVALID_INSTRUMENT_CODE","error_message":"Invalid instrument codes: FOO_EUR. Valid codes: BTC_EUR, ETH_EUR, BTC_EUR_P, ..."}},"9":{"summary":"UNEXPECTED_PARAMETERS","value":{"error":"UNEXPECTED_PARAMETERS","error_message":"Unsupported parameter: limit. Allowed: from, to, instrument_code, cursor, order, max_page_size"}}}}}},"401":{"description":"Unauthorized. The token was accepted by the gateway but rejected by the endpoint: `UNAUTHORIZED`, or `INVALID_REQUEST_SIGNATURE` when the API key requires signed requests and the signature is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"10":{"summary":"Unauthorized","value":{"error":"UNAUTHORIZED","error_message":"Unauthorized access"}},"11":{"summary":"Invalid signature","value":{"error":"INVALID_REQUEST_SIGNATURE","error_message":"The request signature is missing or invalid"}}}}}},"403":{"description":"Forbidden. Either the gateway rejected the token (`{\"message\":\"Forbidden\"}`), or the endpoint denied the request, e.g. `PERMISSION_DENIED` (API key lacks the required scope, or account not permitted) or `EXCHANGE_ACCOUNT_NOT_PROVISIONED`.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/x-ext/bd75d4a"},{"$ref":"#/x-ext/39f3a7e"}]},"examples":{"12":{"summary":"Gateway","value":{"message":"Forbidden"}},"13":{"summary":"Permission denied","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}},"14":{"summary":"Not provisioned","value":{"error":"EXCHANGE_ACCOUNT_NOT_PROVISIONED","error_message":"The account is authenticated but has no exchange account yet"}}}}}},"429":{"description":"Rate limit exceeded. Limits are per account holder per minute: 600 (retail), 2,000 (institutional), 10,000 (market maker).","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"TOO_MANY_REQUESTS","error_message":"Too many requests"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}},"security":[{"bearerAuth":[]}],"operationId":"getTrades"}},"fc76365":{"get":{"summary":"Get Exotic Orders (TP/SL)","description":"## Get Exotic Orders (TP/SL)\n\n> **Warning:** Ensure your API key has the `TRADE` scope. You can generate an API key through the One Trading UI.\n\nThis endpoint is rate-limited per account holder (see `429`).\n\nReturns the account's exotic orders, its take profit / stop loss orders (TP/SLs), that are still live: `PENDING`, `ACTIVE` or `TRIGGERED`. This is where a TP/SL attached with [Create Order](/docs/exchange/rest/trading/create-order) is read back: it is held in a separate service, not on the exchange itself, until a level is reached, so it never appears in Get Orders.\n\n- With no parameters, every live TP/SL of the account, a page at a time: pass the `cursor` of one page to get the next.\n- `instrument_code` and `status` narrow the list. A narrowed list is returned in one page, and its `cursor` is `null`. `limit` still applies, so a narrowed list can end early with no cursor to fetch the rest: raise `limit` (up to 100) to see more.\n- `client_id` returns that one TP/SL in `orders`, whatever its status, finished ones included. The other parameters are ignored.\n\nEach TP/SL carries a `version`, which Update Exotic Order (TP/SL) needs.","tags":["Trading"],"parameters":[{"name":"client_id","in":"query","description":"Return this one TP/SL, in any status. For a TP/SL attached to an order, the order's `client_id`.","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"instrument_code","in":"query","description":"Only TP/SLs on this instrument.","required":false,"example":"BTC_USD_P","schema":{"type":"string"}},{"name":"status","in":"query","description":"Only TP/SLs in this status.","required":false,"schema":{"type":"string","enum":["PENDING","ACTIVE","TRIGGERED"]}},{"name":"limit","in":"query","description":"The most TP/SLs to return, from 1 to 100.","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","description":"The `cursor` of the previous page.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"orders":{"type":"array","items":{"type":"object","description":"A take profit / stop loss.","properties":{"client_id":{"type":"string","format":"uuid","description":"Identifier of the TP/SL: use it to read, update or cancel it. For a TP/SL attached to an order, it is that order's `client_id`."},"instrument_code":{"type":"string","description":"The instrument, e.g. `BTC_USD_P`."},"order_kind":{"type":"string","enum":["TPSL"],"description":"Always `TPSL`."},"tpsl_mode":{"type":"string","enum":["order","position"],"description":"`order`: closes the filled amount of the order it protects. `position`: closes the whole position on the instrument, as it is when a level is reached."},"status":{"type":"string","enum":["PENDING","ACTIVE","TRIGGERED","COMPLETE","CANCELLED"],"description":"Status of the TP/SL.\n- `PENDING`: waiting for the order it is attached to to fill.\n- `ACTIVE`: armed, its levels are watched against the live price.\n- `TRIGGERED`: a level was reached and its close is being placed. It cannot be updated or cancelled.\n- `COMPLETE`: its close finished.\n- `CANCELLED`: finished without closing. The `EXOTIC_ORDER_CANCELLED` WebSocket message carries the reason."},"take_profit":{"type":["object","null"],"description":"Take profit level, `null` when the TP/SL has none.","properties":{"value":{"type":"string","description":"The level, as a positive decimal string.","examples":["78000"]},"type":{"type":"string","enum":["MID","BBO"],"description":"The price the level is watched against. `MID`: the midpoint of the best bid and the best ask. `BBO`: the side of the book the close hits, the best bid for a long, the best ask for a short."}},"required":["value","type"]},"stop_loss":{"type":["object","null"],"description":"Stop loss level, `null` when the TP/SL has none.","properties":{"value":{"type":"string","description":"The level, as a positive decimal string.","examples":["78000"]},"type":{"type":"string","enum":["MID","BBO"],"description":"The price the level is watched against. `MID`: the midpoint of the best bid and the best ask. `BBO`: the side of the book the close hits, the best bid for a long, the best ask for a short."}},"required":["value","type"]},"slippage_bps":{"type":["integer","null"],"description":"How far from its level the close may trade, in basis points. Set when the TP/SL is created; it cannot be changed."},"version":{"type":"integer","description":"Changes each time the TP/SL changes. Send the value you last read when you update it."},"side":{"type":["string","null"],"enum":["BUY","SELL","UNKNOWN"],"description":"Side of the order or position the TP/SL protects (`BUY`: long, `SELL`: short). `UNKNOWN` while it is `PENDING`."},"market_type":{"type":["string","null"],"enum":["SPOT","FUTURES"],"description":"The kind of market the instrument is."},"position_id":{"type":["string","null"],"description":"The futures position an `ACTIVE` TP/SL protects. `null` while it is `PENDING`, and on spot."},"order_id":{"type":["string","null"],"description":"Exchange `order_id` of the order the TP/SL protects, when known."},"type":{"type":["string","null"],"enum":["MARKET","LIMIT"],"description":"Informational. `LIMIT` when the TP/SL armed from an order that had already filled, otherwise `MARKET`. A close is always sent as a limit order."},"price":{"type":["string","null"],"description":"Price of the order the TP/SL protects, when it armed from one. `null` otherwise."},"filled_amount":{"type":"string","description":"Order mode: the filled amount of the protected order, which is what the TP/SL closes. Position mode: the size of the position when the TP/SL armed; it closes the position as it is when a level is reached. `\"0\"` while `PENDING`."},"tp_client_id":{"type":["string","null"],"description":"`client_id` of the close order placed when the take profit fires on a spot market. The orders of a futures close have their own ids, listed in `EXOTIC_ORDER_TRIGGERED`."},"sl_client_id":{"type":["string","null"],"description":"As `tp_client_id`, for the stop loss."},"created_at":{"type":"string","format":"date-time","description":"When the TP/SL was created."},"filled_at":{"type":["string","null"],"format":"date-time","description":"When it became `ACTIVE`."},"completed_at":{"type":["string","null"],"format":"date-time","description":"When it became `COMPLETE`."},"cancelled_at":{"type":["string","null"],"format":"date-time","description":"When it was cancelled."}},"required":["client_id","instrument_code","order_kind","tpsl_mode","status","take_profit","stop_loss","slippage_bps","version","side","market_type","position_id","order_id","type","price","filled_amount","tp_client_id","sl_client_id","created_at","filled_at","completed_at","cancelled_at"]},"description":"The TP/SLs. Empty when there are none."},"cursor":{"type":["string","null"],"description":"Pass it as `cursor` to get the next page. `null` on the last page, and on a list narrowed by `instrument_code`, `status` or `client_id`."}},"required":["orders","cursor"]},"example":{"orders":[{"client_id":"0d0b1f0c-7f0e-4f55-9a53-6f6f3c1c2a10","instrument_code":"BTC_USD_P","order_kind":"TPSL","tpsl_mode":"position","status":"ACTIVE","take_profit":null,"stop_loss":{"value":"65000","type":"MID"},"slippage_bps":500,"version":2,"side":"BUY","market_type":"FUTURES","position_id":"1b0f6f5e-2a59-4f0a-9d0e-5f7f3f0f6a11","order_id":null,"type":"MARKET","price":null,"filled_amount":"1.5","tp_client_id":"c2a7a1de-6d0b-11f0-8de9-0242ac120002","sl_client_id":"1f06d0b6-a7a1-6e20-8de9-0242ac120002","created_at":"2026-11-16T10:15:00.000Z","filled_at":"2026-11-16T10:15:00.000Z","completed_at":null,"cancelled_at":null}],"cursor":null}}}},"400":{"description":"A query parameter is invalid. An unknown parameter is refused with `INVALID_PARAMETERS`. `EXOTIC_ORDER_REJECTED` means the exotic orders service refused the request for a reason without its own code; that code follows in `error_message`.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},"examples":{"1":{"summary":"Invalid client ID","value":{"error":"INVALID_CLIENT_ID","error_message":"client_id must be a UUID"}},"2":{"summary":"Invalid status","value":{"error":"INVALID_STATUS_FILTER","error_message":"status must be one of PENDING, ACTIVE, TRIGGERED"}},"3":{"summary":"Invalid limit","value":{"error":"INVALID_LIMIT","error_message":"The limit parameter must be a positive integer and not exceed the maximum allowed value"}},"4":{"summary":"Invalid cursor","value":{"error":"INVALID_CURSOR","error_message":"The cursor parameter is invalid or malformed"}},"5":{"summary":"Unknown parameter","value":{"error":"INVALID_PARAMETERS","error_message":"One or more parameters are invalid"}},"6":{"summary":"Rejected by the exotic orders service","value":{"error":"EXOTIC_ORDER_REJECTED","error_message":"The exotic orders service rejected the request: HTTP_400"}}}}}},"401":{"description":"The token was rejected: `UNAUTHORIZED`, or `INVALID_REQUEST_SIGNATURE` when the API key requires signed requests and the signature is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},"examples":{"1":{"summary":"Unauthorized","value":{"error":"UNAUTHORIZED","error_message":"Unauthorized access"}},"2":{"summary":"Invalid signature","value":{"error":"INVALID_REQUEST_SIGNATURE","error_message":"The request signature is missing or invalid"}}}}}},"403":{"description":"Either the gateway rejected the token (`{\"message\":\"Forbidden\"}`), the API key lacks the `TRADE` scope or the account is not active (`PERMISSION_DENIED`), or the account has no exchange account (`EXCHANGE_ACCOUNT_NOT_PROVISIONED`).","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}]},"examples":{"1":{"summary":"Gateway","value":{"message":"Forbidden"}},"2":{"summary":"Missing scope, or account not active","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}},"3":{"summary":"Not provisioned","value":{"error":"EXCHANGE_ACCOUNT_NOT_PROVISIONED","error_message":"The account is authenticated but has no exchange account yet"}}}}}},"404":{"description":"No TP/SL has this `client_id`.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},"examples":{"1":{"summary":"Not found","value":{"error":"ORDER_NOT_FOUND","error_message":"The requested order was not found"}}}}}},"429":{"description":"Rate limit exceeded. Limits are per account holder per minute: 600 (retail), 2,000 (institutional), 10,000 (market maker).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},"examples":{"1":{"summary":"Too many requests","value":{"error":"TOO_MANY_REQUESTS","error_message":"Too many requests"}}}}}},"500":{"description":"The request could not be completed. It is safe to read the TP/SL again before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},"examples":{"1":{"summary":"Server error","value":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}}}},"security":[{"bearerAuth":[]}],"operationId":"getExoticOrdersTpSl"},"post":{"summary":"Create Exotic Order (TP/SL)","description":"## Create an Exotic Order (TP/SL)\n\n> **Warning:** Ensure your API key has the `TRADE` scope. You can generate an API key through the One Trading UI.\n\nThis endpoint is rate-limited per account holder (see `429`).\n\nCreates an exotic order: a take profit and/or stop loss (TP/SL) on an order you have already placed, or on an open position. To place a new order with a TP/SL attached, use [Create Order](/docs/exchange/rest/trading/create-order) instead.\n\nThe TP/SL is held in a separate service, not on the exchange itself, which watches its levels against the live price. When one is reached, a reduce-only limit order is placed on the exchange to close for you; a TP/SL with both levels is one order, so when one level fires the other goes with it.\n\n### Position mode (`tpsl_mode: \"position\"`)\nProtects the whole position on `instrument_code`, futures only. Leave `client_id` out: the TP/SL is `ACTIVE` at once, and when a level is reached it closes the position as it is then. Without an open position the request is refused with `POSITION_NOT_FOUND`.\n\nThere is one position TP/SL per instrument. A second is refused with `POSITION_TPSL_EXISTS` unless `tpsl_force` is `true`, which replaces the existing one (it is cancelled with `FORCE_REPLACED`). To change the levels of the one you have, use Update Exotic Order (TP/SL).\n\n### Order mode (`tpsl_mode: \"order\"`, the default)\nProtects one order: `client_id` is required and must be the `client_id` of an order on the account, otherwise the request is refused with `ORDER_NOT_FOUND`. The TP/SL is `PENDING` until that order fills, then closes its filled amount. If the order has already filled, send `status: \"ACTIVE\"` to arm it now. If the order is cancelled or rejected before it fills, the TP/SL is cancelled with it.\n\nOn a spot market a TP/SL is order mode only and protects a `BUY`: it sells what was bought.\n\n### Levels and close price\n- At least one of `take_profit` or `stop_loss`.\n- For a long, the take profit must be above the current price and the stop loss below it; the other way round for a short. A TP/SL that arms at once with a level on the wrong side is refused with `TPSL_OUTSIDE_PRICE_BAND`. One that arms later is checked then, and cancelled with `VALIDATION_FAILED_AT_ACTIVATION` if a level has already been reached.\n- The close is a limit order at the level less `slippage_bps` when selling, or plus it when buying. It fills at the book's better prices up to that limit, and never worse. A stop loss the market gaps through by more than its slippage fills nothing and leaves the position open.\n\nEvery change of state is sent on the WebSocket `ACCOUNT` channel.","tags":["Trading"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"instrument_code":{"type":"string","description":"The instrument, e.g. `BTC_USD_P`."},"tpsl_mode":{"type":"string","enum":["order","position"],"description":"`order`: protect one order, closing its filled amount. `position`: protect the whole position on the instrument. Spot is `order` only.","default":"order"},"client_id":{"type":"string","format":"uuid","description":"`order` mode: required, the `client_id` of the order to protect. `position` mode: leave it out to protect the position that is open now; one is generated and returned. If you send one, the TP/SL waits for the order with that `client_id` to fill, unless `status` is `ACTIVE`."},"take_profit":{"type":"object","description":"Take profit level.","properties":{"value":{"type":"string","description":"The level, as a positive decimal string.","examples":["78000"],"pattern":"^\\d+(\\.\\d+)?$"},"type":{"type":"string","enum":["MID","BBO"],"description":"The price the level is watched against. `MID`: the midpoint of the best bid and the best ask. `BBO`: the side of the book the close hits, the best bid for a long, the best ask for a short.","default":"MID"}},"required":["value"],"additionalProperties":false},"stop_loss":{"type":"object","description":"Stop loss level.","properties":{"value":{"type":"string","description":"The level, as a positive decimal string.","examples":["78000"],"pattern":"^\\d+(\\.\\d+)?$"},"type":{"type":"string","enum":["MID","BBO"],"description":"The price the level is watched against. `MID`: the midpoint of the best bid and the best ask. `BBO`: the side of the book the close hits, the best bid for a long, the best ask for a short.","default":"MID"}},"required":["value"],"additionalProperties":false},"tpsl_force":{"type":"boolean","default":false,"description":"`position` mode: replace the instrument's existing position TP/SL instead of failing with `POSITION_TPSL_EXISTS`."},"slippage_bps":{"type":"integer","minimum":1,"maximum":9999,"description":"How far from its level the close may trade, in basis points. At most the instrument's price collar (`price_collar_percentage` × 100 on Instruments; 1000 for an instrument without one). Defaults to 500 (5%), or the collar if that is less. It cannot be changed later."},"status":{"type":"string","enum":["PENDING","ACTIVE"],"description":"`PENDING`: the TP/SL arms when the order `client_id` fills. `ACTIVE`: arm it now, from an order that has already filled (`order` mode) or from the open position (`position` mode). A `position` TP/SL without a `client_id` is always armed at once.","default":"PENDING"},"order_kind":{"type":"string","enum":["TPSL"],"description":"The kind of order. Only `TPSL` is supported.","default":"TPSL"}},"required":["instrument_code"]},"examples":{"1":{"value":{"instrument_code":"BTC_USD_P","tpsl_mode":"position","stop_loss":{"value":"65000","type":"MID"}},"summary":"Stop loss on the open position"},"2":{"value":{"instrument_code":"BTC_USD_P","tpsl_mode":"position","tpsl_force":true,"take_profit":{"value":"78000"},"stop_loss":{"value":"66000"},"slippage_bps":300},"summary":"Replace the position TP/SL"},"3":{"value":{"instrument_code":"BTC_USD_P","tpsl_mode":"order","client_id":"58503f2b-ca87-4816-9338-93c443e6fdde","take_profit":{"value":"78000","type":"BBO"}},"summary":"Take profit on an open order"}}}},"required":true},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"order":{"type":"object","description":"A take profit / stop loss.","properties":{"client_id":{"type":"string","format":"uuid","description":"Identifier of the TP/SL: use it to read, update or cancel it. For a TP/SL attached to an order, it is that order's `client_id`."},"instrument_code":{"type":"string","description":"The instrument, e.g. `BTC_USD_P`."},"order_kind":{"type":"string","enum":["TPSL"],"description":"Always `TPSL`."},"tpsl_mode":{"type":"string","enum":["order","position"],"description":"`order`: closes the filled amount of the order it protects. `position`: closes the whole position on the instrument, as it is when a level is reached."},"status":{"type":"string","enum":["PENDING","ACTIVE","TRIGGERED","COMPLETE","CANCELLED"],"description":"Status of the TP/SL.\n- `PENDING`: waiting for the order it is attached to to fill.\n- `ACTIVE`: armed, its levels are watched against the live price.\n- `TRIGGERED`: a level was reached and its close is being placed. It cannot be updated or cancelled.\n- `COMPLETE`: its close finished.\n- `CANCELLED`: finished without closing. The `EXOTIC_ORDER_CANCELLED` WebSocket message carries the reason."},"take_profit":{"type":["object","null"],"description":"Take profit level, `null` when the TP/SL has none.","properties":{"value":{"type":"string","description":"The level, as a positive decimal string.","examples":["78000"]},"type":{"type":"string","enum":["MID","BBO"],"description":"The price the level is watched against. `MID`: the midpoint of the best bid and the best ask. `BBO`: the side of the book the close hits, the best bid for a long, the best ask for a short."}},"required":["value","type"]},"stop_loss":{"type":["object","null"],"description":"Stop loss level, `null` when the TP/SL has none.","properties":{"value":{"type":"string","description":"The level, as a positive decimal string.","examples":["78000"]},"type":{"type":"string","enum":["MID","BBO"],"description":"The price the level is watched against. `MID`: the midpoint of the best bid and the best ask. `BBO`: the side of the book the close hits, the best bid for a long, the best ask for a short."}},"required":["value","type"]},"slippage_bps":{"type":["integer","null"],"description":"How far from its level the close may trade, in basis points. Set when the TP/SL is created; it cannot be changed."},"version":{"type":"integer","description":"Changes each time the TP/SL changes. Send the value you last read when you update it."},"side":{"type":["string","null"],"enum":["BUY","SELL","UNKNOWN"],"description":"Side of the order or position the TP/SL protects (`BUY`: long, `SELL`: short). `UNKNOWN` while it is `PENDING`."},"market_type":{"type":["string","null"],"enum":["SPOT","FUTURES"],"description":"The kind of market the instrument is."},"position_id":{"type":["string","null"],"description":"The futures position an `ACTIVE` TP/SL protects. `null` while it is `PENDING`, and on spot."},"order_id":{"type":["string","null"],"description":"Exchange `order_id` of the order the TP/SL protects, when known."},"type":{"type":["string","null"],"enum":["MARKET","LIMIT"],"description":"Informational. `LIMIT` when the TP/SL armed from an order that had already filled, otherwise `MARKET`. A close is always sent as a limit order."},"price":{"type":["string","null"],"description":"Price of the order the TP/SL protects, when it armed from one. `null` otherwise."},"filled_amount":{"type":"string","description":"Order mode: the filled amount of the protected order, which is what the TP/SL closes. Position mode: the size of the position when the TP/SL armed; it closes the position as it is when a level is reached. `\"0\"` while `PENDING`."},"tp_client_id":{"type":["string","null"],"description":"`client_id` of the close order placed when the take profit fires on a spot market. The orders of a futures close have their own ids, listed in `EXOTIC_ORDER_TRIGGERED`."},"sl_client_id":{"type":["string","null"],"description":"As `tp_client_id`, for the stop loss."},"created_at":{"type":"string","format":"date-time","description":"When the TP/SL was created."},"filled_at":{"type":["string","null"],"format":"date-time","description":"When it became `ACTIVE`."},"completed_at":{"type":["string","null"],"format":"date-time","description":"When it became `COMPLETE`."},"cancelled_at":{"type":["string","null"],"format":"date-time","description":"When it was cancelled."}},"required":["client_id","instrument_code","order_kind","tpsl_mode","status","take_profit","stop_loss","slippage_bps","version","side","market_type","position_id","order_id","type","price","filled_amount","tp_client_id","sl_client_id","created_at","filled_at","completed_at","cancelled_at"]}},"required":["order"]},"example":{"order":{"client_id":"0d0b1f0c-7f0e-4f55-9a53-6f6f3c1c2a10","instrument_code":"BTC_USD_P","order_kind":"TPSL","tpsl_mode":"position","status":"ACTIVE","take_profit":null,"stop_loss":{"value":"65000","type":"MID"},"slippage_bps":500,"version":1,"side":"BUY","market_type":"FUTURES","position_id":"1b0f6f5e-2a59-4f0a-9d0e-5f7f3f0f6a11","order_id":null,"type":"MARKET","price":null,"filled_amount":"1.5","tp_client_id":"c2a7a1de-6d0b-11f0-8de9-0242ac120002","sl_client_id":"1f06d0b6-a7a1-6e20-8de9-0242ac120002","created_at":"2026-11-16T10:15:00.000Z","filled_at":"2026-11-16T10:15:00.000Z","completed_at":null,"cancelled_at":null}}}}},"400":{"description":"The request is invalid, or the TP/SL could not be accepted for this market. Unknown fields are refused with `INVALID_EXOTIC_ORDER_REQUEST`. `EXOTIC_ORDER_REJECTED` means the exotic orders service refused the request for a reason without its own code; that code follows in `error_message`.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},"examples":{"1":{"summary":"Invalid body","value":{"error":"INVALID_EXOTIC_ORDER_REQUEST","error_message":"The exotic order request is invalid"}},"2":{"summary":"Missing TP/SL","value":{"error":"MISSING_TP_SL","error_message":"At least one of take_profit or stop_loss must be provided"}},"3":{"summary":"Missing client ID","value":{"error":"MISSING_CLIENT_ID","error_message":"client_id is required when tpsl_mode is order"}},"4":{"summary":"Invalid client ID","value":{"error":"INVALID_CLIENT_ID","error_message":"client_id must be a UUID"}},"5":{"summary":"Invalid instrument","value":{"error":"INVALID_INSTRUMENT_CODE","error_message":"The provided instrument code is invalid"}},"6":{"summary":"Invalid take profit","value":{"error":"INVALID_TAKE_PROFIT","error_message":"take_profit must be an object with a positive decimal string value no greater than 9007199254740991 and a type of MID or BBO"}},"7":{"summary":"Invalid stop loss","value":{"error":"INVALID_STOP_LOSS","error_message":"stop_loss must be an object with a positive decimal string value no greater than 9007199254740991 and a type of MID or BBO"}},"8":{"summary":"Invalid mode","value":{"error":"INVALID_TPSL_MODE","error_message":"tpsl_mode must be order or position"}},"9":{"summary":"Invalid force","value":{"error":"INVALID_TPSL_FORCE","error_message":"tpsl_force must be true or false"}},"10":{"summary":"Invalid slippage","value":{"error":"INVALID_SLIPPAGE_BPS","error_message":"slippage_bps must be an integer from 1 to 9999"}},"11":{"summary":"Invalid status","value":{"error":"INVALID_EXOTIC_ORDER_STATUS","error_message":"status must be PENDING or ACTIVE"}},"12":{"summary":"Invalid kind","value":{"error":"INVALID_ORDER_KIND","error_message":"order_kind must be TPSL"}},"13":{"summary":"Level on the wrong side of the price","value":{"error":"TPSL_OUTSIDE_PRICE_BAND","error_message":"A take profit or stop loss level is on the wrong side of the current price (SL against reference 67250.5)"}},"14":{"summary":"Slippage over the price collar","value":{"error":"SLIPPAGE_ABOVE_PRICE_COLLAR","error_message":"The slippage is over the instrument's price collar, so the close could never place (maximum 1000 bps)"}},"15":{"summary":"Close below the minimum order value","value":{"error":"BELOW_MIN_ORDER_VALUE","error_message":"A take profit or stop loss would place an order below the market's minimum order value (SL, minimum 10)"}},"16":{"summary":"Market closed","value":{"error":"MARKET_CLOSED","error_message":"The market is closed"}},"17":{"summary":"Market not listed","value":{"error":"MARKET_NOT_FOUND","error_message":"The market is not listed"}},"18":{"summary":"Position mode on spot","value":{"error":"SPOT_POSITION_MODE_UNSUPPORTED","error_message":"A spot market has no position; a spot take profit / stop loss must use tpsl_mode order"}},"19":{"summary":"Spot sell","value":{"error":"SPOT_SELL_UNSUPPORTED","error_message":"A spot take profit / stop loss can only protect a buy"}},"20":{"summary":"Order or position could not be read","value":{"error":"EXCHANGE_LOOKUP_FAILED","error_message":"The exchange order or position could not be resolved"}},"21":{"summary":"Rejected by the exotic orders service","value":{"error":"EXOTIC_ORDER_REJECTED","error_message":"The exotic orders service rejected the request: HTTP_400"}}}}}},"401":{"description":"The token was rejected: `UNAUTHORIZED`, or `INVALID_REQUEST_SIGNATURE` when the API key requires signed requests and the signature is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},"examples":{"1":{"summary":"Unauthorized","value":{"error":"UNAUTHORIZED","error_message":"Unauthorized access"}},"2":{"summary":"Invalid signature","value":{"error":"INVALID_REQUEST_SIGNATURE","error_message":"The request signature is missing or invalid"}}}}}},"403":{"description":"Either the gateway rejected the token (`{\"message\":\"Forbidden\"}`), the API key lacks the `TRADE` scope or the account is not active (`PERMISSION_DENIED`), or the account has no exchange account (`EXCHANGE_ACCOUNT_NOT_PROVISIONED`), or the account is not permitted to trade the instrument's product.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}]},"examples":{"1":{"summary":"Gateway","value":{"message":"Forbidden"}},"2":{"summary":"Missing scope, or account not active","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}},"3":{"summary":"Not provisioned","value":{"error":"EXCHANGE_ACCOUNT_NOT_PROVISIONED","error_message":"The account is authenticated but has no exchange account yet"}},"4":{"summary":"Product not permitted","value":{"error":"PERMISSION_DENIED","error_message":"You do not have permission to trade futures."}}}}}},"404":{"description":"`order` mode: no order on the account has this `client_id`. `position` mode: there is no open position on the instrument.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},"examples":{"1":{"summary":"Not found","value":{"error":"ORDER_NOT_FOUND","error_message":"The requested order was not found"}},"2":{"summary":"No open position","value":{"error":"POSITION_NOT_FOUND","error_message":"The requested position was not found"}}}}}},"409":{"description":"The TP/SL conflicts with one that already exists.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},"examples":{"1":{"summary":"Position TP/SL exists","value":{"error":"POSITION_TPSL_EXISTS","error_message":"An active position take profit / stop loss already exists for this instrument; set tpsl_force to replace it (existing client_id 0d0b1f0c-7f0e-4f55-9a53-6f6f3c1c2a10)"}},"2":{"summary":"Already registered","value":{"error":"ORDER_ALREADY_EXISTS","error_message":"A take profit / stop loss is already registered for this client_id"}}}}}},"429":{"description":"Rate limit exceeded. Limits are per account holder per minute: 600 (retail), 2,000 (institutional), 10,000 (market maker).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},"examples":{"1":{"summary":"Too many requests","value":{"error":"TOO_MANY_REQUESTS","error_message":"Too many requests"}}}}}},"500":{"description":"The request could not be completed. It is safe to read the TP/SL again before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},"examples":{"1":{"summary":"Server error","value":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}}},"503":{"description":"The market could not be checked. Nothing was changed: try again.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},"examples":{"1":{"summary":"Instruments unavailable","value":{"error":"INSTRUMENTS_UNAVAILABLE","error_message":"The market could not be checked; try again"}}}}}}},"security":[{"bearerAuth":[]}],"operationId":"createExoticOrderTpSl"},"delete":{"summary":"Cancel Exotic Order (TP/SL)","description":"## Cancel an Exotic Order (TP/SL)\n\n> **Warning:** Ensure your API key has the `TRADE` scope. You can generate an API key through the One Trading UI.\n\nThis endpoint is rate-limited per account holder (see `429`).\n\nCancels TP/SLs without placing an order. Send exactly one of the two parameters:\n\n- `client_id` cancels that one TP/SL, and answers with it in `order`. `EXOTIC_ORDER_CANCELLED` follows on the WebSocket `ACCOUNT` channel with reason `USER_CANCELLED`.\n- `instrument_code` cancels the position TP/SL on that instrument, and its spot TP/SLs, and answers with `cancelled`, `failed` and the cancelled `orders` (reason `BULK_CANCEL`). A futures TP/SL in `order` mode belongs to its order and is cancelled by its `client_id` only. With nothing to cancel the answer is `cancelled: 0`.\n\nCancelling a TP/SL leaves the order or position it protected as it is. The reverse also holds once a TP/SL is `ACTIVE`: cancelling the order it was attached to, or Cancel All Orders, does not cancel it. It ends when it is cancelled here, when a level fires, or when its position is closed or flips.\n\nA TP/SL that is `TRIGGERED` is placing its close: cancelling it by `client_id` is refused with `ORDER_ALREADY_TERMINAL`, and the close runs to its end.","tags":["Trading"],"parameters":[{"name":"client_id","in":"query","description":"Cancel this one TP/SL. Send this or `instrument_code`, not both.","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"instrument_code","in":"query","description":"Cancel the position TP/SL and the spot TP/SLs on this instrument. Send this or `client_id`, not both.","required":false,"example":"BTC_USD_P","schema":{"type":"string"}}],"responses":{"200":{"description":"By `client_id`: the cancelled TP/SL in `order`. By `instrument_code`: `cancelled`, `failed` and `orders`.","content":{"application/json":{"schema":{"oneOf":[{"title":"By client_id","type":"object","properties":{"order":{"type":"object","description":"A take profit / stop loss.","properties":{"client_id":{"type":"string","format":"uuid","description":"Identifier of the TP/SL: use it to read, update or cancel it. For a TP/SL attached to an order, it is that order's `client_id`."},"instrument_code":{"type":"string","description":"The instrument, e.g. `BTC_USD_P`."},"order_kind":{"type":"string","enum":["TPSL"],"description":"Always `TPSL`."},"tpsl_mode":{"type":"string","enum":["order","position"],"description":"`order`: closes the filled amount of the order it protects. `position`: closes the whole position on the instrument, as it is when a level is reached."},"status":{"type":"string","enum":["PENDING","ACTIVE","TRIGGERED","COMPLETE","CANCELLED"],"description":"Status of the TP/SL.\n- `PENDING`: waiting for the order it is attached to to fill.\n- `ACTIVE`: armed, its levels are watched against the live price.\n- `TRIGGERED`: a level was reached and its close is being placed. It cannot be updated or cancelled.\n- `COMPLETE`: its close finished.\n- `CANCELLED`: finished without closing. The `EXOTIC_ORDER_CANCELLED` WebSocket message carries the reason."},"take_profit":{"type":["object","null"],"description":"Take profit level, `null` when the TP/SL has none.","properties":{"value":{"type":"string","description":"The level, as a positive decimal string.","examples":["78000"]},"type":{"type":"string","enum":["MID","BBO"],"description":"The price the level is watched against. `MID`: the midpoint of the best bid and the best ask. `BBO`: the side of the book the close hits, the best bid for a long, the best ask for a short."}},"required":["value","type"]},"stop_loss":{"type":["object","null"],"description":"Stop loss level, `null` when the TP/SL has none.","properties":{"value":{"type":"string","description":"The level, as a positive decimal string.","examples":["78000"]},"type":{"type":"string","enum":["MID","BBO"],"description":"The price the level is watched against. `MID`: the midpoint of the best bid and the best ask. `BBO`: the side of the book the close hits, the best bid for a long, the best ask for a short."}},"required":["value","type"]},"slippage_bps":{"type":["integer","null"],"description":"How far from its level the close may trade, in basis points. Set when the TP/SL is created; it cannot be changed."},"version":{"type":"integer","description":"Changes each time the TP/SL changes. Send the value you last read when you update it."},"side":{"type":["string","null"],"enum":["BUY","SELL","UNKNOWN"],"description":"Side of the order or position the TP/SL protects (`BUY`: long, `SELL`: short). `UNKNOWN` while it is `PENDING`."},"market_type":{"type":["string","null"],"enum":["SPOT","FUTURES"],"description":"The kind of market the instrument is."},"position_id":{"type":["string","null"],"description":"The futures position an `ACTIVE` TP/SL protects. `null` while it is `PENDING`, and on spot."},"order_id":{"type":["string","null"],"description":"Exchange `order_id` of the order the TP/SL protects, when known."},"type":{"type":["string","null"],"enum":["MARKET","LIMIT"],"description":"Informational. `LIMIT` when the TP/SL armed from an order that had already filled, otherwise `MARKET`. A close is always sent as a limit order."},"price":{"type":["string","null"],"description":"Price of the order the TP/SL protects, when it armed from one. `null` otherwise."},"filled_amount":{"type":"string","description":"Order mode: the filled amount of the protected order, which is what the TP/SL closes. Position mode: the size of the position when the TP/SL armed; it closes the position as it is when a level is reached. `\"0\"` while `PENDING`."},"tp_client_id":{"type":["string","null"],"description":"`client_id` of the close order placed when the take profit fires on a spot market. The orders of a futures close have their own ids, listed in `EXOTIC_ORDER_TRIGGERED`."},"sl_client_id":{"type":["string","null"],"description":"As `tp_client_id`, for the stop loss."},"created_at":{"type":"string","format":"date-time","description":"When the TP/SL was created."},"filled_at":{"type":["string","null"],"format":"date-time","description":"When it became `ACTIVE`."},"completed_at":{"type":["string","null"],"format":"date-time","description":"When it became `COMPLETE`."},"cancelled_at":{"type":["string","null"],"format":"date-time","description":"When it was cancelled."}},"required":["client_id","instrument_code","order_kind","tpsl_mode","status","take_profit","stop_loss","slippage_bps","version","side","market_type","position_id","order_id","type","price","filled_amount","tp_client_id","sl_client_id","created_at","filled_at","completed_at","cancelled_at"]}},"required":["order"]},{"title":"By instrument_code","type":"object","properties":{"cancelled":{"type":"integer","description":"How many TP/SLs were cancelled."},"failed":{"type":"integer","description":"How many could not be cancelled, for example one that fired at the same moment."},"orders":{"type":"array","items":{"type":"object","description":"A take profit / stop loss.","properties":{"client_id":{"type":"string","format":"uuid","description":"Identifier of the TP/SL: use it to read, update or cancel it. For a TP/SL attached to an order, it is that order's `client_id`."},"instrument_code":{"type":"string","description":"The instrument, e.g. `BTC_USD_P`."},"order_kind":{"type":"string","enum":["TPSL"],"description":"Always `TPSL`."},"tpsl_mode":{"type":"string","enum":["order","position"],"description":"`order`: closes the filled amount of the order it protects. `position`: closes the whole position on the instrument, as it is when a level is reached."},"status":{"type":"string","enum":["PENDING","ACTIVE","TRIGGERED","COMPLETE","CANCELLED"],"description":"Status of the TP/SL.\n- `PENDING`: waiting for the order it is attached to to fill.\n- `ACTIVE`: armed, its levels are watched against the live price.\n- `TRIGGERED`: a level was reached and its close is being placed. It cannot be updated or cancelled.\n- `COMPLETE`: its close finished.\n- `CANCELLED`: finished without closing. The `EXOTIC_ORDER_CANCELLED` WebSocket message carries the reason."},"take_profit":{"type":["object","null"],"description":"Take profit level, `null` when the TP/SL has none.","properties":{"value":{"type":"string","description":"The level, as a positive decimal string.","examples":["78000"]},"type":{"type":"string","enum":["MID","BBO"],"description":"The price the level is watched against. `MID`: the midpoint of the best bid and the best ask. `BBO`: the side of the book the close hits, the best bid for a long, the best ask for a short."}},"required":["value","type"]},"stop_loss":{"type":["object","null"],"description":"Stop loss level, `null` when the TP/SL has none.","properties":{"value":{"type":"string","description":"The level, as a positive decimal string.","examples":["78000"]},"type":{"type":"string","enum":["MID","BBO"],"description":"The price the level is watched against. `MID`: the midpoint of the best bid and the best ask. `BBO`: the side of the book the close hits, the best bid for a long, the best ask for a short."}},"required":["value","type"]},"slippage_bps":{"type":["integer","null"],"description":"How far from its level the close may trade, in basis points. Set when the TP/SL is created; it cannot be changed."},"version":{"type":"integer","description":"Changes each time the TP/SL changes. Send the value you last read when you update it."},"side":{"type":["string","null"],"enum":["BUY","SELL","UNKNOWN"],"description":"Side of the order or position the TP/SL protects (`BUY`: long, `SELL`: short). `UNKNOWN` while it is `PENDING`."},"market_type":{"type":["string","null"],"enum":["SPOT","FUTURES"],"description":"The kind of market the instrument is."},"position_id":{"type":["string","null"],"description":"The futures position an `ACTIVE` TP/SL protects. `null` while it is `PENDING`, and on spot."},"order_id":{"type":["string","null"],"description":"Exchange `order_id` of the order the TP/SL protects, when known."},"type":{"type":["string","null"],"enum":["MARKET","LIMIT"],"description":"Informational. `LIMIT` when the TP/SL armed from an order that had already filled, otherwise `MARKET`. A close is always sent as a limit order."},"price":{"type":["string","null"],"description":"Price of the order the TP/SL protects, when it armed from one. `null` otherwise."},"filled_amount":{"type":"string","description":"Order mode: the filled amount of the protected order, which is what the TP/SL closes. Position mode: the size of the position when the TP/SL armed; it closes the position as it is when a level is reached. `\"0\"` while `PENDING`."},"tp_client_id":{"type":["string","null"],"description":"`client_id` of the close order placed when the take profit fires on a spot market. The orders of a futures close have their own ids, listed in `EXOTIC_ORDER_TRIGGERED`."},"sl_client_id":{"type":["string","null"],"description":"As `tp_client_id`, for the stop loss."},"created_at":{"type":"string","format":"date-time","description":"When the TP/SL was created."},"filled_at":{"type":["string","null"],"format":"date-time","description":"When it became `ACTIVE`."},"completed_at":{"type":["string","null"],"format":"date-time","description":"When it became `COMPLETE`."},"cancelled_at":{"type":["string","null"],"format":"date-time","description":"When it was cancelled."}},"required":["client_id","instrument_code","order_kind","tpsl_mode","status","take_profit","stop_loss","slippage_bps","version","side","market_type","position_id","order_id","type","price","filled_amount","tp_client_id","sl_client_id","created_at","filled_at","completed_at","cancelled_at"]},"description":"The cancelled TP/SLs."}},"required":["cancelled","failed","orders"]}]},"examples":{"1":{"summary":"By client_id","value":{"order":{"client_id":"0d0b1f0c-7f0e-4f55-9a53-6f6f3c1c2a10","instrument_code":"BTC_USD_P","order_kind":"TPSL","tpsl_mode":"position","status":"CANCELLED","take_profit":null,"stop_loss":{"value":"65000","type":"MID"},"slippage_bps":500,"version":3,"side":"BUY","market_type":"FUTURES","position_id":"1b0f6f5e-2a59-4f0a-9d0e-5f7f3f0f6a11","order_id":null,"type":"MARKET","price":null,"filled_amount":"1.5","tp_client_id":"c2a7a1de-6d0b-11f0-8de9-0242ac120002","sl_client_id":"1f06d0b6-a7a1-6e20-8de9-0242ac120002","created_at":"2026-11-16T10:15:00.000Z","filled_at":"2026-11-16T10:15:00.000Z","completed_at":null,"cancelled_at":"2026-11-16T11:02:10.000Z"}}},"2":{"summary":"By instrument_code","value":{"cancelled":1,"failed":0,"orders":[{"client_id":"0d0b1f0c-7f0e-4f55-9a53-6f6f3c1c2a10","instrument_code":"BTC_USD_P","order_kind":"TPSL","tpsl_mode":"position","status":"CANCELLED","take_profit":null,"stop_loss":{"value":"65000","type":"MID"},"slippage_bps":500,"version":3,"side":"BUY","market_type":"FUTURES","position_id":"1b0f6f5e-2a59-4f0a-9d0e-5f7f3f0f6a11","order_id":null,"type":"MARKET","price":null,"filled_amount":"1.5","tp_client_id":"c2a7a1de-6d0b-11f0-8de9-0242ac120002","sl_client_id":"1f06d0b6-a7a1-6e20-8de9-0242ac120002","created_at":"2026-11-16T10:15:00.000Z","filled_at":"2026-11-16T10:15:00.000Z","completed_at":null,"cancelled_at":"2026-11-16T11:02:10.000Z"}]}}}}}},"400":{"description":"A query parameter is invalid. An unknown parameter is refused with `INVALID_PARAMETERS`. `EXOTIC_ORDER_REJECTED` means the exotic orders service refused the request for a reason without its own code; that code follows in `error_message`.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},"examples":{"1":{"summary":"Neither or both identifiers","value":{"error":"MISSING_IDENTIFIER","error_message":"Exactly one of client_id or instrument_code must be provided"}},"2":{"summary":"Invalid client ID","value":{"error":"INVALID_CLIENT_ID","error_message":"client_id must be a UUID"}},"3":{"summary":"Unknown parameter","value":{"error":"INVALID_PARAMETERS","error_message":"One or more parameters are invalid"}},"4":{"summary":"Rejected by the exotic orders service","value":{"error":"EXOTIC_ORDER_REJECTED","error_message":"The exotic orders service rejected the request: HTTP_400"}}}}}},"401":{"description":"The token was rejected: `UNAUTHORIZED`, or `INVALID_REQUEST_SIGNATURE` when the API key requires signed requests and the signature is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},"examples":{"1":{"summary":"Unauthorized","value":{"error":"UNAUTHORIZED","error_message":"Unauthorized access"}},"2":{"summary":"Invalid signature","value":{"error":"INVALID_REQUEST_SIGNATURE","error_message":"The request signature is missing or invalid"}}}}}},"403":{"description":"Either the gateway rejected the token (`{\"message\":\"Forbidden\"}`), the API key lacks the `TRADE` scope or the account is not active (`PERMISSION_DENIED`), or the account has no exchange account (`EXCHANGE_ACCOUNT_NOT_PROVISIONED`).","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}]},"examples":{"1":{"summary":"Gateway","value":{"message":"Forbidden"}},"2":{"summary":"Missing scope, or account not active","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}},"3":{"summary":"Not provisioned","value":{"error":"EXCHANGE_ACCOUNT_NOT_PROVISIONED","error_message":"The account is authenticated but has no exchange account yet"}}}}}},"404":{"description":"No TP/SL has this `client_id`.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},"examples":{"1":{"summary":"Not found","value":{"error":"ORDER_NOT_FOUND","error_message":"The requested order was not found"}}}}}},"409":{"description":"The TP/SL has already finished, is placing its close, or changed at the same moment.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},"examples":{"1":{"summary":"Already finished, or closing","value":{"error":"ORDER_ALREADY_TERMINAL","error_message":"The take profit / stop loss has already completed or been cancelled"}},"2":{"summary":"Version conflict","value":{"error":"VERSION_CONFLICT","error_message":"The take profit / stop loss was modified by another request; fetch it again and retry"}}}}}},"429":{"description":"Rate limit exceeded. Limits are per account holder per minute: 600 (retail), 2,000 (institutional), 10,000 (market maker).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},"examples":{"1":{"summary":"Too many requests","value":{"error":"TOO_MANY_REQUESTS","error_message":"Too many requests"}}}}}},"500":{"description":"The request could not be completed. It is safe to read the TP/SL again before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},"examples":{"1":{"summary":"Server error","value":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}}}},"security":[{"bearerAuth":[]}],"operationId":"cancelExoticOrderTpSl"},"patch":{"summary":"Update Exotic Order (TP/SL)","description":"## Update an Exotic Order (TP/SL)\n\n> **Warning:** Ensure your API key has the `TRADE` scope. You can generate an API key through the One Trading UI.\n\nThis endpoint is rate-limited per account holder (see `429`).\n\nChanges the levels of a TP/SL without placing an order.\n\n- Identify it by `client_id`, or by `instrument_code` for the position TP/SL on that instrument. Send exactly one of the two.\n- Send `version` as you last read it from Get Exotic Orders (TP/SL) (or from the response that created it). If the TP/SL has changed since, because it fired or another update got there first, the request is refused with `VERSION_CONFLICT`: read it again and retry.\n- Send `take_profit`, `stop_loss` or both. A level you leave out stays as it is, and `null` removes it. Removing the last level cancels the TP/SL (`TP_SL_REMOVED`): the response then carries `cancelled: true`.\n- A new level on the wrong side of the live price is refused with `TPSL_OUTSIDE_PRICE_BAND`.\n- `slippage_bps` and `tpsl_mode` cannot be changed: cancel the TP/SL and create it again, or for a position TP/SL create a new one with `tpsl_force`.\n- A TP/SL that is `TRIGGERED` is placing its close and cannot be updated.\n\nIf a replacement position TP/SL is still `PENDING` next to the `ACTIVE` one (see Create Order), `instrument_code` may pick either: use `client_id`.\n\n`EXOTIC_ORDER_UPDATED` follows on the WebSocket `ACCOUNT` channel.","tags":["Trading"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"client_id":{"type":"string","format":"uuid","description":"The TP/SL to update. Send this or `instrument_code`, not both."},"instrument_code":{"type":"string","description":"Update the position TP/SL on this instrument. Send this or `client_id`, not both."},"version":{"type":"integer","minimum":0,"description":"The `version` you last read. The update applies only if the TP/SL has not changed since."},"take_profit":{"type":["object","null"],"description":"Take profit level. `null` removes the take profit. Leave the field out to keep it as it is.","properties":{"value":{"type":"string","description":"The level, as a positive decimal string.","examples":["78000"],"pattern":"^\\d+(\\.\\d+)?$"},"type":{"type":"string","enum":["MID","BBO"],"description":"The price the level is watched against. `MID`: the midpoint of the best bid and the best ask. `BBO`: the side of the book the close hits, the best bid for a long, the best ask for a short.","default":"MID"}},"required":["value"],"additionalProperties":false},"stop_loss":{"type":["object","null"],"description":"Stop loss level. `null` removes the stop loss. Leave the field out to keep it as it is.","properties":{"value":{"type":"string","description":"The level, as a positive decimal string.","examples":["78000"],"pattern":"^\\d+(\\.\\d+)?$"},"type":{"type":"string","enum":["MID","BBO"],"description":"The price the level is watched against. `MID`: the midpoint of the best bid and the best ask. `BBO`: the side of the book the close hits, the best bid for a long, the best ask for a short.","default":"MID"}},"required":["value"],"additionalProperties":false}},"required":["version"]},"examples":{"1":{"value":{"instrument_code":"BTC_USD_P","version":2,"stop_loss":{"value":"66500","type":"MID"}},"summary":"Move the position stop loss"},"2":{"value":{"client_id":"58503f2b-ca87-4816-9338-93c443e6fdde","version":1,"take_profit":{"value":"79000"}},"summary":"Add a take profit, by client ID"},"3":{"value":{"client_id":"58503f2b-ca87-4816-9338-93c443e6fdde","version":3,"take_profit":null},"summary":"Remove the take profit"}}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"order":{"type":"object","description":"A take profit / stop loss.","properties":{"client_id":{"type":"string","format":"uuid","description":"Identifier of the TP/SL: use it to read, update or cancel it. For a TP/SL attached to an order, it is that order's `client_id`."},"instrument_code":{"type":"string","description":"The instrument, e.g. `BTC_USD_P`."},"order_kind":{"type":"string","enum":["TPSL"],"description":"Always `TPSL`."},"tpsl_mode":{"type":"string","enum":["order","position"],"description":"`order`: closes the filled amount of the order it protects. `position`: closes the whole position on the instrument, as it is when a level is reached."},"status":{"type":"string","enum":["PENDING","ACTIVE","TRIGGERED","COMPLETE","CANCELLED"],"description":"Status of the TP/SL.\n- `PENDING`: waiting for the order it is attached to to fill.\n- `ACTIVE`: armed, its levels are watched against the live price.\n- `TRIGGERED`: a level was reached and its close is being placed. It cannot be updated or cancelled.\n- `COMPLETE`: its close finished.\n- `CANCELLED`: finished without closing. The `EXOTIC_ORDER_CANCELLED` WebSocket message carries the reason."},"take_profit":{"type":["object","null"],"description":"Take profit level, `null` when the TP/SL has none.","properties":{"value":{"type":"string","description":"The level, as a positive decimal string.","examples":["78000"]},"type":{"type":"string","enum":["MID","BBO"],"description":"The price the level is watched against. `MID`: the midpoint of the best bid and the best ask. `BBO`: the side of the book the close hits, the best bid for a long, the best ask for a short."}},"required":["value","type"]},"stop_loss":{"type":["object","null"],"description":"Stop loss level, `null` when the TP/SL has none.","properties":{"value":{"type":"string","description":"The level, as a positive decimal string.","examples":["78000"]},"type":{"type":"string","enum":["MID","BBO"],"description":"The price the level is watched against. `MID`: the midpoint of the best bid and the best ask. `BBO`: the side of the book the close hits, the best bid for a long, the best ask for a short."}},"required":["value","type"]},"slippage_bps":{"type":["integer","null"],"description":"How far from its level the close may trade, in basis points. Set when the TP/SL is created; it cannot be changed."},"version":{"type":"integer","description":"Changes each time the TP/SL changes. Send the value you last read when you update it."},"side":{"type":["string","null"],"enum":["BUY","SELL","UNKNOWN"],"description":"Side of the order or position the TP/SL protects (`BUY`: long, `SELL`: short). `UNKNOWN` while it is `PENDING`."},"market_type":{"type":["string","null"],"enum":["SPOT","FUTURES"],"description":"The kind of market the instrument is."},"position_id":{"type":["string","null"],"description":"The futures position an `ACTIVE` TP/SL protects. `null` while it is `PENDING`, and on spot."},"order_id":{"type":["string","null"],"description":"Exchange `order_id` of the order the TP/SL protects, when known."},"type":{"type":["string","null"],"enum":["MARKET","LIMIT"],"description":"Informational. `LIMIT` when the TP/SL armed from an order that had already filled, otherwise `MARKET`. A close is always sent as a limit order."},"price":{"type":["string","null"],"description":"Price of the order the TP/SL protects, when it armed from one. `null` otherwise."},"filled_amount":{"type":"string","description":"Order mode: the filled amount of the protected order, which is what the TP/SL closes. Position mode: the size of the position when the TP/SL armed; it closes the position as it is when a level is reached. `\"0\"` while `PENDING`."},"tp_client_id":{"type":["string","null"],"description":"`client_id` of the close order placed when the take profit fires on a spot market. The orders of a futures close have their own ids, listed in `EXOTIC_ORDER_TRIGGERED`."},"sl_client_id":{"type":["string","null"],"description":"As `tp_client_id`, for the stop loss."},"created_at":{"type":"string","format":"date-time","description":"When the TP/SL was created."},"filled_at":{"type":["string","null"],"format":"date-time","description":"When it became `ACTIVE`."},"completed_at":{"type":["string","null"],"format":"date-time","description":"When it became `COMPLETE`."},"cancelled_at":{"type":["string","null"],"format":"date-time","description":"When it was cancelled."}},"required":["client_id","instrument_code","order_kind","tpsl_mode","status","take_profit","stop_loss","slippage_bps","version","side","market_type","position_id","order_id","type","price","filled_amount","tp_client_id","sl_client_id","created_at","filled_at","completed_at","cancelled_at"]},"cancelled":{"type":"boolean","description":"Present, as `true`, only when the update removed the last level and so cancelled the TP/SL."}},"required":["order"]},"examples":{"1":{"summary":"Updated","value":{"order":{"client_id":"0d0b1f0c-7f0e-4f55-9a53-6f6f3c1c2a10","instrument_code":"BTC_USD_P","order_kind":"TPSL","tpsl_mode":"position","status":"ACTIVE","take_profit":null,"stop_loss":{"value":"66500","type":"MID"},"slippage_bps":500,"version":3,"side":"BUY","market_type":"FUTURES","position_id":"1b0f6f5e-2a59-4f0a-9d0e-5f7f3f0f6a11","order_id":null,"type":"MARKET","price":null,"filled_amount":"1.5","tp_client_id":"c2a7a1de-6d0b-11f0-8de9-0242ac120002","sl_client_id":"1f06d0b6-a7a1-6e20-8de9-0242ac120002","created_at":"2026-11-16T10:15:00.000Z","filled_at":"2026-11-16T10:15:00.000Z","completed_at":null,"cancelled_at":null}}},"2":{"summary":"Last level removed","value":{"order":{"client_id":"0d0b1f0c-7f0e-4f55-9a53-6f6f3c1c2a10","instrument_code":"BTC_USD_P","order_kind":"TPSL","tpsl_mode":"position","status":"CANCELLED","take_profit":null,"stop_loss":null,"slippage_bps":500,"version":4,"side":"BUY","market_type":"FUTURES","position_id":"1b0f6f5e-2a59-4f0a-9d0e-5f7f3f0f6a11","order_id":null,"type":"MARKET","price":null,"filled_amount":"1.5","tp_client_id":"c2a7a1de-6d0b-11f0-8de9-0242ac120002","sl_client_id":"1f06d0b6-a7a1-6e20-8de9-0242ac120002","created_at":"2026-11-16T10:15:00.000Z","filled_at":"2026-11-16T10:15:00.000Z","completed_at":null,"cancelled_at":"2026-11-16T11:02:10.000Z"},"cancelled":true}}}}}},"400":{"description":"The request is invalid. Unknown fields are refused with `INVALID_EXOTIC_ORDER_REQUEST`. `EXOTIC_ORDER_REJECTED` means the exotic orders service refused the request for a reason without its own code; that code follows in `error_message`.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},"examples":{"1":{"summary":"Invalid body","value":{"error":"INVALID_EXOTIC_ORDER_REQUEST","error_message":"The exotic order request is invalid"}},"2":{"summary":"Neither or both identifiers","value":{"error":"MISSING_IDENTIFIER","error_message":"Exactly one of client_id or instrument_code must be provided"}},"3":{"summary":"No level sent","value":{"error":"MISSING_TP_SL","error_message":"At least one of take_profit or stop_loss must be provided"}},"4":{"summary":"Invalid version","value":{"error":"INVALID_VERSION","error_message":"version must be a non-negative integer"}},"5":{"summary":"Invalid client ID","value":{"error":"INVALID_CLIENT_ID","error_message":"client_id must be a UUID"}},"6":{"summary":"Invalid take profit","value":{"error":"INVALID_TAKE_PROFIT","error_message":"take_profit must be an object with a positive decimal string value no greater than 9007199254740991 and a type of MID or BBO"}},"7":{"summary":"Invalid stop loss","value":{"error":"INVALID_STOP_LOSS","error_message":"stop_loss must be an object with a positive decimal string value no greater than 9007199254740991 and a type of MID or BBO"}},"8":{"summary":"Level on the wrong side of the price","value":{"error":"TPSL_OUTSIDE_PRICE_BAND","error_message":"A take profit or stop loss level is on the wrong side of the current price (SL against reference 67250.5)"}},"9":{"summary":"Close below the minimum order value","value":{"error":"BELOW_MIN_ORDER_VALUE","error_message":"A take profit or stop loss would place an order below the market's minimum order value (TP, minimum 10)"}},"10":{"summary":"Rejected by the exotic orders service","value":{"error":"EXOTIC_ORDER_REJECTED","error_message":"The exotic orders service rejected the request: HTTP_400"}}}}}},"401":{"description":"The token was rejected: `UNAUTHORIZED`, or `INVALID_REQUEST_SIGNATURE` when the API key requires signed requests and the signature is missing or invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},"examples":{"1":{"summary":"Unauthorized","value":{"error":"UNAUTHORIZED","error_message":"Unauthorized access"}},"2":{"summary":"Invalid signature","value":{"error":"INVALID_REQUEST_SIGNATURE","error_message":"The request signature is missing or invalid"}}}}}},"403":{"description":"Either the gateway rejected the token (`{\"message\":\"Forbidden\"}`), the API key lacks the `TRADE` scope or the account is not active (`PERMISSION_DENIED`), or the account has no exchange account (`EXCHANGE_ACCOUNT_NOT_PROVISIONED`).","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}]},"examples":{"1":{"summary":"Gateway","value":{"message":"Forbidden"}},"2":{"summary":"Missing scope, or account not active","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}},"3":{"summary":"Not provisioned","value":{"error":"EXCHANGE_ACCOUNT_NOT_PROVISIONED","error_message":"The account is authenticated but has no exchange account yet"}}}}}},"404":{"description":"No TP/SL has this `client_id`, or the instrument has no live position TP/SL.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},"examples":{"1":{"summary":"Not found","value":{"error":"ORDER_NOT_FOUND","error_message":"The requested order was not found"}},"2":{"summary":"No position TP/SL","value":{"error":"POSITION_TPSL_NOT_FOUND","error_message":"No active position take profit / stop loss exists for this instrument"}}}}}},"409":{"description":"The TP/SL changed since `version` was read, or can no longer be updated.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},"examples":{"1":{"summary":"Version conflict","value":{"error":"VERSION_CONFLICT","error_message":"The take profit / stop loss was modified by another request; fetch it again and retry"}},"2":{"summary":"Already finished, or closing","value":{"error":"ORDER_ALREADY_TERMINAL","error_message":"The take profit / stop loss has already completed or been cancelled"}}}}}},"429":{"description":"Rate limit exceeded. Limits are per account holder per minute: 600 (retail), 2,000 (institutional), 10,000 (market maker).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},"examples":{"1":{"summary":"Too many requests","value":{"error":"TOO_MANY_REQUESTS","error_message":"Too many requests"}}}}}},"500":{"description":"The request could not be completed. It is safe to read the TP/SL again before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},"examples":{"1":{"summary":"Server error","value":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}}},"503":{"description":"The market could not be checked. Nothing was changed: try again.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error code."},"error_message":{"type":"string","description":"Human-readable detail."}},"required":["error","error_message"]},"examples":{"1":{"summary":"Instruments unavailable","value":{"error":"INSTRUMENTS_UNAVAILABLE","error_message":"The market could not be checked; try again"}}}}}}},"security":[{"bearerAuth":[]}],"operationId":"updateExoticOrderTpSl"}},"b2dc3c0":{"get":{"summary":"Get Payout Accounts","description":"Returns the account holder's pending and active payout accounts. Use a returned `payout_account_id` with Withdraw to Payout Account. Payout accounts are added and approved through the One Trading web app.\n\nOnly fields relevant to the payout account type are present.\n\nOnly the `type` and `currency_code` query parameters are accepted; any other is rejected with `400 INVALID_PAYOUT_ACCOUNTS_QUERY`.\n\n**Required API scope:** `WITHDRAW`. This endpoint is not rate-limited.\n\n> **Important:** For security reasons, this endpoint requires an API key with the `WITHDRAW` scope and is only available to market-maker accounts; other accounts receive `403 WITHDRAWAL_NOT_ENABLED`.\n> \n> An API key can only be given the `WITHDRAW` scope together with an IP allowlist and signed requests, and requests from an address outside the allowlist are rejected by the gateway (`403 {\"message\":\"Forbidden\"}`). Legacy API keys must also carry an IP allowlist (`403 API_KEY_IP_ALLOWLIST_REQUIRED`), and the request must come from an address on it (`403 API_KEY_IP_NOT_ALLOWED`).","operationId":"getPayoutAccounts","tags":["Funding"],"parameters":[{"name":"type","in":"query","description":"Only return payout accounts of this transfer method.","required":false,"schema":{"type":"string","enum":["BLINC","SEPA","SWIFT","WIRE","BLOCKCHAIN"]}},{"name":"currency_code","in":"query","description":"Only return payout accounts for this currency, e.g. `EUR`. Any case is accepted; the code is trimmed and upper-cased.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Payout accounts.","content":{"application/json":{"schema":{"type":"object","required":["payout_accounts"],"properties":{"payout_accounts":{"type":"array","items":{"type":"object","required":["payout_account_id","type","currency_code","state","account_holder_name","created_at"],"properties":{"payout_account_id":{"type":"string","format":"uuid","description":"Pass as `payout_account.payout_account_id` when withdrawing."},"type":{"type":"string","enum":["BLINC","SEPA","SWIFT","WIRE","BLOCKCHAIN"],"description":"Transfer method of the payout account."},"currency_code":{"type":"string","description":"Currency the payout account receives."},"state":{"type":"string","enum":["PENDING","ACTIVE"],"description":"`PENDING` accounts are awaiting approval and cannot be withdrawn to yet."},"label":{"type":"string"},"account_holder_name":{"type":"string"},"iban":{"type":"string"},"bic":{"type":"string"},"account_number":{"type":"string"},"routing_number":{"type":"string"},"bank_name":{"type":"string"},"bank_country_code":{"type":"string"},"blinc_id":{"type":"string"},"blockchain_address":{"type":"string"},"destination_tag":{"type":"string"},"destination_tag_type":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}}}}},"examples":{"default":{"summary":"SEPA and blockchain payout accounts","value":{"payout_accounts":[{"payout_account_id":"1ef8a2b4-5c6d-6e7f-8a9b-0c1d2e3f4a01","type":"SEPA","currency_code":"EUR","state":"ACTIVE","label":"Main bank","account_holder_name":"Example Trading Ltd","iban":"DE89370400440532013000","bic":"COBADEFFXXX","created_at":"2026-01-19T15:00:00.000000Z"},{"payout_account_id":"1ef8a2b4-5c6d-6e7f-8a9b-0c1d2e3f4a02","type":"BLOCKCHAIN","currency_code":"XRP","state":"PENDING","account_holder_name":"Example Trading Ltd","blockchain_address":"rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh","destination_tag":"12345","destination_tag_type":"tag","created_at":"2026-01-20T15:00:00.000000Z"}]}}}}}},"400":{"description":"Invalid query parameters. `INVALID_PAYOUT_ACCOUNTS_QUERY` carries a validation detail in `error_message` (e.g. the unrecognised parameter).","content":{"application/json":{"schema":{"type":"object","required":["error","error_message"],"properties":{"error":{"type":"string","description":"Stable error code.","enum":["INVALID_TRANSFER_METHOD","INVALID_CURRENCY_CODE","INVALID_PAYOUT_ACCOUNTS_QUERY"]},"error_message":{"type":"string","description":"Human-readable description of the error."}}},"examples":{"2":{"summary":"INVALID_TRANSFER_METHOD","value":{"error":"INVALID_TRANSFER_METHOD","error_message":"type must be one of BLINC, SEPA, SWIFT, WIRE, BLOCKCHAIN"}},"3":{"summary":"INVALID_CURRENCY_CODE","value":{"error":"INVALID_CURRENCY_CODE","error_message":"currency_code must be a currency code, e.g. EUR or BTC"}},"4":{"summary":"INVALID_PAYOUT_ACCOUNTS_QUERY","value":{"error":"INVALID_PAYOUT_ACCOUNTS_QUERY","error_message":"body: Unrecognized key: \"foo\""}}}}}},"403":{"description":"Not permitted. Codes: `MISSING_WITHDRAW_SCOPE`, `API_KEY_IP_ALLOWLIST_REQUIRED`, `API_KEY_IP_NOT_ALLOWED`, `WITHDRAWAL_NOT_ENABLED`, `PERMISSION_DENIED`. `WITHDRAWAL_NOT_ENABLED` is returned for accounts that are not market makers. `PERMISSION_DENIED` is returned when the token cannot be used for this endpoint. The gateway returns `{\"message\":\"Forbidden\"}` for a missing, invalid or revoked token, or a request from an address outside the API key's allowlist.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/x-ext/bd75d4a"},{"$ref":"#/x-ext/39f3a7e"}]},"examples":{"5":{"summary":"MISSING_WITHDRAW_SCOPE","value":{"error":"MISSING_WITHDRAW_SCOPE","error_message":"This API key does not have the withdraw scope"}},"6":{"summary":"API_KEY_IP_ALLOWLIST_REQUIRED","value":{"error":"API_KEY_IP_ALLOWLIST_REQUIRED","error_message":"An API key used for withdrawals must have an IP allowlist"}},"7":{"summary":"API_KEY_IP_NOT_ALLOWED","value":{"error":"API_KEY_IP_NOT_ALLOWED","error_message":"The request IP address is not in the API key allowlist"}},"8":{"summary":"WITHDRAWAL_NOT_ENABLED","value":{"error":"WITHDRAWAL_NOT_ENABLED","error_message":"API withdrawals are not enabled for this account"}},"9":{"summary":"PERMISSION_DENIED","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}},"10":{"summary":"Gateway","value":{"message":"Forbidden"}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"type":"object","required":["error","error_message"],"properties":{"error":{"type":"string","description":"Stable error code.","enum":["SERVER_ERROR"]},"error_message":{"type":"string","description":"Human-readable description of the error."}}},"example":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}},"security":[{"bearerAuth":[]}]}},"94d07d9":{"title":"SubaccountTransferRequest","type":"object","required":["amount","currency","source_account_id","destination_account_id"],"properties":{"amount":{"type":["string","number"],"description":"Amount to transfer, as a decimal string; a JSON number is also accepted and read in full. Must match `^[0-9]+(\\.[0-9]+)?$` (digits with an optional decimal part, no commas or exponent). Truncated to 8 decimal places (3 for SHIB, PEPE, BTT), and must be greater than zero after truncation.","examples":["100.00"]},"currency":{"type":"string","description":"Upper-case currency (asset) code of the balance to move, e.g. `EUR`.","examples":["EUR"]},"source_account_id":{"type":"string","description":"Account to debit: the main account ID or a subaccount ID. Must be owned by the caller.","examples":["8f2b6c1e-0a9d-4c7e-9b21-2f5d3a1c4e6a"]},"destination_account_id":{"type":"string","description":"Account to credit: the main account ID or a subaccount ID. Must be owned by the caller and different from `source_account_id`.","examples":["3c7a1d40-6b2e-4f88-9a10-7e5c2b9f0d13"]}}},"a399388":{"title":"SubaccountTransferResponse","type":"object","properties":{"transfer":{"type":"object","properties":{"account_holder":{"type":"string","description":"ID of the source account (same value as `source_account_id`)."},"transfer_id":{"type":"string","description":"Unique identifier of the outgoing transfer record."},"source_account_id":{"type":"string","description":"Account that was debited."},"destination_account_id":{"type":"string","description":"Account that was credited."},"currency":{"type":"string","description":"Currency code as sent in the request."},"amount":{"type":"string","description":"Amount transferred, after truncation, as a decimal string."},"time":{"type":"string","format":"date-time","description":"ISO-8601 timestamp at which the transfer was recorded."}},"required":["account_holder","transfer_id","source_account_id","destination_account_id","currency","amount","time"]}},"required":["transfer"]},"780cd0b":{"post":{"summary":"Transfer Subaccount Balance","description":"Transfers an amount of a single currency from one account to another, where both accounts belong to the authenticated account holder (the main account or any of its subaccounts).\n\nThe debit is applied to the source account first; if the credit to the destination fails, the debit is automatically rolled back.\n\n**Required API scope:** `SUBACCOUNT_TRANSFER`. The API key presented in the `Authorization: Bearer <token>` header must carry this permission (keys with `UI_HOLDER` / `UI_ACCOUNT` permissions are also authorised). The account holder must be active. This endpoint is rate-limited per account holder (see `429`).\n\nBoth `source_account_id` and `destination_account_id` must be owned by the caller and must be different from one another. `amount` is a decimal string (a JSON number is also accepted). Amount precision is truncated to 8 decimal places (3 for SHIB, PEPE and BTT). The available balance of the source account is checked before the transfer.\n\n\n> **Note:** This endpoint does not allow transfers to and from the `instant-trade` account.","operationId":"transferSubaccountBalance","tags":["Funding"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/x-ext/94d07d9"},"examples":{"default":{"value":{"amount":"100.00","currency":"EUR","source_account_id":"8f2b6c1e-0a9d-4c7e-9b21-2f5d3a1c4e6a","destination_account_id":"3c7a1d40-6b2e-4f88-9a10-7e5c2b9f0d13"},"summary":"Move 100 EUR from a subaccount to the main account"}}}},"required":true},"responses":{"200":{"description":"Transfer completed. Returns the outgoing transfer record; `account_holder` holds the source account ID.","content":{"application/json":{"schema":{"$ref":"#/x-ext/a399388"},"example":{"transfer":{"account_holder":"8f2b6c1e-0a9d-4c7e-9b21-2f5d3a1c4e6a","transfer_id":"5b9e2f10-8c4a-4d21-b6f7-1a2c3d4e5f60","source_account_id":"8f2b6c1e-0a9d-4c7e-9b21-2f5d3a1c4e6a","destination_account_id":"3c7a1d40-6b2e-4f88-9a10-7e5c2b9f0d13","currency":"EUR","amount":"100.00","time":"2026-07-03T10:15:30.000Z"}}}}},"400":{"description":"Validation error. `error` holds a human-readable message. Returned when the body is not valid JSON, a required field is missing, the amount is malformed or not greater than zero after truncation, source and destination are identical, the body fails validation for any other reason (`Invalid transfer.`), the source account has no balance in the currency (also the case for an unknown or lower-case currency code), the source balance is insufficient, or a BLP account would drop below its EUR threshold.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"2":{"summary":"invalidJson","value":{"error":"Invalid JSON."}},"3":{"summary":"missingAmount","value":{"error":"amount is required."}},"4":{"summary":"invalidAmount","value":{"error":"invalid amount."}},"5":{"summary":"missingCurrency","value":{"error":"currency is required."}},"6":{"summary":"sameAccount","value":{"error":"source_account_id and destination_account_id cannot be the same."}},"7":{"summary":"noBalance","value":{"error":"No balance returned for account 8f2b6c1e-0a9d-4c7e-9b21-2f5d3a1c4e6a for currency EUR"}},"8":{"summary":"insufficientBalance","value":{"error":"Insufficient balance in account 8f2b6c1e-0a9d-4c7e-9b21-2f5d3a1c4e6a for a transfer of 100.00 EUR"}},"9":{"summary":"blpThreshold","value":{"error":"BLP account 8f2b6c1e-0a9d-4c7e-9b21-2f5d3a1c4e6a would be below the threshold of 1000 EUR after the transfer"}},"20":{"summary":"amountNotPositive","value":{"error":"amount must be greater than zero."}},"21":{"summary":"missingSource","value":{"error":"source_account_id is required."}},"22":{"summary":"missingDestination","value":{"error":"destination_account_id is required."}},"23":{"summary":"invalidTransfer","value":{"error":"Invalid transfer."}}}}}},"401":{"description":"Unauthorized. The token was accepted by the gateway but rejected by the endpoint: `UNAUTHORIZED`, or `INVALID_REQUEST_SIGNATURE` when the API key requires signed requests and the signature is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"10":{"summary":"Unauthorized","value":{"error":"UNAUTHORIZED","error_message":"Unauthorized access"}},"11":{"summary":"Invalid signature","value":{"error":"INVALID_REQUEST_SIGNATURE","error_message":"The request signature is missing or invalid"}}}}}},"403":{"description":"Permission denied. `{\"error\":\"Permission denied.\"}` when the account holder is not active or one of the accounts is not owned by the caller. `PERMISSION_DENIED` (with `error_message`) when the API key lacks the `SUBACCOUNT_TRANSFER` scope, `EXCHANGE_ACCOUNT_NOT_PROVISIONED` when the account has no exchange account yet, and the gateway returns `{\"message\":\"Forbidden\"}` for a missing, invalid or revoked token.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/x-ext/bd75d4a"},{"$ref":"#/x-ext/39f3a7e"}]},"examples":{"12":{"summary":"default","value":{"error":"Permission denied."}},"13":{"summary":"missingScope","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}},"14":{"summary":"notProvisioned","value":{"error":"EXCHANGE_ACCOUNT_NOT_PROVISIONED","error_message":"The account is authenticated but has no exchange account yet"}},"15":{"summary":"gateway","value":{"message":"Forbidden"}}}}}},"422":{"description":"Unprocessable. The exchange rejected the debit: `INSUFFICIENT_FUNDS` when the source account no longer has enough funds at the time of the debit, or `USER_MGMT_USER_IN_DERISK` when the user is currently in a de-risk state.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"16":{"summary":"insufficientFunds","value":{"error":"INSUFFICIENT_FUNDS"}},"17":{"summary":"derisk","value":{"error":"USER_MGMT_USER_IN_DERISK"}}}}}},"429":{"description":"Rate limit exceeded. Limits are per account holder per minute: 600 (retail), 2,000 (institutional), 10,000 (market maker).","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"Too many requests."}}}},"500":{"description":"Server error or server configuration error.","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"examples":{"18":{"summary":"default","value":{"error":"Server error."}},"19":{"summary":"misconfigured","value":{"error":"Server configuration error."}}}}}}},"security":[{"bearerAuth":[]}]}},"8c22f32":{"get":{"summary":"Get Transactions","description":"Returns the funding history of the account the token acts on: deposits, withdrawals, transfers between your accounts, fees and adjustments, newest first by request time.\n\nA main-account token returns the main account's transactions; a subaccount token returns only that subaccount's.\n\n`type` is the transfer method; use it with `direction` to tell a deposit (`incoming`) from a withdrawal (`outgoing`):\n\n| `type` | Meaning |\n|---|---|\n| `SEPA`, `SEPA_INSTANT`, `SWIFT`, `WIRE`, `BLINC`, `CARD`, `KINEXYS` | Fiat deposit or withdrawal |\n| `BLOCKCHAIN` | Crypto deposit or withdrawal |\n| `INTERNAL` | Internal transfer |\n| `SUBACCOUNT_TRANSFER` | Transfer between your main account and a subaccount |\n| `INSTANT_TRADE_ACCOUNT_TRANSFER` | Transfer to or from your instant trade account |\n| `FEE`, `INSTANT_TRADE_FEE` | Fee charged to the account |\n| `ADJUSTMENT` | Balance adjustment, e.g. staking |\n\n### Pagination\n\nResults are returned newest first, `limit` at a time (default 100, max 1000). When more may follow, the response carries a `cursor`; pass it unchanged, with the same filters, to get the next page. `cursor` is `null` on the last page. A page that ends exactly on the last transaction can still carry a cursor, in which case the next request returns an empty `transactions` list with `cursor: null`.\n\n### Filters\n\n`type` and `status` take a comma-separated list without spaces (e.g. `type=SEPA,BLOCKCHAIN`). `from` and `to` bound the request time (`requested_at`), both inclusive, and take ISO 8601 timestamps with a zone (`Z` or an offset such as `+02:00`), e.g. `2026-10-01T00:00:00Z`. Any query parameter not listed is rejected with `400 UNEXPECTED_PARAMETERS`.\n\nFields that do not apply to a transaction (e.g. `iban` on a crypto deposit) are left out.\n\n**Required API scope:** `READ_ONLY`. Rate-limited per account holder per minute: 600 (retail), 2,000 (institutional), 10,000 (market maker).","operationId":"getAccountTransactions","tags":["Funding"],"parameters":[{"name":"type","in":"query","description":"Only return transactions of these transfer methods, comma separated, e.g. `SEPA,BLOCKCHAIN`. One or more of: `ADJUSTMENT`, `BLINC`, `BLOCKCHAIN`, `CARD`, `FEE`, `INSTANT_TRADE_ACCOUNT_TRANSFER`, `INSTANT_TRADE_FEE`, `INTERNAL`, `KINEXYS`, `SEPA`, `SEPA_INSTANT`, `SUBACCOUNT_TRANSFER`, `SWIFT`, `WIRE`.","required":false,"example":"SEPA,BLOCKCHAIN","schema":{"type":"string"}},{"name":"status","in":"query","description":"Only return transactions in these statuses, comma separated, e.g. `DONE,PENDING`. One or more of: `CANCELLED`, `CARD_PENDING`, `CONFIRMED`, `CREDITED`, `DONE`, `FAILED`, `INITIATED`, `PENDING`, `REJECTED`, `UNDER_REVIEW`.","required":false,"example":"DONE","schema":{"type":"string"}},{"name":"direction","in":"query","description":"`incoming` (deposits and incoming transfers) or `outgoing` (withdrawals, outgoing transfers and fees).","required":false,"schema":{"type":"string","enum":["incoming","outgoing"]}},{"name":"currency","in":"query","description":"Only return transactions in this currency, e.g. `EUR`. Any case is accepted; the code is trimmed and upper-cased.","required":false,"example":"EUR","schema":{"type":"string"}},{"name":"from","in":"query","description":"Start of the period on `requested_at` (inclusive). ISO 8601 with a zone, e.g. `2026-09-01T00:00:00Z`.","required":false,"example":"2026-09-01T00:00:00Z","schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","description":"End of the period on `requested_at` (inclusive). ISO 8601 with a zone, e.g. `2026-10-01T00:00:00Z`. Must not be before `from`.","required":false,"example":"2026-10-01T00:00:00Z","schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","description":"Maximum number of transactions per page, between 1 and 1000. Defaults to 100.","required":false,"example":100,"schema":{"type":"integer","minimum":1,"maximum":1000,"default":100}},{"name":"cursor","in":"query","description":"Opaque pointer to the next page, taken unchanged from the `cursor` of the previous response. Send the same filters as the previous request.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"A page of transactions.","content":{"application/json":{"schema":{"type":"object","required":["transactions","cursor"],"properties":{"transactions":{"type":"array","items":{"type":"object","required":["transaction_id","account_id","type","direction","status","currency","amount","requested_at"],"properties":{"transaction_id":{"type":"string","format":"uuid"},"account_id":{"type":"string","format":"uuid","description":"The account (main account or subaccount) the transaction belongs to."},"type":{"type":"string","enum":["ADJUSTMENT","BLINC","BLOCKCHAIN","CARD","FEE","INSTANT_TRADE_ACCOUNT_TRANSFER","INSTANT_TRADE_FEE","INTERNAL","KINEXYS","SEPA","SEPA_INSTANT","SUBACCOUNT_TRANSFER","SWIFT","WIRE"],"description":"Transfer method."},"direction":{"type":"string","enum":["incoming","outgoing"],"description":"`incoming` credits the account, `outgoing` debits it."},"status":{"type":"string","enum":["CANCELLED","CARD_PENDING","CONFIRMED","CREDITED","DONE","FAILED","INITIATED","PENDING","REJECTED","UNDER_REVIEW","BROKER_CREDITED"]},"currency":{"type":"string","description":"e.g. `EUR`, `BTC`."},"amount":{"type":"string","description":"Gross amount, as a decimal string."},"fee_amount":{"type":"string","description":"Fee charged on the transaction, in `currency`."},"net_amount":{"type":"string","description":"`amount` minus `fee_amount`."},"requested_at":{"type":"string","format":"date-time","description":"When the transaction was requested. Results are ordered and filtered by this time."},"confirmed_at":{"type":"string","format":"date-time","description":"When the transaction was confirmed, where applicable."},"completed_at":{"type":"string","format":"date-time","description":"When the transaction completed or was rejected."},"source_account":{"type":"string","description":"Source account or wallet id, where applicable (e.g. the sending account of a subaccount transfer)."},"destination_account":{"type":"string","description":"Destination account, payout account or wallet id, where applicable."},"blockchain_transaction_id":{"type":"string","description":"On-chain transaction hash, for `BLOCKCHAIN` transactions."},"payout_account_label":{"type":"string","description":"Label of the destination payout account, for withdrawals."},"blinc_id":{"type":"string","description":"BLINC id of the destination payout account."},"iban":{"type":"string","description":"IBAN of the destination payout account."},"bic":{"type":"string","description":"BIC of the destination payout account."},"blockchain_address":{"type":"string","description":"Address of the destination payout account, for crypto withdrawals."}}}},"cursor":{"type":["string","null"],"description":"Pass as `cursor` to get the next page; `null` on the last page."}}},"examples":{"default":{"summary":"Withdrawal, deposit and subaccount transfer","value":{"transactions":[{"transaction_id":"1ef8a2b4-5c6d-6e7f-8a9b-0c1d2e3f4a01","account_id":"1ef8a2b4-5c6d-6e7f-8a9b-0c1d2e3f4a5b","type":"SEPA","direction":"outgoing","status":"DONE","currency":"EUR","amount":"1000.00","fee_amount":"1.00","net_amount":"999.00","requested_at":"2026-10-01T09:00:00.000000Z","confirmed_at":"2026-10-01T09:00:05.000000Z","completed_at":"2026-10-01T10:00:00.000000Z","source_account":"1ef8a2b4-5c6d-6e7f-8a9b-0c1d2e3f4a5b","destination_account":"1ef8a2b4-5c6d-6e7f-8a9b-0c1d2e3f4a02","payout_account_label":"Main bank","iban":"DE89370400440532013000","bic":"COBADEFFXXX"},{"transaction_id":"1ef8a2b4-5c6d-6e7f-8a9b-0c1d2e3f4a03","account_id":"1ef8a2b4-5c6d-6e7f-8a9b-0c1d2e3f4a5b","type":"BLOCKCHAIN","direction":"incoming","status":"DONE","currency":"BTC","amount":"0.5","fee_amount":"0","net_amount":"0.5","requested_at":"2026-09-30T09:00:00.000000Z","completed_at":"2026-09-30T09:20:00.000000Z","blockchain_transaction_id":"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"},{"transaction_id":"1ef8a2b4-5c6d-6e7f-8a9b-0c1d2e3f4a04","account_id":"1ef8a2b4-5c6d-6e7f-8a9b-0c1d2e3f4a5b","type":"SUBACCOUNT_TRANSFER","direction":"outgoing","status":"DONE","currency":"EUR","amount":"250","fee_amount":"0","net_amount":"250","requested_at":"2026-09-29T12:00:00.000000Z","completed_at":"2026-09-29T12:00:00.000000Z","source_account":"1ef8a2b4-5c6d-6e7f-8a9b-0c1d2e3f4a5b","destination_account":"1ef8a2b4-5c6d-6e7f-8a9b-0c1d2e3f4a6c"}],"cursor":"MjAyNC0wMS0wMVQwMDowMDowMC4wMDBafDIwMjYtMDktMjlUMTE6NTk6NTkuOTk5Wg=="}}}}}},"400":{"description":"Invalid query parameters.","content":{"application/json":{"schema":{"type":"object","required":["error","error_message"],"properties":{"error":{"type":"string","description":"Stable error code.","enum":["INVALID_TRANSACTION_TYPE","INVALID_TRANSACTION_STATUS","INVALID_DIRECTION","INVALID_CURRENCY","INVALID_FROM_TIMESTAMP","INVALID_TO_TIMESTAMP","INVALID_DATE_RANGE","INVALID_LIMIT","INVALID_CURSOR","UNEXPECTED_PARAMETERS"]},"error_message":{"type":"string","description":"Human-readable description of the error."}}},"examples":{"2":{"summary":"INVALID_TRANSACTION_TYPE","value":{"error":"INVALID_TRANSACTION_TYPE","error_message":"type must be a comma separated list of ADJUSTMENT, BLINC, BLOCKCHAIN, CARD, FEE, INSTANT_TRADE_ACCOUNT_TRANSFER, INSTANT_TRADE_FEE, INTERNAL, KINEXYS, SEPA, SEPA_INSTANT, SUBACCOUNT_TRANSFER, SWIFT, WIRE"}},"3":{"summary":"INVALID_TRANSACTION_STATUS","value":{"error":"INVALID_TRANSACTION_STATUS","error_message":"status must be a comma separated list of CANCELLED, CARD_PENDING, CONFIRMED, CREDITED, DONE, FAILED, INITIATED, PENDING, REJECTED, UNDER_REVIEW"}},"4":{"summary":"INVALID_DIRECTION","value":{"error":"INVALID_DIRECTION","error_message":"direction must be one of incoming, outgoing"}},"5":{"summary":"INVALID_CURRENCY","value":{"error":"INVALID_CURRENCY","error_message":"currency must be a currency code, e.g. EUR or BTC"}},"6":{"summary":"INVALID_FROM_TIMESTAMP","value":{"error":"INVALID_FROM_TIMESTAMP","error_message":"The from timestamp is invalid or in an unsupported format"}},"7":{"summary":"INVALID_TO_TIMESTAMP","value":{"error":"INVALID_TO_TIMESTAMP","error_message":"The to timestamp is invalid or in an unsupported format"}},"8":{"summary":"INVALID_DATE_RANGE","value":{"error":"INVALID_DATE_RANGE","error_message":"The date range is invalid or exceeds the maximum allowed period"}},"9":{"summary":"INVALID_LIMIT","value":{"error":"INVALID_LIMIT","error_message":"The limit parameter must be a positive integer and not exceed the maximum allowed value"}},"10":{"summary":"INVALID_CURSOR","value":{"error":"INVALID_CURSOR","error_message":"The cursor parameter is invalid or malformed"}},"11":{"summary":"UNEXPECTED_PARAMETERS","value":{"error":"UNEXPECTED_PARAMETERS","error_message":"Unsupported parameter: foo. Allowed: type, status, direction, currency, from, to, limit, cursor"}}}}}},"403":{"description":"Forbidden. Either the gateway rejected the token (`{\"message\":\"Forbidden\"}`), or the endpoint denied the request with `PERMISSION_DENIED`: the API key lacks the `READ_ONLY` scope, or the request signature is missing or invalid on a key that requires signed requests.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/x-ext/bd75d4a"},{"$ref":"#/x-ext/39f3a7e"}]},"examples":{"gateway":{"summary":"Gateway","value":{"message":"Forbidden"}},"denied":{"summary":"Permission denied","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}}}}}},"429":{"description":"Rate limit exceeded. Limits are per account holder per minute: 600 (retail), 2,000 (institutional), 10,000 (market maker).","content":{"application/json":{"schema":{"$ref":"#/x-ext/bd75d4a"},"example":{"error":"TOO_MANY_REQUESTS","error_message":"Too many requests"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"type":"object","required":["error","error_message"],"properties":{"error":{"type":"string","description":"Stable error code.","enum":["SERVER_ERROR"]},"error_message":{"type":"string","description":"Human-readable description of the error."}}},"example":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}},"security":[{"bearerAuth":[]}]}},"7a68e35":{"get":{"summary":"Get Deposit Addresses","description":"Returns the crypto deposit addresses of your account, each with the network to send on.\n\nDeposit addresses belong to your main account, and deposits to them are credited to it, so this endpoint takes a **main-account token**; a subaccount token gets `403 SUBACCOUNT_NOT_SUPPORTED`.\n\nA currency you haven't generated an address for yet is simply absent from the list: generate one with `POST /v1/account/deposit-addresses`. The currencies and networks you can deposit, with each token's contract address, are in the `networks` of `GET /v1/currencies`.\n\n### Before you send\n\n- Send the currency **only on the address's `network`**. The same address can exist on several networks (e.g. EVM chains), and a deposit on any other network can't be credited.\n- When `destination_tag` is set, include it with **every** deposit. Without it the deposit can't be matched to your account.\n- Check `deposit_enabled`: when it is `false`, deposits of that currency are currently not accepted for your account.\n\n### Filters\n\nBoth are optional; without them every address is returned.\n\n- `currency`: one currency code, e.g. `BTC`. A currency that can't be deposited, such as fiat, answers `400 CURRENCY_NOT_SUPPORTED`.\n- `network`: a network id from `GET /v1/currencies`, e.g. `ETHEREUM`. With `currency`, a network the currency isn't on answers `400 NETWORK_NOT_SUPPORTED`.\n\nRequires an API key (every key has read access) or a user session. Rate limited.","operationId":"getDepositAddresses","tags":["Funding"],"parameters":[{"name":"currency","in":"query","description":"Only addresses for this currency, e.g. `BTC`. Any case is accepted; the code is trimmed and upper-cased.","required":false,"example":"BTC","schema":{"type":"string","pattern":"^\\s*(?=.*[A-Za-z])[A-Za-z0-9]{1,8}\\s*$"}},{"name":"network","in":"query","description":"Only addresses on this network (a network id from `GET /v1/currencies`, e.g. `ETHEREUM`).","required":false,"example":"BITCOIN","schema":{"type":"string"}}],"responses":{"200":{"description":"The account's deposit addresses, ordered by currency. Empty when none has been generated.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["currency","network","address","destination_tag","destination_tag_type","created_at","deposit_enabled"],"properties":{"currency":{"type":"string","description":"Currency code, e.g. `BTC`."},"network":{"type":"string","description":"The network the address is on, as listed in the currency's `networks` in `GET /v1/currencies`, e.g. `BITCOIN` or `ETHEREUM`. Only send the currency on this network."},"address":{"type":"string","description":"The deposit address."},"destination_tag":{"type":["string","null"],"description":"The tag to send with every deposit to this address, on networks that need one (e.g. XRP Ledger). A deposit without it cannot be credited. `null` when the network needs none."},"destination_tag_type":{"type":["string","null"],"enum":["memo","message","destinationTag",null],"description":"What the network calls the tag: `destinationTag` (XRP Ledger), `memo` (Stellar, Cosmos Hub, EOS) or `message` (NEM). `null` when the network needs none."},"created_at":{"type":"string","format":"date-time","description":"When the address was generated (ISO 8601, UTC)."},"deposit_enabled":{"type":"boolean","description":"Whether deposits of the currency to this address are currently accepted for your account. `false` when deposits have been disabled since the address was generated: the address stays yours, but a deposit to it would not be credited until they are enabled again."}}}},"examples":{"default":{"summary":"BTC and XRP addresses","value":[{"currency":"BTC","network":"BITCOIN","address":"bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh","destination_tag":null,"destination_tag_type":null,"created_at":"2026-11-04T10:00:00.000Z","deposit_enabled":true},{"currency":"XRP","network":"XRP_LEDGER","address":"rDsbeomae4FXwgQTJp9Rs64Qg9vDiTCdBv","destination_tag":"1234567","destination_tag_type":"destinationTag","created_at":"2026-11-04T10:05:00.000Z","deposit_enabled":true}]},"empty":{"summary":"No address generated yet","value":[]}}}}},"400":{"description":"Invalid query parameters, or a currency or network that can't be deposited.","content":{"application/json":{"schema":{"type":"object","required":["error","error_message"],"properties":{"error":{"type":"string","description":"Stable error code.","enum":["INVALID_CURRENCY","INVALID_NETWORK","CURRENCY_NOT_SUPPORTED","NETWORK_NOT_SUPPORTED","UNEXPECTED_PARAMETERS"]},"error_message":{"type":"string","description":"Human-readable description of the error."}}},"examples":{"3":{"summary":"INVALID_CURRENCY","value":{"error":"INVALID_CURRENCY","error_message":"currency must be a currency code, e.g. BTC"}},"4":{"summary":"INVALID_NETWORK","value":{"error":"INVALID_NETWORK","error_message":"network must be a network id from GET /v1/currencies, e.g. ETHEREUM"}},"5":{"summary":"CURRENCY_NOT_SUPPORTED","value":{"error":"CURRENCY_NOT_SUPPORTED","error_message":"Deposits are not available for this currency"}},"6":{"summary":"NETWORK_NOT_SUPPORTED","value":{"error":"NETWORK_NOT_SUPPORTED","error_message":"The currency cannot be deposited on this network; GET /v1/currencies lists its networks"}},"7":{"summary":"UNEXPECTED_PARAMETERS","value":{"error":"UNEXPECTED_PARAMETERS","error_message":"Unsupported parameter: foo. Allowed: currency, network"}}}}}},"403":{"description":"Forbidden. Either the gateway rejected the token (`{\"message\":\"Forbidden\"}`), or the endpoint denied the request: `PERMISSION_DENIED` when the token has no exchange account; `SUBACCOUNT_NOT_SUPPORTED` for a subaccount token.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["error","error_message"],"properties":{"error":{"type":"string","description":"Stable error code.","enum":["PERMISSION_DENIED","SUBACCOUNT_NOT_SUPPORTED"]},"error_message":{"type":"string","description":"Human-readable description of the error."}}},{"type":"object","required":["message"],"properties":{"message":{"type":"string","description":"Gateway rejection message."}}}]},"examples":{"9":{"summary":"PERMISSION_DENIED","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}},"10":{"summary":"SUBACCOUNT_NOT_SUPPORTED","value":{"error":"SUBACCOUNT_NOT_SUPPORTED","error_message":"Deposit addresses belong to the main account; use a main account token"}},"gateway":{"summary":"Gateway","value":{"message":"Forbidden"}}}}}},"429":{"description":"Rate limit exceeded. Limits are per account holder per minute: 600 (retail), 2,000 (institutional), 10,000 (market maker).","content":{"application/json":{"schema":{"type":"object","required":["error","error_message"],"properties":{"error":{"type":"string","description":"Stable error code.","enum":["TOO_MANY_REQUESTS"]},"error_message":{"type":"string","description":"Human-readable description of the error."}}},"example":{"error":"TOO_MANY_REQUESTS","error_message":"Too many requests"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"type":"object","required":["error","error_message"],"properties":{"error":{"type":"string","description":"Stable error code.","enum":["SERVER_ERROR"]},"error_message":{"type":"string","description":"Human-readable description of the error."}}},"example":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}},"security":[{"bearerAuth":[]}]},"post":{"summary":"Create Deposit Address","description":"Generates your account's deposit address for a currency, or returns the one it already has.\n\n- `201 Created`: a new address was generated.\n- `200 OK`: you already had an address for the currency; it comes back unchanged. Calling again is safe.\n\nA first address can take several seconds to generate.\n\n`network` is optional and defaults to the currency's default network (`is_default` in `GET /v1/currencies`). For now, addresses can only be generated on the default network; any other network answers `400 NETWORK_NOT_SUPPORTED`.\n\nSend the currency only on the returned `network`, and include `destination_tag` with every deposit when it is set; see `GET /v1/account/deposit-addresses`.\n\n### Requirements\n\n- A **main-account token**: deposit addresses belong to your main account, and deposits to them are credited to it. A subaccount token gets `403 SUBACCOUNT_NOT_SUPPORTED`.\n- An API key with the `TRADE` or `WITHDRAW` scope, or a user session.\n- An active, verified account (`403 ACCOUNT_NOT_ELIGIBLE` otherwise), with deposits of the currency enabled for it (`403 DEPOSITS_NOT_ENABLED` otherwise).\n\nRate limited.","operationId":"createDepositAddress","tags":["Funding"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["currency"],"properties":{"currency":{"type":"string","description":"Currency code, e.g. `BTC`. Any case is accepted; the code is trimmed and upper-cased.","pattern":"^\\s*(?=.*[A-Za-z])[A-Za-z0-9]{1,8}\\s*$"},"network":{"type":"string","description":"Network id from `GET /v1/currencies`. Optional; defaults to the currency's default network, which is currently the only one accepted."}},"additionalProperties":false},"examples":{"default":{"value":{"currency":"BTC"},"summary":"Default network"},"network":{"value":{"currency":"ETH","network":"ETHEREUM"},"summary":"Network named"}}}}},"responses":{"200":{"description":"You already had an address for the currency; it is returned unchanged.","content":{"application/json":{"schema":{"type":"object","required":["currency","network","address","destination_tag","destination_tag_type","created_at","deposit_enabled"],"properties":{"currency":{"type":"string","description":"Currency code, e.g. `BTC`."},"network":{"type":"string","description":"The network the address is on, as listed in the currency's `networks` in `GET /v1/currencies`, e.g. `BITCOIN` or `ETHEREUM`. Only send the currency on this network."},"address":{"type":"string","description":"The deposit address."},"destination_tag":{"type":["string","null"],"description":"The tag to send with every deposit to this address, on networks that need one (e.g. XRP Ledger). A deposit without it cannot be credited. `null` when the network needs none."},"destination_tag_type":{"type":["string","null"],"enum":["memo","message","destinationTag",null],"description":"What the network calls the tag: `destinationTag` (XRP Ledger), `memo` (Stellar, Cosmos Hub, EOS) or `message` (NEM). `null` when the network needs none."},"created_at":{"type":"string","format":"date-time","description":"When the address was generated (ISO 8601, UTC)."},"deposit_enabled":{"type":"boolean","description":"Whether deposits of the currency to this address are currently accepted for your account. `false` when deposits have been disabled since the address was generated: the address stays yours, but a deposit to it would not be credited until they are enabled again."}}},"example":{"currency":"BTC","network":"BITCOIN","address":"bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh","destination_tag":null,"destination_tag_type":null,"created_at":"2026-11-04T10:00:00.000Z","deposit_enabled":true}}}},"201":{"description":"A new address was generated.","content":{"application/json":{"schema":{"type":"object","required":["currency","network","address","destination_tag","destination_tag_type","created_at","deposit_enabled"],"properties":{"currency":{"type":"string","description":"Currency code, e.g. `BTC`."},"network":{"type":"string","description":"The network the address is on, as listed in the currency's `networks` in `GET /v1/currencies`, e.g. `BITCOIN` or `ETHEREUM`. Only send the currency on this network."},"address":{"type":"string","description":"The deposit address."},"destination_tag":{"type":["string","null"],"description":"The tag to send with every deposit to this address, on networks that need one (e.g. XRP Ledger). A deposit without it cannot be credited. `null` when the network needs none."},"destination_tag_type":{"type":["string","null"],"enum":["memo","message","destinationTag",null],"description":"What the network calls the tag: `destinationTag` (XRP Ledger), `memo` (Stellar, Cosmos Hub, EOS) or `message` (NEM). `null` when the network needs none."},"created_at":{"type":"string","format":"date-time","description":"When the address was generated (ISO 8601, UTC)."},"deposit_enabled":{"type":"boolean","description":"Whether deposits of the currency to this address are currently accepted for your account. `false` when deposits have been disabled since the address was generated: the address stays yours, but a deposit to it would not be credited until they are enabled again."}}},"examples":{"btc":{"summary":"BTC","value":{"currency":"BTC","network":"BITCOIN","address":"bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh","destination_tag":null,"destination_tag_type":null,"created_at":"2026-11-04T10:00:00.000Z","deposit_enabled":true}},"xrp":{"summary":"XRP, with a destination tag","value":{"currency":"XRP","network":"XRP_LEDGER","address":"rDsbeomae4FXwgQTJp9Rs64Qg9vDiTCdBv","destination_tag":"1234567","destination_tag_type":"destinationTag","created_at":"2026-11-04T10:05:00.000Z","deposit_enabled":true}}}}}},"400":{"description":"Invalid body, or a currency or network that can't be deposited.","content":{"application/json":{"schema":{"type":"object","required":["error","error_message"],"properties":{"error":{"type":"string","description":"Stable error code.","enum":["INVALID_REQUEST_BODY","INVALID_CURRENCY","INVALID_NETWORK","CURRENCY_NOT_SUPPORTED","NETWORK_NOT_SUPPORTED","UNEXPECTED_PARAMETERS"]},"error_message":{"type":"string","description":"Human-readable description of the error."}}},"examples":{"4":{"summary":"INVALID_REQUEST_BODY","value":{"error":"INVALID_REQUEST_BODY","error_message":"body: must be valid JSON"}},"5":{"summary":"INVALID_CURRENCY","value":{"error":"INVALID_CURRENCY","error_message":"currency must be a currency code, e.g. BTC"}},"6":{"summary":"INVALID_NETWORK","value":{"error":"INVALID_NETWORK","error_message":"network must be a network id from GET /v1/currencies, e.g. ETHEREUM"}},"7":{"summary":"CURRENCY_NOT_SUPPORTED","value":{"error":"CURRENCY_NOT_SUPPORTED","error_message":"Deposits are not available for this currency"}},"8":{"summary":"NETWORK_NOT_SUPPORTED","value":{"error":"NETWORK_NOT_SUPPORTED","error_message":"The currency cannot be deposited on this network; GET /v1/currencies lists its networks"}},"9":{"summary":"UNEXPECTED_PARAMETERS","value":{"error":"UNEXPECTED_PARAMETERS","error_message":"Unexpected parameters were provided"}}}}}},"403":{"description":"Forbidden. Either the gateway rejected the token (`{\"message\":\"Forbidden\"}`), or the endpoint denied the request: `PERMISSION_DENIED` when the API key lacks the `TRADE` and `WITHDRAW` scopes or the token has no exchange account; `SUBACCOUNT_NOT_SUPPORTED` for a subaccount token; `ACCOUNT_NOT_ELIGIBLE` when the account isn't active and verified; `DEPOSITS_NOT_ENABLED` when deposits of the currency aren't enabled for the account.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["error","error_message"],"properties":{"error":{"type":"string","description":"Stable error code.","enum":["PERMISSION_DENIED","SUBACCOUNT_NOT_SUPPORTED","ACCOUNT_NOT_ELIGIBLE","DEPOSITS_NOT_ENABLED"]},"error_message":{"type":"string","description":"Human-readable description of the error."}}},{"type":"object","required":["message"],"properties":{"message":{"type":"string","description":"Gateway rejection message."}}}]},"examples":{"11":{"summary":"PERMISSION_DENIED","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}},"12":{"summary":"SUBACCOUNT_NOT_SUPPORTED","value":{"error":"SUBACCOUNT_NOT_SUPPORTED","error_message":"Deposit addresses belong to the main account; use a main account token"}},"13":{"summary":"ACCOUNT_NOT_ELIGIBLE","value":{"error":"ACCOUNT_NOT_ELIGIBLE","error_message":"The account must be active and verified to create a deposit address"}},"14":{"summary":"DEPOSITS_NOT_ENABLED","value":{"error":"DEPOSITS_NOT_ENABLED","error_message":"Deposits of this currency are not enabled for the account"}},"gateway":{"summary":"Gateway","value":{"message":"Forbidden"}}}}}},"409":{"description":"Your existing address for the currency is on a different network from the one requested. `GET /v1/account/deposit-addresses` returns it.","content":{"application/json":{"schema":{"type":"object","required":["error","error_message"],"properties":{"error":{"type":"string","description":"Stable error code.","enum":["DEPOSIT_ADDRESS_ON_OTHER_NETWORK"]},"error_message":{"type":"string","description":"Human-readable description of the error."}}},"example":{"error":"DEPOSIT_ADDRESS_ON_OTHER_NETWORK","error_message":"The account's ETH deposit address is on ETHEREUM; GET /v1/account/deposit-addresses returns it"}}}},"429":{"description":"Rate limit exceeded. Limits are per account holder per minute: 600 (retail), 2,000 (institutional), 10,000 (market maker).","content":{"application/json":{"schema":{"type":"object","required":["error","error_message"],"properties":{"error":{"type":"string","description":"Stable error code.","enum":["TOO_MANY_REQUESTS"]},"error_message":{"type":"string","description":"Human-readable description of the error."}}},"example":{"error":"TOO_MANY_REQUESTS","error_message":"Too many requests"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"type":"object","required":["error","error_message"],"properties":{"error":{"type":"string","description":"Stable error code.","enum":["SERVER_ERROR"]},"error_message":{"type":"string","description":"Human-readable description of the error."}}},"example":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}},"security":[{"bearerAuth":[]}]}},"b5f2cbe":{"post":{"summary":"Withdraw to Payout Account","description":"Withdraws funds from the account holder's main account to one of their active payout accounts. The withdrawal is confirmed immediately and processed asynchronously; track it with the returned `transaction_id`.\n\nIdentify the payout account with exactly one of `payout_account_id` (recommended, from Get Payout Accounts), `iban`, `account_number`, `blinc_id` or `blockchain_address`. The payout account must be active and match `type` and `currency_code`.\n\n`amount` is a plain decimal string (no sign, exponent or leading zeros) with no more decimal places than the currency supports (see Currencies), at most 8; trailing zeros count towards the decimal places. The withdrawal fee is deducted from `amount`, so `amount` must be greater than the fee.\n\nWithdrawals are made from the main account only; tokens acting on a subaccount are rejected. The account must be active and verified.\n\n**Required API scope:** `WITHDRAW`. This endpoint is not rate-limited.\n\n> **Important:** For security reasons, this endpoint requires an API key with the `WITHDRAW` scope and is only available to market-maker accounts; other accounts receive `403 WITHDRAWAL_NOT_ENABLED`.\n> \n> An API key can only be given the `WITHDRAW` scope together with an IP allowlist and signed requests, and requests from an address outside the allowlist are rejected by the gateway (`403 {\"message\":\"Forbidden\"}`). Legacy API keys must also carry an IP allowlist (`403 API_KEY_IP_ALLOWLIST_REQUIRED`), and the request must come from an address on it (`403 API_KEY_IP_NOT_ALLOWED`).","operationId":"withdrawToPayoutAccount","tags":["Funding"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["currency_code","amount","type","payout_account"],"properties":{"currency_code":{"type":"string","description":"Currency to withdraw, e.g. `EUR` or `BTC`. Any case is accepted; the code is trimmed and upper-cased."},"amount":{"type":"string","description":"Positive decimal string with no sign, exponent or leading zeros, within the currency precision (at most 8 decimal places).","examples":["100.50"]},"type":{"type":"string","enum":["BLINC","SEPA","SWIFT","WIRE","BLOCKCHAIN"],"description":"Transfer method. Must match the payout account."},"payout_account":{"description":"Exactly one payout account identifier.","oneOf":[{"title":"By payout account ID","type":"object","additionalProperties":false,"required":["payout_account_id"],"properties":{"payout_account_id":{"type":"string","format":"uuid"}}},{"title":"By IBAN","type":"object","additionalProperties":false,"required":["iban"],"properties":{"iban":{"type":"string"}}},{"title":"By account number","type":"object","additionalProperties":false,"required":["account_number"],"properties":{"account_number":{"type":"string"}}},{"title":"By BLINC ID","type":"object","additionalProperties":false,"required":["blinc_id"],"properties":{"blinc_id":{"type":"string"}}},{"title":"By blockchain address","type":"object","additionalProperties":false,"required":["blockchain_address"],"properties":{"blockchain_address":{"type":"string"}}}]}}},"examples":{"byPayoutAccountId":{"value":{"currency_code":"EUR","amount":"100.50","type":"SEPA","payout_account":{"payout_account_id":"1ef8a2b4-5c6d-6e7f-8a9b-0c1d2e3f4a01"}},"summary":"SEPA withdrawal by payout account ID"},"byBlockchainAddress":{"value":{"currency_code":"BTC","amount":"0.25","type":"BLOCKCHAIN","payout_account":{"blockchain_address":"bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh"}},"summary":"BTC withdrawal by blockchain address"}}}},"required":true},"responses":{"200":{"description":"Withdrawal created.","content":{"application/json":{"schema":{"type":"object","required":["success","transaction_id"],"properties":{"success":{"type":"boolean","const":true},"transaction_id":{"type":"string","format":"uuid","description":"ID of the withdrawal transaction."}}},"example":{"success":true,"transaction_id":"1ef92c1a-7b3d-6e40-9f21-5a6b7c8d9e0f"}}}},"400":{"description":"The request is invalid or was rejected. `INVALID_WITHDRAWAL_REQUEST` covers a missing or malformed JSON body and unknown fields, with the detail in `error_message`. Rejections by the payment processor that have no specific code are returned as `WITHDRAWAL_REJECTED`.","content":{"application/json":{"schema":{"type":"object","required":["error","error_message"],"properties":{"error":{"type":"string","description":"Stable error code.","enum":["INVALID_WITHDRAWAL_REQUEST","INVALID_CURRENCY_CODE","UNSUPPORTED_CURRENCY","INVALID_AMOUNT","AMOUNT_EXCEEDS_CURRENCY_PRECISION","INVALID_TRANSFER_METHOD","INVALID_PAYOUT_ACCOUNT_REFERENCE","PAYOUT_ACCOUNT_NOT_FOUND","PAYOUT_ACCOUNT_INACTIVE","PAYOUT_ACCOUNT_TYPE_MISMATCH","PAYOUT_ACCOUNT_CURRENCY_MISMATCH","TRANSFER_METHOD_DISABLED","WITHDRAWAL_AMOUNT_TOO_LOW","WITHDRAWAL_REJECTED"]},"error_message":{"type":"string","description":"Human-readable description of the error."}}},"examples":{"2":{"summary":"INVALID_WITHDRAWAL_REQUEST","value":{"error":"INVALID_WITHDRAWAL_REQUEST","error_message":"body: a JSON body is required"}},"3":{"summary":"INVALID_CURRENCY_CODE","value":{"error":"INVALID_CURRENCY_CODE","error_message":"currency_code must be a currency code, e.g. EUR or BTC"}},"4":{"summary":"UNSUPPORTED_CURRENCY","value":{"error":"UNSUPPORTED_CURRENCY","error_message":"currency_code is not a supported currency"}},"5":{"summary":"INVALID_AMOUNT","value":{"error":"INVALID_AMOUNT","error_message":"amount must be a positive decimal string within the precision of the currency"}},"6":{"summary":"AMOUNT_EXCEEDS_CURRENCY_PRECISION","value":{"error":"AMOUNT_EXCEEDS_CURRENCY_PRECISION","error_message":"amount has more decimal places than currency_code supports; each currency precision is listed by GET /v1/currencies"}},"7":{"summary":"INVALID_TRANSFER_METHOD","value":{"error":"INVALID_TRANSFER_METHOD","error_message":"type must be one of BLINC, SEPA, SWIFT, WIRE, BLOCKCHAIN"}},"8":{"summary":"INVALID_PAYOUT_ACCOUNT_REFERENCE","value":{"error":"INVALID_PAYOUT_ACCOUNT_REFERENCE","error_message":"payout_account must contain exactly one of payout_account_id, iban, account_number, blinc_id, blockchain_address"}},"9":{"summary":"PAYOUT_ACCOUNT_NOT_FOUND","value":{"error":"PAYOUT_ACCOUNT_NOT_FOUND","error_message":"No single active payout account of this account matches payout_account"}},"10":{"summary":"PAYOUT_ACCOUNT_INACTIVE","value":{"error":"PAYOUT_ACCOUNT_INACTIVE","error_message":"The payout account is not active"}},"11":{"summary":"PAYOUT_ACCOUNT_TYPE_MISMATCH","value":{"error":"PAYOUT_ACCOUNT_TYPE_MISMATCH","error_message":"The payout account does not support this type"}},"12":{"summary":"PAYOUT_ACCOUNT_CURRENCY_MISMATCH","value":{"error":"PAYOUT_ACCOUNT_CURRENCY_MISMATCH","error_message":"The payout account does not support this currency"}},"13":{"summary":"TRANSFER_METHOD_DISABLED","value":{"error":"TRANSFER_METHOD_DISABLED","error_message":"Withdrawals with this type and currency are currently disabled"}},"14":{"summary":"WITHDRAWAL_AMOUNT_TOO_LOW","value":{"error":"WITHDRAWAL_AMOUNT_TOO_LOW","error_message":"amount must be greater than the withdrawal fee"}},"15":{"summary":"WITHDRAWAL_REJECTED","value":{"error":"WITHDRAWAL_REJECTED","error_message":"The withdrawal was rejected"}}}}}},"403":{"description":"Not permitted. Codes: `MISSING_WITHDRAW_SCOPE`, `API_KEY_IP_ALLOWLIST_REQUIRED`, `API_KEY_IP_NOT_ALLOWED`, `WITHDRAWAL_NOT_ENABLED`, `PERMISSION_DENIED`, `WITHDRAWAL_SUBACCOUNT_NOT_SUPPORTED`, `WITHDRAWAL_PROOF_OF_FUNDS_REVIEW`. `WITHDRAWAL_NOT_ENABLED` is returned for accounts that are not market makers. `PERMISSION_DENIED` is returned when the token cannot be used for this endpoint. The gateway returns `{\"message\":\"Forbidden\"}` for a missing, invalid or revoked token, or a request from an address outside the API key's allowlist. `PERMISSION_DENIED` is also returned when the account is not active or not verified. `WITHDRAWAL_PROOF_OF_FUNDS_REVIEW` is returned while a proof of funds review is open on the account.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/x-ext/bd75d4a"},{"$ref":"#/x-ext/39f3a7e"}]},"examples":{"16":{"summary":"MISSING_WITHDRAW_SCOPE","value":{"error":"MISSING_WITHDRAW_SCOPE","error_message":"This API key does not have the withdraw scope"}},"17":{"summary":"API_KEY_IP_ALLOWLIST_REQUIRED","value":{"error":"API_KEY_IP_ALLOWLIST_REQUIRED","error_message":"An API key used for withdrawals must have an IP allowlist"}},"18":{"summary":"API_KEY_IP_NOT_ALLOWED","value":{"error":"API_KEY_IP_NOT_ALLOWED","error_message":"The request IP address is not in the API key allowlist"}},"19":{"summary":"WITHDRAWAL_NOT_ENABLED","value":{"error":"WITHDRAWAL_NOT_ENABLED","error_message":"API withdrawals are not enabled for this account"}},"20":{"summary":"PERMISSION_DENIED","value":{"error":"PERMISSION_DENIED","error_message":"Permission denied"}},"21":{"summary":"WITHDRAWAL_SUBACCOUNT_NOT_SUPPORTED","value":{"error":"WITHDRAWAL_SUBACCOUNT_NOT_SUPPORTED","error_message":"Withdrawals are made from the main account; use a token for the main account"}},"22":{"summary":"Gateway","value":{"message":"Forbidden"}},"29":{"summary":"WITHDRAWAL_PROOF_OF_FUNDS_REVIEW","value":{"error":"WITHDRAWAL_PROOF_OF_FUNDS_REVIEW","error_message":"Withdrawals are disabled while a proof of funds review is open"}}}}}},"500":{"description":"Server error.","content":{"application/json":{"schema":{"type":"object","required":["error","error_message"],"properties":{"error":{"type":"string","description":"Stable error code.","enum":["SERVER_ERROR"]},"error_message":{"type":"string","description":"Human-readable description of the error."}}},"example":{"error":"SERVER_ERROR","error_message":"An internal server error occurred"}}}}},"security":[{"bearerAuth":[]}]}}}}