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

# Stocks order

> Receive processing, completed, and failed status notifications for Stocks orders.

## Event types

All order notifications use `event_name: STOCKS_ORDER`. The `event_type` identifies the order stage.

| Event type                | Order status | Meaning                                                                                                |
| ------------------------- | ------------ | ------------------------------------------------------------------------------------------------------ |
| `stocks.order.processing` | `PENDING`    | The order was accepted. Execution data that is not yet known remains null.                             |
| `stocks.order.completed`  | `SUCCESS`    | Settlement completed. Use actual execution values for reconciliation.                                  |
| `stocks.order.failed`     | `FAILED`     | The order reached a final failure state. Quote rejection without an order does not produce this event. |

## Order snapshot

The three events share the envelope and order field definitions below. `data.order` is the order snapshot at the time of the event.

* **Processing**: `completed_at`, `failed_at`, `failure_code`, and `failure_message` are null.
* **Completed**: `completed_at` has a value and failure fields are null. Execution quantity, cash amount, fees, and total amount are provided; the execution price can be null when no settlement price is available.
* **Failed**: `failed_at`, `failure_code`, and `failure_message` have values; `completed_at` is null. Execution quantities, amounts, and fees remain null. Failure codes include `STOCKS_ORDER_FAILED` and `STOCKS_QUOTE_EXPIRED` for an order whose quote expires before execution.

## Handle notifications

Notifications can be duplicated or arrive out of order. Do not roll back a terminal order state when a processing notification arrives later. A delivery timeout or missing transaction hash does not by itself indicate order failure.

Follow [Receive order Webhooks](/stocks/guide/receive-webhooks) for signature verification, persistence, and delivery and business event deduplication. Use [Retrieve an order](/stocks/api-reference/retrieve-order) to reconcile the current result.


## OpenAPI

````yaml stocks/webhooks-stocks.yaml webhook stocksOrder
openapi: 3.1.0
info:
  title: Stocks order webhooks
  version: 1.6.0
  description: >-
    Order state notifications delivered as HTTP POST JSON to your subscribed
    endpoint.
servers: []
security: []
paths: {}

````