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

chevron-right200hashtag

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"}
  ]
}
chevron-right400hashtag

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'

Last updated