This document provides example request and subscription payloads for receiving personal order and trade execution data via WebSocket.
Real-Time Streaming Method for My Orders and Trades
For my orders and trades data, the corresponding information is transmitted as a real-time stream only when an actual order or trade event occurs. Therefore, it is normal behavior that no data is received if no orders or trades happen after the connection is established.
Please refer to the WebSocket Usage Guide - Connection Management to ensure your client implementation or specifications maintain the connection even when no data is being transmitted.
WebSocket Endpoint
| Type | Endpoint |
|---|---|
| Private | wss://{region}-api.upbit.com/websocket/v1/private |
Use the endpoint for your region.
| Region | Endpoint |
|---|---|
| Singapore | wss://sg-api.upbit.com/websocket/v1/private |
| Indonesia | wss://id-api.upbit.com/websocket/v1/private |
| Thailand | wss://th-api.upbit.com/websocket/v1/private |
Private WebSocket Connection Management GuideWhen a large number of Private WebSocket connections are maintained simultaneously, new connection attempts may be rejected. Please minimize unnecessary connections and, where possible, subscribe to the required data types through a single existing connection.
Request Message Format
To request announcement data, after establishing a WebSocket connection, create a JSON Object with the structure below and include it as a Data Type Object in the request message.
For the complete WebSocket request message specification, including the Ticket and Format Objects, refer to the WebSocket Usage and Error Guide.
| Field Name | Type | Description | Required | Default |
|---|---|---|---|---|
| type | String | Data type to receive. Set to myOrder to receive data. | Required | |
| codes | List:String | List of trading pairs to receive. Must be requested in uppercase. | Required | If omitted or requested as an empty array, data for all markets will be received. |
| format | String | Data format to receive.DEFAULT: Default format.SIMPLE: Simplified format with abbreviated field names.JSON_LIST: List format.SIMPLE_LIST: List format with abbreviated field names. | Required |
Subscription Data Specification
When a new announcement is published or an existing announcement is updated, real-time stream data is returned as follows.
New Fields Added (2025.07.02)Due to the addition of the Self-Match Prevention (SMP) feature, the order data fields have been updated as follows. For detailed information, please refer to the related announcement and the [SMP Detailed Explanation].
smp_type: reduce, cancel_maker, cancel_taker
A new order state prevented (match prevention) has been added to the state field.
A new order condition post_only has been added, and post_only is now a valid value for the time_in_force field.
| Field Name | Abbreviation | Description | Type | Value Example |
|---|---|---|---|---|
| type | ty | Data type | String | myOrder |
| code | cd | Pair code (e.g., SGD-BTC) | String | |
| uuid | uid | Unique identifier (UUID) for the order. | String | |
| ask_bid | ab | Buy/Sell classification | String | ASK: SellBID: Buy |
| order_type | ot | Order type | String | limit: Limit orderprice: Market buy ordermarket: Market sell orderbest: Best limit order |
| state | s | Order state | String | wait: Waiting to be filledwatch: Pending reserved ordertrade: Trade occurreddone: Fully filledcancel: Order canceledprevented: Match prevented |
| trade_uuid | tuid | Unique identifier (UUID) for the trade | String | |
| price | p | Order price or trade price (when state is "trade") | Double | |
| avg_price | ap | Average trade price | Double | |
| volume | v | Order volume or trade volume (when state is trade) | Double | |
| remaining_volume | rv | Remaining order volume after trade | Double | |
| executed_volume | ev | Executed volume | Double | |
| trades_count | tc | Number of trades on this order | Integer | |
| reserved_fee | rsf | Reserved fee amount | Double | |
| remaining_fee | rmf | Remaining fee amount | Double | |
| paid_fee | pf | Fee amount paid at the time of execution. | Double | |
| locked | l | Funds locked for the order | Double | |
| executed_funds | ef | Amount executed | Double | |
| time_in_force | tif | IOC, FOK, POST ONLY order conditions | String | iocfokpost_only |
| trade_fee | tf | Fee incurred upon trade (state:trade(null if state is not trade) | Double | |
| is_maker | im | Maker/taker status of the order involved in the trade (state: trade(null if state is not trade) | Boolean | true: Maker orderfalse: Taker order |
| identifier | id | Client-specified order identifier | String | |
| smp_type | smpt | Self-match prevention type (prevents matching between maker and taker orders from the same user) | String | reduce: Reduce and proceedcancel_maker: Cancel maker ordercancel_taker: Cancel taker order |
| prevented_volume | pv | Order quantity canceled due to self-match prevention | Double | |
| prevented_locked | pl | Amount canceled due to self-match prevention (For buy orders: canceled amount in funds For sell orders: canceled amount in volume) | Double | |
| trade_timestamp | ttms | Trade timestamp (ms) | Long | |
| order_timestamp | otms | Order timestamp (ms) | Long | |
| timestamp | tms | Timestamp (ms) | Long | |
| stream_type | st | Stream type | String | REALTIME: Real-time streamSNAPSHOT: Snapshot |
Examples
Subscription Request Example
[
{
"ticket": "0e66c0ac-7e13-43ef-91fb-2a87c2956c49"
},
{
"type": "myOrder"
}
]
// or
[
{
"ticket": "test-myOrder"
},
{
"type": "myOrder",
"codes": []
}
]Subscription Data Example
{
"type": "myOrder",
"code": "SGD-XRP",
"uuid": "ac2dc2a3-fce9-40a2-a4f6-5987c25c438f",
"ask_bid": "BID",
"order_type": "limit",
"state": "trade",
"trade_uuid": "68315169-fba4-4175-ade3-aff14a616657",
"price": 0.001453,
"avg_price": 0.00145372,
"volume": 30925891.29839369,
"remaining_volume": 29968038.09235948,
"executed_volume": 30925891.29839369,
"trades_count": 1,
"reserved_fee": 44.23943970238218,
"remaining_fee": 21.77177967409916,
"paid_fee": 22.467660028283017,
"locked": 43565.33112787242,
"executed_funds": 44935.32005656603,
"time_in_force": null,
"trade_fee": 22.467660028283017,
"is_maker": true,
"identifier": "test-1",
"smp_type": "cancel_maker",
"prevented_volume": 1.174291929,
"prevented_locked": 0.001706246173,
"trade_timestamp": 1710751590421,
"order_timestamp": 1710751590000,
"timestamp": 1710751597500,
"stream_type": "REALTIME"
}Error Information
If an error occurs after establishing a WebSocket connection and sending a request, the response is returned in the following JSON format.
{
"error": {
"name": "ERROR_CODE",
"message": "ERROR_MESSAGE"
}
}The main error codes that may be returned are listed below.
error.name | Reason | Recommended Action |
|---|---|---|
INVALID_AUTH | Missing authentication information or authentication token verification failure | When using a Private WebSocket endpoint, make sure you are connected to the correct endpoint and that the Authorization header contains a valid authentication token. |
WRONG_FORMAT | Invalid request message format | Make sure the request message follows the WebSocket request format. Check the Object structure as well as the type and value of each field. |
NO_TICKET | Missing ticket field | Make sure the request message includes a Ticket Object and the ticket field. |
NO_TYPE | Missing type field | Make sure the Data Type Object includes the type field and specify the data type to subscribe to. |
NO_CODES | Missing codes field | Check whether the subscribed data type requires the codes field and specify the trading pair codes to receive. |
INVALID_PARAM | Missing required request field or unsupported value | Make sure all required fields are included and that each field contains a supported value. |
Too Many Requests | Request rate limit exceeded | Wait until another request can be made, then retry. Refer to the Rate Limits section for details. |
I'm a teapot | Requests are temporarily restricted due to repeated Too Many Requests errors | Check the restriction period included in the response and retry after the specified time has passed. |
Rate Limits
APIs are grouped into Rate Limit groups. APIs within the same group share the same per-second request limit.
The maximum number of requests allowed per Rate Limit group may change after prior notice according to service policy, and additional restrictions may be applied depending on service conditions. For details, refer to Rate Limits.
| Rate Limit Group | Policy | Applied By |
|---|---|---|
websocket-connect | Up to 5 connections per second | Account |
websocket-message | Up to 5 messages per second and 100 messages per minute | Connection |
Managing WebSocket Rate LimitsUnlike REST API responses, WebSocket does not provide the number of remaining requests. Clients should track the number of WebSocket connection attempts and data request messages they send to ensure compliance with the applicable rate limits. If a rate limit is reached, wait for an appropriate period before sending another request..
