Skip to main content
The Pacifica Python SDK provides a comprehensive example on using this endpoint
POST /api/v1/orders/batch

Operation Type (for Signing)

Header FieldTypeContent
None-Batch orders are not signed as a whole, but rather by its individual actions components.

Request Body

FieldTypeNeedDescriptionExample
”actions”arrayrequiredList of order actions to perform

Each action has a “type” field and action-specific “data”
See next two rows
”type”stringrequiredSpecifies type of action. This is DIFFERENT to the “type” used in signature headers

”Create"
"CreateMarket"
"Cancel"
"Edit"
"SetPositionTpsl"
"CancelStopOrder”


(case sensitive)

“data”objectrequiredContains signed request payloads of individual actions. Fields are identical to the corresponding standalone endpoints: create limit order, create market order, cancel order, edit order, create position TP/SL, and cancel stop order.See code block below. Messages and corresponding fields are identical to create and cancel requests.
{
   "actions":[
      {
         "type":"Create",
         "data":{
            "account":"42trU9A5...",
            "signature":"5UpRZ14Q...",
            "timestamp":1749190500355,
            "expiry_window":5000,
            "symbol":"BTC",
            "price":"100000",
            "reduce_only":false,
            "amount":"0.1",
            "side":"bid",
            "tif":"GTC",
            "client_order_id":"57a5efb1-bb96-49a5-8bfd-f25d5f22bc7e"
         }
      },
      {
         "type":"CreateMarket",
         "data":{
            "account":"42trU9A5...",
            "signature":"3KxMn7pQ...",
            "timestamp":1749190500355,
            "expiry_window":5000,
            "symbol":"ETH",
            "amount":"1.0",
            "side":"ask",
            "slippage_percent":"0.5",
            "reduce_only":false
         }
      },
      {
         "type":"Cancel",
         "data":{
            "account":"42trU9A5...",
            "signature":"4NDFHyTG...",
            "timestamp":1749190500355,
            "expiry_window":5000,
            "symbol":"BTC",
            "order_id":42069
         }
      }
   ]
}

Response

  • Status 200: Batch operations processed successfully
{
  "success": true,
  "data": {
    "results": [
      {
        "success": true,
        "order_id": 470506,
        "error": null
      },
      {
        "success": true,
        "order_id": null,
        "error": null
      }
    ]
  },
    "error": null,
    "code": null
}
  • Status 400: Bad request
  {
    "error": "Invalid batch operation parameters",
    "code": 400
  }
  • Status 500: Internal server error

Notes on Batch Ordering

Speed Bump (Latency Protection)

Batch orders are subject to a conditional ~200ms delay to protect liquidity providers from adverse selection:

Speed bump is applied if the batch contains:
  • Market orders (CreateMarket)
  • Limit orders with TIF = GTC or IOC
Speed bump is NOT applied if the batch only contains:
  • Add Liquidity Only orders (TIF = ALO)
  • Top of Book orders (TIF = TOB)
  • Cancel operations
  • TP/SL operations

Signature Requirements

  • Each action in the batch must be individually signed
  • All signatures must be valid for the batch to process

Execution Behavior and Limits

  • Maximum 10 actions per batch request
  • Actions are executed atomically in the order provided
  • If one action fails, subsequent actions are still attempted