My Order and Trade

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

TypeEndpoint
Privatewss://{region}-api.upbit.com/websocket/v1/private

Use the endpoint for your region.

RegionEndpoint
Singaporewss://sg-api.upbit.com/websocket/v1/private
Indonesiawss://id-api.upbit.com/websocket/v1/private
Thailandwss://th-api.upbit.com/websocket/v1/private

Private WebSocket Connection Management Guide

When 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 NameTypeDescriptionRequiredDefault
typeStringData type to receive. Set to myOrder to receive data.Required
codesList:StringList of trading pairs to receive.
Must be requested in uppercase.
RequiredIf omitted or requested as an empty array, data for all markets will be received.
formatStringData 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 NameAbbreviationDescriptionTypeValue Example
typetyData typeStringmyOrder
codecdPair code (e.g., SGD-BTC)String
uuiduidUnique identifier (UUID) for the order.String
ask_bidabBuy/Sell classificationStringASK: Sell
BID: Buy
order_typeotOrder typeStringlimit: Limit order
price: Market buy order
market: Market sell order
best: Best limit order
statesOrder stateStringwait: Waiting to be filled
watch: Pending reserved order
trade: Trade occurred
done: Fully filled
cancel: Order canceled
prevented: Match prevented
trade_uuidtuidUnique identifier (UUID) for the tradeString
pricepOrder price or trade price (when state is "trade")Double
avg_priceapAverage trade priceDouble
volumevOrder volume or trade volume (when state is trade)Double
remaining_volumervRemaining order volume after tradeDouble
executed_volumeevExecuted volumeDouble
trades_counttcNumber of trades on this orderInteger
reserved_feersfReserved fee amountDouble
remaining_feermfRemaining fee amountDouble
paid_feepfFee amount paid at the time of execution.Double
lockedlFunds locked for the orderDouble
executed_fundsefAmount executedDouble
time_in_forcetifIOC, FOK, POST ONLY order conditionsStringioc
fok
post_only
trade_feetfFee incurred upon trade
(state:trade(null if state is not trade)
Double
is_makerimMaker/taker status of the order involved in the trade
(state: trade(null if state is not trade)
Booleantrue: Maker order
false: Taker order
identifieridClient-specified order identifierString
smp_typesmptSelf-match prevention type (prevents matching between maker and taker orders from the same user)Stringreduce: Reduce and proceed
cancel_maker: Cancel maker order
cancel_taker: Cancel taker order
prevented_volumepvOrder quantity canceled due to self-match preventionDouble
prevented_lockedplAmount canceled due to self-match prevention
(For buy orders: canceled amount in funds
For sell orders: canceled amount in volume)
Double
trade_timestampttmsTrade timestamp (ms)Long
order_timestampotmsOrder timestamp (ms)Long
timestamptmsTimestamp (ms)Long
stream_typestStream typeStringREALTIME: Real-time stream
SNAPSHOT: 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.nameReasonRecommended Action
INVALID_AUTHMissing authentication information or authentication token verification failureWhen 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_FORMATInvalid request message formatMake sure the request message follows the WebSocket request format. Check the Object structure as well as the type and value of each field.
NO_TICKETMissing ticket fieldMake sure the request message includes a Ticket Object and the ticket field.
NO_TYPEMissing type fieldMake sure the Data Type Object includes the type field and specify the data type to subscribe to.
NO_CODESMissing codes fieldCheck whether the subscribed data type requires the codes field and specify the trading pair codes to receive.
INVALID_PARAMMissing required request field or unsupported valueMake sure all required fields are included and that each field contains a supported value.
Too Many RequestsRequest rate limit exceededWait until another request can be made, then retry. Refer to the Rate Limits section for details.
I'm a teapotRequests are temporarily restricted due to repeated Too Many Requests errorsCheck 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 GroupPolicyApplied By
websocket-connectUp to 5 connections per secondAccount
websocket-messageUp to 5 messages per second and 100 messages per minuteConnection

Managing WebSocket Rate Limits

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