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

# Orders and positions

> Find an order and connect its result to holdings and position changes.

[Stablecoin Account API Publisher Disclaimer](/stablecoin-account/v1.6/guide/stablecoin-account-api-publisher-disclaimer)

Use the `order_id` saved after [Create order](/stocks/api-reference/create-order). For asset-level queries, use the `asset_id` selected before trading.

## 1. Retrieve or find the order

With `order_id`, call [Retrieve order](/stocks/api-reference/retrieve-order) (`GET /order/{order_id}`). If the create-order response was lost, call [List orders](/stocks/api-reference/list-orders) (`GET /order`) with the `client_reference` you submitted.

For order history, filter the list by `asset_id`, `symbol`, `order_status`, or `from` / `to`. The time window applies to order creation, includes `from`, and excludes `to`. Recover the original result before placing another order.

## 2. Query the holding

After the trade succeeds, call [List positions](/stocks/api-reference/list-positions) (`GET /position`) with `asset_id`.

| Field                | Use                                             |
| -------------------- | ----------------------------------------------- |
| `quantity`           | Current total holding of the asset.             |
| `available_quantity` | Quantity available for a subsequent sell quote. |
| `frozen_quantity`    | Quantity reserved and currently unavailable.    |

## 3. Match the position change

Call [List position events](/stocks/api-reference/list-position-events) (`GET /position/event`) with `order_id` to locate the trade's position changes. Read `quantity_delta`, `quantity_after`, and `created_at` alongside the order's `executed_quantity`.

For an asset's change history, filter by `asset_id` or `symbol`, and optionally `from` / `to`. Here the time window applies to the event time, includes `from`, and excludes `to`.

If a change is an `ADJUSTMENT`, call [List corporate actions](/stocks/api-reference/list-corporate-actions) (`GET /asset/{asset_id}/corporate-action`) for that asset. Read `old_multiplier`, `new_multiplier`, `effective_at`, and `applied_at` to understand applied adjustments; a position event need not be associated with an order.

Order history can also contain `DEPOSIT` and `WITHDRAWAL` records. Use `transfer_quantity` for those records; the quote-and-order flow above creates `BUY` or `SELL` trades.

## Read all pages

For list queries, pass `page_number` and `page_size`. Read `data`, then increase `page_number` until you have read `total_pages`. The default page size is 10 and the maximum is 100.
