sFOX API
Sign InOpen Account
sFOX API
sFOX API
  • Introduction
    • Welcome
    • Getting Started
    • Systems & Operations
    • Rate Limits
  • REST API
    • REST Endpoints
    • Authentication
    • Rate Limits
    • Account Management
      • Get All Balances
      • Get All Currencies
      • Get All Currency Pairs
      • Get All Transactions
      • Get Fees
    • Orders
      • Order Types
      • Create Order
      • Cancel Order
      • Cancel Multiple Orders
      • Cancel All Orders
      • Amend Order
      • Get Single Order
      • Get All Open Orders
      • Get All Done Orders
      • Get All Trades
    • Request for Quote (RFQ)
    • Post-Trade Settlement (PTS)
      • Get Account Risk Metrics
      • Get All Positions
      • Get All Funding Transactions
      • Get All Funding Rates
      • Get All Risk Modes
      • Create Transfer
    • Shorting
      • Get Account Risk Metrics
      • Get All Positions
    • Transfers
      • Get All Deposit Addresses
      • Get Single Deposit Address
      • Create Deposit Address
      • Deposit From Bank Account
      • Withdraw From Account
      • Get Single Withdrawal Fee
      • Create Transfer
    • Custody (sFOX SAFE)
      • Get Whitelisted Addresses
      • Add Whitelisted Address
      • Delete Whitelisted Address
      • Get Approval Rules
      • Create Approval Rule
      • Edit Approval Rule
      • Get Approval Requests
      • Respond to Approval Request
    • Staking
      • Get Staking Currencies
      • Get All Staking Transactions
      • Create Stake
      • Cancel Stake
      • Unstake
    • Market Data
      • Get Candlesticks
      • Get Volume Analytics
      • Get Order Estimate
      • Get Order Book
    • Reporting
      • Get Orders Report
      • Get Monthly Summary
      • Get Portfolio Valuation
      • Get All Transactions
  • WebSocket API
    • Introduction
    • Connecting
    • Rate Limits
    • Authentication
    • Subscribing & Unsubscribing
    • Message Format
    • Market Data
      • Order Book
      • Trades
      • Ticker
    • Orders & Account Data
      • Orders
      • Trades
      • Balances
      • Post-Trade Settlement
  • FIX API
    • FIX Order Entry
    • FIX Market Data
    • QuickFIX Guide
  • Errors
    • Error Codes
Powered by GitBook
  1. REST API
  2. Orders

Cancel Multiple Orders

DELETE https://api.sfox.com/v1/orders?ids=<order_id1>,<order_id2>,<...>

Cancel a list of order IDs. sFOX will attempt to cancel each order included in the list and respond with the orders that were able to be canceled.

Query Parameters

Parameter
Type
Description

ids required

string

List of order IDs separated by a comma (,)

e.g. /orders?ids=123,456,789

Responses

200

Responds with an array of all of the orders listed in the request that were able to begin cancelation (Cancel Pending) or were successfully canceled (Canceled)

{ 
  "orders": [
    {"id": 2, "status": "Cancel pending"},
    {"id": 3, "status": "Canceled"}
  ]
}
400

If all of the provided order IDs were invalid, or were already in a Done or Canceled state, the response will contain an error.

{ 
  "error": "the order ids provided were invalid or the orders were already done/canceled"
}

Example Requests

curl -X DELETE \
  -H 'Authorization: Bearer <API_TOKEN>' \
  'https://api.sfox.com/v1/orders?ids=123,456'
const axios = require('axios');

axios({
  method: 'delete',
  url: 'https://api.sfox.com/v1/orders',
  headers: {
    'Authorization': 'Bearer <API_KEY>'
  },
  params: {
    ids: '123,456'
  }
}).then(response => {
  console.log(response)
}).catch(err => {
  console.error(err)
});
import requests

data = requests.delete(
  "https://api.sfox.com/v1/orders",
  headers={
    "Authorization": "Bearer <API_KEY>",
  },
  params={
   "ids": "123,456"
  }
)
print(data)
PreviousCancel OrderNextCancel All Orders

Last updated 1 year ago