Skip to main content
WEBHOOK

Event types

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

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 for signature verification, persistence, and delivery and business event deduplication. Use Retrieve an order to reconcile the current result.

Body

application/json
version
string
required

Version configured for the webhook subscription.

event_name
enum<string>
required
Available options:
STOCKS_ORDER
event_type
enum<string>
required
Available options:
stocks.order.processing,
stocks.order.completed,
stocks.order.failed
event_id
string<uuid>
required

Notification identifier. HTTP retries of the same delivery record retain this identifier.

source_id
string<uuid>
required

Order identifier; equals data.order.order_id.

data
object
required

Response

Event durably received.