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

> This endpoint allows users to get order history and finished order strategies in one list.

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

This endpoint returns your orders and your finished [order strategies](https://docs.pacifica.fi/api-documentation/api/rest-api/order-strategies) in one list. It sorts the list by creation time, newest first. Each item has a `kind` and a `record`.

It differs from [Get order history](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/get-order-history.md) in these ways:

* It includes finished order strategies as `"kind": "strategy"` records. Open strategies are not included.
* It leaves out orders that a strategy placed. A strategy sets `parent_id` on each order that it places. You can find these orders in the strategy record's `owned_orders`.
* It sorts by creation time. Get order history sorts by order ID.
* `has_more` is `true` only when another page exists.

#### 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>`"account"`</td><td>string</td><td>required</td><td>Account address</td><td>`42trU9A5...`</td></tr><tr><td>`"limit"`</td><td>integer</td><td>optional</td><td>Maximum number of records to return. Default and maximum are 100. Values outside 1 to 100 are clamped to that range</td><td>`100`</td></tr><tr><td>`"cursor"`</td><td>string</td><td>optional</td><td>The `"next_cursor"` value from the previous page. Leave it out to get the first page</td><td>`pxinAJf8...`</td></tr></tbody></table>

```http theme={null}
/api/v1/orders/history/records?account=42trU9A5...&limit=100
```

#### Response

* Status 200: Successfully retrieved order history records

```json theme={null}
{
  "success": true,
  "data": [
    {
      "kind": "strategy",
      "record": {
        "strategy_id": "0f8e6c2a-5b1d-4c3e-9a7f-2d4b6e8a1c3f",
        "revision": 2,
        "account": "42trU9A5...",
        "strategy_type": "twap",
        "definition": {
          "strategy_type": "twap",
          "params": { ... }
        },
        "lifecycle": "completed",
        "state": { ... },
        "applied_trade_history_id": 912800455,
        "applied_order_history_id": 1840022917,
        "expires_at_ms": null,
        "scheduled_start_at_ms": null,
        "scheduled_end_at_ms": null,
        "created_at_ms": 1759224900000,
        "updated_at_ms": 1759225500000,
        "owned_orders": [
          {
            "order_id": 315992800,
            "prev_order_id": null,
            "is_open": false,
            "client_order_id": null,
            "take_profit_client_order_id": null,
            "stop_loss_client_order_id": null
          },
          ...
        ]
      }
    },
    {
      "kind": "order",
      "record": {
        "order_id": 315992721,
        "client_order_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
        "parent_id": null,
        "symbol": "XPL",
        "side": "ask",
        "initial_price": "1.0865",
        "average_filled_price": "0",
        "amount": "984",
        "filled_amount": "0",
        "order_status": "open",
        "order_type": "limit",
        "stop_price": null,
        "stop_parent_order_id": null,
        "reduce_only": false,
        "trigger_price_type": null,
        "reason": null,
        "instrument_type": "perpetual",
        "created_at": 1759224893638,
        "updated_at": 1759224893638
      }
    },
    ...
  ],
  "next_cursor": "pxinAJf8...",
  "has_more": true
}
```

<table><thead><tr><th width="208">Field</th><th width="186">Type</th><th>Description</th></tr></thead><tbody><tr><td>`"kind"`</td><td>string</td><td>`"order"` or `"strategy"`</td></tr><tr><td>`"record"`</td><td>object</td><td>An order record or a strategy record, as set by `"kind"` (see below)</td></tr><tr><td>`"next_cursor"`</td><td>string</td><td>Cursor for the next page. Omitted when `"has_more"` is `false`</td></tr><tr><td>`"has_more"`</td><td>boolean</td><td>`true` if more records exist after this page</td></tr></tbody></table>

To get the next page, send the same request with `cursor` set to `next_cursor`. Treat the cursor as an opaque string. It doesn't work with [Get order history](https://docs.pacifica.fi/api-documentation/api/rest-api/orders/get-order-history.md).

**Order Record Fields** (`"kind": "order"`)

Each order appears once, in its latest state.

<table><thead><tr><th width="208">Field</th><th width="186">Type</th><th>Description</th></tr></thead><tbody><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>Always `null` in this endpoint</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>`"initial_price"`</td><td>decimal string</td><td>Initial (limit) price of the order</td></tr><tr><td>`"average_filled_price"`</td><td>decimal string</td><td>VWAP of price at which the order was filled. `"0"` if nothing has filled</td></tr><tr><td>`"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>`"order_status"`</td><td>string</td><td>`"open"`\
`"partially_filled"`\
`"filled"`\
`"cancelled"`\
`"rejected"`</td></tr><tr><td>`"order_type"`</td><td>string</td><td>`"limit"`\
`"market"`\
`"stop_limit"`\
`"stop_market"`\
`"take_profit_limit"`\
`"stop_loss_limit"`\
`"take_profit_market"`\
`"stop_loss_market"`</td></tr><tr><td>`"stop_price"`</td><td>decimal string</td><td>Stop price of a stop order</td></tr><tr><td>`"stop_parent_order_id"`</td><td>integer</td><td>Parent order id of a stop 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>`"reason"`</td><td>string</td><td>Provides reason for an order being `"cancelled"` or `"rejected"`:\
`"cancel"`\
`"force_cancel"`\
`"expired"`\
`"post_only_rejected"`\
`"self_trade_prevented"`</td></tr><tr><td>`"instrument_type"`</td><td>string</td><td>`"perpetual"` or `"spot"`</td></tr><tr><td>`"created_at"`</td><td>integer</td><td>Timestamp in milliseconds of the first event for this order. The list sorts by this value</td></tr><tr><td>`"updated_at"`</td><td>integer</td><td>Timestamp in milliseconds of the latest event for this order</td></tr></tbody></table>

**Strategy Record Fields** (`"kind": "strategy"`)

A strategy record is a finished order strategy. The main fields are below. See [Order strategies](https://docs.pacifica.fi/api-documentation/api/rest-api/order-strategies) for the full shape, `definition`, and `state`.

<table><thead><tr><th width="208">Field</th><th width="186">Type</th><th>Description</th></tr></thead><tbody><tr><td>`"strategy_id"`</td><td>UUID</td><td>Strategy ID</td></tr><tr><td>`"strategy_type"`</td><td>string</td><td>Strategy type, for example `"twap"`</td></tr><tr><td>`"lifecycle"`</td><td>string</td><td>`"completed"`\
`"cancelled"`\
`"expired"`\
`"failed"`</td></tr><tr><td>`"terminal_reason"`</td><td>string</td><td>Why the strategy ended, for example `"user_cancel"` or `"insufficient_balance"`. Omitted when no reason applies</td></tr><tr><td>`"owned_orders"`</td><td>array</td><td>Orders that the strategy placed</td></tr><tr><td>`"created_at_ms"`</td><td>integer</td><td>Timestamp in milliseconds when the strategy was created. The list sorts by this value</td></tr><tr><td>`"updated_at_ms"`</td><td>integer</td><td>Timestamp in milliseconds when the strategy last changed</td></tr></tbody></table>

* Status 400: Invalid request parameters or invalid cursor
* Status 500: Internal server error

#### Code Example (Python)

```python theme={null}
import requests

response = requests.get(
    "/api/v1/orders/history/records?account=42trU9A5...&limit=100",
    headers={"Accept": "*/*"},
)

data = response.json()
```


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