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

# Track orders with Webhooks

> Connect order notifications to order queries and position reconciliation.

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

Configure your endpoint using [Webhook settings](/account-center/v1.6/guide/webhooks-setting). For signature verification and delivery handling, use the shared [Webhooks overview](/account-center/v1.6/guide/webhooks-overview).

## Connect a notification to your order

Save `order_id` when [creating the order](/stocks/api-reference/create-order). In a Stocks notification, `source_id` and `data.order.order_id` identify that order. `data.order` contains its snapshot at the event time.

| Event type                | Next API call                                                                                                                                                                                        |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `stocks.order.processing` | Continue tracking with [Retrieve order](/stocks/api-reference/retrieve-order) using `source_id`.                                                                                                     |
| `stocks.order.completed`  | Read the execution result, then query [List positions](/stocks/api-reference/list-positions) with `asset_id` and [List position events](/stocks/api-reference/list-position-events) with `order_id`. |
| `stocks.order.failed`     | Read `failure_code` and `failure_message`; use [Retrieve order](/stocks/api-reference/retrieve-order) if you need the current state.                                                                 |

See [Stocks order Webhook](/stocks/webhooks/order) for the complete fields and notification examples.

## Handle repeated or missing notifications

Use `event_id` to identify a delivery and `data.business_event_id` to identify the business event within your account. Do not apply a position change twice or replace a terminal result with a late processing notification.

If no final notification arrives, query [Retrieve order](/stocks/api-reference/retrieve-order) using the saved `order_id`. If that identifier was not received, use [List orders](/stocks/api-reference/list-orders) with `client_reference`. Do not create a second order solely because a notification is missing.
