Taiwan order-update WebSocket
GET{BASE_URL}/tw/websocket
Connect to wss://{BASE_URL}/tw/websocket with the X-API-KEY
header. The key is checked before the upgrade: a missing or invalid key
gets an HTTP 401 error body instead of a WebSocket. Read-only keys may
connect. Browser clients whose Origin host differs from the API host
are refused with HTTP 403.
Which updates you receive. A connection receives updates for every
Taiwan order whose receiving initiator is the API client that owns the
key, across all of its accounts. The receiving initiator is the client
that placed the order unless receiving_initiator was set; a modify
keeps the original order's receiving initiator unless it sets a new
one. Every open connection for the same client receives every update.
Messages. The server sends text frames shaped as
{"message_type": "order_update", "message": {...}} and expects no
messages from the client; a data frame from the client closes the
connection with status 1008. The server sends a WebSocket ping every
30 seconds. Updates for the same order arrive in event order.
No replay. Updates are delivered only to connections open at that
moment; missed updates are not re-sent. After reconnecting, reconcile
with /tw/orders.
order_event values sent: new, partial_fill, fill, canceled,
rejected, replaced, cancel_rejected, replace_rejected.
AutoFX orders (coming soon) arrive as separate updates with
order.parent_av_order_id set to the equity order's av_order_id.
Responses
- 101
- 401
- 500
- 503
- default
WebSocket upgraded.
Missing or invalid X-API-KEY.
Unexpected server-side failure, for example the order service did not
answer in time (AVInternal_Error, system too busy) or was
unreachable (Misc_Error). For order requests, check the order's
status before retrying: a retried order_id that was already
accepted is rejected as a duplicate.
A required service is temporarily unavailable (for example the database, or for Hong Kong requests that read from GigaMoney Whale, the Whale connection). Retry later.
Text frames sent after the upgrade.