> ## 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>`"order_id"`</td><td>integer</td><td>required</td><td>Order ID to retrieve history for</td><td>`13753364`</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>`"history_id"`</td><td>integer</td><td>History ID assigned to the order</td></tr><tr><td>`"order_id"`</td><td>integer</td><td>Order ID assigned to order</td></tr><tr><td>`"client_order_id"`</td><td>UUID</td><td>CLOID of order if assigned by user</td></tr><tr><td>`"parent_id"`</td><td>UUID or null</td><td>ID of the [order strategy](https://docs.pacifica.fi/api-documentation/api/rest-api/order-strategies) that placed the order. `null` for other orders</td></tr><tr><td>`"symbol"`</td><td>string</td><td>Trading pair symbol</td></tr><tr><td>`"side"`</td><td>string</td><td>Whether the order is a bid or an ask</td></tr><tr><td>`"price"`</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>`"initial_amount"`</td><td>decimal string</td><td>Amount (in token denomination) of the order placed</td></tr><tr><td>`"filled_amount"`</td><td>decimal string</td><td>Amount (in token denomination) of the order placed that was filled</td></tr><tr><td>`"cancelled_amount"`</td><td>decimal string</td><td>Amount (in token denomination) of the order placed that was cancelled</td></tr><tr><td>`"event_type"`</td><td>string</td><td>`"make"``"stop_created"``"twap_created"``"fulfill_market"``"fulfill_limit"``"adjust"``"stop_parent_order_filled"``"stop_triggered"``"stop_upgrade"``"twap_triggered"``"cancel"``"force_cancel"``"expired"``"post_only_rejected"``"self_trade_prevented"`</td></tr><tr><td>`"order_type"`</td><td>string</td><td><sup>`"limit"`</sup>\
<sup>`"market"`</sup>\
<sup>`"stop_limit"`</sup>\
<sup>`"stop_market"`</sup>\
<sup>`"take_profit_limit"`</sup>\
<sup>`"stop_loss_limit"`</sup>\
<sup>`"take_profit_market"`</sup>\
<sup>`"stop_loss_market"`</sup></td></tr><tr><td>`"order_status"`</td><td>string</td><td>`"open"`\
`"partially_filled"`\
`"filled"`\
`"cancelled"`\
`"rejected"`</td></tr><tr><td>`"stop_price"`</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>`"stop_parent_order_id"`</td><td>integer</td><td>Order id of stop order attached to original order</td></tr><tr><td>`"reduce_only"`</td><td>boolean</td><td>If the order is reduce only</td></tr><tr><td>`"trigger_price_type"`</td><td>string</td><td>Price type used to trigger stop orders (`mark_price`, `last_trade_price`, `mid_price`); defaults to `last_trade_price`</td></tr><tr><td>`"instrument_type"`</td><td>string</td><td>Instrument type of the market</td></tr><tr><td>`"created_at"`</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()
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.