One Trading API
REST API
WebSocket API
REST API
WebSocket API
  1. Trading
  • Futures
    • Introduction
    • Funding Rate Methodology
    • Funding Payments
      GET
    • Positions
      GET
    • Position Funding Payments
      GET
    • Funding Rate Settings
      GET
    • Get Futures Open Positions
      GET
    • Futures Portfolio Summary
      GET
    • Current Funding Rate
      GET
    • Funding Rate History
      GET
    • Funding Schedule
      GET
  • Public
    • Currencies
      GET
    • Instruments
      GET
    • Candlesticks
      GET
    • Fee Groups
      GET
    • Order Book
      GET
    • Market Ticker
      GET
    • Market Ticker For Instrument
      GET
    • Time
      GET
  • Trading
    • Get Orders
      GET
    • Create Order
      POST
    • Get Order by Client ID
      GET
    • Get Order by Order ID
      GET
    • Balances
      GET
    • Fees
      GET
    • Get Trades for Order
      GET
    • Get Trade by Trade ID
      GET
    • Get Trades
      GET
    • Cancel All Orders
      DELETE
    • Cancel Order by Order ID
      DELETE
    • Cancel Order by Client ID
      DELETE
  • Funding
    • Transfer Subaccount Balance
      POST
  1. Trading

Cancel All Orders

DELETE
https://api.onetrading.com/fast/v1/account/orders
Submits a cancel request for all open orders of an account.
Optionally the user can specify a list of ids representing order ids or a list of client_ids, and an instrument_code, as query parameters:
instrument_code alone cancels every open order on that instrument.
ids cancels those orders, regardless of the market they belong to. With instrument_code, only those orders on that instrument are cancelled.
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.
Calling 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.
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.
Make sure to have a valid API key with the scope TRADE, otherwise this operation will be rejected. This endpoint is not rate-limited.

Response#

The response lists the cancellations the exchange confirmed within a short window, not every order submitted for cancellation:
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.
With ids, it contains the order ids confirmed within 2 seconds. IDs of orders that do not exist are skipped.
With client_ids, it contains the client ids (not order ids) confirmed within 2 seconds.
ids and client_ids must be wrapped in square brackets, e.g. [id1,id2].

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Query Params

Responses

🟢200Success
application/json
Bodyapplication/json

🟠400Bad Request
🟠401Unauthorized
🟠403Forbidden
🔴500Server Error
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --globoff --request DELETE 'https://api.onetrading.com/fast/v1/account/orders?instrument_code=BTC_EUR&ids=[d1efc79d-f78d-4a9d-a4c0-dbe76c9a4e6f%2C8ada8f2d-56ea-4b24-bfd4-06723dfbb3be]&client_ids=[d1efc79d-f78d-4a9d-a4c0-dbe76c9a4e6f%2C8ada8f2d-56ea-4b24-bfd4-06723dfbb3be]' \
--header 'Authorization: Bearer <token>'
Response Response Example
200 - Success Example
7749a0ff-9a5f-41ac-a1a5-dc031a70091c
Previous
Get Trades
Next
Cancel Order by Order ID
Built with