Trading requests
Place new order (TRADE)
{
"id": "56374a46-3061-486b-a311-99ee972eb648",
"method": "order.place",
"params": {
"symbol": "BTCUSDT",
"side": "SELL",
"type": "LIMIT",
"timeInForce": "GTC",
"price": "23416.10000000",
"quantity": "0.00847000",
"apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A",
"signature": "15af09e41c36f3cc61378c2fbe2c33719a03dd5eba8d0f9206fbda44de717c88",
"timestamp": 1660801715431
}
}
Send in a new order.
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
side | ENUM | YES | BUY or SELL |
type | ENUM | YES | |
timeInForce | ENUM | NO * | |
price | DECIMAL | NO * | |
quantity | DECIMAL | NO * | |
quoteOrderQty | DECIMAL | NO * | |
newClientOrderId | STRING | NO | Arbitrary unique ID among open orders. Automatically generated if not sent |
newOrderRespType | ENUM | NO | Select response format:
|
stopPrice | DECIMAL | NO * | |
trailingDelta | INT | NO * | See Trailing Stop order FAQ |
icebergQty | DECIMAL | NO | |
strategyId | LONG | NO | Arbitrary numeric value identifying the order within an order strategy. |
strategyType | INT | NO | Arbitrary numeric value identifying the order strategy. Values smaller than |
selfTradePreventionMode | ENUM | NO | The allowed enums is dependent on what is configured on the symbol. Supported values: STP Modes |
apiKey | STRING | YES | |
recvWindow | INT | NO | The value cannot be greater than 60000 |
signature | STRING | YES | |
timestamp | INT | YES |
Certain parameters (*) become mandatory based on the order type
:
Order type |
Mandatory parameters |
---|---|
LIMIT |
|
LIMIT_MAKER |
|
MARKET |
|
STOP_LOSS |
|
STOP_LOSS_LIMIT |
|
TAKE_PROFIT |
|
TAKE_PROFIT_LIMIT |
|
Supported order types:
Order type |
Description |
---|---|
LIMIT |
Buy or sell |
LIMIT_MAKER |
This order type is also known as a POST-ONLY order. |
MARKET |
Buy or sell at the best available market price.
|
STOP_LOSS |
Execute a
I.e., when |
STOP_LOSS_LIMIT |
Place a |
TAKE_PROFIT |
Like |
TAKE_PROFIT_LIMIT |
Like |
Available timeInForce
options,
setting how long the order should be active before expiration:
TIF | Description |
---|---|
GTC | Good 'til Canceled – the order will remain on the book until you cancel it, or the order is completely filled. |
IOC | Immediate or Cancel – the order will be filled for as much as possible, the unfilled quantity immediately expires. |
FOK | Fill or Kill – the order will expire unless it cannot be immediately filled for the entire quantity. |
Notes:
-
newClientOrderId
specifiesclientOrderId
value for the order.A new order with the same
clientOrderId
is accepted only when the previous one is filled or expired. -
Any
LIMIT
orLIMIT_MAKER
order can be made into an iceberg order by specifying theicebergQty
.An order with an
icebergQty
must havetimeInForce
set toGTC
. -
Trigger order price rules for
STOP_LOSS
/TAKE_PROFIT
orders:stopPrice
must be above market price:STOP_LOSS BUY
,TAKE_PROFIT SELL
stopPrice
must be below market price:STOP_LOSS SELL
,TAKE_PROFIT BUY
-
MARKET
orders usingquoteOrderQty
followLOT_SIZE
filter rules.The order will execute a quantity that has notional value as close as possible to requested
quoteOrderQty
.
Data Source: Matching Engine
Response:
Response format is selected by using the newOrderRespType
parameter.
ACK
response type:
{
"id": "56374a46-3061-486b-a311-99ee972eb648",
"status": 200,
"result": {
"symbol": "BTCUSDT",
"orderId": 12569099453,
"orderListId": -1, // always -1 for singular orders
"clientOrderId": "4d96324ff9d44481926157ec08158a40",
"transactTime": 1660801715639
},
"rateLimits": [
{
"rateLimitType": "ORDERS",
"interval": "SECOND",
"intervalNum": 10,
"limit": 50,
"count": 1
},
{
"rateLimitType": "ORDERS",
"interval": "DAY",
"intervalNum": 1,
"limit": 160000,
"count": 1
},
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 6000,
"count": 1
}
]
}
RESULT
response type:
{
"id": "56374a46-3061-486b-a311-99ee972eb648",
"status": 200,
"result": {
"symbol": "BTCUSDT",
"orderId": 12569099453,
"orderListId": -1, // always -1 for singular orders
"clientOrderId": "4d96324ff9d44481926157ec08158a40",
"transactTime": 1660801715639,
"price": "23416.10000000",
"origQty": "0.00847000",
"executedQty": "0.00000000",
"origQuoteOrderQty": "0.000000",
"cummulativeQuoteQty": "0.00000000",
"status": "NEW",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "SELL",
"workingTime": 1660801715639,
"selfTradePreventionMode": "NONE"
},
"rateLimits": [
{
"rateLimitType": "ORDERS",
"interval": "SECOND",
"intervalNum": 10,
"limit": 50,
"count": 1
},
{
"rateLimitType": "ORDERS",
"interval": "DAY",
"intervalNum": 1,
"limit": 160000,
"count": 1
},
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 6000
,
"count": 1
}
]
}
FULL
response type:
{
"id": "56374a46-3061-486b-a311-99ee972eb648",
"status": 200,
"result": {
"symbol": "BTCUSDT",
"orderId": 12569099453,
"orderListId": -1,
"clientOrderId": "4d96324ff9d44481926157ec08158a40",
"transactTime": 1660801715793,
"price": "23416.10000000",
"origQty": "0.00847000",
"executedQty": "0.00847000",
"origQuoteOrderQty": "0.000000",
"cummulativeQuoteQty": "198.33521500",
"status": "FILLED",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "SELL",
"workingTime": 1660801715793,
// FULL response is identical to RESULT response, with the same optional fields
// based on the order type and parameters. FULL response additionally includes
// the list of trades which immediately filled the order.
"fills": [
{
"price": "23416.10000000",
"qty": "0.00635000",
"commission": "0.000000",
"commissionAsset": "BNB",
"tradeId": 1650422481
},
{
"price": "23416.50000000",
"qty": "0.00212000",
"commission": "0.000000",
"commissionAsset": "BNB",
"tradeId": 1650422482
}
]
},
"rateLimits": [
{
"rateLimitType": "ORDERS",
"interval": "SECOND",
"intervalNum": 10,
"limit": 50,
"count": 1
},
{
"rateLimitType": "ORDERS",
"interval": "DAY",
"intervalNum": 1,
"limit": 160000,
"count": 1
},
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 6000,
"count": 1
}
]
}
Conditional fields in Order Responses
There are fields in the order responses (e.g. order placement, order query, order cancellation) that appear only if certain conditions are met.
These fields can apply to Order lists.
The fields are listed below:
Field | Description | Visibility conditions | Examples |
---|---|---|---|
icebergQty | Quantity for the iceberg order | Appears only if the parameter icebergQty was sent in the request. | "icebergQty": "0.00000000" |
preventedMatchId | When used in combination with symbol , can be used to query a prevented match. | Appears only if the order expired due to STP. | "preventedMatchId": 0 |
preventedQuantity | Order quantity that expired due to STP | Appears only if the order expired due to STP. | "preventedQuantity": "1.200000" |
stopPrice | Price when the algorithmic order will be triggered | Appears for STOP_LOSS . TAKE_PROFIT , STOP_LOSS_LIMIT and TAKE_PROFIT_LIMIT orders. | "stopPrice": "23500.00000000" |
strategyId | Can be used to label an order that's part of an order strategy. | Appears if the parameter was populated in the request. | "strategyId": 37463720 |
strategyType | Can be used to label an order that is using an order strategy. | Appears if the parameter was populated in the request. | "strategyType": 1000000 |
trailingDelta | Delta price change required before order activation | Appears for Trailing Stop Orders. | "trailingDelta": 10 |
trailingTime | Time when the trailing order is now active and tracking price changes | Appears only for Trailing Stop Orders. | "trailingTime": -1 |
usedSor | Field that determines whether order used SOR | Appears when placing orders using SOR | "usedSor": true |
workingFloor | Field that determines whether the order is being filled by the SOR or by the order book the order was submitted to. | Appears when placing orders using SOR | "workingFloor": "SOR" |
Test new order (TRADE)
{
"id": "6ffebe91-01d9-43ac-be99-57cf062e0e30",
"method": "order.test",
"params": {
"symbol": "BTCUSDT",
"side": "SELL",
"type": "LIMIT",
"timeInForce": "GTC",
"price": "23416.10000000",
"quantity": "0.00847000",
"apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A",
"signature": "15af09e41c36f3cc61378c2fbe2c33719a03dd5eba8d0f9206fbda44de717c88",
"timestamp": 1660801715431
}
}
Test order placement.
Validates new order parameters and verifies your signature but does not send the order into the matching engine.
Weight:
Condition | Request Weight |
---|---|
Without computeCommissionRates | 1 |
With computeCommissionRates | 20 |
Parameters:
In addition to all parameters accepted by order.place
,
the following optional parameters are also accepted:
Name | Type | Mandatory | Description |
---|---|---|---|
computeCommissionRates | BOOLEAN | NO | Default: false |
Data Source: Memory
Response:
Without computeCommissionRates
:
{
"id": "6ffebe91-01d9-43ac-be99-57cf062e0e30",
"status": 200,
"result": {},
"rateLimits": [
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 6000,
"count": 1
}
]
}
With computeCommissionRates
:
{
"id": "6ffebe91-01d9-43ac-be99-57cf062e0e30",
"status": 200,
"result": {
"standardCommissionForOrder": { //Standard commission rates on trades from the order.
"maker": "0.00000112",
"taker": "0.00000114"
},
"taxCommissionForOrder": { //Tax commission rates for trades from the order
"maker": "0.00000112",
"taker": "0.00000114"
},
"discount": { //Discount on standard commissions when paying in BNB.
"enabledForAccount": true,
"enabledForSymbol": true,
"discountAsset": "BNB",
"discount": "0.25000000" //Standard commission is reduced by this rate when paying in BNB.
}
},
"rateLimits": [
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 6000,
"count": 20
}
]
}
Query order (USER_DATA)
{
"id": "aa62318a-5a97-4f3b-bdc7-640bbe33b291",
"method": "order.status",
"params": {
"symbol": "BTCUSDT",
"orderId": 12569099453,
"apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A",
"signature": "2c3aab5a078ee4ea465ecd95523b77289f61476c2f238ec10c55ea6cb11a6f35",
"timestamp": 1660801720951
}
}
Check execution status of an order.
Weight: 4
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol |
STRING | YES | |
orderId |
INT | YES | Lookup order by orderId |
origClientOrderId |
STRING | Lookup order by clientOrderId |
|
apiKey |
STRING | YES | |
recvWindow |
INT | NO | The value cannot be greater than 60000 |
signature |
STRING | YES | |
timestamp |
INT | YES |
Notes:
-
If both
orderId
andorigClientOrderId
parameters are specified, onlyorderId
is used andorigClientOrderId
is ignored. -
For some historical orders the
cummulativeQuoteQty
response field may be negative, meaning the data is not available at this time.
Data Source: Memory => Database
Response:
{
"id": "aa62318a-5a97-4f3b-bdc7-640bbe33b291",
"status": 200,
"result": {
"symbol": "BTCUSDT",
"orderId": 12569099453,
"orderListId": -1, // set only for orders of an order list
"clientOrderId": "4d96324ff9d44481926157",
"price": "23416.10000000",
"origQty": "0.00847000",
"executedQty": "0.00847000",
"cummulativeQuoteQty": "198.33521500",
"status": "FILLED",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "SELL",
"stopPrice": "0.00000000", // always present, zero if order type does not use stopPrice
"trailingDelta": 10, // present only if trailingDelta set for the order
"trailingTime": -1, // present only if trailingDelta set for the order
"icebergQty": "0.00000000", // always present, zero for non-iceberg orders
"time": 1660801715639, // time when the order was placed
"updateTime": 1660801717945, // time of the last update to the order
"isWorking": true,
"workingTime": 1660801715639,
"origQuoteOrderQty": "0.00000000" // always present, zero if order type does not use quoteOrderQty
"strategyId": 37463720, // present only if strategyId set for the order
"strategyType": 1000000, // present only if strategyType set for the order
"selfTradePreventionMode": "NONE",
"preventedMatchId": 0, // present only if the order expired due to STP
"preventedQuantity": "1.200000" // present only if the order expired due to STP
},
"rateLimits": [
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 6000,
"count": 4
}
]
}
Note: The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.
Cancel order (TRADE)
{
"id": "5633b6a2-90a9-4192-83e7-925c90b6a2fd",
"method": "order.cancel",
"params": {
"symbol": "BTCUSDT",
"origClientOrderId": "4d96324ff9d44481926157",
"apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A",
"signature": "33d5b721f278ae17a52f004a82a6f68a70c68e7dd6776ed0be77a455ab855282",
"timestamp": 1660801715830
}
}
Cancel an active order.
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol |
STRING | YES | |
orderId |
INT | YES | Cancel order by orderId |
origClientOrderId |
STRING | Cancel order by clientOrderId |
|
newClientOrderId |
STRING | NO | New ID for the canceled order. Automatically generated if not sent |
cancelRestrictions |
ENUM | NO | Supported values: ONLY_NEW - Cancel will succeed if the order status is NEW .ONLY_PARTIALLY_FILLED - Cancel will succeed if order status is PARTIALLY_FILLED . |
apiKey |
STRING | YES | |
recvWindow |
INT | NO | The value cannot be greater than 60000 |
signature |
STRING | YES | |
timestamp |
INT | YES |
Notes:
-
If both
orderId
andorigClientOrderId
parameters are specified, onlyorderId
is used andorigClientOrderId
is ignored. -
newClientOrderId
will replaceclientOrderId
of the canceled order, freeing it up for new orders. -
If you cancel an order that is a part of an order list, the entire order list is canceled.
Data Source: Matching Engine
Response:
When an individual order is canceled:
{
"id": "5633b6a2-90a9-4192-83e7-925c90b6a2fd",
"status": 200,
"result": {
"symbol": "BTCUSDT",
"origClientOrderId": "4d96324ff9d44481926157", // clientOrderId that was canceled
"orderId": 12569099453,
"orderListId": -1, // set only for legs of an order list
"clientOrderId": "91fe37ce9e69c90d6358c0", // newClientOrderId from request
"transactTime": 1684804350068,
"price": "23416.10000000",
"origQty": "0.00847000",
"executedQty": "0.00001000",
"origQuoteOrderQty": "0.000000",
"cummulativeQuoteQty": "0.23416100",
"status": "CANCELED",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "SELL",
"stopPrice": "0.00000000", // present only if stopPrice set for the order
"trailingDelta": 0, // present only if trailingDelta set for the order
"icebergQty": "0.00000000", // present only if icebergQty set for the order
"strategyId": 37463720, // present only if strategyId set for the order
"strategyType": 1000000, // present only if strategyType set for the order
"selfTradePreventionMode": "NONE"
},
"rateLimits": [
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 6000,
"count": 1
}
]
}
When an order list is canceled:
{
"id": "16eaf097-bbec-44b9-96ff-e97e6e875870",
"status": 200,
"result": {
"orderListId": 19431,
"contingencyType": "OCO",
"listStatusType": "ALL_DONE",
"listOrderStatus": "ALL_DONE",
"listClientOrderId": "iuVNVJYYrByz6C4yGOPPK0",
"transactionTime": 1660803702431,
"symbol": "BTCUSDT",
"orders": [
{
"symbol": "BTCUSDT",
"orderId": 12569099453,
"clientOrderId": "bX5wROblo6YeDwa9iTLeyY"
},
{
"symbol": "BTCUSDT",
"orderId": 12569099454,
"clientOrderId": "Tnu2IP0J5Y4mxw3IATBfmW"
}
],
//order list's leg status format is the same as for individual orders.
"orderReports": [
{
"symbol": "BTCUSDT",
"origClientOrderId": "bX5wROblo6YeDwa9iTLeyY",
"orderId": 12569099453,
"orderListId": 19431,
"clientOrderId": "OFFXQtxVFZ6Nbcg4PgE2DA",
"transactTime": 1684804350068,
"price": "23450.50000000",
"origQty": "0.00850000"
"executedQty": "0.00000000",
"origQuoteOrderQty": "0.000000",
"cummulativeQuoteQty": "0.00000000",
"status": "CANCELED",
"timeInForce": "GTC",
"type": "STOP_LOSS_LIMIT",
"side": "BUY",
"stopPrice": "23430.00000000",
"selfTradePreventionMode": "NONE"
},
{
"symbol": "BTCUSDT",
"origClientOrderId": "Tnu2IP0J5Y4mxw3IATBfmW",
"orderId": 12569099454,
"orderListId": 19431,
"clientOrderId": "OFFXQtxVFZ6Nbcg4PgE2DA",
"transactTime": 1684804350068,
"price": "23400.00000000",
"origQty": "0.00850000"
"executedQty": "0.00000000",
"cummulativeQuoteQty": "0.00000000",
"status": "CANCELED",
"timeInForce": "GTC",
"type": "LIMIT_MAKER",
"side": "BUY",
"selfTradePreventionMode": "NONE"
}
]
},
"rateLimits": [
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 6000,
"count": 1
}
]
}
Note: The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.
Regarding cancelRestrictions
- If the
cancelRestrictions
value is not any of the supported values, the error will be:
{
"code": -1145,
"msg": "Invalid cancelRestrictions"
}
- If the order did not pass the conditions for
cancelRestrictions
, the error will be:
{
"code": -2011,
"msg": "Order was not canceled due to cancel restrictions."
}
Cancel and replace order (TRADE)
{
"id": "99de1036-b5e2-4e0f-9b5c-13d751c93a1a",
"method": "order.cancelReplace",
"params": {
"symbol": "BTCUSDT",
"cancelReplaceMode": "ALLOW_FAILURE",
"cancelOrigClientOrderId": "4d96324ff9d44481926157",
"side": "SELL",
"type": "LIMIT",
"timeInForce": "GTC",
"price": "23416.10000000",
"quantity": "0.00847000",
"apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A",
"signature": "7028fdc187868754d25e42c37ccfa5ba2bab1d180ad55d4c3a7e2de643943dc5",
"timestamp": 1660813156900
}
}
Cancel an existing order and immediately place a new order instead of the canceled one.
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol |
STRING | YES | |
cancelReplaceMode |
ENUM | YES | |
cancelOrderId |
INT | YES | Cancel order by orderId |
cancelOrigClientOrderId |
STRING | Cancel order by clientOrderId |
|
cancelNewClientOrderId |
STRING | NO | New ID for the canceled order. Automatically generated if not sent |
side |
ENUM | YES | BUY or SELL |
type |
ENUM | YES | |
timeInForce |
ENUM | NO * | |
price |
DECIMAL | NO * | |
quantity |
DECIMAL | NO * | |
quoteOrderQty |
DECIMAL | NO * | |
newClientOrderId |
STRING | NO | Arbitrary unique ID among open orders. Automatically generated if not sent |
newOrderRespType |
ENUM | NO |
Select response format:
|
stopPrice |
DECIMAL | NO * | |
trailingDelta |
DECIMAL | NO * | See Trailing Stop order FAQ |
icebergQty |
DECIMAL | NO | |
strategyId |
LONG | NO | Arbitrary numeric value identifying the order within an order strategy. |
strategyType |
INT | NO |
Arbitrary numeric value identifying the order strategy. Values smaller than 1000000 are reserved and cannot be used. |
selfTradePreventionMode |
ENUM | NO |
The allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE. |
cancelRestrictions |
ENUM | NO | Supported values: ONLY_NEW - Cancel will succeed if the order status is NEW .ONLY_PARTIALLY_FILLED - Cancel will succeed if order status is PARTIALLY_FILLED . For more information please refer to Regarding cancelRestrictions . |
apiKey |
STRING | YES | |
orderRateLimitExceededMode |
ENUM | NO | Supported values: DO_NOTHING (default)- will only attempt to cancel the order if account has not exceeded the unfilled order rate limitCANCEL_ONLY - will always cancel the order. |
recvWindow |
INT | NO | The value cannot be greater than 60000 |
signature |
STRING | YES | |
timestamp |
INT | YES |
Similar to the order.place
request,
additional mandatory parameters (*) are determined by the new order type
.
Available cancelReplaceMode
options:
STOP_ON_FAILURE
– if cancellation request fails, new order placement will not be attempted.ALLOW_FAILURE
– new order placement will be attempted even if the cancel request fails.
Request | Response | ||||
---|---|---|---|---|---|
cancelReplaceMode |
orderRateLimitExceededMode |
Unfilled Order Count | cancelResult |
newOrderResult |
status |
STOP_ON_FAILURE |
DO_NOTHING |
Within Limits | ✅ SUCCESS |
✅ SUCCESS |
200 |
❌ FAILURE |
➖ NOT_ATTEMPTED |
400 |
|||
✅ SUCCESS |
❌ FAILURE |
409 |
|||
Exceeds Limits | ✅ SUCCESS |
✅ SUCCESS |
N/A | ||
❌ FAILURE |
➖ NOT_ATTEMPTED |
N/A | |||
✅ SUCCESS |
❌ FAILURE |
N/A | |||
CANCEL_ONLY |
Within Limits | ✅ SUCCESS |
✅ SUCCESS |
200 |
|
❌ FAILURE |
➖ NOT_ATTEMPTED |
400 |
|||
✅ SUCCESS |
❌ FAILURE |
409 |
|||
Exceeds Limits | ❌ FAILURE |
➖ NOT_ATTEMPTED |
429 |
||
✅ SUCCESS |
❌ FAILURE |
429 |
|||
ALLOW_FAILURE |
DO_NOTHING |
Within Limits | ✅ SUCCESS |
✅ SUCCESS |
200 |
❌ FAILURE |
❌ FAILURE |
400 |
|||
❌ FAILURE |
✅ SUCCESS |
409 |
|||
✅ SUCCESS |
❌ FAILURE |
409 |
|||
Exceeds Limits | ✅ SUCCESS |
✅ SUCCESS |
N/A | ||
❌ FAILURE |
❌ FAILURE |
N/A | |||
❌ FAILURE |
✅ SUCCESS |
N/A | |||
✅ SUCCESS |
❌ FAILURE |
N/A | |||
CANCEL_ONLY |
Within Limits | ✅ SUCCESS |
✅ SUCCESS |
200 |
|
❌ FAILURE |
❌ FAILURE |
400 |
|||
❌ FAILURE |
✅ SUCCESS |
409 |
|||
✅ SUCCESS |
❌ FAILURE |
409 |
|||
Exceeds Limits | ✅ SUCCESS |
✅ SUCCESS |
200 |
||
❌ FAILURE |
❌ FAILURE |
400 |
|||
❌ FAILURE |
✅ SUCCESS |
N/A | |||
✅ SUCCESS |
❌ FAILURE |
409 |
Notes:
-
If both
cancelOrderId
andcancelOrigClientOrderId
parameters are specified, onlycancelOrderId
is used andcancelOrigClientOrderId
is ignored. -
cancelNewClientOrderId
will replaceclientOrderId
of the canceled order, freeing it up for new orders. -
newClientOrderId
specifiesclientOrderId
value for the placed order.A new order with the same
clientOrderId
is accepted only when the previous one is filled or expired.The new order can reuse old
clientOrderId
of the canceled order. -
This cancel-replace operation is not transactional.
If one operation succeeds but the other one fails, the successful operation is still executed.
For example, in
STOP_ON_FAILURE
mode, if the new order placement fails, the old order is still canceled. -
Filters and order count limits are evaluated before cancellation and order placement occurs.
-
If new order placement is not attempted, your order count is still incremented.
-
Like
order.cancel
, if you cancel an individual order from an order list, the entire order list is cancelled.
Data Source: Matching Engine
Response:
If both cancel and placement succeed, you get the following response with "status": 200
:
{
"id": "99de1036-b5e2-4e0f-9b5c-13d751c93a1a",
"status": 200,
"result": {
"cancelResult": "SUCCESS",
"newOrderResult": "SUCCESS",
// Format is identical to "order.cancel" format.
// Some fields are optional and are included only for orders that set them.
"cancelResponse": {
"symbol": "BTCUSDT",
"origClientOrderId": "4d96324ff9d44481926157", // cancelOrigClientOrderId from request
"orderId": 125690984230,
"orderListId": -1,
"clientOrderId": "91fe37ce9e69c90d6358c0", // cancelNewClientOrderId from request
"transactTime": 1684804350068,
"price": "23450.00000000",
"origQty": "0.00847000",
"executedQty": "0.00001000",
"origQuoteOrderQty": "0.000000",
"cummulativeQuoteQty": "0.23450000",
"status": "CANCELED",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "SELL",
"selfTradePreventionMode": "NONE"
},
// Format is identical to "order.place" format, affected by "newOrderRespType".
// Some fields are optional and are included only for orders that set them.
"newOrderResponse": {
"symbol": "BTCUSDT",
"orderId": 12569099453,
"orderListId": -1,
"clientOrderId": "bX5wROblo6YeDwa9iTLeyY", // newClientOrderId from request
"transactTime": 1660813156959,
"price": "23416.10000000",
"origQty": "0.00847000",
"executedQty": "0.00000000",
"origQuoteOrderQty": "0.000000",
"cummulativeQuoteQty": "0.00000000",
"status": "NEW",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "SELL",
"selfTradePreventionMode": "NONE"
}
},
"rateLimits": [
{
"rateLimitType": "ORDERS",
"interval": "SECOND",
"intervalNum": 10,
"limit": 50,
"count": 1
},
{
"rateLimitType": "ORDERS",
"interval": "DAY",
"intervalNum": 1,
"limit": 160000,
"count": 1
},
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 6000,
"count": 1
}
]
}
In STOP_ON_FAILURE
mode, failed order cancellation prevents new order from being placed
and returns the following response with "status": 400
:
{
"id": "27e1bf9f-0539-4fb0-85c6-06183d36f66c",
"status": 400,
"error": {
"code": -2022,
"msg": "Order cancel-replace failed.",
"data": {
"cancelResult": "FAILURE",
"newOrderResult": "NOT_ATTEMPTED",
"cancelResponse": {
"code": -2011,
"msg": "Unknown order sent."
},
"newOrderResponse": null
}
},
"rateLimits": [
{
"rateLimitType": "ORDERS",
"interval": "SECOND",
"intervalNum": 10,
"limit": 50,
"count": 1
},
{
"rateLimitType": "ORDERS",
"interval": "DAY",
"intervalNum": 1,
"limit": 160000,
"count": 1
},
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 6000,
"count": 1
}
]
}
If cancel-replace mode allows failure and one of the operations fails,
you get a response with "status": 409
,
and the "data"
field detailing which operation succeeded, which failed, and why:
{
"id": "b220edfe-f3c4-4a3a-9d13-b35473783a25",
"status": 409,
"error": {
"code": -2021,
"msg": "Order cancel-replace partially failed.",
"data": {
"cancelResult": "SUCCESS",
"newOrderResult": "FAILURE",
"cancelResponse": {
"symbol": "BTCUSDT",
"origClientOrderId": "4d96324ff9d44481926157",
"orderId": 125690984230,
"orderListId": -1,
"clientOrderId": "91fe37ce9e69c90d6358c0",
"price": "23450.00000000",
"origQty": "0.00847000",
"executedQty": "0.00001000",
"origQuoteOrderQty": "0.000000",
"cummulativeQuoteQty": "0.23450000",
"status": "CANCELED",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "SELL",
"selfTradePreventionMode": "NONE"
},
"newOrderResponse": {
"code": -2010,
"msg": "Order would immediately match and take."
}
}
},
"rateLimits": [
{
"rateLimitType": "ORDERS",
"interval": "SECOND",
"intervalNum": 10,
"limit": 50,
"count": 1
},
{
"rateLimitType": "ORDERS",
"interval": "DAY",
"intervalNum": 1,
"limit": 160000,
"count": 1
},
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 6000,
"count": 1
}
]
}
{
"id": "ce641763-ff74-41ac-b9f7-db7cbe5e93b1",
"status": 409,
"error": {
"code": -2021,
"msg": "Order cancel-replace partially failed.",
"data": {
"cancelResult": "FAILURE",
"newOrderResult": "SUCCESS",
"cancelResponse": {
"code": -2011,
"msg": "Unknown order sent."
},
"newOrderResponse": {
"symbol": "BTCUSDT",
"orderId": 12569099453,
"orderListId": -1,
"clientOrderId": "bX5wROblo6YeDwa9iTLeyY",
"transactTime": 1660813156959,
"price": "23416.10000000",
"origQty": "0.00847000",
"executedQty": "0.00000000",
"origQuoteOrderQty": "0.000000",
"cummulativeQuoteQty": "0.00000000",
"status": "NEW",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "SELL",
"workingTime": 1669693344508,
"fills": [],
"selfTradePreventionMode": "NONE"
}
}
},
"rateLimits": [
{
"rateLimitType": "ORDERS",
"interval": "SECOND",
"intervalNum": 10,
"limit": 50,
"count": 1
},
{
"rateLimitType": "ORDERS",
"interval": "DAY",
"intervalNum": 1,
"limit": 160000,
"count": 1
},
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 6000,
"count": 1
}
]
}
If both operations fail, response will have "status": 400
:
{
"id": "3b3ac45c-1002-4c7d-88e8-630c408ecd87",
"status": 400,
"error": {
"code": -2022,
"msg": "Order cancel-replace failed.",
"data": {
"cancelResult": "FAILURE",
"newOrderResult": "FAILURE",
"cancelResponse": {
"code": -2011,
"msg": "Unknown order sent."
},
"newOrderResponse": {
"code": -2010,
"msg": "Order would immediately match and take."
}
}
},
"rateLimits": [
{
"rateLimitType": "ORDERS",
"interval": "SECOND",
"intervalNum": 10,
"limit": 50,
"count": 1
},
{
"rateLimitType": "ORDERS",
"interval": "DAY",
"intervalNum": 1,
"limit": 160000,
"count": 1
},
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 6000,
"count": 1
}
]
}
If orderRateLimitExceededMode
is DO_NOTHING
regardless of cancelReplaceMode
, and you have exceeded your unfilled order count, you will get status 429
with the following error:
{
"id": "3b3ac45c-1002-4c7d-88e8-630c408ecd87",
"status": 429,
"error": {
"code": -1015,
"msg": "Too many new orders; current limit is 50 orders per 10 SECOND."
},
"rateLimits": [
{
"rateLimitType": "ORDERS",
"interval": "SECOND",
"intervalNum": 10,
"limit": 50,
"count": 50
},
{
"rateLimitType": "ORDERS",
"interval": "DAY",
"intervalNum": 1,
"limit": 160000,
"count": 50
},
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 6000,
"count": 1
}
]
}
If orderRateLimitExceededMode
is CANCEL_ONLY
regardless of cancelReplaceMode
, and you have exceeded your unfilled order count, you will get status 409
with the following error:
{
"id": "3b3ac45c-1002-4c7d-88e8-630c408ecd87",
"status": 409,
"error": {
"code": -2021,
"msg": "Order cancel-replace partially failed.",
"data": {
"cancelResult": "SUCCESS",
"newOrderResult": "FAILURE",
"cancelResponse": {
"symbol": "LTCBNB",
"origClientOrderId": "GKt5zzfOxRDSQLveDYCTkc",
"orderId": 64,
"orderListId": -1,
"clientOrderId": "loehOJF3FjoreUBDmv739R",
"transactTime": 1715779007228,
"price": "1.00",
"origQty": "10.00000000",
"executedQty": "0.00000000",
"origQuoteOrderQty": "0.000000",
"cummulativeQuoteQty": "0.00",
"status": "CANCELED",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "SELL",
"selfTradePreventionMode": "NONE"
},
"newOrderResponse": {
"code": -1015,
"msg": "Too many new orders; current limit is 50 orders per 10 SECOND."
}
}
},
"rateLimits": [
{
"rateLimitType": "ORDERS",
"interval": "SECOND",
"intervalNum": 10,
"limit": 50,
"count": 50
},
{
"rateLimitType": "ORDERS",
"interval": "DAY",
"intervalNum": 1,
"limit": 160000,
"count": 50
},
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 6000,
"count": 1
}
]
}
Note: The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.
Current open orders (USER_DATA)
{
"id": "55f07876-4f6f-4c47-87dc-43e5fff3f2e7",
"method": "openOrders.status",
"params": {
"symbol": "BTCUSDT",
"apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A",
"signature": "d632b3fdb8a81dd44f82c7c901833309dd714fe508772a89b0a35b0ee0c48b89",
"timestamp": 1660813156812
}
}
Query execution status of all open orders.
If you need to continuously monitor order status updates, please consider using WebSocket Streams:
userDataStream.start
requestexecutionReport
user data stream event
Weight: Adjusted based on the number of requested symbols:
Parameter | Weight |
---|---|
symbol | 6 |
none | 80 |
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | NO | If omitted, open orders for all symbols are returned |
apiKey | STRING | YES | |
recvWindow | INT | NO | The value cannot be greater than 60000 |
signature | STRING | YES | |
timestamp | INT | YES |
Data Source: Memory => Database
Response:
Status reports for open orders are identical to order.status
.
Note that some fields are optional and included only for orders that set them.
Open orders are always returned as a flat list.
If all symbols are requested, use the symbol
field to tell which symbol the orders belong to.
{
"id": "55f07876-4f6f-4c47-87dc-43e5fff3f2e7",
"status": 200,
"result": [
{
"symbol": "BTCUSDT",
"orderId": 12569099453,
"orderListId": -1,
"clientOrderId": "4d96324ff9d44481926157",
"price": "23416.10000000",
"origQty": "0.00847000",
"executedQty": "0.00720000",
"origQuoteOrderQty": "0.000000",
"cummulativeQuoteQty": "172.43931000",
"status": "PARTIALLY_FILLED",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "SELL",
"stopPrice": "0.00000000",
"icebergQty": "0.00000000",
"time": 1660801715639,
"updateTime": 1660801717945,
"isWorking": true,
"workingTime": 1660801715639,
"origQuoteOrderQty": "0.00000000",
"selfTradePreventionMode": "NONE"
}
],
"rateLimits": [
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 6000,
"count": 6
}
]
}
Note: The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.
Cancel open orders (TRADE)
{
"id": "778f938f-9041-4b88-9914-efbf64eeacc8",
"method": "openOrders.cancelAll"
"params": {
"symbol": "BTCUSDT",
"apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A",
"signature": "773f01b6e3c2c9e0c1d217bc043ce383c1ddd6f0e25f8d6070f2b66a6ceaf3a5",
"timestamp": 1660805557200
}
}
Cancel all open orders on a symbol. This includes orders that are part of an order list.
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
apiKey | STRING | YES | |
recvWindow | INT | NO | The value cannot be greater than 60000 |
signature | STRING | YES | |
timestamp | INT | YES |
Data Source: Matching Engine
Response:
Cancellation reports for orders and order lists have the same format as in order.cancel
.
{
"id": "778f938f-9041-4b88-9914-efbf64eeacc8",
"status": 200,
"result": [
{
"symbol": "BTCUSDT",
"origClientOrderId": "4d96324ff9d44481926157",
"orderId": 12569099453,
"orderListId": -1,
"clientOrderId": "91fe37ce9e69c90d6358c0",
"transactTime": 1684804350068,
"price": "23416.10000000",
"origQty": "0.00847000",
"executedQty": "0.00001000",
"origQuoteOrderQty": "0.000000",
"cummulativeQuoteQty": "0.23416100",
"status": "CANCELED",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "SELL",
"stopPrice": "0.00000000",
"trailingDelta": 0,
"trailingTime": -1,
"icebergQty": "0.00000000",
"strategyId": 37463720,
"strategyType": 1000000,
"selfTradePreventionMode": "NONE"
},
{
"orderListId": 19431,
"contingencyType": "OCO",
"listStatusType": "ALL_DONE",
"listOrderStatus": "ALL_DONE",
"listClientOrderId": "iuVNVJYYrByz6C4yGOPPK0",
"transactionTime": 1660803702431,
"symbol": "BTCUSDT",
"orders": [
{
"symbol": "BTCUSDT",
"orderId": 12569099453,
"clientOrderId": "bX5wROblo6YeDwa9iTLeyY"
},
{
"symbol": "BTCUSDT",
"orderId": 12569099454,
"clientOrderId": "Tnu2IP0J5Y4mxw3IATBfmW"
}
],
"orderReports": [
{
"symbol": "BTCUSDT",
"origClientOrderId": "bX5wROblo6YeDwa9iTLeyY",
"orderId": 12569099453,
"orderListId": 19431,
"clientOrderId": "OFFXQtxVFZ6Nbcg4PgE2DA",
"transactTime": 1684804350068,
"price": "23450.50000000",
"origQty": "0.00850000",
"executedQty": "0.00000000",
"origQuoteOrderQty": "0.000000",
"cummulativeQuoteQty": "0.00000000",
"status": "CANCELED",
"timeInForce": "GTC",
"type": "STOP_LOSS_LIMIT",
"side": "BUY",
"stopPrice": "23430.00000000",
"selfTradePreventionMode": "NONE"
},
{
"symbol": "BTCUSDT",
"origClientOrderId": "Tnu2IP0J5Y4mxw3IATBfmW",
"orderId": 12569099454,
"orderListId": 19431,
"clientOrderId": "OFFXQtxVFZ6Nbcg4PgE2DA",
"transactTime": 1684804350068,
"price": "23400.00000000",
"origQty": "0.00850000",
"executedQty": "0.00000000",
"origQuoteOrderQty": "0.000000",
"cummulativeQuoteQty": "0.00000000",
"status": "CANCELED",
"timeInForce": "GTC",
"type": "LIMIT_MAKER",
"side": "BUY",
"selfTradePreventionMode": "NONE"
}
]
}
],
"rateLimits": [
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 6000,
"count": 1
}
]
}
Note: The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.
Order lists
Place new OCO - Deprecated (TRADE)
{
"id": "56374a46-3061-486b-a311-99ee972eb648",
"method": "orderList.place",
"params": {
"symbol": "BTCUSDT",
"side": "SELL",
"price": "23420.00000000",
"quantity": "0.00650000",
"stopPrice": "23410.00000000",
"stopLimitPrice": "23405.00000000",
"stopLimitTimeInForce": "GTC",
"newOrderRespType": "RESULT",
"apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A",
"signature": "6689c2a36a639ff3915c2904871709990ab65f3c7a9ff13857558fd350315c35",
"timestamp": 1660801713767
}
}
Send in a new one-cancels-the-other (OCO) pair:
LIMIT_MAKER
+ STOP_LOSS
/STOP_LOSS_LIMIT
orders (called legs),
where activation of one order immediately cancels the other.
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
side | ENUM | YES | BUY or SELL |
price | DECIMAL | YES | Price for the limit order |
quantity | DECIMAL | YES | |
listClientOrderId | STRING | NO | Arbitrary unique ID among open order lists. Automatically generated if not sent |
limitClientOrderId | STRING | NO | Arbitrary unique ID among open orders for the limit order. Automatically generated if not sent |
limitIcebergQty | DECIMAL | NO | |
limitStrategyId | LONG | NO | Arbitrary numeric value identifying the limit order within an order strategy. |
limitStrategyType | INT | NO | Arbitrary numeric value identifying the limit order strategy. Values smaller than |
stopPrice | DECIMAL | YES * | Either stopPrice or trailingDelta , or both must be specified |
trailingDelta | INT | YES * | See Trailing Stop order FAQ |
stopClientOrderId | STRING | NO | Arbitrary unique ID among open orders for the stop order. Automatically generated if not sent |
stopLimitPrice | DECIMAL | NO * | |
stopLimitTimeInForce | ENUM | NO * | See order.place for available options |
stopIcebergQty | DECIMAL | NO * | |
stopStrategyId | LONG | NO | Arbitrary numeric value identifying the stop order within an order strategy. |
stopStrategyType | INT | NO | Arbitrary numeric value identifying the stop order strategy. Values smaller than |
newOrderRespType | ENUM | NO | Select response format: ACK , RESULT , FULL (default) |
selfTradePreventionMode | ENUM | NO | The allowed enums is dependent on what is configured on the symbol. The possible supported values are: STP Modes |
apiKey | STRING | YES | |
recvWindow | INT | NO | The value cannot be greater than 60000 |
signature | STRING | YES | |
timestamp | INT | YES |
Notes:
-
listClientOrderId
parameter specifieslistClientOrderId
for the OCO pair.A new OCO with the same
listClientOrderId
is accepted only when the previous one is filled or completely expired.listClientOrderId
is distinct fromclientOrderId
of individual orders. -
limitClientOrderId
andstopClientOrderId
specifyclientOrderId
values for both legs of the OCO.A new order with the same
clientOrderId
is accepted only when the previous one is filled or expired. -
Price restrictions on the legs:
side
Price relation BUY
price
< market price <stopPrice
SELL
price
> market price >stopPrice
-
Both legs have the same
quantity
.However, you can set different iceberg quantity for individual legs.
If
stopIcebergQty
is used,stopLimitTimeInForce
must beGTC
. -
trailingDelta
applies only to theSTOP_LOSS
/STOP_LOSS_LIMIT
leg of the OCO. -
OCOs add 2 orders to the unfilled order count,
EXCHANGE_MAX_ORDERS
filter, andMAX_NUM_ORDERS
filter.
Data Source: Matching Engine
Response:
Response format for orderReports
is selected using the newOrderRespType
parameter.
The following example is for RESULT
response type.
See order.place
for more examples.
{
"id": "57833dc0-e3f2-43fb-ba20-46480973b0aa",
"status": 200,
"result": {
"orderListId": 1274512,
"contingencyType": "OCO",
"listStatusType": "EXEC_STARTED",
"listOrderStatus": "EXECUTING",
"listClientOrderId": "08985fedd9ea2cf6b28996",
"transactionTime": 1660801713793,
"symbol": "BTCUSDT",
"orders": [
{
"symbol": "BTCUSDT",
"orderId": 12569138901,
"clientOrderId": "BqtFCj5odMoWtSqGk2X9tU"
},
{
"symbol": "BTCUSDT",
"orderId": 12569138902,
"clientOrderId": "jLnZpj5enfMXTuhKB1d0us"
}
],
"orderReports": [
{
"symbol": "BTCUSDT",
"orderId": 12569138901,
"orderListId": 1274512,
"clientOrderId": "BqtFCj5odMoWtSqGk2X9tU",
"transactTime": 1660801713793,
"price": "23410.00000000",
"origQty": "0.00650000",
"executedQty": "0.00000000",
"origQuoteOrderQty": "0.000000",
"cummulativeQuoteQty": "0.00000000",
"status": "NEW",
"timeInForce": "GTC",
"type": "STOP_LOSS_LIMIT",
"side": "SELL",
"stopPrice": "23405.00000000",
"workingTime": -1,
"selfTradePreventionMode": "NONE"
},
{
"symbol": "BTCUSDT",
"orderId": 12569138902,
"orderListId": 1274512,
"clientOrderId": "jLnZpj5enfMXTuhKB1d0us",
"transactTime": 1660801713793,
"price": "23420.00000000",
"origQty": "0.00650000",
"executedQty": "0.00000000",
"origQuoteOrderQty": "0.000000",
"cummulativeQuoteQty": "0.00000000",
"status": "NEW",
"timeInForce": "GTC",
"type": "LIMIT_MAKER",
"side": "SELL",
"workingTime": 1660801713793,
"selfTradePreventionMode": "NONE"
}
]
},
"rateLimits": [
{
"rateLimitType": "ORDERS",
"interval": "SECOND",
"intervalNum": 10,
"limit": 50,
"count": 2
},
{
"rateLimitType": "ORDERS",
"interval": "DAY",
"intervalNum": 1,
"limit": 160000,
"count": 2
},
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 6000,
"count": 1
}
]
}
Place new Order list - OCO (TRADE)
{
"id": "56374a46-3261-486b-a211-99ed972eb648",
"method": "orderList.place.oco",
"params":
{
"symbol": "LTCBNB",
"side": "BUY",
"quantity": 1,
"timestamp": 1711062760647,
"aboveType": "STOP_LOSS_LIMIT",
"abovePrice": "1.5",
"aboveStopPrice": "1.50000001",
"aboveTimeInForce": "GTC",
"belowType": "LIMIT_MAKER",
"belowPrice": "1.49999999",
"apiKey": "duwNf97YPLqhFIk7kZF0dDdGYVAXStA7BeEz0fIT9RAhUbixJtyS6kJ3hhzJsRXC",
"signature": "64614cfd8dd38260d4fd86d3c455dbf4b9d1c8a8170ea54f700592a986c30ddb"
}
}
Weight: 1
Send in an one-cancels the other (OCO) pair, where activation of one order immediately cancels the other.
- An OCO has 2 orders called the above order and below order.
- One of the orders must be a
LIMIT_MAKER/TAKE_PROFIT/TAKE_PROFIT_LIMIT
order and the other must beSTOP_LOSS
orSTOP_LOSS_LIMIT
order. - Price restrictions:
- If the OCO is on the
SELL
side:LIMIT_MAKER/TAKE_PROFIT_LIMIT
price
> Last Traded Price >STOP_LOSS/STOP_LOSS_LIMIT
stopPrice
TAKE_PROFIT stopPrice
> Last Traded Price >STOP_LOSS/STOP_LOSS_LIMIT stopPrice
- If the OCO is on the
BUY
side:LIMIT_MAKER
price
< Last Traded Price <STOP_LOSS/STOP_LOSS_LIMIT
stopPrice
TAKE_PROFIT stopPrice
> Last Traded Price >STOP_LOSS/STOP_LOSS_LIMIT stopPrice
- If the OCO is on the
- OCOs add 2 orders to the unfilled order count,
EXCHANGE_MAX_ORDERS
filter, andMAX_NUM_ORDERS
filter.
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
listClientOrderId | STRING | NO | Arbitrary unique ID among open order lists. Automatically generated if not sent. A new order list with the same listClientOrderId is accepted only when the previous one is filled or completely expired. listClientOrderId is distinct from the aboveClientOrderId and the belowCLientOrderId . |
side | ENUM | YES | BUY or SELL |
quantity | DECIMAL | YES | Quantity for both orders of the order list. |
aboveType | ENUM | YES | Supported values: STOP_LOSS_LIMIT , STOP_LOSS , LIMIT_MAKER , TAKE_PROFIT , TAKE_PROFIT_LIMIT |
aboveClientOrderId | STRING | NO | Arbitrary unique ID among open orders for the above order. Automatically generated if not sent |
aboveIcebergQty | LONG | NO | Note that this can only be used if aboveTimeInForce is GTC . |
abovePrice | DECIMAL | NO | Can be used if aboveType is STOP_LOSS_LIMIT , LIMIT_MAKER , or TAKE_PROFIT_LIMIT to specify the limit price. |
aboveStopPrice | DECIMAL | NO | Can be used if aboveType is STOP_LOSS , STOP_LOSS_LIMIT , TAKE_PROFIT , TAKE_PROFIT_LIMIT Either aboveStopPrice or aboveTrailingDelta or both, must be specified. |
aboveTrailingDelta | LONG | NO | See Trailing Stop order FAQ. |
aboveTimeInForce | DECIMAL | NO | Required if aboveType is STOP_LOSS_LIMIT or TAKE_PROFIT_LIMIT . |
aboveStrategyId | LONG | NO | Arbitrary numeric value identifying the above order within an order strategy. |
aboveStrategyType | INT | NO | Arbitrary numeric value identifying the above order strategy. Values smaller than 1000000 are reserved and cannot be used. |
belowType | ENUM | YES | Supported values: STOP_LOSS , STOP_LOSS_LIMIT , TAKE_PROFIT ,TAKE_PROFIT_LIMIT |
belowClientOrderId | STRING | NO | |
belowIcebergQty | LONG | NO | Note that this can only be used if belowTimeInForce is GTC . |
belowPrice | DECIMAL | NO | Can be used if belowType is STOP_LOSS_LIMIT , LIMIT_MAKER , or TAKE_PROFIT_LIMIT to specify the limit price. |
belowStopPrice | DECIMAL | NO | Can be used if belowType is STOP_LOSS , STOP_LOSS_LIMIT, TAKE_PROFIT or TAKE_PROFIT_LIMIT . |
Either belowStopPrice or belowTrailingDelta or both, must be specified. | |||
belowTrailingDelta | LONG | NO | See Trailing Stop order FAQ. |
belowTimeInForce | ENUM | NO | Required if belowType is STOP_LOSS_LIMIT or TAKE_PROFIT_LIMIT |
belowStrategyId | LONG | NO | Arbitrary numeric value identifying the below order within an order strategy. |
belowStrategyType | INT | NO | Arbitrary numeric value identifying the below order strategy. Values smaller than 1000000 are reserved and cannot be used. |
newOrderRespType | ENUM | NO | Select response format: ACK , RESULT , FULL |
selfTradePreventionMode | ENUM | NO | The allowed enums is dependent on what is configured on the symbol. The possible supported values are: STP Modes. |
apiKey | STRING | YES | |
recvWindow | LONG | NO | The value cannot be greater than 60000 . |
timestamp | LONG | YES | |
signature | STRING | YES |
Data Source: Matching Engine
Response:
Response format for orderReports
is selected using the newOrderRespType
parameter.
The following example is for RESULT
response type.
See order.place
for more examples.
{
"id": "56374a46-3261-486b-a211-99ed972eb648",
"status": 200,
"result":
{
"orderListId": 2,
"contingencyType": "OCO",
"listStatusType": "EXEC_STARTED",
"listOrderStatus": "EXECUTING",
"listClientOrderId": "cKPMnDCbcLQILtDYM4f4fX",
"transactionTime": 1711062760648,
"symbol": "LTCBNB",
"orders":
[
{
"symbol": "LTCBNB",
"orderId": 2,
"clientOrderId": "0m6I4wfxvTUrOBSMUl0OPU"
},
{
"symbol": "LTCBNB",
"orderId": 3,
"clientOrderId": "Z2IMlR79XNY5LU0tOxrWyW"
}
],
"orderReports":
[
{
"symbol": "LTCBNB",
"orderId": 2,
"orderListId": 2,
"clientOrderId": "0m6I4wfxvTUrOBSMUl0OPU",
"transactTime": 1711062760648,
"price": "1.50000000",
"origQty": "1.000000",
"executedQty": "0.000000",
"origQuoteOrderQty": "0.000000",
"cummulativeQuoteQty": "0.00000000",
"status": "NEW",
"timeInForce": "GTC",
"type": "STOP_LOSS_LIMIT",
"side": "BUY",
"stopPrice": "1.50000001",
"workingTime": -1,
"selfTradePreventionMode": "NONE"
},
{
"symbol": "LTCBNB",
"orderId": 3,
"orderListId": 2,
"clientOrderId": "Z2IMlR79XNY5LU0tOxrWyW",
"transactTime": 1711062760648,
"price": "1.49999999",
"origQty": "1.000000",
"executedQty": "0.000000",
"origQuoteOrderQty": "0.000000",
"cummulativeQuoteQty": "0.00000000",
"status": "NEW",
"timeInForce": "GTC",
"type": "LIMIT_MAKER",
"side": "BUY",
"workingTime": 1711062760648,
"selfTradePreventionMode": "NONE"
}
]
},
"rateLimits":
[
{
"rateLimitType": "ORDERS",
"interval": "SECOND",
"intervalNum": 10,
"limit": 50,
"count": 2
},
{
"rateLimitType": "ORDERS",
"interval": "DAY",
"intervalNum": 1,
"limit": 160000,
"count": 2
},
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 6000,
"count": 1
}
]
}
Place new Order list - OTO (TRADE)
{
"id": "1712544395950",
"method": "orderList.place.oto",
"params": {
"signature": "3e1e5ac8690b0caf9a2afd5c5de881ceba69939cc9d817daead5386bf65d0cbb",
"apiKey": "Rf07JlnL9PHVxjs27O5CvKNyOsV4qJ5gXdrRfpvlOdvMZbGZbPO5Ce2nIwfRP0iA",
"pendingQuantity": 1,
"pendingSide": "BUY",
"pendingType": "MARKET",
"symbol": "LTCBNB",
"recvWindow": "5000",
"timestamp": "1712544395951",
"workingPrice": 1,
"workingQuantity": 1,
"workingSide": "SELL",
"workingTimeInForce": "GTC",
"workingType": "LIMIT"
}
}
Places an OTO.
- An OTO (One-Triggers-the-Other) is an order list comprised of 2 orders.
- The first order is called the working order and must be
LIMIT
orLIMIT_MAKER
. Initially, only the working order goes on the order book. - The second order is called the pending order. It can be any order type except for
MARKET
orders using parameterquoteOrderQty
. The pending order is only placed on the order book when the working order gets fully filled. - If either the working order or the pending order is cancelled individually, the other order in the order list will also be canceled or expired.
- OTOs add 2 orders to the unfilled order count,
EXCHANGE_MAX_NUM_ORDERS
filter andMAX_NUM_ORDERS
filter.
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
listClientOrderId | STRING | NO | Arbitrary unique ID among open order lists. Automatically generated if not sent. A new order list with the same listClientOrderId is accepted only when the previous one is filled or completely expired. listClientOrderId is distinct from the workingClientOrderId and the pendingClientOrderId . |
newOrderRespType | ENUM | NO | Format of the JSON response. Supported values: Order Response Type |
selfTradePreventionMode | ENUM | NO | The allowed values are dependent on what is configured on the symbol. See STP Modes |
workingType | ENUM | YES | Supported values: LIMIT ,LIMIT_MAKER |
workingSide | ENUM | YES | Supported values: Order Side |
workingClientOrderId | STRING | NO | Arbitrary unique ID among open orders for the working order. Automatically generated if not sent. |
workingPrice | DECIMAL | YES | |
workingQuantity | DECIMAL | YES | Sets the quantity for the working order. |
workingIcebergQty | DECIMAL | NO | This can only be used if workingTimeInForce is GTC , or if workingType is LIMIT_MAKER . |
workingTimeInForce | ENUM | NO | Supported values: Time In Force |
workingStrategyId | LONG | NO | Arbitrary numeric value identifying the working order within an order strategy. |
workingStrategyType | INT | NO | Arbitrary numeric value identifying the working order strategy. Values smaller than 1000000 are reserved and cannot be used. |
pendingType | ENUM | YES | Supported values: Order Types Note that MARKET orders using quoteOrderQty are not supported. |
pendingSide | ENUM | YES | Supported values: Order Side |
pendingClientOrderId | STRING | NO | Arbitrary unique ID among open orders for the pending order. Automatically generated if not sent. |
pendingPrice | DECIMAL | NO | |
pendingStopPrice | DECIMAL | NO | |
pendingTrailingDelta | DECIMAL | NO | |
pendingQuantity | DECIMAL | YES | Sets the quantity for the pending order. |
pendingIcebergQty | DECIMAL | NO | This can only be used if pendingTimeInForce is GTC , or if pendingType is LIMIT_MAKER . |
pendingTimeInForce | ENUM | NO | Supported values: Time In Force |
pendingStrategyId | LONG | NO | Arbitrary numeric value identifying the pending order within an order strategy. |
pendingStrategyType | INT | NO | Arbitrary numeric value identifying the pending order strategy. Values smaller than 1000000 are reserved and cannot be used. |
recvWindow | LONG | NO | The value cannot be greater than 60000 . |
timestamp | LONG | YES | |
signature | STRING | YES |
Mandatory parameters based on pendingType
or workingType
Depending on the pendingType
or workingType
, some optional parameters will become mandatory.
Type | Additional mandatory parameters | Additional information |
---|---|---|
workingType = LIMIT | workingTimeInForce | |
pendingType = LIMIT | pendingPrice , pendingTimeInForce | |
pendingType = STOP_LOSS or TAKE_PROFIT | pendingStopPrice and/or pendingTrailingDelta | |
pendingType =STOP_LOSS_LIMIT or TAKE_PROFIT_LIMIT | pendingStopPrice and/or pendingTrailingDelta , pendingTimeInForce |
Data Source:
Matching Engine
Response:
{
"id": "1712544395950",
"status": 200,
"result": {
"orderListId": 626,
"contingencyType": "OTO",
"listStatusType": "EXEC_STARTED",
"listOrderStatus": "EXECUTING",
"listClientOrderId": "KA4EBjGnzvSwSCQsDdTrlf",
"transactionTime": 1712544395981,
"symbol": "1712544378871",
"orders": [
{
"symbol": "LTCBNB",
"orderId": 13,
"clientOrderId": "YiAUtM9yJjl1a2jXHSp9Ny"
},
{
"symbol": "LTCBNB",
"orderId": 14,
"clientOrderId": "9MxJSE1TYkmyx5lbGLve7R"
}
],
"orderReports": [
{
"symbol": "LTCBNB",
"orderId": 13,
"orderListId": 626,
"clientOrderId": "YiAUtM9yJjl1a2jXHSp9Ny",
"transactTime": 1712544395981,
"price": "1.000000",
"origQty": "1.000000",
"executedQty": "0.000000",
"origQuoteOrderQty": "0.000000",
"cummulativeQuoteQty": "0.000000",
"status": "NEW",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "SELL",
"workingTime": 1712544395981,
"selfTradePreventionMode": "NONE"
},
{
"symbol": "LTCBNB",
"orderId": 14,
"orderListId": 626,
"clientOrderId": "9MxJSE1TYkmyx5lbGLve7R",
"transactTime": 1712544395981,
"price": "0.000000",
"origQty": "1.000000",
"executedQty": "0.000000",
"origQuoteOrderQty": "0.000000",
"cummulativeQuoteQty": "0.000000",
"status": "PENDING_NEW",
"timeInForce": "GTC",
"type": "MARKET",
"side": "BUY",
"workingTime": -1,
"selfTradePreventionMode": "NONE"
}
]
},
"rateLimits": [
{
"rateLimitType": "ORDERS",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 10000000,
"count": 10
},
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 1000,
"count": 38
}
]
}
Note: The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.
Place new Order list - OTOCO (TRADE)
{
"id": "1712544408508",
"method": "orderList.place.otoco",
"params": {
"signature": "c094473304374e1b9c5f7e2558358066cfa99df69f50f63d09cfee755136cb07",
"apiKey": "Rf07JlnL9PHVxjs27O5CvKNyOsV4qJ5gXdrRfpvlOdvMZbGZbPO5Ce2nIwfRP0iA",
"pendingQuantity": 5,
"pendingSide": "SELL",
"pendingBelowPrice": 5,
"pendingBelowType": "LIMIT_MAKER",
"pendingAboveStopPrice": 0.5,
"pendingAboveType": "STOP_LOSS",
"symbol": "LTCBNB",
"recvWindow": "5000",
"timestamp": "1712544408509",
"workingPrice": 1.5,
"workingQuantity": 1,
"workingSide": "BUY",
"workingTimeInForce": "GTC",
"workingType": "LIMIT"
}
}
Place an OTOCO.
- An OTOCO (One-Triggers-One-Cancels-the-Other) is an order list comprised of 3 orders.
- The first order is called the working order and must be
LIMIT
orLIMIT_MAKER
. Initially, only the working order goes on the order book.- The behavior of the working order is the same as the OTO.
- OTOCO has 2 pending orders (pending above and pending below), forming an OCO pair. The pending orders are only placed on the order book when the working order gets fully filled.
- OTOCOs add 3 orders to the unfilled order count,
EXCHANGE_MAX_NUM_ORDERS
filter, andMAX_NUM_ORDERS
filter.
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
listClientOrderId | STRING | NO | Arbitrary unique ID among open order lists. Automatically generated if not sent. A new order list with the same listClientOrderId is accepted only when the previous one is filled or completely expired. listClientOrderId is distinct from the workingClientOrderId , pendingAboveClientOrderId , and the pendingBelowClientOrderId . |
newOrderRespType | ENUM | NO | Format the JSON response. Supported values: Order Response Type |
selfTradePreventionMode | ENUM | NO | The allowed values are dependent on what is configured on the symbol. See STP Modes |
workingType | ENUM | YES | Supported values: LIMIT , LIMIT_MAKER |
workingSide | ENUM | YES | Supported values: Order Side |
workingClientOrderId | STRING | NO | Arbitrary unique ID among open orders for the working order. Automatically generated if not sent. |
workingPrice | DECIMAL | YES | |
workingQuantity | DECIMAL | YES | |
workingIcebergQty | DECIMAL | NO | This can only be used if workingTimeInForce is GTC . |
workingTimeInForce | ENUM | NO | Supported values: Time In Force |
workingStrategyId | LONG | NO | Arbitrary numeric value identifying the working order within an order strategy. |
workingStrategyType | INT | NO | Arbitrary numeric value identifying the working order strategy. Values smaller than 1000000 are reserved and cannot be used. |
pendingSide | ENUM | YES | Supported values: Order Side |
pendingQuantity | DECIMAL | YES | |
pendingAboveType | ENUM | YES | Supported values: STOP_LOSS_LIMIT , STOP_LOSS , LIMIT_MAKER , TAKE_PROFIT , TAKE_PROFIT_LIMIT |
pendingAboveClientOrderId | STRING | NO | Arbitrary unique ID among open orders for the pending above order. Automatically generated if not sent. |
pendingAbovePrice | DECIMAL | NO | Can be used if pendingAboveType is STOP_LOSS_LIMIT , LIMIT_MAKER , or TAKE_PROFIT_LIMIT to specify the limit price. |
pendingAboveStopPrice | DECIMAL | NO | Can be used if pendingAboveType is STOP_LOSS , STOP_LOSS_LIMIT , TAKE_PROFIT , TAKE_PROFIT_LIMIT |
pendingAboveTrailingDelta | DECIMAL | NO | See Trailing Stop FAQ |
pendingAboveIcebergQty | DECIMAL | NO | This can only be used if pendingAboveTimeInForce is GTC or if pendingAboveType is LIMIT_MAKER . |
pendingAboveTimeInForce | ENUM | NO | |
pendingAboveStrategyId | LONG | NO | Arbitrary numeric value identifying the pending above order within an order strategy. |
pendingAboveStrategyType | INT | NO | Arbitrary numeric value identifying the pending above order strategy. Values smaller than 1000000 are reserved and cannot be used. |
pendingBelowType | ENUM | NO | Supported values: STOP_LOSS , STOP_LOSS_LIMIT , TAKE_PROFIT ,TAKE_PROFIT_LIMIT |
pendingBelowClientOrderId | STRING | NO | Arbitrary unique ID among open orders for the pending below order. Automatically generated if not sent. |
pendingBelowPrice | DECIMAL | NO | Can be used if pendingBelowType is STOP_LOSS_LIMIT or TAKE_PROFIT_LIMIT to specify limit price |
pendingBelowStopPrice | DECIMAL | NO | Can be used if pendingBelowType is STOP_LOSS , STOP_LOSS_LIMIT, TAKE_PROFIT or TAKE_PROFIT_LIMIT . |
Either pendingBelowStopPrice or pendingBelowTrailingDelta or both, must be specified. | |||
pendingBelowTrailingDelta | DECIMAL | NO | |
pendingBelowIcebergQty | DECIMAL | NO | This can only be used if pendingBelowTimeInForce is GTC , or if pendingBelowType is LIMIT_MAKER . |
pendingBelowTimeInForce | ENUM | NO | Supported values: Time In Force |
pendingBelowStrategyId | LONG | NO | Arbitrary numeric value identifying the pending below order within an order strategy. |
pendingBelowStrategyType | INT | NO | Arbitrary numeric value identifying the pending below order strategy. Values smaller than 1000000 are reserved and cannot be used. |
recvWindow | LONG | NO | The value cannot be greater than 60000 . |
timestamp | LONG | YES | |
signature | STRING | YES |
Mandatory parameters based on pendingAboveType
, pendingBelowType
or workingType
Depending on the pendingAboveType
/pendingBelowType
or workingType
, some optional parameters will become mandatory.
Type | Additional mandatory parameters | Additional information |
---|---|---|
workingType = LIMIT | workingTimeInForce | |
pendingAboveType = LIMIT_MAKER | pendingAbovePrice | |
pendingAboveType = STOP_LOSS/TAKE_PROFIT | pendingAboveStopPrice and/or pendingAboveTrailingDelta | |
pendingAboveType=STOP_LOSS_LIMIT/TAKE_PROFIT_LIMIT | pendingAbovePrice , pendingAboveStopPrice and/or pendingAboveTrailingDelta , pendingAboveTimeInForce | |
pendingBelowType = LIMIT_MAKER | pendingBelowPrice | |
pendingBelowType= STOP_LOSS/TAKE_PROFIT | pendingBelowStopPrice and/or pendingBelowTrailingDelta | |
pendingBelowType=STOP_LOSS_LIMIT/TAKE_PROFIT_LIMIT | pendingBelowPrice , pendingBelowStopPrice and/or pendingBelowTrailingDelta , pendingBelowTimeInForce |
Data Source: Matching Engine
Response:
{
"id": "1712544408508",
"status": 200,
"result": {
"orderListId": 629,
"contingencyType": "OTO",
"listStatusType": "EXEC_STARTED",
"listOrderStatus": "EXECUTING",
"listClientOrderId": "GaeJHjZPasPItFj4x7Mqm6",
"transactionTime": 1712544408537,
"symbol": "1712544378871",
"orders": [
{
"symbol": "1712544378871",
"orderId": 23,
"clientOrderId": "OVQOpKwfmPCfaBTD0n7e7H"
},
{
"symbol": "1712544378871",
"orderId": 24,
"clientOrderId": "YcCPKCDMQIjNvLtNswt82X"
},
{
"symbol": "1712544378871",
"orderId": 25,
"clientOrderId": "ilpIoShcFZ1ZGgSASKxMPt"
}
],
"orderReports": [
{
"symbol": "LTCBNB",
"orderId": 23,
"orderListId": 629,
"clientOrderId": "OVQOpKwfmPCfaBTD0n7e7H",
"transactTime": 1712544408537,
"price": "1.500000",
"origQty": "1.000000",
"executedQty": "0.000000",
"origQuoteOrderQty": "0.000000",
"cummulativeQuoteQty": "0.000000",
"status": "NEW",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "BUY",
"workingTime": 1712544408537,
"selfTradePreventionMode": "NONE"
},
{
"symbol": "LTCBNB",
"orderId": 24,
"orderListId": 629,
"clientOrderId": "YcCPKCDMQIjNvLtNswt82X",
"transactTime": 1712544408537,
"price": "0.000000",
"origQty": "5.000000",
"executedQty": "0.000000",
"origQuoteOrderQty": "0.000000",
"cummulativeQuoteQty": "0.000000",
"status": "PENDING_NEW",
"timeInForce": "GTC",
"type": "STOP_LOSS",
"side": "SELL",
"stopPrice": "0.500000",
"workingTime": -1,
"selfTradePreventionMode": "NONE"
},
{
"symbol": "LTCBNB",
"orderId": 25,
"orderListId": 629,
"clientOrderId": "ilpIoShcFZ1ZGgSASKxMPt",
"transactTime": 1712544408537,
"price": "5.000000",
"origQty": "5.000000",
"executedQty": "0.000000",
"origQuoteOrderQty": "0.000000",
"cummulativeQuoteQty": "0.000000",
"status": "PENDING_NEW",
"timeInForce": "GTC",
"type": "LIMIT_MAKER",
"side": "SELL",
"workingTime": -1,
"selfTradePreventionMode": "NONE"
}
]
},
"rateLimits": [
{
"rateLimitType": "ORDERS",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 10000000,
"count": 18
},
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 1000,
"count": 65
}
]
}
Note: The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.
Query Order list (USER_DATA)
{
"id": "b53fd5ff-82c7-4a04-bd64-5f9dc42c2100",
"method": "orderList.status",
"params": {
"origClientOrderId": "08985fedd9ea2cf6b28996"
"apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A",
"signature": "d12f4e8892d46c0ddfbd43d556ff6d818581b3be22a02810c2c20cb719aed6a4",
"timestamp": 1660801713965
}
}
Check execution status of an Order list.
For execution status of individual orders, use order.status
.
Weight: 4
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
origClientOrderId |
STRING | YES | Query order list by listClientOrderId |
orderListId |
INT | Query order list by orderListId |
|
apiKey |
STRING | YES | |
recvWindow |
INT | NO | The value cannot be greater than 60000 |
signature |
STRING | YES | |
timestamp |
INT | YES |
Notes:
-
origClientOrderId
refers tolistClientOrderId
of the order list itself. -
If both
origClientOrderId
andorderListId
parameters are specified, onlyorigClientOrderId
is used andorderListId
is ignored.
Data Source: Database
Response:
{
"id": "b53fd5ff-82c7-4a04-bd64-5f9dc42c2100",
"status": 200,
"result": {
"orderListId": 1274512,
"contingencyType": "OCO",
"listStatusType": "EXEC_STARTED",
"listOrderStatus": "EXECUTING",
"listClientOrderId": "08985fedd9ea2cf6b28996",
"transactionTime": 1660801713793,
"symbol": "BTCUSDT",
"orders": [
{
"symbol": "BTCUSDT",
"orderId": 12569138901,
"clientOrderId": "BqtFCj5odMoWtSqGk2X9tU"
},
{
"symbol": "BTCUSDT",
"orderId": 12569138902,
"clientOrderId": "jLnZpj5enfMXTuhKB1d0us"
}
]
},
"rateLimits": [
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 6000,
"count": 4
}
]
}
Cancel Order list (TRADE)
{
"id": "c5899911-d3f4-47ae-8835-97da553d27d0",
"method": "orderList.cancel",
"params": {
"symbol": "BTCUSDT",
"orderListId": 1274512,
"apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A",
"signature": "4973f4b2fee30bf6d45e4a973e941cc60fdd53c8dd5a25edeac96f5733c0ccee",
"timestamp": 1660801720210
}
}
Cancel an active order list.
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol |
STRING | YES | |
orderListId |
INT | YES | Cancel order list by orderListId |
listClientOrderId |
STRING | Cancel order list by listClientId |
|
newClientOrderId |
STRING | NO | New ID for the canceled order list. Automatically generated if not sent |
apiKey |
STRING | YES | |
recvWindow |
INT | NO | The value cannot be greater than 60000 |
signature |
STRING | YES | |
timestamp |
INT | YES |
Notes:
-
If both
orderListId
andlistClientOrderId
parameters are specified, onlyorderListId
is used andlistClientOrderId
is ignored. -
Canceling an individual leg with
order.cancel
will cancel the entire order list as well.
Data Source: Matching Engine
Response:
{
"id": "c5899911-d3f4-47ae-8835-97da553d27d0",
"status": 200,
"result": {
"orderListId": 1274512,
"contingencyType": "OCO",
"listStatusType": "ALL_DONE",
"listOrderStatus": "ALL_DONE",
"listClientOrderId": "6023531d7edaad348f5aff",
"transactionTime": 1660801720215,
"symbol": "BTCUSDT",
"orders": [
{
"symbol": "BTCUSDT",
"orderId": 12569138901,
"clientOrderId": "BqtFCj5odMoWtSqGk2X9tU"
},
{
"symbol": "BTCUSDT",
"orderId": 12569138902,
"clientOrderId": "jLnZpj5enfMXTuhKB1d0us"
}
],
"orderReports": [
{
"symbol": "BTCUSDT",
"orderId": 12569138901,
"orderListId": 1274512,
"clientOrderId": "BqtFCj5odMoWtSqGk2X9tU",
"transactTime": 1660801720215,
"price": "23410.00000000",
"origQty": "0.00650000",
"executedQty": "0.00000000",
"origQuoteOrderQty": "0.000000",
"cummulativeQuoteQty": "0.00000000",
"status": "CANCELED",
"timeInForce": "GTC",
"type": "STOP_LOSS_LIMIT",
"side": "SELL",
"stopPrice": "23405.00000000",
"selfTradePreventionMode": "NONE"
},
{
"symbol": "BTCUSDT",
"orderId": 12569138902,
"orderListId": 1274512,
"clientOrderId": "jLnZpj5enfMXTuhKB1d0us",
"transactTime": 1660801720215,
"price": "23420.00000000",
"origQty": "0.00650000",
"executedQty": "0.00000000",
"origQuoteOrderQty": "0.000000",
"cummulativeQuoteQty": "0.00000000",
"status": "CANCELED",
"timeInForce": "GTC",
"type": "LIMIT_MAKER",
"side": "SELL",
"selfTradePreventionMode": "NONE"
}
]
},
"rateLimits": [
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 6000,
"count": 1
}
]
}
Current open Order lists (USER_DATA)
{
"id": "3a4437e2-41a3-4c19-897c-9cadc5dce8b6",
"method": "openOrderLists.status",
"params": {
"apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A",
"signature": "1bea8b157dd78c3da30359bddcd999e4049749fe50b828e620e12f64e8b433c9",
"timestamp": 1660801713831
}
}
Query execution status of all open order lists.
If you need to continuously monitor order status updates, please consider using WebSocket Streams:
userDataStream.start
requestexecutionReport
user data stream event
Weight: 6
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
apiKey | STRING | YES | |
recvWindow | INT | NO | The value cannot be greater than 60000 |
signature | STRING | YES | |
timestamp | INT | YES |
Data Source: Database
Response:
{
"id": "3a4437e2-41a3-4c19-897c-9cadc5dce8b6",
"status": 200,
"result": [
{
"orderListId": 0,
"contingencyType": "OCO",
"listStatusType": "EXEC_STARTED",
"listOrderStatus": "EXECUTING",
"listClientOrderId": "08985fedd9ea2cf6b28996",
"transactionTime": 1660801713793,
"symbol": "BTCUSDT",
"orders": [
{
"symbol": "BTCUSDT",
"orderId": 4,
"clientOrderId": "CUhLgTXnX5n2c0gWiLpV4d"
},
{
"symbol": "BTCUSDT",
"orderId": 5,
"clientOrderId": "1ZqG7bBuYwaF4SU8CwnwHm"
}
]
}
],
"rateLimits": [
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 6000,
"count": 6
}
]
}
SOR
Place new order using SOR (TRADE)
{
"id": "3a4437e2-41a3-4c19-897c-9cadc5dce8b6",
"method": "sor.order.place",
"params":
{
"symbol": "BTCUSDT",
"side": "BUY",
"type": "LIMIT",
"quantity": 0.5,
"timeInForce": "GTC",
"price": 31000,
"timestamp": 1687485436575,
"apiKey": "u5lgqJb97QWXWfgeV4cROuHbReSJM9rgQL0IvYcYc7BVeA5lpAqqc3a5p2OARIFk",
"signature": "fd301899567bc9472ce023392160cdc265ad8fcbbb67e0ea1b2af70a4b0cd9c7"
}
}
Places an order using smart order routing (SOR).
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
side | ENUM | YES | BUY or SELL |
type | ENUM | YES | |
timeInForce | ENUM | NO | Applicable only to LIMIT order type |
price | DECIMAL | NO | Applicable only to LIMIT order type |
quantity | DECIMAL | YES | |
newClientOrderId | STRING | NO | Arbitrary unique ID among open orders. Automatically generated if not sent |
newOrderRespType | ENUM | NO | Select response format:
|
icebergQty | DECIMAL | NO | |
strategyId | LONG | NO | Arbitrary numeric value identifying the order within an order strategy. |
strategyType | INT | NO | Arbitrary numeric value identifying the order strategy. Values smaller than |
selfTradePreventionMode | ENUM | NO | The allowed enums is dependent on what is configured on the symbol. The possible supported values are: STP Modes. |
apiKey | STRING | YES | |
timestamp | INT | YES | |
recvWindow | INT | NO | The value cannot be greater than 60000 |
signature | STRING | YES |
Note: sor.order.place
only supports LIMIT
and MARKET
orders. quoteOrderQty
is not supported.
Data Source: Matching Engine
Response:
{
"id": "3a4437e2-41a3-4c19-897c-9cadc5dce8b6",
"status": 200,
"result": [
{
"symbol": "BTCUSDT",
"orderId": 2,
"orderListId": -1,
"clientOrderId": "sBI1KM6nNtOfj5tccZSKly",
"transactTime": 1689149087774,
"price": "31000.00000000",
"origQty": "0.50000000",
"executedQty": "0.50000000",
"origQuoteOrderQty": "0.000000",
"cummulativeQuoteQty": "14000.00000000",
"status": "FILLED",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "BUY",
"workingTime": 1689149087774,
"fills": [
{
"matchType": "ONE_PARTY_TRADE_REPORT",
"price": "28000.00000000",
"qty": "0.50000000",
"commission": "0.00000000",
"commissionAsset": "BTC",
"tradeId": -1,
"allocId": 0
}
],
"workingFloor": "SOR",
"selfTradePreventionMode": "NONE",
"usedSor": true
}
],
"rateLimits": [
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 6000,
"count": 1
}
]
}
Test new order using SOR (TRADE)
{
"id": "3a4437e2-41a3-4c19-897c-9cadc5dce8b6",
"method": "sor.order.test",
"params":
{
"symbol": "BTCUSDT",
"side": "BUY",
"type": "LIMIT",
"quantity": 0.1,
"timeInForce": "GTC",
"price": 0.1,
"timestamp": 1687485436575,
"apiKey": "u5lgqJb97QWXWfgeV4cROuHbReSJM9rgQL0IvYcYc7BVeA5lpAqqc3a5p2OARIFk",
"signature": "fd301899567bc9472ce023392160cdc265ad8fcbbb67e0ea1b2af70a4b0cd9c7"
}
}
Test new order creation and signature/recvWindow using smart order routing (SOR). Creates and validates a new order but does not send it into the matching engine.
Weight:
Condition | Request Weight |
---|---|
Without computeCommissionRates | 1 |
With computeCommissionRates | 20 |
Parameters:
In addition to all parameters accepted by sor.order.place
,
the following optional parameters are also accepted:
Name | Type | Mandatory | Description |
---|---|---|---|
computeCommissionRates | BOOLEAN | NO | Default: false |
Data Source: Memory
Response:
Without computeCommissionRates
:
{
"id": "3a4437e2-41a3-4c19-897c-9cadc5dce8b6",
"status": 200,
"result": {},
"rateLimits": [
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 6000,
"count": 1
}
]
}
With computeCommissionRates
:
{
"id": "3a4437e2-41a3-4c19-897c-9cadc5dce8b6",
"status": 200,
"result": {
"standardCommissionForOrder": { //Commission rates for the order depending on its role (e.g. maker or taker)
"maker": "0.00000112",
"taker": "0.00000114"
},
"taxCommissionForOrder": { //Tax deduction rates for the order depending on its role (e.g. maker or taker)
"maker": "0.00000112",
"taker": "0.00000114"
},
"discount": { //Discount on standard commissions when paying in BNB.
"enabledForAccount": true,
"enabledForSymbol": true,
"discountAsset": "BNB",
"discount": "0.25" //Standard commission is reduced by this rate when paying in BNB.
}
},
"rateLimits": [
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 6000,
"count": 20
}
]
}