> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.paradex.trade/api/prod/orders/cancel-batch/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.paradex.trade/_mcp/server. # Cancel batch of orders by order IDs DELETE https://api.prod.paradex.trade/v1/orders/batch Content-Type: application/json Queues cancellation for multiple orders by providing identifiers in a batch. The request body can contain either or both of: * `order_ids`: Array of order IDs assigned by Paradex * `client_order_ids`: Array of client-assigned order IDs ```json { "order_ids": ["order-id-1", "order-id-2"], "client_order_ids": ["client-id-1", "client-id-2"] } ``` Returns a 200 OK status code with detailed results for each order: ```json { "results": [ { "id": "order-id-1", "client_id": "client-id-X", "account": "account-1", "market": "BTC-USD-PERP", "status": "QUEUED_FOR_CANCELLATION" }, { "id": "order-id-2", "client_id": "client-id-Y", "account": "account-1", "market": "ETH-USD-PERP", "status": "ALREADY_CLOSED" }, { "id": "order-id-3", "client_id": "client-id-1", "account": "account-1", "market": "BTC-USD-PERP", "status": "QUEUED_FOR_CANCELLATION" }, { "client_id": "client-id-2", "status": "NOT_FOUND" } ] } ``` Each result includes: * `id`: Order ID (if the order was found) * `client_id`: Client order ID (if available) * `account`: Account that owns the order * `market`: Market of the order * `status`: One of: * `QUEUED_FOR_CANCELLATION`: Order was successfully queued for cancellation * `ALREADY_CLOSED`: Order was already in a closed state * `NOT_FOUND`: The order with the provided ID/client ID was not found Confirmation of cancellation will be sent via websocket or can be verified from GET /orders/:id endpoint. Orders that are already in a CLOSED state will be included in the response with status "ALREADY\_CLOSED". Reference: https://docs.paradex.trade/api/prod/orders/cancel-batch ## Authentication - `Authorization` header (required) — API Key authentication via header ## Request ### Body (application/json) This endpoint expects a requests.CancelOrderBatchRequest. - `client_order_ids` (list of string, optional) — List of client order IDs to cancel - `order_ids` (list of string, optional) — List of order IDs to cancel ## Response ### 200 List of cancellation results - `results` (list of responses.CancelOrderResult, optional) — List of cancellation results ## Errors ### 400 Bad Request Error Bad Request - `data` (ResponsesApiErrorData, optional) — any additional data related to the error - `error` (enum, optional) — unique immutable string identifier for specific error - Allowed values: `VALIDATION_ERROR`, `BINDING_ERROR`, `INTERNAL_ERROR`, `NOT_FOUND`, `SERVICE_UNAVAILABLE`, `INVALID_REQUEST_PARAMETER`, `ORDER_ID_NOT_FOUND`, `ORDER_IS_CLOSED`, `ORDER_IS_NOT_OPEN`, `INVALID_ORDER_SIZE`, `CLIENT_ORDER_ID_NOT_FOUND`, `DUPLICATED_CLIENT_ID`, `INVALID_SYMBOL`, `INVALID_TOKEN`, `INVALID_ETHEREUM_ADDRESS`, `INVALID_ETHEREUM_SIGNATURE`, `INVALID_STARKNET_ADDRESS`, `INVALID_STARKNET_SIGNATURE`, `STARKNET_SIGNATURE_VERIFICATION_FAILED`, `ETHEREUM_SIGNER_MISMATCH`, `ETHEREUM_HASH_MISMATCH`, `NOT_ONBOARDED`, `INVALID_TIMESTAMP`, `INVALID_BLOCK_EXPIRATION`, `ACCOUNT_NOT_FOUND`, `MEDIA_NOT_FOUND`, `INVALID_ORDER_SIGNATURE`, `PUBLIC_KEY_INVALID`, `UNAUTHORIZED_ETHEREUM_ADDRESS`, `UNAUTHORIZED_ERROR`, `ETHEREUM_ADDRESS_ALREADY_ONBOARDED`, `EVM_ADDRESS_ALREADY_ONBOARDED`, `MARKET_NOT_FOUND`, `ALLOWLIST_ENTRY_NOT_FOUND`, `USERNAME_IN_USE`, `GEO_IP_BLOCK`, `ETHEREUM_ADDRESS_BLOCKED`, `PROGRAM_NOT_FOUND`, `PROGRAM_NOT_SUPPORTED`, `INVALID_DASHBOARD`, `MARKET_NOT_OPEN`, `MARKET_NOT_SETTLED`, `INVALID_REFERRAL_CODE`, `REQUEST_NOT_ALLOWED`, `PARENT_ADDRESS_ALREADY_ONBOARDED`, `INVALID_PARENT_ACCOUNT`, `INVALID_VAULT_OPERATOR_CHAIN`, `VAULT_OPERATOR_ALREADY_ONBOARDED`, `VAULT_NAME_IN_USE`, `VAULT_NOT_FOUND`, `VAULT_STRATEGY_NOT_FOUND`, `VAULT_LIMIT_REACHED`, `VAULT_DATA_PRIVATE`, `BATCH_SIZE_OUT_OF_RANGE`, `ISOLATED_MARKET_ACCOUNT_MISMATCH`, `NO_ACCESS_TO_MARKET`, `POINTS_SUMMARY_NOT_FOUND`, `ALGO_ID_NOT_FOUND`, `INVALID_DERIVATION_PATH`, `PROFILE_STATS_NOT_FOUND`, `INVALID_CHAIN`, `INVALID_LAYERSWAP_SWAP`, `SOCIAL_USERNAME_IN_USE`, `INVALID_OAUTH_REQUEST`, `RPI_ACCOUNT_NOT_WHITELISTED`, `SYSTEM_STATUS_POST_ONLY`, `SYSTEM_STATUS_CANCEL_ONLY`, `INVALID_MARKETING_CODE`, `OFFER_NOT_FOUND`, `MARKET_MARGIN_RESTRICTED`, `NOT_UNIQUE`, `ACCOUNT_ALREADY_REFERRED`, `ONBOARDING_PERIOD_EXPIRED`, `ONBOARDING_RATE_LIMITED`, `SUBACCOUNTS_LIMIT_EXCEEDED`, `INSUFFICIENT_MIN_CHAIN_BALANCE`, `INSUFFICIENT_EVM_BALANCE`, `PORTFOLIO_MARGIN_ONBOARDING_DISABLED`, `PORTFOLIO_MARGIN_INVALID_ACCOUNT_KIND`, `EVM_VAULT_OPERATORS_DISABLED`, `INVALID_EVM_SIGNATURE`, `EVM_SIGNATURE_VERIFICATION_FAILED`, `INVALID_SUBKEY`, `SUBKEY_NOT_ACTIVATABLE`, `TOKEN_LIMIT_REACHED`, `INVALID_TOKEN_SCOPE`, `IP_NOT_ALLOWED`, `INSUFFICIENT_TRANSFERRABLE_XP`, `TRANSFER_LIMIT_REACHED`, `XP_TRANSFERS_DISABLED`, `BLOCK_TRADE_NOT_FOUND`, `BLOCK_TRADE_NOT_ENABLED`, `BLOCK_TRADE_EXPIRED`, `BLOCK_TRADE_ALREADY_CANCELLED`, `BLOCK_TRADE_INVALID_STATUS`, `BLOCK_TRADE_UNAUTHORIZED`, `BLOCK_TRADE_MISSING_TRADES`, `BLOCK_TRADE_MISSING_SIGNERS`, `BLOCK_TRADE_MISSING_SIGNATURE`, `BLOCK_TRADE_ACCOUNT_MISMATCH`, `BLOCK_TRADE_INVALID_SIGNATURE`, `BLOCK_TRADE_SIGNER_KEY_UNAUTHORIZED`, `BLOCK_TRADE_REPLAYED_SIGNATURE`, `BLOCK_TRADE_SELF_TRADE`, `OFFER_ALREADY_CANCELLED`, `OFFER_INVALID_STATUS`, `OFFER_UNAUTHORIZED`, `OFFER_PARENT_MISMATCH`, `OFFER_PARENT_NOT_ACCEPTING`, `PORTFOLIO_MARGIN_CONFIG_NOT_FOUND`, `MARGIN_CONFIG_NOT_FOUND`, `MMP_CONFIG_INVALID`, `MMP_NOT_ENABLED`, `MMP_MIN_FREEZE_NOT_ELAPSED`, `MMP_NOT_CONFIGURED` - `message` (string, optional) — detailed description of error and how to address it ## Types ### responses.CancelOrderResult - `account` (string, optional) — Account that owns the order - `client_id` (string, optional) — Client order ID - `id` (string, optional) — Order ID - `market` (string, optional) — Market of the order - `status` (string, optional) — Status of the cancellation: QUEUED_FOR_CANCELLATION, ALREADY_CLOSED, NOT_FOUND ### ResponsesApiErrorData any additional data related to the error ## Examples **Request** ```json {} ``` **Response** ```json { "results": [ { "account": "string", "client_id": "string", "id": "string", "market": "string", "status": "string" } ] } ``` **SDK Code** ```python import requests url = "https://api.prod.paradex.trade/v1/orders/batch" payload = {} headers = { "Authorization": "", "Content-Type": "application/json" } response = requests.delete(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.prod.paradex.trade/v1/orders/batch'; const options = { method: 'DELETE', headers: {Authorization: '', 'Content-Type': 'application/json'}, body: '{}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.prod.paradex.trade/v1/orders/batch" payload := strings.NewReader("{}") req, _ := http.NewRequest("DELETE", url, payload) req.Header.Add("Authorization", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.prod.paradex.trade/v1/orders/batch") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Delete.new(url) request["Authorization"] = '' request["Content-Type"] = 'application/json' request.body = "{}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.delete("https://api.prod.paradex.trade/v1/orders/batch") .header("Authorization", "") .header("Content-Type", "application/json") .body("{}") .asString(); ``` ```php request('DELETE', 'https://api.prod.paradex.trade/v1/orders/batch', [ 'body' => '{}', 'headers' => [ 'Authorization' => '', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.prod.paradex.trade/v1/orders/batch"); var request = new RestRequest(Method.DELETE); request.AddHeader("Authorization", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "", "Content-Type": "application/json" ] let parameters = [] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.prod.paradex.trade/v1/orders/batch")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "DELETE" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```