TW Trading (Beta)
The Taiwanese Trading API provides access to Taiwanese-listed cash equities. It shares the same APAC base URLs as the HK API and supports order management, position tracking, account management, end-customer accounts, and market data.
Taiwanese market support is currently in beta. IPO subscriptions, options, multileg orders, FOP transfers, and house margin are not available for the Taiwanese market. Transaction history (GET /tw/transactions) is not populated yet and returns an empty list.
Paths
Every Taiwan endpoint uses the /tw prefix (for example, /tw/orders/new or /tw/balances). The path selects the market, so do not send a market query or body field. Accounts, orders, positions, transactions, and WebSocket updates are resolved only within the Taiwan stack; use account numbers returned by GET /tw/accounts.
Order updates stream over wss://{BASE_URL}/tw/websocket.
Orders
- Use the Taiwanese security code as a string (for example,
2330or0050). - Taiwanese equities trade in board lots of 1,000 shares. Atomic Vaults does not check the lot size, so contact us before sending odd-lot quantities.
- Equity orders use
security_type: CS, whole-share quantities,execution_instruction: held, andtime_in_force: day. Market and limit orders are supported;priceis required only for limit orders. Notional orders are not supported. - Opening a short position requires
sell_shortorsell_short_exemptand is accepted only for easy-to-borrow symbols. Usesellwithposition_effect: close.
Trading Sessions
| Session | Time (Taipei) |
|---|---|
TW2 Regular session | 09:00 – 13:25 |
TW3 Closing auction | 13:25 – 13:30 |
Pass trading_session_ids to restrict an order to specific sessions, or omit it to trade in both. The opening auction (TW1) is not supported. Any supported order is accepted from 09:00 to 13:30 Taipei time. At other times, only limit orders from a TWD account are accepted. The same window applies to modifies.
Accounts and FX
Taiwanese equities currently trade from TWD cash accounts only. Submit orders from a TWD account returned by GET /tw/accounts; margin accounts are rejected.
USD accounts are not supported yet. This includes USD-funded equity buys (AutoFX) and standalone USD/TWD FX orders (security_type: FOR). The endpoint pages describe their planned behavior as a preview:
- A USD funding account will be paired with a TWD settlement account, identified by
settlement_account_numberinGET /tw/accounts. - A Taiwanese equity buy submitted from the USD account will be funded by AutoFX orders created automatically. They will appear in
GET /tw/orders?security_type=FORand on the WebSocket withpurpose: equity_fundingand aparent_av_order_idpointing to the equity order. - A standalone FX order will use
security_type: FORandsymbol: USD/TWD, withquantityas the USD amount.
Error Handling
Failed HTTP requests return a JSON body with an error_code and a human-readable error_msg:
{
"error_code": "DisallowedOrderAction_Error",
"error_msg": "market is closed"
}
Use error_code for programmatic handling; the wording of error_msg can change.
error_code | HTTP status | Meaning |
|---|---|---|
BasicInput_Error | 400 | A field is missing or invalid, or account_number is missing or not linked to your API key |
DisallowedOrderAction_Error | 400 | The request is valid but not allowed now, for example the market is closed or the account is frozen |
AccountBalancesPositions_Error | 400 | Not enough cash or shares for the order |
Instrument_Error | 400 | Unknown symbol, or a symbol that cannot be traded |
DataRetrieval_Error | 400 | The requested record was not found, for example an unknown order_id |
Permission_Error | 401 / 403 | 401: the X-API-KEY header is missing or invalid. 403: a read-only key was used for a POST |
Misc_Error | 400 / 500 | 400: the request body is not valid JSON or has a field of the wrong type. 500: an unexpected server error |
AVInternal_Error | 500 | Internal error, for example system too busy. Check the order's status before retrying |
A 503 means the service is temporarily unavailable; retry later. Order rejections that happen after an order is accepted, for example by the exchange, are not HTTP errors: they arrive as rejected WebSocket updates.
Guides
- Orders Acceptance: trading sessions, order types and when orders are accepted.
- Risk Limits: order validation, buying power and common rejections.
- WebSocket: connecting to
/tw/websocketand handling order updates.
See Environments & Base URLs for all available endpoints across UAT and Production.
Browse the individual endpoints in the sidebar to see request/response details, parameters, and schemas. Use the server selector on each endpoint page to switch between environments.