POST
/
api
/
v1
/
orders
/
{orderId}
/
cancel
curl -X POST "https://api.roxom.com/api/v1/orders/01234567-89ab-7def-8123-456789abcdea/cancel" \
  -H "X-API-Key: your_api_key_here" \
  -H "Content-Type: application/json"
{
  "data": {
    "success": true
  }
}

Cancel Single Order

Cancel an existing active order by order ID.

Endpoint

POST /api/v1/orders/{orderId}/cancel

Parameters

orderId
string
required
Order ID to cancel (UUID v7)
X-API-Key
string
required
API key for authentication

Example Request

curl -X POST "https://api.roxom.com/api/v1/orders/01234567-89ab-7def-8123-456789abcdea/cancel" \
  -H "X-API-Key: your_api_key_here" \
  -H "Content-Type: application/json"

Response

{
  "data": {
    "success": true
  }
}
data
object
Cancellation confirmation details

Cancel All Orders

Cancel all active orders for the authenticated account.

Endpoint

POST /api/v1/orders/cancel-all

Parameters

X-API-Key
string
required
API key for authentication

Example Request

curl -X POST "https://api.roxom.com/api/v1/orders/cancel-all" \
  -H "X-API-Key: your_api_key_here" \
  -H "Content-Type: application/json"

Response

{
  "data": {
    "cancelledOrderIds": [
      "01234567-89ab-7def-8123-456789abcdef",
      "98765432-10fe-dcba-9876-543210fedcba"
    ]
  },
  "error": false
}
data
object
Bulk cancellation results

Cancellation States

Error Handling

Emergency Cancellation

For urgent situations, use the “Cancel All” endpoint to quickly close all positions:
def emergency_cancel_all():
    """Emergency function to cancel all active orders."""
    
    try:
        response = requests.post(
            'https://api.roxom.com/api/v1/orders/cancel-all',
            headers=headers,
            timeout=5
        )
        
        if response.status_code == 200:
            result = response.json()
            print(f"Emergency cancel: {len(result['data']['cancelledOrderIds'])} orders canceled")
            return True
        else:
            print(f"Emergency cancel failed: {response.status_code}")
            return False
            
    except Exception as e:
        print(f"Emergency cancel error: {e}")
        return False

Best Practices