> ## 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.

# Get Order History by ID

> This endpoint allows users to get order history by id.

```http theme={null}
GET /api/v1/orders/history_by_id
```

#### Query Parameters

<table><thead><tr><th width="176">Field</th><th width="98">Type</th><th width="95">Need</th><th width="189">Description</th><th>Example</th></tr></thead><tbody><tr><td><code>"order\_id"</code></td><td>integer</td><td>required</td><td>Order ID to retrieve history for</td><td><code>13753364</code></td></tr></tbody></table>

```http theme={null}
/api/v1/orders/history_by_id?order_id=13753364
```

#### Response

* Status 200: Successfully retrieved open orders

```json theme={null}
{
  "success": true,
  "data": [
    {
      "history_id": 641452639,
      "order_id": 315992721,
      "client_order_id": "ade1aa6...",
      "symbol": "XPL",
      "side": "ask",
      "price": "1.0865",
      "initial_amount": "984",
      "filled_amount": "0",
      "cancelled_amount": "984",
      "event_type": "cancel",
      "order_type": "limit",
      "order_status": "cancelled",
      "stop_price": null,
      "stop_parent_order_id": null,
      "reduce_only": false,
      "created_at": 1759224895038
    },
    {
      "history_id": 641452513,
      "order_id": 315992721,
      "client_order_id": "ade1aa6...",
      "symbol": "XPL",
      "side": "ask",
      "price": "1.0865",
      "initial_amount": "984",
      "filled_amount": "0",
      "cancelled_amount": "0",
      "event_type": "make",
      "order_type": "limit",
      "order_status": "open",
      "stop_price": null,
      "stop_parent_order_id": null,
      "reduce_only": false,
      "created_at": 1759224893638
    }
  ],
  "error": null,
  "code": null
}
```

<table><thead><tr><th width="208">Field</th><th width="186">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>"history\_id"</code></td><td>integer</td><td>History ID assigned to the order</td></tr><tr><td><code>"order\_id"</code></td><td>integer</td><td>Order ID assigned to order</td></tr><tr><td><code>"client\_order\_id"</code></td><td>UUID</td><td>CLOID of order if assigned by user</td></tr><tr><td><code>"symbol"</code></td><td>string</td><td>Trading pair symbol</td></tr><tr><td><code>"side"</code></td><td>string</td><td>Whether the order is a bid or an ask</td></tr><tr><td><code>"price"</code></td><td>decimal string</td><td>Execution price of the order event (e.g. order creation limit price, order matching filled price, limit price at cancellation)</td></tr><tr><td><code>"initial\_amount"</code></td><td>decimal string</td><td>Amount (in token denomination) of the order placed</td></tr><tr><td><code>"filled\_amount"</code></td><td>decimal string</td><td>Amount (in token denomination) of the order placed that was filled</td></tr><tr><td><code>"cancelled\_amount"</code></td><td>decimal string</td><td>Amount (in token denomination) of the order placed that was cancelled</td></tr><tr><td><code>"event\_type"</code></td><td>string</td><td><p><code>"make"</code></p><p><code>"stop\_created"</code></p><p><code>"twap\_created"</code></p><p><code>"fulfill\_market"</code></p><p><code>"fulfill\_limit"</code></p><p><code>"adjust"</code></p><p><code>"stop\_parent\_order\_filled"</code></p><p><code>"stop\_triggered"</code></p><p><code>"stop\_upgrade"</code></p><p><code>"twap\_triggered"</code></p><p><code>"cancel"</code></p><p><code>"force\_cancel"</code></p><p><code>"expired"</code></p><p><code>"post\_only\_rejected"</code></p><p><code>"self\_trade\_prevented"</code></p></td></tr><tr><td><code>"order\_type"</code></td><td>string</td><td><sup><code>"limit"</code></sup><br /><sup><code>"market"</code></sup><br /><sup><code>"stop\_limit"</code></sup><br /><sup><code>"stop\_market"</code></sup><br /><sup><code>"take\_profit\_limit"</code></sup><br /><sup><code>"stop\_loss\_limit"</code></sup><br /><sup><code>"take\_profit\_market"</code></sup><br /><sup><code>"stop\_loss\_market"</code></sup></td></tr><tr><td><code>"order\_status"</code></td><td>string</td><td><code>"open"</code><br /><code>"partially\_filled"</code><br /><code>"filled"</code><br /><code>"cancelled"</code><br /><code>"rejected"</code></td></tr><tr><td><code>"stop\_price"</code></td><td>decimal string</td><td>Stop price assigned upon order creation for subsequent position if order is filled if specified by user.</td></tr><tr><td><code>"stop\_parent\_order\_id"</code></td><td>integer</td><td>Order id of stop order attached to original order</td></tr><tr><td><code>"reduce\_only"</code></td><td>boolean</td><td>If the order is reduce only</td></tr><tr><td><code>"trigger\_price\_type"</code></td><td>string</td><td>Price type used to trigger stop orders (<code>mark\_price</code>, <code>last\_trade\_price</code>, <code>mid\_price</code>); defaults to <code>last\_trade\_price</code></td></tr><tr><td><code>"instrument\_type"</code></td><td>string</td><td>Instrument type of the market</td></tr><tr><td><code>"created\_at"</code></td><td>integer</td><td>Timestamp in milliseconds when the order was created on Pacifica</td></tr></tbody></table>

* Status 400: Invalid request parameters
* Status 401: Unauthorized access
* Status 500: Internal server error

#### Code Example (Python)

```python theme={null}
import requests

response = requests.get(
    "/api/v1/orders/history_by_id?order_id=13753364",
    headers={"Accept": "*/*"},
)

data = response.json()
```
