Cancel all orders

This endpoint allows users to cancel all orders for all/given symbol(s).

The Pacifica Python SDK provides a comprehensive example on using this endpoint

POST /api/v1/orders/cancel_all

Operation Type (for signing)

Header Field
Type
Content

"type"

string

"cancel_all_orders"

Request Body

Field
Type
Need
Description
Example

"account"

string

required

User's wallet address

42trU9A5...

"signature"

string

required

Cryptographic signature

5j1Vy9Uq...

"timestamp"

integer

required

Current timestamp in milliseconds

1716200000000

"all_symbols"

boolean

required

Whether to cancel orders for all symbols

true

"exclude_reduce_only"

boolean

required

Whether to exclude reduce-only orders

false

"symbol"

string

required (if all_symbols is false)

Trading pair symbol

"agent_wallet"

string

optional

Agent wallet address

69trU9A5...

"expiry_window"

integer

optional

Signature expiry in milliseconds

30000

{
  "account": "42trU9A5...",
  "signature": "5j1Vy9Uq...",
  "timestamp": 1716200000000,
  "all_symbols": true,
  "exclude_reduce_only": false,
  "symbol": "BTC",
  "agent_wallet": "69trU9A5...",
  "expiry_window": 30000
}

Response

  • Status 200: All orders cancelled successfully

  {
    "cancelled_count": 5
  }
  • Status 400: Bad request

  {
    "error": "Invalid parameters",
    "code": 400
  }
  • Status 500: Internal server error

Code Example (Python)

import requests

payload = {
    "account": "42trU9A5...",
    "signature": "5j1Vy9Uq...",
    "timestamp": 1716200000000,
    "all_symbols": True,
    "exclude_reduce_only": False
}

response = requests.post(
    "/api/v1/orders/cancel_all",
    json=payload,
    headers={"Content-Type": "application/json"}
)

data = response.json()

Last updated