Public Rest API for Binance SPOT Testnet
General API Information
- The base endpoint is https://testnet.binance.vision/api
- Responses are in JSON by default. To receive responses in SBE, refer to the SBE FAQ page.
- Data is returned in chronological order, unless noted otherwise.
- Without
startTimeorendTime, returns the most recent items up to the limit. - With
startTime, returns oldest items fromstartTimeup to the limit. - With
endTime, returns most recent items up toendTimeand the limit. - With both, behaves like
startTimebut does not exceedendTime.
- Without
- All time and timestamp related fields in the JSON responses are in milliseconds by default. To
receive the information in microseconds, please add the header
X-MBX-TIME-UNIT:MICROSECONDorX-MBX-TIME-UNIT:microsecond. - We support HMAC, RSA, and Ed25519 keys. For more information, please see API Key types.
- Timestamp parameters (e.g.
startTime,endTime,timestamp) can be passed in milliseconds or microseconds. - If there are enums or terms you want clarification on, please see the SPOT Glossary for more information.
- APIs have a timeout of 10 seconds when processing a request. If a response from the Matching
Engine takes longer than this, the API responds with "Timeout waiting for response from backend
server. Send status unknown; execution status unknown." (-1007 TIMEOUT)
- This does not always mean that the request failed in the Matching Engine.
- If the status of the request has not appeared in User Data Stream, please perform an API query for its status.
- Please avoid SQL keywords in requests as they may trigger a security block by a WAF (Web Application Firewall) rule. See https://www.binance.com/en/support/faq/detail/360004492232 for more details.
- If your request contains a symbol name containing non-ASCII characters, then the response may contain non-ASCII characters encoded in UTF-8.
- Some endpoints may return asset and/or symbol names containing non-ASCII characters encoded in UTF-8 even if the request did not contain non-ASCII characters.
HTTP Return Codes
- HTTP
4XXreturn codes are used for malformed requests; the issue is on the sender's side. - HTTP
403return code is used when a WAF (Web Application Firewall) rule has been violated. This can indicate a rate limit violation or a security block. See https://www.binance.com/en/support/faq/detail/360004492232 for more details. - HTTP
409return code is used when a cancelReplace order partially succeeds. (i.e. if the cancellation of the order fails but the new order placement succeeds.) - HTTP
429return code is used when breaking a request rate limit. - HTTP
418return code is used when an IP has been auto-banned for continuing to send requests after receiving429codes. - HTTP
5XXreturn codes are used for internal errors; the issue is on Binance's side. It is important to NOT treat this as a failure operation; the execution status is UNKNOWN and could have been a success.
Error Codes
- Any endpoint can return an ERROR
Sample Payload below:
Code
- Specific error codes and messages are defined in Errors Codes.
General Information on Endpoints
- For
GETendpoints, parameters must be sent as aquery string. - For
POST,PUT, andDELETEendpoints, the parameters may be sent as aquery stringor in therequest bodywith content typeapplication/x-www-form-urlencoded. You may mix parameters between both thequery stringandrequest bodyif you wish to do so. - Parameters may be sent in any order.
- If a parameter sent in both the
query stringandrequest body, thequery stringparameter will be used.
LIMITS
General Info on Limits
- The following
intervalLettervalues for headers:- SECOND => S
- MINUTE => M
- HOUR => H
- DAY => D
intervalNumdescribes the amount of the interval. For example,intervalNum5 withintervalLetterM means "Every 5 minutes".- The
/api/v3/exchangeInforateLimitsarray contains objects related to the exchange'sRAW_REQUESTS,REQUEST_WEIGHT, andORDERSrate limits. These are further defined in theENUM definitionssection underRate limiters (rateLimitType). - Requests fail with HTTP status code 429 when you exceed the request rate limit.
IP Limits
- Every request will contain
X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)in the response headers which has the current used weight for the IP for all request rate limiters defined. - Each route has a
weightwhich determines for the number of requests each endpoint counts for. Heavier endpoints and endpoints that do operations on multiple symbols will have a heavierweight. - When a 429 is received, it's your obligation as an API to back off and not spam the API.
- Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban (HTTP status 418).
- IP bans are tracked and scale in duration for repeat offenders, from 2 minutes to 3 days.
- A
Retry-Afterheader is sent with a 418 or 429 responses and will give the number of seconds required to wait, in the case of a 429, to prevent a ban, or, in the case of a 418, until the ban is over. - The limits on the API are based on the IPs, not the API keys.
Unfilled Order Count
- Every successful order response will contain a
X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)header indicating how many orders you have placed for that interval. To monitor this, refer toGET api/v3/rateLimit/order. - Rejected/unsuccessful orders are not guaranteed to have
X-MBX-ORDER-COUNT-**headers in the response. - If you have exceeded this, you will receive a 429 error with the
Retry-Afterheader. - Please note that if your orders are consistently filled by trades, you can continuously place orders on the API. For more information, please see Spot Unfilled Order Count Rules.
- The number of unfilled orders is tracked for each account.
Data Sources
- The API system is asynchronous, so some delay in the response is normal and expected.
- Each endpoint has a data source indicating where the data is being retrieved, and thus which endpoints have the most up-to-date response.
These are the three sources, ordered by least to most potential for delays in data updates.
- Matching Engine - the data is from the Matching Engine
- Memory - the data is from a server's local or external memory
- Database - the data is taken directly from a database
Some endpoints can have more than 1 data source. (e.g. Memory => Database) This means that the endpoint will check the first Data Source, and if it cannot find the value it's looking for it will check the next one.
Request Security
- Each endpoint has a security type indicating required API key permissions, shown next to the endpoint name (e.g., New order (TRADE)).
- If unspecified, the security type is
NONE. - Except for
NONE, all endpoints with a security type are consideredSIGNEDrequests (i.e. including asignature). - Secure endpoints require a valid API key to be specified and authenticated.
- API keys can be created on the SPOT Test Network upon logging in with your Github account.
- Both API key and secret key are sensitive. Never share them with anyone. If you notice unusual activity in your account, immediately revoke all the keys and contact Binance support.
- API keys can be configured to allow access only to certain types of secure endpoints.
- For example, you can have an API key with
TRADEpermission for trading, while using a separate API key withUSER_DATApermission to monitor your order status. - By default, an API key cannot
TRADE. You need to enable trading in API Management first.
- For example, you can have an API key with
| Security type | Description |
|---|---|
NONE | Public market data |
TRADE | Trading on the exchange, placing and canceling orders |
USER_DATA | Private account information, such as order status and your trading history |
USER_STREAM | Managing User Data Stream subscriptions |
SIGNED Endpoint security
SIGNEDendpoints require an additional parameter,signature, to be sent in thequery stringorrequest body.
Signature Case Sensitivity
- HMAC: Signatures generated using HMAC are not case-sensitive. This means the signature string can be verified regardless of letter casing.
- RSA: Signatures generated using RSA are case-sensitive.
- Ed25519: Signatures generated using Ed25519 are also case-sensitive
Please consult SIGNED request example (HMAC), SIGNED request example (RSA), and SIGNED request example (Ed25519) on how to compute signature, depending on which API key type you are using.
Timing security
SIGNEDrequests also require atimestampparameter which should be the current timestamp either in milliseconds or microseconds. (See General API Information)- An additional optional parameter,
recvWindow, specifies for how long the request stays valid and may only be specified in milliseconds.recvWindowsupports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.- If
recvWindowis not sent, it defaults to 5000 milliseconds. - Maximum
recvWindowis 60000 milliseconds.
- Request processing logic is as follows:
Code
Serious trading is about timing. Networks can be unstable and unreliable, which can lead to
requests taking varying amounts of time to reach the servers. With recvWindow, you can specify
that the request must be processed within a certain number of milliseconds or be rejected by the
server.
It is recommended to use a small recvWindow of 5000 or less! The max cannot go beyond 60,000!
SIGNED Endpoint Examples for POST /api/v3/order
HMAC Keys
The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing.
Here is a step-by-step example of how to send a valid signed payload from the Linux command line
using echo, openssl, and curl. There is one example with a symbol name comprised entirely of
ASCII characters and one example with a symbol name containing non-ASCII characters.
Example API key and secret key:
| Key | Value |
|---|---|
apiKey | vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A |
secretKey | NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j |
WARNING: DO NOT SHARE YOUR API KEY AND SECRET KEY WITH ANYONE.
The example keys are provided here only for illustrative purposes.
Example of request with a symbol name comprised entirely of ASCII characters:
| Parameter | Value |
|---|---|
symbol | LTCBTC |
side | BUY |
type | LIMIT |
timeInForce | GTC |
quantity | 1 |
price | 0.1 |
recvWindow | 5000 |
timestamp | 1499827319559 |
Example of a request with a symbol name containing non-ASCII characters:
| Parameter | Value |
|---|---|
symbol | 123456 |
side | BUY |
type | LIMIT |
timeInForce | GTC |
quantity | 1 |
price | 0.1 |
recvWindow | 5000 |
timestamp | 1499827319559 |
Step 1: Construct the signature payload
- Format parameters as
parameter=valuepairs separated by&. - Percent-encode the string.
For the first set of example parameters (ASCII only), the parameter=value string should look like
this:
Code
After percent-encoding, the signature payload should look like this:
Code
For the second set of example parameters (some non-ASCII characters), the parameter=value string
should look like this:
Code
After percent-encoding, the signature payload should look like this:
Code
Step 2: Compute the signature
- Use the
secretKeyof your API key as the signing key for the HMAC-SHA-256 algorithm. - Sign the signature payload constructed in Step 1.
- Encode the HMAC-SHA-256 output as a hex string.
Note that secretKey and the payload are case-sensitive, while the resulting signature value is
case-insensitive.
Example commands
For the first set of example parameters (ASCII only):
Code
For the second set of example parameters (some non-ASCII characters):
Code
Step 3: Add signature to the request
Complete the request by adding the signature parameter to the query string.
For the first set of example parameters (ASCII only):
Code
For the second set of example parameters (some non-ASCII characters)
Code
Here is a sample Bash script performing all the steps above:
Code
RSA Keys
The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing.
To get your API key, you need to upload your RSA Public Key to your account and a corresponding API key will be provided for you.
Only PKCS#8 keys are supported.
There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters.
These examples assume the private key is stored in the file ./test-prv-key.pem.
| Key | Value |
|---|---|
apiKey | CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ |
Example of request with a symbol name comprised entirely of ASCII characters:
| Parameter | Value |
|---|---|
symbol | BTCUSDT |
side | SELL |
type | LIMIT |
timeInForce | GTC |
quantity | 1 |
price | 0.2 |
timestamp | 1668481559918 |
recvWindow | 5000 |
Example of a request with a symbol name containing non-ASCII characters:
| Parameter | Value |
|---|---|
symbol | 123456 |
side | SELL |
type | LIMIT |
timeInForce | GTC |
quantity | 1 |
price | 0.2 |
timestamp | 1668481559918 |
recvWindow | 5000 |
Step 1: Construct the signature payload
- Format parameters as
parameter=valuepairs separated by&. - Percent-encode the string.
For the first set of example parameters (ASCII only), the parameter=value string should look like
this:
Code
After percent-encoding, the signature payload should look like this:
Code
For the second set of example parameters (some non-ASCII characters), the parameter=value string
should look like this:
Code
After percent-encoding, the signature payload should look like this:
Code
Step 2: Compute the signature
- Sign the signature payload constructed in Step 1 using the RSASSA-PKCS1-v1_5 algorithm with SHA-256 hash function.
- Encode the output in base64.
Note that the payload and the resulting signature are case-sensitive.
For the first set of example parameters (ASCII only):
Code
For the second set of example parameters (some non-ASCII characters):
Code
- Percent-encode the base64 string.
For the first set of example parameters (ASCII only):
Code
For the second set of example parameters (some non-ASCII characters):
Code
Step 3: Add signature to the request
Complete the request by adding the signature parameter to the query string.
For the first set of example parameters (ASCII only):
Code
For the second set of example parameters (some non-ASCII characters):
Code
Here is a sample Bash script performing all the steps above:
Code
Ed25519 Keys
Note: It is highly recommended to use Ed25519 API keys as it should provide the best performance and security out of all supported key types.
The signature payload of your request is the query string concatenated without separator to the HTTP body. Any non-ASCII character must be percent-encoded before signing.
There is one example with a symbol name comprised entirely of ASCII characters and one example with a symbol name containing non-ASCII characters.
These examples assume the private key is stored in the file ./test-prv-key.pem.
| Key | Value |
|---|---|
apiKey | 4yNzx3yWC5bS6YTwEkSRaC0nRmSQIIStAUOh1b6kqaBrTLIhjCpI5lJH8q8R8WNO |
Example of request with a symbol name comprised entirely of ASCII characters.
| Parameter | Value |
|---|---|
symbol | BTCUSDT |
side | SELL |
type | LIMIT |
timeInForce | GTC |
quantity | 1 |
price | 0.2 |
timestamp | 1668481559918 |
recvWindow | 5000 |
Example of a request with a symbol name containing non-ASCII characters.
| Parameter | Value |
|---|---|
symbol | 123456 |
side | SELL |
type | LIMIT |
timeInForce | GTC |
quantity | 1 |
price | 0.2 |
timestamp | 1668481559918 |
recvWindow | 5000 |
Step 1: Construct the signature payload
- Format parameters as
parameter=valuepairs separated by&. - Percent-encode the string.
For the first set of example parameters (ASCII only), the parameter=value string should look like
this:
Code
After percent-encoding, the signature payload should look like this:
Code
For the second set of example parameters (some non-ASCII characters), the parameter=value string
should look like this:
Code
After percent-encoding, the signature payload should look like this:
Code
Step 2: Compute the signature
- Sign the payload.
- Encode the output as a base64 string.
Note that the payload and the resulting signature are case-sensitive.
For the first set of example parameters (ASCII only):
Code
For the second set of example parameters (some non-ASCII characters):
Code
- Percent-encode the base64 string.
For the first set of example parameters (ASCII only):
Code
For the second set of example parameters (some non-ASCII characters):
Code
Step 3: Add signature to the request
Complete the request by adding the signature parameter to the query string.
For the first set of example parameters (ASCII only):
Code
For the second set of example parameters (some non-ASCII characters):
Code
Here is a sample Python script performing all the steps above:
Code
Public API Endpoints
General endpoints
Test connectivity
Code
Test connectivity to the Rest API.
Weight: 1
Parameters: NONE
Data Source: Memory
Response:
Code
Check server time
Code
Test connectivity to the Rest API and get the current server time.
Weight: 1
Parameters: NONE
Data Source: Memory
Response:
Code
Exchange information
Code
Current exchange trading rules and symbol information
Weight: 20
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | No | Example: curl -X GET "https://api.binance.com/api/v3/exchangeInfo?symbol=BNBBTC" |
| symbols | ARRAY OF STRING | No | Examples: curl -X GET "https://api.binance.com/api/v3/exchangeInfo?symbols=%5B%22BNBBTC%22,%22BTCUSDT%22%5D" or curl -g -X GET 'https://api.binance.com/api/v3/exchangeInfo?symbols=["BTCUSDT","BNBBTC"]' |
| permissions | ENUM | No | Examples: curl -X GET "https://api.binance.com/api/v3/exchangeInfo?permissions=SPOT" or curl -X GET "https://api.binance.com/api/v3/exchangeInfo?permissions=%5B%22MARGIN%22%2C%22LEVERAGED%22%5D" or curl -g -X GET 'https://api.binance.com/api/v3/exchangeInfo?permissions=["MARGIN","LEVERAGED"]' |
| showPermissionSets | BOOLEAN | No | Controls whether the content of the permissionSets field is populated or not. Defaults to true |
| symbolStatus | ENUM | No | Filters for symbols that have this tradingStatus. Valid values: TRADING, HALT, BREAK Cannot be used in combination with symbols or symbol. |
Notes:
- If the value provided to
symbolorsymbolsdo not exist, the endpoint will throw an error saying the symbol is invalid. - All parameters are optional.
permissionscan support single or multiple values (e.g.SPOT,["MARGIN","LEVERAGED"]). This cannot be used in combination withsymbolorsymbols.- If
permissionsparameter not provided, all symbols that have eitherSPOT,MARGIN, orLEVERAGEDpermission will be exposed.- To display symbols with any permission you need to specify them explicitly in
permissions: (e.g.["SPOT","MARGIN",...].). See Account and Symbol Permissions for the full list.
- To display symbols with any permission you need to specify them explicitly in
Examples of Symbol Permissions Interpretation from the Response:
[["A","B"]]means you may place an order if your account has either permission "A" or permission "B".[["A"],["B"]]means you can place an order if your account has permission "A" and permission "B".[["A"],["B","C"]]means you can place an order if your account has permission "A" and permission "B" or permission "C". (Inclusive or is applied here, not exclusive or, so your account may have both permission "B" and permission "C".)
Data Source: Memory
Response:
Code
Query Execution Rules
Code
Weight
| Parameter | Weight |
|---|---|
symbol | 2 |
symbols | 2 for each symbol, capped at a max of 40 |
symbolStatus | 40 |
| None | 40 |
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
symbol | STRING | No | Query for specified symbol |
symbols | STRING | No | Query for multiple symbols |
symbolStatus | ENUM | Query for all symbols with the specified status. Supported values: TRADING, HALT, BREAK |
Note: No combination of multiple parameters is allowed.
Data Source: Memory
Response:
Code
Market Data endpoints
Order book
Code
Weight: Adjusted based on the limit:
| Limit | Request Weight |
|---|---|
| 1-100 | 5 |
| 101-500 | 25 |
| 501-1000 | 50 |
| 1001-5000 | 250 |
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| limit | INT | NO | Default: 100; Maximum: 5000. If limit > 5000, only 5000 entries will be returned. |
| symbolStatus | ENUM | NO | Filters for symbols that have this tradingStatus. A status mismatch returns error -1220 SYMBOL_DOES_NOT_MATCH_STATUS. Valid values: TRADING, HALT, BREAK |
Data Source: Memory
Response:
Code
Recent trades list
Code
Get recent trades.
Weight: 25
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| limit | INT | NO | Default: 500; Maximum: 1000. |
Data Source: Memory
Response:
Code
Old trade lookup
Code
Get older trades.
Weight: 25
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| limit | INT | NO | Default: 500; Maximum: 1000. |
| fromId | LONG | NO | TradeId to fetch from. Default gets most recent trades. |
Data Source: Database
Response:
Code
Historical Block Trades
Code
Get block trades.
Weight: 25
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
symbol | STRING | YES | |
fromId | LONG | YES | Block trade ID to fetch from |
limit | LONG | NO | Default: 500; Maximum: 1000 |
Data Source: Database
Response:
Code
Compressed/Aggregate trades list
Code
Get compressed, aggregate trades. Trades that fill at the time, from the same taker order, with the same price will have the quantity aggregated.
Weight: 4
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| fromId | LONG | NO | ID to get aggregate trades from INCLUSIVE. |
| startTime | LONG | NO | Timestamp in ms to get aggregate trades from INCLUSIVE. |
| endTime | LONG | NO | Timestamp in ms to get aggregate trades until INCLUSIVE. |
| limit | INT | NO | Default: 500; Maximum: 1000. |
- If fromId, startTime, and endTime are not sent, the most recent aggregate trades will be returned.
Data Source: Database
Response:
Code
Kline/Candlestick data
Code
Kline/candlestick bars for a symbol. Klines are uniquely identified by their open time.
Weight: 2
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| interval | ENUM | YES | |
| startTime | LONG | NO | |
| endTime | LONG | NO | |
| timeZone | STRING | NO | Default: 0 (UTC) |
| limit | INT | NO | Default: 500; Maximum: 1000. |
Supported kline intervals (case-sensitive):
| Interval | interval value |
|---|---|
| seconds | 1s |
| minutes | 1m, 3m, 5m, 15m, 30m |
| hours | 1h, 2h, 4h, 6h, 8h, 12h |
| days | 1d, 3d |
| weeks | 1w |
| months | 1M |
Notes:
- If
startTimeandendTimeare not sent, the most recent klines are returned. - Supported values for
timeZone:- Hours and minutes (e.g.
-1:00,05:45) - Only hours (e.g.
0,8,4) - Accepted range is strictly [-12:00 to +14:00] inclusive
- Hours and minutes (e.g.
- If
timeZoneprovided, kline intervals are interpreted in that timezone instead of UTC. - Note that
startTimeandendTimeare always interpreted in UTC, regardless oftimeZone.
Data Source: Database
Response:
Code
UIKlines
Code
The request is similar to klines having the same parameters and response.
uiKlines return modified kline data, optimized for presentation of candlestick charts.
Weight: 2
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| interval | ENUM | YES | See klines |
| startTime | LONG | NO | |
| endTime | LONG | NO | |
| timeZone | STRING | NO | Default: 0 (UTC) |
| limit | INT | NO | Default: 500; Maximum: 1000. |
- If
startTimeandendTimeare not sent, the most recent klines are returned. - Supported values for
timeZone:- Hours and minutes (e.g.
-1:00,05:45) - Only hours (e.g.
0,8,4) - Accepted range is strictly [-12:00 to +14:00] inclusive
- Hours and minutes (e.g.
- If
timeZoneprovided, kline intervals are interpreted in that timezone instead of UTC. - Note that
startTimeandendTimeare always interpreted in UTC, regardless oftimeZone.
Data Source: Database
Response:
Code
Current average price
Code
Current average price for a symbol.
Weight: 2
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES |
Data Source: Memory
Response:
Code
24hr ticker price change statistics
Code
24 hour rolling window price change statistics. Careful when accessing this with no symbol.
Weight:
Parameters:
Data Source: Memory
Response - FULL:
Code
OR
Code
Response - MINI:
Code
OR
Code
Trading Day Ticker
Code
Price change statistics for a trading day.
Weight:
4 for each requested symbol. The weight for this request will cap at 200 once
the number of symbols in the request is more than 50.
Parameters:
Notes:
- Supported values for
timeZone:- Hours and minutes (e.g.
-1:00,05:45) - Only hours (e.g.
0,8,4)
- Hours and minutes (e.g.
Data Source: Database
Response - FULL:
With symbol:
Code
With symbols:
Code
Response - MINI:
With symbol:
Code
With symbols:
Code
Symbol price ticker
Code
Latest price for a symbol or symbols.
Weight:
Parameters:
Data Source: Memory
Response:
Code
OR
Code
Symbol order book ticker
Code
Best price/qty on the order book for a symbol or symbols.
Weight:
Parameters:
Data Source: Memory
Response:
Code
OR
Code
Rolling window price change statistics
Code
Note: This endpoint is different from the GET /api/v3/ticker/24hr endpoint.
The window used to compute statistics will be no more than 59999ms from the requested windowSize.
openTime for /api/v3/ticker always starts on a minute, while the closeTime is the current time
of the request. As such, the effective window will be up to 59999ms wider than windowSize.
E.g. If the closeTime is 1641287867099 (January 04, 2022 09:17:47:099 UTC) , and the windowSize
is 1d. the openTime will be: 1641201420000 (January 3, 2022, 09:17:00)
Weight:
4 for each requested symbol regardless of windowSize. The weight for
this request will cap at 200 once the number of symbols in the request is more than 50.
Parameters:
Data Source: Database
Response - FULL:
When using symbol:
Code
or
When using symbols:
Code
Response - MINI:
When using symbol:
Code
OR
When using symbols:
Code
Query Reference Price
Code
Weight: 2
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
symbol | STRING | Yes |
Data Source: Memory
Response:
If a reference price is set:
Code
If no reference price is set:
Code
If no reference price has ever been set:
Code
Query Reference Price Calculation
Code
Describes how reference price is calculated for a given symbol.
Weight: 2
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
symbol | STRING | Yes | |
symbolStatus | ENUM | No | Supported values: TRADING, HALT, BREAK |
Data Source: Memory
Response:
If reference price is not being calculated:
Code
If the reference price is being calculated by the matching engine as an arithmetic mean:
Code
If the reference price is being calculated outside the matching engine:
Code
Trading endpoints
New order (TRADE)
Code
Send in a new order.
This adds 1 order to the EXCHANGE_MAX_ORDERS filter and the MAX_NUM_ORDERS filter.
Weight: 1
Unfilled Order Count: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| side | ENUM | YES | Please see Enums for supported values. |
| type | ENUM | YES | Please see Enums for supported values. |
| timeInForce | ENUM | NO | Please see Enums for supported values. |
| quantity | DECIMAL | NO | |
| quoteOrderQty | DECIMAL | NO | |
| price | DECIMAL | NO | |
| newClientOrderId | STRING | NO | A unique id among open orders. Automatically generated if not sent. Orders with the same newClientOrderID can be accepted only when the previous one is filled, otherwise the order will be rejected. |
| strategyId | LONG | NO | |
| strategyType | INT | NO | The value cannot be less than 1000000. |
| stopPrice | DECIMAL | NO | Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders. |
| trailingDelta | LONG | NO | See Trailing Stop order FAQ. |
| icebergQty | DECIMAL | NO | Used with LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT to create an iceberg order. |
| newOrderRespType | ENUM | NO | Set the response JSON. ACK, RESULT, or FULL; MARKET and LIMIT order types default to FULL, all other orders default to ACK. |
| selfTradePreventionMode | ENUM | NO | The allowed enums is dependent on what is configured on the symbol. The possible supported values are: STP Modes. |
| pegPriceType | ENUM | NO | PRIMARY_PEG or MARKET_PEG. See Pegged Orders Info |
| pegOffsetValue | INT | NO | Price level to peg the price to (max: 100). See Pegged Orders Info |
| pegOffsetType | ENUM | NO | Only PRICE_LEVEL is supported. See Pegged Orders Info |
| recvWindow | DECIMAL | NO | The value cannot be greater than 60000. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. |
| timestamp | LONG | YES |
Some additional mandatory parameters based on order type:
| Type | Additional mandatory parameters | Additional Information |
|---|---|---|
LIMIT | timeInForce, quantity, price | |
MARKET | quantity or quoteOrderQty | MARKET orders using the quantity field specifies the amount of the base asset the user wants to buy or sell at the market price. E.g. MARKET order on BTCUSDT will specify how much BTC the user is buying or selling. MARKET orders using quoteOrderQty specifies the amount the user wants to spend (when buying) or receive (when selling) the quote asset; the correct quantity will be determined based on the market liquidity and quoteOrderQty. E.g. Using the symbol BTCUSDT: BUY side, the order will buy as many BTC as quoteOrderQty USDT can. SELL side, the order will sell as much BTC needed to receive quoteOrderQty USDT. |
STOP_LOSS | quantity, stopPrice or trailingDelta | This will execute a MARKET order when the conditions are met. (e.g. stopPrice is met or trailingDelta is activated) |
STOP_LOSS_LIMIT | timeInForce, quantity, price, stopPrice or trailingDelta | |
TAKE_PROFIT | quantity, stopPrice or trailingDelta | This will execute a MARKET order when the conditions are met. (e.g. stopPrice is met or trailingDelta is activated) |
TAKE_PROFIT_LIMIT | timeInForce, quantity, price, stopPrice or trailingDelta | |
LIMIT_MAKER | quantity, price | This is a LIMIT order that will be rejected if the order immediately matches and trades as a taker. This is also known as a POST-ONLY order. |
Notes on using parameters for Pegged Orders:
- These parameters are allowed for
LIMIT,LIMIT_MAKER,STOP_LOSS_LIMIT,TAKE_PROFIT_LIMITorders. - If
pegPriceTypeis specified,pricebecomes optional. Otherwise, it is still mandatory. pegPriceType=PRIMARY_PEGmeans the primary peg, that is the best price on the same side of the order book as your order.pegPriceType=MARKET_PEGmeans the market peg, that is the best price on the opposite side of the order book from your order.- Use
pegOffsetTypeandpegOffsetValueto request a price level other than the best one. These parameters must be specified together.
Other info:
-
Any
LIMITorLIMIT_MAKERtype order can be made an iceberg order by sending anicebergQty. -
Any order with an
icebergQtyMUST havetimeInForceset toGTC. -
For
STOP_LOSS,STOP_LOSS_LIMIT,TAKE_PROFIT_LIMITandTAKE_PROFITorders,trailingDeltacan be combined withstopPrice. -
MARKETorders usingquoteOrderQtywill not breakLOT_SIZEfilter rules; the order will execute aquantitythat will have the notional value as close as possible toquoteOrderQty. Trigger order price rules against market price for both MARKET and LIMIT versions: -
Price above market price:
STOP_LOSSBUY,TAKE_PROFITSELL -
Price below market price:
STOP_LOSSSELL,TAKE_PROFITBUY
Data Source: Matching Engine
Response - ACK:
Code
Response - RESULT:
Code
Response - FULL:
Code
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" |
pegPriceType | Price peg type | Only for pegged orders | "pegPriceType": "PRIMARY_PEG" |
pegOffsetType | Price peg offset type | Only for pegged orders, if requested | "pegOffsetType": "PRICE_LEVEL" |
pegOffsetValue | Price peg offset value | Only for pegged orders, if requested | "pegOffsetValue": 5 |
peggedPrice | Current price order is pegged at | Only for pegged orders, once determined | "peggedPrice": "87523.83710000" |
expiryReason | Cause of the order’s expiration | When an order has expired | “expiryReason”: “INSUFFICIENT_LIQUIDITY” |
Test new order (TRADE)
Code
Test new order creation and signature/recvWindow long. 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 POST /api/v3/order, the following
optional parameters are also accepted:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| computeCommissionRates | BOOLEAN | NO | Default: false See Commissions FAQ to learn more. |
Data Source: Memory
Response:
Without computeCommissionRates
Code
With computeCommissionRates
Code
Query order (USER_DATA)
Code
Check an order's status.
Weight: 4
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| orderId | LONG | NO | |
| origClientOrderId | STRING | NO | |
| recvWindow | DECIMAL | NO | The value cannot be greater than 60000. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. |
| timestamp | LONG | YES |
Notes:
- Either
orderIdororigClientOrderIdmust be sent. - If both
orderIdandorigClientOrderIdare provided, theorderIdis searched first, then theorigClientOrderIdfrom that result is checked against that order. If both conditions are not met the request will be rejected. - For some historical orders
cummulativeQuoteQtywill be < 0, meaning the data is not available at this time.
Data Source: Memory => Database
Response:
Code
Note: The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.
Cancel order (TRADE)
Code
Cancel an active order.
Weight: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| orderId | LONG | NO | |
| origClientOrderId | STRING | NO | |
| newClientOrderId | STRING | NO | Used to uniquely identify this cancel. Automatically generated by default. |
| 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. |
| recvWindow | DECIMAL | NO | The value cannot be greater than 60000. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. |
| timestamp | LONG | YES |
Notes:
- Either
orderIdororigClientOrderIdmust be sent. - If both
orderIdandorigClientOrderIdare provided, theorderIdis searched first, then theorigClientOrderIdfrom that result is checked against that order. If both conditions are not met the request will be rejected.
Data Source: Matching Engine
Response:
Code
Notes:
- The payload above does not show all fields that can appear in the order response. Please refer to Conditional fields in Order Responses.
- The performance for canceling an order (single cancel or as part of a cancel-replace) is always
better when only
orderIdis sent. SendingorigClientOrderIdor bothorderId+origClientOrderIdwill be slower.
Regarding cancelRestrictions
- If the
cancelRestrictionsvalue is not any of the supported values, the error will be:
Code
- If the order did not pass the conditions for
cancelRestrictions, the error will be:
Code
Cancel All Open Orders on a Symbol (TRADE)
Code
Cancels all active orders on a symbol. This includes orders that are part of an order list.
Weight: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| recvWindow | DECIMAL | NO | The value cannot be greater than 60000. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. |
| timestamp | LONG | YES |
Data Source: Matching Engine
Response:
Code
Cancel an Existing Order and Send a New Order (TRADE)
Code
- Cancels an existing order and places a new order on the same symbol.
- Filters and Order Count are evaluated before the processing of the cancellation and order placement occurs.
- A new order that was not attempted (i.e. when
newOrderResult: NOT_ATTEMPTED), will still increase the unfilled order count by 1. - You can only cancel an individual order from an orderList using this endpoint, but the result is the same as canceling the entire orderList.
Weight: 1
Unfilled Order Count: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| side | ENUM | YES | |
| type | ENUM | YES | |
| cancelReplaceMode | ENUM | YES | The allowed values are: STOP_ON_FAILURE - If the cancel request fails, the new order placement will not be attempted. ALLOW_FAILURE - new order placement will be attempted even if cancel request fails. |
| timeInForce | ENUM | NO | |
| quantity | DECIMAL | NO | |
| quoteOrderQty | DECIMAL | NO | |
| price | DECIMAL | NO | |
| cancelNewClientOrderId | STRING | NO | Used to uniquely identify this cancel. Automatically generated by default. |
| cancelOrigClientOrderId | STRING | NO | Either cancelOrderId or cancelOrigClientOrderId must be sent. If both cancelOrderId and cancelOrigClientOrderId parameters are provided, the cancelOrderId is searched first, then the cancelOrigClientOrderId from that result is checked against that order. If both conditions are not met the request will be rejected. |
| cancelOrderId | LONG | NO | Either cancelOrderId or cancelOrigClientOrderId must be sent. If both cancelOrderId and cancelOrigClientOrderId parameters are provided, the cancelOrderId is searched first, then the cancelOrigClientOrderId from that result is checked against that order. If both conditions are not met the request will be rejected. |
| newClientOrderId | STRING | NO | Used to identify the new order. |
| strategyId | LONG | NO | |
| strategyType | INT | NO | The value cannot be less than 1000000. |
| stopPrice | DECIMAL | NO | |
| trailingDelta | LONG | NO | See Trailing Stop order FAQ |
| icebergQty | DECIMAL | NO | |
| newOrderRespType | ENUM | NO | Allowed values: ACK, RESULT, FULL MARKET and LIMIT orders types default to FULL; all other orders default to ACK |
| selfTradePreventionMode | ENUM | NO | The allowed enums is dependent on what is configured on the symbol. The possible supported values are: STP Modes. |
| 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 |
| orderRateLimitExceededMode | ENUM | No | Supported values: DO_NOTHING (default)- will only attempt to cancel the order if account has not exceeded the unfilled order rate limit CANCEL_ONLY - will always cancel the order |
| pegPriceType | ENUM | NO | PRIMARY_PEG or MARKET_PEG See Pegged Orders |
| pegOffsetValue | INT | NO | Price level to peg the price to (max: 100) See Pegged Orders |
| pegOffsetType | ENUM | NO | Only PRICE_LEVEL is supported See Pegged Orders |
| recvWindow | DECIMAL | NO | The value cannot be greater than 60000. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. |
| timestamp | LONG | YES |
Similar to POST /api/v3/order, additional mandatory parameters are determined by type.
Response format varies depending on whether the processing of the message succeeded, partially succeeded, or failed.
Data Source: Matching Engine
Response SUCCESS and account has not exceeded the unfilled order count:
Code
Response when Cancel Order Fails with STOP_ON FAILURE and account has not exceeded their unfilled order count:
Code
Response when Cancel Order Succeeds but New Order Placement Fails and account has not exceeded their unfilled order count:
Code
Response when Cancel Order fails with ALLOW_FAILURE and account has not exceeded their unfilled order count:
Code
Response when both Cancel Order and New Order Placement fail using
cancelReplaceMode=ALLOW_FAILURE and account has not exceeded their unfilled order count:
Code
Response when using orderRateLimitExceededMode=DO_NOTHING and account's unfilled order count has
been exceeded:
Code
Response when using orderRateLimitExceededMode=CANCEL_ONLY and account's unfilled order count
has been exceeded:
Code
Notes:
- The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.
- The performance for canceling an order (single cancel or as part of a cancel-replace) is always
better when only
orderIdis sent. SendingorigClientOrderIdor bothorderId+origClientOrderIdwill be slower.
Order Amend Keep Priority (TRADE)
Code
Reduce the quantity of an existing open order.
This adds 0 orders to the EXCHANGE_MAX_ORDERS filter and the MAX_NUM_ORDERS filter.
Read Order Amend Keep Priority FAQ to learn more.
Weight: 4
Unfilled Order Count: 0
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| orderId | LONG | NO* | orderId or origClientOrderId must be sent |
| origClientOrderId | STRING | NO* | orderId or origClientOrderId must be sent |
| newClientOrderId | STRING | NO* | The new client order ID for the order after being amended. If not sent, one will be randomly generated. It is possible to reuse the current clientOrderId by sending it as the newClientOrderId. |
| newQty | DECIMAL | YES | newQty must be greater than 0 and less than the order's quantity. |
| recvWindow | DECIMAL | NO | The value cannot be greater than 60000. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. |
| timestamp | LONG | YES |
Data Source: Matching Engine
Response: Response for a single order:
Code
Response for an order that is part of an Order list:
Code
Note: The payloads above do not show all fields that can appear. Please refer to Conditional fields in Order Responses.
Order lists
New Order list - OCO (TRADE)
Code
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_LIMITorder and the other must beSTOP_LOSSorSTOP_LOSS_LIMITorder. - Price restrictions
- If the OCO is on the
SELLside:LIMIT_MAKER/TAKE_PROFIT_LIMITprice> Last Traded Price >STOP_LOSS/STOP_LOSS_LIMITstopPriceTAKE_PROFIT stopPrice> Last Traded Price >STOP_LOSS/STOP_LOSS_LIMIT stopPrice
- If the OCO is on the
BUYside:LIMIT_MAKER/TAKE_PROFIT_LIMIT price< Last Traded Price <stopPriceTAKE_PROFIT stopPrice< Last Traded Price <STOP_LOSS/STOP_LOSS_LIMIT stopPrice
- If the OCO is on the
- OCOs add 2 orders to the
EXCHANGE_MAX_ORDERSfilter and theMAX_NUM_ORDERSfilter.
Weight: 1
Unfilled Order Count: 2
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 | ENUM | 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. |
| abovePegPriceType | ENUM | NO | See Pegged Orders |
| abovePegOffsetType | ENUM | NO | |
| abovePegOffsetValue | INT | NO | |
| belowType | ENUM | Yes | Supported values: STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT,TAKE_PROFIT_LIMIT |
| belowClientOrderId | STRING | No | Arbitrary unique ID among open orders for the below order. Automatically generated if not sent |
| 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, TAKE_PROFIT_LIMIT, or LIMIT_MAKER 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. 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. |
| belowPegPriceType | ENUM | NO | | See Pegged Orders |
| belowPegOffsetType | ENUM | NO | |
| belowPegOffsetValue | INT | NO | |
| newOrderRespType | ENUM | No | Select response format: ACK, RESULT, FULL |
| selfTradePreventionMode | ENUM | No | The allowed enums is dependent on what is configured on the symbol. Supported values: STP Modes |
| recvWindow | DECIMAL | No | The value cannot be greater than 60000. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. |
| timestamp | LONG | Yes |
Data Source: Matching Engine
Response:
Response format for orderReports is selected using the newOrderRespType parameter. The following
example is for the RESULT response type. See POST /api/v3/order for more
examples.
Code
New Order list - OTO (TRADE)
Code
Place 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
LIMITorLIMIT_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
MARKETorders 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.
- When the order list is placed, if the working order gets immediately fully filled, the
placement response will show the working order as
FILLEDbut the pending order will still appear asPENDING_NEW. You need to query the status of the pending order again to see its updated status. - OTOs add 2 orders to the
EXCHANGE_MAX_NUM_ORDERSfilter andMAX_NUM_ORDERSfilter.
Weight: 1
Unfilled Order Count: 2
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. Supported values: 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. |
| workingPegPriceType | ENUM | NO | See Pegged Orders |
| workingPegOffsetType | ENUM | NO | |
| workingPegOffsetValue | INT | NO | |
| 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. |
| pendingPegPriceType | ENUM | NO | See Pegged Orders |
| pendingPegOffsetType | ENUM | NO | |
| pendingPegOffsetValue | INT | NO | |
| recvWindow | DECIMAL | NO | The value cannot be greater than 60000. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. |
| timestamp | LONG | 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 | pendingPrice, pendingStopPrice and/or pendingTrailingDelta, pendingTimeInForce |
Data Source:
Matching Engine
Response:
Code
Note: The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.
New Order list - OTOCO (TRADE)
Code
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
LIMITorLIMIT_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.
- The rules of the pending above and pending below follow the same rules as the Order list OCO.
- OTOCOs add 3 orders to the
EXCHANGE_MAX_NUM_ORDERSfilter andMAX_NUM_ORDERSfilter.
Weight: 1
Unfilled Order Count: 3
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 of the JSON response. Supported values: Order Response Type |
| selfTradePreventionMode | ENUM | NO | The allowed values are dependent on what is configured on the symbol. Supported values: 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 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. |
| workingPegPriceType | ENUM | NO | See Pegged Orders |
| workingPegOffsetType | ENUM | NO | |
| workingPegOffsetValue | INT | NO | |
| 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, or 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. |
| pendingAbovePegPriceType | ENUM | NO | See Pegged Orders |
| pendingAbovePegOffsetType | ENUM | NO | |
| pendingAbovePegOffsetValue | INT | NO | |
| 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. |
| pendingBelowPegPriceType | ENUM | NO | See Pegged Orders |
| pendingBelowPegOffsetType | ENUM | NO | |
| pendingBelowPegOffsetValue | INT | NO | |
| recvWindow | DECIMAL | NO | The value cannot be greater than 60000. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. |
| timestamp | LONG | 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:
Code
Note: The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.
New Order List - OPO (TRADE)
Code
Place an OPO.
- OPOs add 2 orders to the EXCHANGE_MAX_NUM_ORDERS filter and MAX_NUM_ORDERS filter.
Weight: 1
Unfilled Order Count: 2
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. Supported values: 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. |
| workingPegPriceType | ENUM | NO | See Pegged Orders |
| workingPegOffsetType | ENUM | NO | |
| workingPegOffsetValue | INT | NO | |
| 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 | |
| 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. |
| pendingPegPriceType | ENUM | NO | See Pegged Orders |
| pendingPegOffsetType | ENUM | NO | |
| pendingPegOffsetValue | INT | NO | |
| recvWindow | DECIMAL | NO | The value cannot be greater than 60000. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. |
| timestamp | LONG | YES |
Data Source: Matching Engine
Response:
Code
Note: The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.
New Order List - OPOCO (TRADE)
Code
Place an OPOCO.
Weight: 1
Unfilled Order Count: 3
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 of the JSON response. Supported values: Order Response Type |
| selfTradePreventionMode | ENUM | NO | The allowed values are dependent on what is configured on the symbol. Supported values: 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 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. |
| workingPegPriceType | ENUM | NO | See Pegged Orders |
| workingPegOffsetType | ENUM | NO | |
| workingPegOffsetValue | INT | NO | |
| pendingSide | ENUM | YES | Supported values: Order side |
| 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. |
| pendingAbovePegPriceType | ENUM | NO | See Pegged Orders |
| pendingAbovePegOffsetType | ENUM | NO | |
| pendingAbovePegOffsetValue | INT | NO | |
| 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. |
| pendingBelowPegPriceType | ENUM | NO | See Pegged Orders |
| pendingBelowPegOffsetType | ENUM | NO | |
| pendingBelowPegOffsetValue | INT | NO | |
| recvWindow | DECIMAL | NO | The value cannot be greater than 60000. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. |
| timestamp | LONG | YES |
Response
Code
Note: The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.
Cancel Order list (TRADE)
Code
Cancel an entire Order list
Weight: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| orderListId | LONG | NO | Either orderListId or listClientOrderId must be provided |
| listClientOrderId | STRING | NO | Either orderListId or listClientOrderId must be provided |
| newClientOrderId | STRING | NO | Used to uniquely identify this cancel. Automatically generated by default |
| recvWindow | DECIMAL | NO | The value cannot be greater than 60000. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. |
| timestamp | LONG | YES |
Notes:
- Canceling an individual order from an order list will cancel the entire order list.
- If both
orderListIdandlistClientOrderIdparameters are provided, theorderListIdis searched first, then thelistClientOrderIdfrom that result is checked against that order. If both conditions are not met the request will be rejected.
Data Source: Matching Engine
Response:
Code
SOR
New order using SOR (TRADE)
Code
Places an order using smart order routing (SOR).
This adds 1 order to the EXCHANGE_MAX_ORDERS filter and the MAX_NUM_ORDERS filter.
Read SOR FAQ to learn more.
Weight: 1
Unfilled Order Count: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| side | ENUM | YES | |
| type | ENUM | YES | |
| timeInForce | ENUM | NO | |
| quantity | DECIMAL | YES | |
| price | DECIMAL | NO | |
| newClientOrderId | STRING | NO | A unique id among open orders. Automatically generated if not sent. Orders with the same newClientOrderID can be accepted only when the previous one is filled, otherwise the order will be rejected. |
| strategyId | LONG | NO | |
| strategyType | INT | NO | The value cannot be less than 1000000. |
| icebergQty | DECIMAL | NO | Used with LIMIT to create an iceberg order. |
| newOrderRespType | ENUM | NO | Set the response JSON. ACK, RESULT, or FULL. Default to FULL |
| selfTradePreventionMode | ENUM | NO | The allowed enums is dependent on what is configured on the symbol. The possible supported values are: STP Modes. |
| recvWindow | DECIMAL | NO | The value cannot be greater than 60000. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. |
| timestamp | LONG | YES |
Note: POST /api/v3/sor/order only supports LIMIT and MARKET orders. quoteOrderQty is not
supported.
Data Source: Matching Engine
Response:
Code
Test new order using SOR (TRADE)
Code
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 POST /api/v3/sor/order,
the following optional parameters are also accepted:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| computeCommissionRates | BOOLEAN | NO | Default: false |
Data Source: Memory
Response:
Without computeCommissionRates
Code
With computeCommissionRates
Code
Account Endpoints
Account information (USER_DATA)
Code
Get current account information.
Weight: 20
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| omitZeroBalances | BOOLEAN | NO | When set to true, emits only the non-zero balances of an account. Default value: false |
| recvWindow | DECIMAL | NO | The value cannot be greater than 60000. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. |
| timestamp | LONG | YES |
Data Source: Memory => Database
Response:
Code
Current open orders (USER_DATA)
Code
Get all open orders on a symbol. Careful when accessing this with no symbol.
Weight: 6 for a single symbol; 80 when the symbol parameter is omitted
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | NO | |
| recvWindow | DECIMAL | NO | The value cannot be greater than 60000. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. |
| timestamp | LONG | YES |
- If the symbol is not sent, orders for all symbols will be returned in an array.
Data Source: Memory => Database
Response:
Code
Note: The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.
All orders (USER_DATA)
Code
Get all account orders; active, canceled, or filled.
Weight: 20
Data Source: Database
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| orderId | LONG | NO | |
| startTime | LONG | NO | |
| endTime | LONG | NO | |
| limit | INT | NO | Default 500; Maximum: 1000. |
| recvWindow | DECIMAL | NO | The value cannot be greater than 60000. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. |
| timestamp | LONG | YES |
Notes:
- If
orderIdis set, it will get orders >= thatorderId. Otherwise most recent orders are returned. - For some historical orders
cummulativeQuoteQtywill be < 0, meaning the data is not available at this time. - If
startTimeand/orendTimeprovided,orderIdis not required. - The time between
startTimeandendTimecan't be longer than 24 hours.
Response:
Code
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)
Code
Retrieves a specific order list based on provided optional parameters.
Weight:
4
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| orderListId | LONG | NO* | Query order list by orderListId. orderListId or origClientOrderId must be provided. |
| origClientOrderId | STRING | NO* | Query order list by listClientOrderId. orderListId or origClientOrderId must be provided. |
| recvWindow | DECIMAL | NO | The value cannot be greater than 60000. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. |
| timestamp | LONG | YES |
Data Source: Database
Response:
Code
Query all Order lists (USER_DATA)
Code
Retrieves all order lists based on provided optional parameters
Note that the time between startTime and endTime can't be longer than 24 hours.
Weight:
20
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| fromId | LONG | NO | If supplied, neither startTime or endTime can be provided |
| startTime | LONG | NO | |
| endTime | LONG | NO | |
| limit | INT | NO | Default: 500; Maximum: 1000 |
| recvWindow | DECIMAL | NO | The value cannot be greater than 60000. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. |
| timestamp | LONG | YES |
Data Source: Database
Response:
Code
Query Open Order lists (USER_DATA)
Code
Weight: 6
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| recvWindow | DECIMAL | NO | The value cannot be greater than 60000. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. |
| timestamp | LONG | YES |
Data Source: Database
Response:
Code
Account trade list (USER_DATA)
Code
Get trades for a specific account and symbol.
Weight:
| Condition | Weight |
|---|---|
| Without orderId | 20 |
| With orderId | 5 |
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| orderId | LONG | NO | This can only be used in combination with symbol. |
| startTime | LONG | NO | |
| endTime | LONG | NO | |
| fromId | LONG | NO | TradeId to fetch from. Default gets most recent trades. |
| limit | INT | NO | Default: 500; Maximum: 1000. |
| recvWindow | DECIMAL | NO | The value cannot be greater than 60000. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. |
| timestamp | LONG | YES |
Notes:
- If
fromIdis set, it will get trades >= thatfromId. Otherwise most recent trades are returned. - The time between
startTimeandendTimecan't be longer than 24 hours. - These are the supported combinations of all parameters:
symbolsymbol+orderIdsymbol+startTimesymbol+endTimesymbol+fromIdsymbol+startTime+endTimesymbol+orderId+fromId
Data Source: Memory => Database
Response:
Code
Query Unfilled Order Count (USER_DATA)
Code
Displays the user's unfilled order count for all intervals.
Weight: 40
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| recvWindow | DECIMAL | NO | The value cannot be greater than 60000. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. |
| timestamp | LONG | YES |
Data Source: Memory
Response:
Code
Query Prevented Matches (USER_DATA)
Code
Displays the list of orders that were expired due to STP.
These are the combinations supported:
symbol+preventedMatchIdsymbol+orderIdsymbol+orderId+fromPreventedMatchId(limitwill default to 500)symbol+orderId+fromPreventedMatchId+limit
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| preventedMatchId | LONG | NO | |
| orderId | LONG | NO | |
| fromPreventedMatchId | LONG | NO | |
| limit | INT | NO | Default: 500; Maximum: 1000 |
| recvWindow | DECIMAL | NO | The value cannot be greater than 60000. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. |
| timestamp | LONG | YES |
Weight:
| Case | Weight |
|---|---|
If symbol is invalid | 2 |
Querying by preventedMatchId | 2 |
Querying by orderId | 20 |
Data Source:
Database
Response:
Code
Query Allocations (USER_DATA)
Code
Retrieves allocations resulting from SOR order placement.
Weight: 20
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | Yes | |
| startTime | LONG | No | |
| endTime | LONG | No | |
| fromAllocationId | INT | No | |
| limit | INT | No | Default: 500; Maximum: 1000 |
| orderId | LONG | No | |
| recvWindow | DECIMAL | No | The value cannot be greater than 60000. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. |
| timestamp | LONG | No |
Supported parameter combinations:
| Parameters | Response |
|---|---|
symbol | allocations from oldest to newest |
symbol + startTime | oldest allocations since startTime |
symbol + endTime | newest allocations until endTime |
symbol + startTime + endTime | allocations within the time range |
symbol + fromAllocationId | allocations by allocation ID |
symbol + orderId | allocations related to an order starting with oldest |
symbol + orderId + fromAllocationId | allocations related to an order by allocation ID |
Note: The time between startTime and endTime can't be longer than 24 hours.
Data Source: Database
Response:
Code
Query Commission Rates (USER_DATA)
Code
Get current account commission rates.
Weight: 20
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES |
Data Source: Database
Response:
Code
Query Order Amendments (USER_DATA)
Code
Queries all amendments of a single order.
Weight: 4
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| orderId | LONG | YES | |
| fromExecutionId | LONG | NO | |
| limit | LONG | NO | Default:500; Maximum: 1000 |
| recvWindow | DECIMAL | NO | The value cannot be greater than 60000. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. |
| timestamp | LONG | YES |
Data Source:
Database
Response:
Code
Query relevant filters (USER_DATA)
Code
Retrieves the list of filters relevant to an account on a given symbol. This is the
only endpoint that shows if an account has MAX_ASSET filters applied to
it.
Weight: 40
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| recvWindow | DECIMAL | NO | The value cannot be greater than 60000. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. |
| timestamp | LONG | YES |
Data Source: Memory
Response:
Code