> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pacifica.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# Batch Order

> This endpoint allows users to submit multiple order operations in a single request. Batched orders are executed in the order they are batched in, and will not be split up by other users' orders.

The [Pacifica Python SDK](https://github.com/pacifica-fi/python-sdk/blob/f2385d42e9ae5276ba2ba85505d51db2eefd2715/rest/batch_orders.py) provides a comprehensive example on using this endpoint

```http theme={null}
POST /api/v1/orders/batch
```

#### Operation Type (for Signing)

<table><thead><tr><th width="220">Header Field</th><th width="123">Type</th><th>Content</th></tr></thead><tbody><tr><td>None</td><td>-</td><td>Batch orders are not signed as a whole, but rather by its individual actions components.</td></tr></tbody></table>

#### Request Body

<table><thead><tr><th width="118">Field</th><th width="98">Type</th><th width="95">Need</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><code>"actions"</code></td><td>array</td><td>required</td><td>List of order actions to perform<br /><br />Each action has a "type" field and action-specific "data"</td><td>See next two rows</td></tr><tr><td><code>"type"</code></td><td>string</td><td>required</td><td>Specifies type of action. This is DIFFERENT to the "type" used in signature headers</td><td><p><code>"Create"</code><br /><code>"CreateMarket"</code><br /><code>"Cancel"</code><br /><code>"Edit"</code><br /><code>"SetPositionTpsl"</code><br /><code>"CancelStopOrder"</code></p><p><br />(case sensitive)</p></td></tr><tr><td><code>"data"</code></td><td>object</td><td>required</td><td>Contains 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.</td><td>See code block below. Messages and corresponding fields are identical to <a href="/api-documentation/api/rest-api/orders/create-limit-order">create</a> and <a href="/api-documentation/api/rest-api/orders/cancel-order">cancel</a> requests.</td></tr></tbody></table>

```json theme={null}
{
   "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

```json theme={null}
{
  "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

```json theme={null}
  {
    "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
