Navbar
简体中文

Change Log

Important Documentation Notice

Binance has launched its new API Documentation Portal. The existing GitHub API documentation is now deprecated(2024-06-17) and set to go offline in the upcoming few months following user migration; the exact date will be determined and communicated in due course.

During this transition phase, both sites will be maintained. However, any new services will only be published in the new portal moving forward.

Here's a reference table of the links for the current and new API documentation:

Functionality Current Documentation New Documentation
Spot Trading Current Documentation New Documentation
Spot Websocket API Current Documentation New Documentation
Margin Trading Current Documentation New Documentation
Derivative UM Futures Current Documentation New Documentation
Derivative CM Futures Current Documentation New Documentation
Derivative Options Current Documentation New Documentation
Derivative Portfolio Margin Current Documentation New Documentation
Wallet Current Documentation New Documentation
Sub Account Current Documentation New Documentation
Simple Earn Current Documentation New Documentation
Dual Investment Current Documentation New Documentation
Auto Invest Current Documentation New Documentation
Staking Current Documentation New Documentation
Mining Current Documentation New Documentation
Algo Trading Current Documentation New Documentation
Copy Trading Current Documentation New Documentation
Porfolio Margin Pro Current Documentation New Documentation
Fiat Current Documentation New Documentation
C2C Current Documentation New Documentation
VIP Loan Current Documentation New Documentation
Crypto Loan Current Documentation New Documentation
Pay Current Documentation New Documentation
Convert Current Documentation New Documentation
Rebate Current Documentation New Documentation
NFT Current Documentation New Documentation
Gift Card Current Documentation New Documentation

2024-10-18

REST and WebSocket API:


2024-10-17

Changes to Exchange Information (i.e. GET /api/v3/exchangeInfo from REST and exchangeInfofor WebSocket API).


2024-09-02


2024-08-16

Notice: The changes below are being rolled out gradually, and may take approximately a week to complete.

SPOT API: * New error message have been added when quote quantity market orders (aka reverse market orders) are rejected in low-liquidity situations.


2024-07-22

SPOT API


2024-06-11


2024-06-06

This will be available by June 6, 11:59 UTC.

SPOT API


2024-06-04


2024-05-30

WebSocket Streams


2024-05-22


2024-04-18


2024-04-10

The following changes have been postponed to take effect on April 25, 05:00 UTC

SBE


2024-04-08


2024-04-02

Notice: The changes below are being rolled out gradually, and will take approximately a week to complete.

User Data Stream:

The following will take effect approximately a week after the release date:

SBE


2024-02-28

This will take effect on March 5, 2024.

Simple Binary Encoding (SBE) will be added to the live exchange, both for the Rest API and WebSocket API on SPOT.

For more information on SBE, please refer to the FAQ.


2024-02-27


2024-02-23


2024-02-08

The SPOT WebSocket API can now support SBE on SPOT Testnet.

The SBE schema has been updated with WebSocket API metadata without incrementing either schemaId or version.

Users using SBE only on the REST API may continue to use the SBE schema with git commit hash 128b94b2591944a536ae427626b795000100cf1d or update to the newly-published SBE schema.

Users who want to use SBE on the WebSocket API must use the newly-published SBE schema.

The FAQ for SBE has been updated.


2024-01-24


2024-01-19


2024-01-15


2024-01-09


2023-12-22


2023-12-08

Simple Binary Encoding (SBE) has been added to SPOT Testnet.

This will be added to the live exchange at a later date.

For more information on what SBE is, please refer to the FAQ


2023-12-04

Notice: The changes below are being rolled out gradually, and will take approximately a week to complete.

General Changes:

SPOT API

WebSocket Streams

User Data Streams

The following will take effect approximately a week after the release date:


2023-11-21


2023-11-17


2023-11-02


2023-10-19

Effective on 2023-10-19 00:00 UTC

The request weights of the following requests have been increased:

SPOT API Condition Previous Request Weight New Request Weight
GET /api/v3/trades N/A 2 10
GET /api/v3/depth Limit 1-100 2 5
Limit 101-500 10 25
Limit 501-1000 20 50
Limit 1001-5000 100 250

2023-10-16


2023-10-11


2023-10-03


2023-09-25


2023-09-22


2023-09-18


2023-09-14


2023-09-04


2023-08-31


2023-08-26


2023-08-25

The following changes will be effective from 2023-08-25 at UTC 00:00.

Please refer to the table for more details:

Request Previous Request Weight New Request Weight
GET /api/v3/order 2 4
GET /api/v3/orderList 2 4
GET /api/v3/openOrders - With symbol 3 6
GET /api/v3/openOrders- Without symbol 40 80
GET /api/v3/openOrderList 3 6
GET /api/v3/allOrders 10 20
GET /api/v3/allOrderList 10 20
GET /api/v3/myTrades 10 20
GET /api/v3/myAllocations 10 20
GET /api/v3/myPreventedMatches - Using preventedMatchId 1 2
GET /api/v3/myPreventedMatches - Using orderId 10 20
GET /api/v3/account 10 20
GET /api/v3/rateLimit/order 20 40
GET /api/v3/exchangeInfo 10 20
GET /api/v3/depth - Limit 1-100 1 2
GET /api/v3/depth - Limit 101-500 5 10
GET /api/v3/depth - Limit 501-1000 10 20
GET /api/v3/depth - Limit 1001-5000 50 100
GET /api/v3/aggTrades 1 2
GET /api/v3/trades 1 2
GET /api/v3/historicalTrades 5 10
GET /api/v3/klines 1 2
GET /api/v3/uiKlines 1 2
GET /api/v3/ticker/bookTicker - With symbol 1 2
GET /api/v3/ticker/bookTicker - Without symbol or With symbols 2 4
GET /api/v3/ticker/price- With symbol 1 2
GET /api/v3/ticker/price- Without symbol or With symbols 2 4
GET /api/v3/ticker/24hr - With symbol or With symbols using 1-20 symbols 1 2
GET /api/v3/ticker/24hr - With symbols using 21-100 symbols 20 40
GET /api/v3/ticker/24hr - Without symbol or symbols using 101 or more symbols 40 80
GET /api/v3/avgPrice 1 2
GET /api/v3/ticker 2 4
GET /api/v3/ticker - Maximum weight for this request 100 200
POST /api/v3/userDataStream 1 2
PUT /api/v3/userDataStream 1 2
DELETE /api/v3/userDataStream 1 2

2023-08-18


2023-08-08

Smart Order Routing (SOR) has been added to the APIs. For more information please refer to our FAQ. Please wait for future announcements on when the feature will be enabled.

SPOT API

USER DATA STREAM


2023-08-02


2023-07-20


2023-07-18


2023-07-14


2023-07-11

Notice: The change below are being rolled out, and will take approximately a week to complete.

SPOT API

The following changes will take effect approximately a week from the release date::


2023-07-07


2023-06-29


2023-06-22


2023-06-20


2023-06-09


2023-06-06


2023-06-01


2023-05-30


2023-05-26

Notice: The change below are being rolled out, and will take approximately a week to complete.


2023-05-24


2023-05-18


2023-05-09


2023-04-20


2023-04-18


2023-03-23


2023-03-13

Notice: All changes are being rolled out gradually to all our servers, and may take a week to complete.

GENERAL CHANGES

Situation Old Error Message New Error Message
An account cannot place or cancel an order, due to trading ability disabled. This action is disabled on this account. This account may not place or cancel orders.
When the permissions configured on the symbol do not match the permissions on the account. This symbol is not permitted for this account.
When the account tries to place an order on a symbol it has no permissions for. This symbol is restricted for this account.
Placing an order when symbol is not TRADING. Unsupported order combination. This order type is not possible in this trading phase.
Placing an order with timeinForce=IOC or FOK on a trading phase that does not support it. Limit orders require GTC for this phase.

The following changes will take effect approximately a week from the release date, but the rest of the documentation has been updated to reflect the future changes:

SPOT API


2023-02-27


2023-02-21


2023-02-17

The Websocket Stream now only allows 300 connections requests every 5 minutes.

This limit is per IP address.

Please be careful when trying to open multiple connections or reconnecting to the Websocket API.


2023-02-13


2023-02-02


2023-01-26

As per the announcement, Self Trade Prevention will be enabled at 2023-01-26 08:00 UTC.

Please refer to GET /api/v3/exchangeInfo from the Rest API or exchangeInfo from the Websocket API on the default and allowed modes.


2023-01-23

New API cluster has been added. Note that all endpoints are functionally equal, but may vary in performance.


2023-01-19

ACTUAL RELEASE DATE TBD

SPOT API

New Feature: Self-Trade Prevention (aka STP) will be added to the system at a later date. This will prevent orders from matching with orders from the same account, or accounts under the same tradeGroupId.

Please refer to GET /api/v3/exchangeInfo from the SPOT API or exchangeInfo from the Websocket API on the status.

"defaultSelfTradePreventionMode": "NONE",   //If selfTradePreventionMode not provided, this will be the value passed to the engine
"allowedSelfTradePreventionModes": [        //What the allowed modes of selfTradePrevention are
    "NONE",
    "EXPIRE_TAKER",
    "EXPIRE_BOTH",
    "EXPIRE_MAKER"
]

USER DATA STREAM


2023-01-13


2023-01-05


2022-12-26


2022-12-15


2022-12-13

REST API

Some error messages on error code -1003 have changed:

Too much request weight used; current limit is %s request weight per %s %s. Please use the websocket for live updates to avoid polling the API.

has been updated to:

Too much request weight used; current limit is %s request weight per %s. Please use WebSocket Streams for live updates to avoid polling the API.

Way too much request weight used; IP banned until %s. Please use the websocket for live updates to avoid bans.

has been updated to:

Way too much request weight used; IP banned until %s. Please use WebSocket Streams for live updates to avoid bans.


2022-12-05

Notice: These changes are being rolled out gradually to all our servers, and will take approximately a week to complete.

WEBSOCKET

SPOT API

Note: These new fields will appear approximately a week from the release date.

USER DATA STREAM


2022-12-02


2022-11-29


2022-11-22


2022-11-18


2022-11-14


2022-11-02


2022-11-01


2022-10-28


2022-10-15


2022-09-30


2022-09-30

Scheduled changes to the removal of !bookTicker around November 2022.


2022-09-29


2022-09-22


2022-09-16


2022-09-15


2022-09-15

Note that these are rolling changes, so it may take a few days for it to rollout to all our servers.


2022-09-12


2022-09-05


2022-08-23

SPOT API

Note that these are rolling changes, so it may take a few days for it to rollout to all our servers.


2022-08-18


2022-08-08

SPOT API

USER DATA STREAM


2022-08-05


2022-07-21


2022-07-18


2022-07-01


2022-06-20

SPOT API: Changes to GET /api/v3/ticker

    {
     "code": -1101,
     "msg": "Too many values sent for parameter 'symbols', maximum allowed up to 100." 
    }

2022-06-15

Note: The update is being rolled out over the next few days, so these changes may not be visible right away.

WEBSOCKETS


2022-06-02


2022-05-31


2022-05-26


2022-05-23


2022-05-19


2022-05-17

SPOT API

{
"code": -1102,
"msg": "Mandatory parameter 'symbol' was not sent, was empty/null, or malformed." 
}
Endpoint Number of Symbols Weight
GET /api/v3/ticker/price Any 2
GET /api/v3/ticker/bookTicker Any 2
GET /api/v3/ticker/24hr 1-20 1
GET /api/v3/ticker/24hr 21-100 20
GET /api/v3/ticker/24hr 101 or more 40

2022-05-05


2022-04-28


2022-04-27

FAQ: Time-Weighted Average Price(Twap) Introduction


2022-04-26


2022-04-20

FAQ: Portfolio Margin Program

Only Portfolio Margin Account is accessible to this endpoint. To enroll, kindly refer to: How to Enroll into the Binance Portfolio Margin Program


2022-04-13

FAQ: Volume Participation(VP) Introduction


2022-04-13

Information on Trailing Stops

SPOT API

USER DATA STREAM


2022-04-12

Note: The changes are being rolled out during the next few days, so these will not appear right away.


2022-3-29

The following updates will take effect on March 31, 2022 08:00 AM UTC

The query time period must be less then 30 days; If startTime and endTime not sent, return records of the last 30 days by default


2022-03-25


2022-03-08


2022-02-28


2022-02-22

SPOT API

Limit Request Weight
1-100 1
101-500 5
501-1000 10
1001-5000 50

2022-2-18


2022-2-17

The following updates will take effect on February 24, 2022 08:00 AM UTC

The time limit of this endpoint is shortened to only support querying the data of the latest month


2022-2-09


2022-1-25


2022-1-21


2022-1-4


2021-12-30


2021-12-29


2021-12-24


2021-12-03


2021-11-30


2021-11-19


2021-11-18

The following updates will take effect on November 25, 2021 08:00 AM UTC

The query time range of both endpoints are shortened to support data query within the last 6 months only, where startTime does not support selecting a timestamp beyond 6 months. If you do not specify startTime and endTime, the data of the last 7 days will be returned by default.


2021-11-17


2021-11-16


2021-11-09


2021-11-08


2021-11-05


2021-11-04

The following updates will take effect on November 11, 2021 08:00 AM UTC

The query time range of both endpoints are shortened to support data query within the last 6 months only, where startTime does not support selecting a timestamp beyond 6 months. If you do not specify startTime and endTime, the data of the last 7 days will be returned by default.


2021-11-01


2021-10-22


2021-10-14


2021-09-18


2021-09-17


2021-09-08


2021-09-03


2021-08-27


2021-08-23

Same usage as spot account OCO


2021-08-20


2021-08-12


2021-08-05


2021-08-05

The time between startTime and endTime cannot be longer than 30 days. If startTime and endTime are both not sent, then the last 30 days' data will be returned


2021-07-29


2021-07-27


2021-07-16


2021-07-09


2021-06-24


2021-06-17


2021-06-15


2021-06-04

On August 01, 2021 02:00 AM UTC the WAPI endpoints will be discontinued:

The WAPI endpoints have been removed from Binance API Documentation.To ensure your trading strategies are not affected, all API users are encouraged to upgrade trading bots to SAPI endpoints as soon as possible.


2021-05-26


2021-05-12


2021-04-28

On May 15, 2021 08:00 UTC the SAPI Create Margin Account endpoint will be discontinued:

Isolated Margin account creation and trade preparation can be completed directly through Isolated Margin funds transfer POST /sapi/v1/margin/isolated/transfer


2021-04-26

On April 28, 2021 00:00 UTC the weights to the following endpoints will be adjusted:


2021-04-08


2021-04-02


2021-04-01


2021-03-31


2021-03-08


2021-03-05


2021-02-08


2021-02-04


2021-01-15


2021-01-10


2021-01-01

USER DATA STREAM


2020-12-30


2020-12-22


2020-12-11


2020-12-02


2020-12-01


2020-11-27

New API clusters have been added in order to improve performance.

Users can access any of the following API clusters, in addition to api.binance.com

If there are any performance issues with accessing api.binance.com please try any of the following instead:


2020-11-16


2020-11-13


2020-11-10


2020-11-09


2020-11-03


2020-10-14


2020-10-10


2020-09-30


2020-09-28


2020-09-23

2020-09-09

USER DATA STREAM


2020-09-03


2020-09-01


2020-08-27


2020-08-26


2020-07-28

ISOLATED MARGIN


2020-07-20


2020-07-17


2020-07-13


2020-06-28


2020-05-06


2020-05-01


2020-04-25

SPOT API

USER DATA STREAM


2020-04-23

WEB SOCKET STREAM

2020-04-16


2020-04-02


2020-03-24


2020-03-13


2020-02-05


2020-01-15


2019-12-25


2019-12-18


2019-11-30


2019-11-28


2019-11-22


2019-11-19


2019-11-13

Rest API

    {
      "code": -1128,
      "msg": "Combination of optional parameters invalid. Recommendation: 'stopLimitTimeInForce' should also be sent."
    }

Deprecation of v1 endpoints:

By end of Q1 2020, the following endpoints will be removed from the API. The documentation has been updated to use the v3 versions of these endpoints.

These endpoints however, will NOT be migrated to v3. Please use the following endpoints instead moving forward.

Old V1 Endpoints New V3 Endpoints
GET api/v1/ticker/allPrices GET api/v3/ticker/price
GET api/v1/ticker/allBookTickers GET api/v3/ticker/bookTicker

USER DATA STREAM

WEB SOCKET STREAM


2019-11-08


2019-11-04


2019-10-29


2019-10-14


2019-10-11


2019-09-09


2019-09-03


2019-08-16


2019-09-15

Rest API

USER DATA STREAM

NEW ERRORS

NEW -2011 ERRORS


2019-03-12

Rest API

Websocket streams

System improvements


2018-11-13

Rest API

Explanation for the average price calculation:

  1. (qty * price) of all trades / sum of qty of all trades over previous 5 minutes.

  2. If there is no trade in the last 5 minutes, it takes the first trade that happened outside of the 5min window. For example if the last trade was 20 minutes ago, that trade's price is the 5 min average.

  3. If there is no trade on the symbol, there is no average price and market orders cannot be placed. On a new symbol with applyToMarket enabled on the MIN_NOTIONAL filter, market orders cannot be placed until there is at least 1 trade.

  4. The current average price can be checked here: https://api.binance.com/api/v3/avgPrice?symbol=<symbol> For example: https://api.binance.com/api/v3/avgPrice?symbol=BNBUSDT

User data stream


2018-07-18

Rest API

User data stream


2018-01-23


2018-01-20


2018-01-14

Introduction

API Key Setup

API Key Restrictions

Enabling Accounts

Spot Account

A SPOT account is provided by default upon creation of a Binance Account.

Margin Account

To enable a MARGIN account for Margin Trading, please refer to the Margin Trading Guide

Spot Testnet

Users can use the SPOT Testnet to practice SPOT trading.

Currently, this is only available via the API.

Please refer to the SPOT Testnet page for more information and how to set up the Testnet API key.

API Library

Connectors

The following are lightweight libraries that work as connectors to the Binance public API, written in different languages:

Postman Collections

Postman collections are available, and they are recommended for new users seeking a quick and easy start with the API.

https://github.com/binance/binance-api-postman

Swagger

A YAML file with OpenAPI specification for the RESTful API is available, along with a Swagger UI page for reference.

https://github.com/binance/binance-api-swagger

Contact Us


General Info

General API Information

HTTP Return Codes

Error Codes and Messages

The error payload on API and SAPI is as follows:

{
  "code": -1121,
  "msg": "Invalid symbol."
}

General Information on Endpoints


LIMITS

General Info on Limits

IP Limits

Unfilled Order Count

Websocket Limits

/api/ and /sapi/ Limit Introduction

The /api/* and /sapi/* endpoints adopt either of two access limiting rules, IP limits or UID (account) limits.


Data Sources

These are the three sources, ordered by which is has the most up-to-date response to the one with potential delays in updates.

Endpoint security type

Security Type Description
NONE Endpoint can be accessed freely.
TRADE Endpoint requires sending a valid API-Key and signature.
MARGIN Endpoint requires sending a valid API-Key and signature.
USER_DATA Endpoint requires sending a valid API-Key and signature.
USER_STREAM Endpoint requires sending a valid API-Key.
MARKET_DATA Endpoint requires sending a valid API-Key.

SIGNED (TRADE, USER_DATA, AND MARGIN) Endpoint security

Timing security

The logic is as follows:

  if (timestamp < (serverTime + 1000) && (serverTime - timestamp) <= recvWindow)
  {
    // process request
  } 
  else 
  {
    // reject request
  }

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.

SIGNED Endpoint Examples for POST /api/v3/order - HMAC Keys

Here is a step-by-step example of how to send a vaild signed payload from the Linux command line using echo, openssl, and curl.

Key Value
apiKey vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A
secretKey NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j
Parameter Value
symbol LTCBTC
side BUY
type LIMIT
timeInForce GTC
quantity 1
price 0.1
recvWindow 5000
timestamp 1499827319559

Example 1: As a request body

Example 1

HMAC SHA256 signature:

    $ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j"
    (stdin)= c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71

curl command:

    (HMAC SHA256)
    $ curl -H "X-MBX-APIKEY: vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" -X POST 'https://api.binance.com/api/v3/order' -d 'symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559&signature=c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71'

symbol=LTCBTC
&side=BUY
&type=LIMIT
&timeInForce=GTC
&quantity=1
&price=0.1
&recvWindow=5000
&timestamp=1499827319559

Example 2: As a query string

Example 2

HMAC SHA256 signature:

    $ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j"
    (stdin)= c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71

curl command:

    (HMAC SHA256)
   $ curl -H "X-MBX-APIKEY: vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" -X POST 'https://api.binance.com/api/v3/order?symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559&signature=c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71'

symbol=LTCBTC
&side=BUY
&type=LIMIT
&timeInForce=GTC
&quantity=1
&price=0.1
&recvWindow=5000
&timestamp=1499827319559

Example 3: Mixed query string and request body

Example 3

HMAC SHA256 signature:

   $ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTCquantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j"
    (stdin)= 0fd168b8ddb4876a0358a8d14d0c9f3da0e9b20c5d52b2a00fcf7d1c602f9a77

curl command:

    (HMAC SHA256)
    $ curl -H "X-MBX-APIKEY: vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" -X POST 'https://api.binance.com/api/v3/order?symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC' -d 'quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559&signature=0fd168b8ddb4876a0358a8d14d0c9f3da0e9b20c5d52b2a00fcf7d1c602f9a77'

symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC

quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559

Note that the signature is different in example 3. There is no & between "GTC" and "quantity=1".

SIGNED Endpoint Example for POST /api/v3/order - RSA Keys

For this example, the private key will be referenced as test-prv-key.pem

Key Value
apiKey CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ
Parameter Value
symbol BTCUSDT
side SELL
type LIMIT
timeInForce GTC
quantity 1
price 0.2
recvWindow 5000
timestamp 1668481559918

Signature payload (with the listed parameters):

symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2&timestamp=1668481559918&recvWindow=5000

Step 1: Construct the payload

Arrange the list of parameters into a string. Separate each parameter with a &.

Step 2: Compute the signature:

2.1 - Encode signature payload as ASCII data.

Step 2.2

 $ echo -n 'symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2&timestamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem

2.2 - Sign payload using RSASSA-PKCS1-v1_5 algorithm with SHA-256 hash function.

Step 2.3

$  echo -n 'symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2&timestamp=1668481559918&recvWindow=5000' | openssl dgst -sha256 -sign ./test-prv-key.pem | openssl enc -base64 -A
HZ8HOjiJ1s/igS9JA+n7+7Ti/ihtkRF5BIWcPIEluJP6tlbFM/Bf44LfZka/iemtahZAZzcO9TnI5uaXh3++lrqtNonCwp6/245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH+XxaCmR0WcvlKjNQnp12/eKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang/1WOq+Jaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT/fNnMRxFc7u+j3qI//5yuGuu14KR0MuQKKCSpViieD+fIti46sxPTsjSemoUKp0oXA==

2.3 - Encode output as base64 string.

Step 2.4

HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D

2.4 - Since the signature may contain / and =, this could cause issues with sending the request. So the signature has to be URL encoded.

Step 2.5

 curl -H "X-MBX-APIKEY: CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ" -X POST 'https://api.binance.com/api/v3/order?symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2&timestamp=1668481559918recvWindow=5000&signature=HZ8HOjiJ1s%2FigS9JA%2Bn7%2B7Ti%2FihtkRF5BIWcPIEluJP6tlbFM%2FBf44LfZka%2FiemtahZAZzcO9TnI5uaXh3%2B%2BlrqtNonCwp6%2F245UFWkiW1elpgtVAmJPbogcAv6rSlokztAfWk296ZJXzRDYAtzGH0gq7CgSJKfH%2BXxaCmR0WcvlKjNQnp12%2FeKXJYO4tDap8UCBLuyxDnR7oJKLHQHJLP0r0EAVOOSIbrFang%2F1WOq%2BJaq4Efc4XpnTgnwlBbWTmhWDR1pvS9iVEzcSYLHT%2FfNnMRxFc7u%2Bj3qI%2F%2F5yuGuu14KR0MuQKKCSpViieD%2BfIti46sxPTsjSemoUKp0oXA%3D%3D'

2.5 - curl command

Bash script

#!/usr/bin/env bash

# Set up authentication:
API_KEY="put your own API Key here"
PRIVATE_KEY_PATH="test-prv-key.pem"

# Set up the request:
API_METHOD="POST"
API_CALL="api/v3/order"
API_PARAMS="symbol=BTCUSDT&side=SELL&type=LIMIT&timeInForce=GTC&quantity=1&price=0.2"

# Sign the request:
timestamp=$(date +%s000)
api_params_with_timestamp="$API_PARAMS&timestamp=$timestamp"
signature=$(echo -n "$api_params_with_timestamp" \
            | openssl dgst -sha256 -sign "$PRIVATE_KEY_PATH" \
            | openssl enc -base64 -A)

# Send the request:
curl -H "X-MBX-APIKEY: $API_KEY" -X "$API_METHOD" \
    "https://api.binance.com/$API_CALL?$api_params_with_timestamp" \
    --data-urlencode "signature=$signature"

A sample Bash script containing similar steps is available in the right side.

SIGNED Endpoint Examples for POST /api/v3/order - Ed25519 Keys

Parameter Value
symbol BTCUSDT
side SELL
type LIMIT
timeInForce GTC
quantity 1
price 0.2
timestamp 1668481559918

Python script

#!/usr/bin/env python3

import base64
import requests
import time
from cryptography.hazmat.primitives.serialization import load_pem_private_key

# Set up authentication
API_KEY='put your own API Key here'
PRIVATE_KEY_PATH='test-prv-key.pem'

# Load the private key.
# In this example the key is expected to be stored without encryption,
# but we recommend using a strong password for improved security.
with open(PRIVATE_KEY_PATH, 'rb') as f:
    private_key = load_pem_private_key(data=f.read(),
                                       password=None)

# Set up the request parameters
params = {
    'symbol':       'BTCUSDT',
    'side':         'SELL',
    'type':         'LIMIT',
    'timeInForce':  'GTC',
    'quantity':     '1.0000000',
    'price':        '0.20',
}

# Timestamp the request
timestamp = int(time.time() * 1000) # UNIX timestamp in milliseconds
params['timestamp'] = timestamp

# Sign the request
payload = '&'.join([f'{param}={value}' for param, value in params.items()])
signature = base64.b64encode(private_key.sign(payload.encode('ASCII')))
params['signature'] = signature

# Send the request
headers = {
    'X-MBX-APIKEY': API_KEY,
}
response = requests.post(
    'https://api.binance.com/api/v3/order',
    headers=headers,
    data=params,
)
print(response.json())

A sample code in Python to show how to sign the payload with an Ed25519 key is available on the right side.


Public API Definitions

Terminology

These terms will be used throughout the documentation, so it is recommended especially for new users to read to help their understanding of the API.

ENUM definitions

Symbol status (status):

Account and Symbol Permissions (permissions):

Order status (status):

Status Description
NEW The order has been accepted by the engine.
PARTIALLY_FILLED A part of the order has been filled.
FILLED The order has been completed.
CANCELED The order has been canceled by the user.
PENDING_CANCEL Currently unused
REJECTED The order was not accepted by the engine and not processed.
EXPIRED The order was canceled according to the order type's rules (e.g. LIMIT FOK orders with no fill, LIMIT IOC or MARKET orders that partially fill) or by the exchange, (e.g. orders canceled during liquidation, orders canceled during maintenance)
EXPIRED_IN_MATCH The order was canceled by the exchange due to STP trigger. (e.g. an order with EXPIRE_TAKER will match with existing orders on the book with the same account or same tradeGroupId)

Order list Status (listStatusType):

Status Description
RESPONSE This is used when the ListStatus is responding to a failed action. (E.g. order list placement or cancellation)
EXEC_STARTED The order list has been placed or there is an update to the order list status.
ALL_DONE The order list has finished executing and thus no longer active.

Order list Order Status (listOrderStatus):

Status Description
EXECUTING Either an order list has been placed or there is an update to the status of the list.
ALL_DONE An order list has completed execution and thus no longer active.
REJECT The List Status is responding to a failed action either during order placement or order canceled.)

ContingencyType

AllocationType

WorkingFloor

Order types (orderTypes, type):

Order Response Type (newOrderRespType):

Order side (side):

Time in force (timeInForce):

This sets how long an order will be active before expiration.

Status Description
GTC Good Til Canceled

An order will be on the book unless the order is canceled.
IOC Immediate Or Cancel

An order will try to fill the order as much as it can before the order expires.
FOK Fill or Kill

An order will expire if the full order cannot be filled upon execution.

Kline/Candlestick chart intervals:

s-> seconds; m -> minutes; h -> hours; d -> days; w -> weeks; M -> months

Rate limiters (rateLimitType)

REQUEST_WEIGHT

    {
      "rateLimitType": "REQUEST_WEIGHT",
      "interval": "MINUTE",
      "intervalNum": 1,
      "limit": 6000
    }

ORDERS

    {
      "rateLimitType": "ORDERS",
      "interval": "SECOND",
      "intervalNum": 10,
      "limit": 100
    },
    {
      "rateLimitType": "ORDERS",
      "interval": "DAY",
      "intervalNum": 1,
      "limit": 200000
    }

RAW_REQUESTS

    {
      "rateLimitType": "RAW_REQUESTS",
      "interval": "MINUTE",
      "intervalNum": 5,
      "limit": 5000
    }

Rate limit intervals (interval)

STP Modes


Filters

Filters define trading rules on a symbol or an exchange. Filters come in two forms: symbol filters and exchange filters.

Symbol Filters

PRICE_FILTER

ExchangeInfo format:

  {
    "filterType": "PRICE_FILTER",
    "minPrice": "0.00000100",
    "maxPrice": "100000.00000000",
    "tickSize": "0.00000100"
  }

The PRICE_FILTER defines the price rules for a symbol. There are 3 parts:

Any of the above variables can be set to 0, which disables that rule in the price filter. In order to pass the price filter, the following must be true for price/stopPrice of the enabled rules:

PERCENT_PRICE

ExchangeInfo format:

  {
    "filterType": "PERCENT_PRICE",
    "multiplierUp": "1.3000",
    "multiplierDown": "0.7000",
    "avgPriceMins": 5
  }

The PERCENT_PRICE filter defines the valid range for the price based on the average of the previous trades. avgPriceMins is the number of minutes the average price is calculated over. 0 means the last price is used.

In order to pass the percent price, the following must be true for price:

PERCENT_PRICE_BY_SIDE

ExchangeInfo format:

    {
          "filterType": "PERCENT_PRICE_BY_SIDE",
          "bidMultiplierUp": "1.2",
          "bidMultiplierDown": "0.2",
          "askMultiplierUp": "5",
          "askMultiplierDown": "0.8",
          "avgPriceMins": 1
    }

The PERCENT_PRICE_BY_SIDE filter defines the valid range for the price based on the average of the previous trades.

avgPriceMins is the number of minutes the average price is calculated over. 0 means the last price is used.

There is a different range depending on whether the order is placed on the BUY side or the SELL side.

Buy orders will succeed on this filter if:

Sell orders will succeed on this filter if:

LOT_SIZE

ExchangeInfo format:

  {
    "filterType": "LOT_SIZE",
    "minQty": "0.00100000",
    "maxQty": "100000.00000000",
    "stepSize": "0.00100000"
  }

The LOT_SIZE filter defines the quantity (aka "lots" in auction terms) rules for a symbol. There are 3 parts:

In order to pass the lot size, the following must be true for quantity/icebergQty:

MIN_NOTIONAL

ExchangeInfo format:

  {
    "filterType": "MIN_NOTIONAL",
    "minNotional": "0.00100000",
    "applyToMarket": true,
    "avgPriceMins": 5
  }

The MIN_NOTIONAL filter defines the minimum notional value allowed for an order on a symbol. An order's notional value is the price * quantity. If the order is an Algo order (e.g. STOP_LOSS_LIMIT), then the notional value of the stopPrice * quantity will also be evaluated. If the order is an Iceberg Order, then the notional value of the price * icebergQty will also be evaluated. applyToMarket determines whether or not the MIN_NOTIONAL filter will also be applied to MARKET orders. Since MARKET orders have no price, the average price is used over the last avgPriceMins minutes. avgPriceMins is the number of minutes the average price is calculated over. 0 means the last price is used.

NOTIONAL

ExchangeInfo format:

{
   "filterType": "NOTIONAL",
   "minNotional": "10.00000000",
   "applyMinToMarket": false,
   "maxNotional": "10000.00000000",
   "applyMaxToMarket": false,
   "avgPriceMins": 5
}

The NOTIONAL filter defines the acceptable notional range allowed for an order on a symbol.



applyMinToMarket determines whether the minNotional will be applied to MARKET orders.

applyMaxToMarket determines whether the maxNotional will be applied to MARKET orders.

In order to pass this filter, the notional (price * quantity) has to pass the following conditions:

For MARKET orders, the average price used over the last avgPriceMins minutes will be used for calculation.

If the avgPriceMins is 0, then the last price will be used.

ICEBERG_PARTS

ExchangeInfo format:

  {
    "filterType": "ICEBERG_PARTS",
    "limit": 10
  }

The ICEBERG_PARTS filter defines the maximum parts an iceberg order can have. The number of ICEBERG_PARTS is defined as CEIL(qty / icebergQty).

MARKET_LOT_SIZE

ExchangeInfo format:

  {
    "filterType": "MARKET_LOT_SIZE",
    "minQty": "0.00100000",
    "maxQty": "100000.00000000",
    "stepSize": "0.00100000"
  }

The MARKET_LOT_SIZE filter defines the quantity (aka "lots" in auction terms) rules for MARKET orders on a symbol. There are 3 parts:

In order to pass the market lot size, the following must be true for quantity:

MAX_NUM_ORDERS

ExchangeInfo format:

  {
    "filterType": "MAX_NUM_ORDERS",
    "maxNumOrders": 25
  }

The MAX_NUM_ORDERS filter defines the maximum number of orders an account is allowed to have open on a symbol. Note that both "algo" orders and normal orders are counted for this filter.

MAX_NUM_ALGO_ORDERS

ExchangeInfo format:

  {
    "filterType": "MAX_NUM_ALGO_ORDERS",
    "maxNumAlgoOrders": 5
  }

The MAX_NUM_ALGO_ORDERS filter defines the maximum number of "algo" orders an account is allowed to have open on a symbol. "Algo" orders are STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.

MAX_NUM_ICEBERG_ORDERS

The MAX_NUM_ICEBERG_ORDERS filter defines the maximum number of ICEBERG orders an account is allowed to have open on a symbol. An ICEBERG order is any order where the icebergQty is > 0.

ExchangeInfo format:

  {
    "filterType": "MAX_NUM_ICEBERG_ORDERS",
    "maxNumIcebergOrders": 5
  }

MAX_POSITION

The MAX_POSITION filter defines the allowed maximum position an account can have on the base asset of a symbol. An account's position defined as the sum of the account's:

  1. free balance of the base asset
  2. locked balance of the base asset
  3. sum of the qty of all open BUY orders

BUY orders will be rejected if the account's position is greater than the maximum position allowed.

If an order's quantity can cause the position to overflow, this will also fail the MAX_POSITION filter.

ExchangeInfo format:

{
  "filterType":"MAX_POSITION",
  "maxPosition":"10.00000000"
}

TRAILING_DELTA

ExchangeInfo format:

    {
          "filterType": "TRAILING_DELTA",
          "minTrailingAboveDelta": 10,
          "maxTrailingAboveDelta": 2000,
          "minTrailingBelowDelta": 10,
          "maxTrailingBelowDelta": 2000
   }

The TRAILING_DELTA filter defines the minimum and maximum value for the parameter trailingDelta.

In order for a trailing stop order to pass this filter, the following must be true:

For STOP_LOSS BUY, STOP_LOSS_LIMIT_BUY,TAKE_PROFIT SELL and TAKE_PROFIT_LIMIT SELL orders:

For STOP_LOSS SELL, STOP_LOSS_LIMIT SELL, TAKE_PROFIT BUY, and TAKE_PROFIT_LIMIT BUY orders:

Exchange Filters

EXCHANGE_MAX_NUM_ORDERS

ExchangeInfo format:

  {
    "filterType": "EXCHANGE_MAX_NUM_ORDERS",
    "maxNumOrders": 1000
  }

The EXCHANGE_MAX_NUM_ORDERS filter defines the maximum number of orders an account is allowed to have open on the exchange. Note that both "algo" orders and normal orders are counted for this filter.

EXCHANGE_MAX_NUM_ALGO_ORDERS

ExchangeInfo format:

  {
    "filterType": "EXCHANGE_MAX_NUM_ALGO_ORDERS",
    "maxNumAlgoOrders": 200
  }

The EXCHANGE_MAX_NUM_ALGO_ORDERS filter defines the maximum number of "algo" orders an account is allowed to have open on the exchange. "Algo" orders are STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.

EXCHANGE_MAX_NUM_ICEBERG_ORDERS

The EXCHANGE_MAX_NUM_ICEBERG_ORDERS filter defines the maximum number of iceberg orders an account is allowed to have open on the exchange.

ExchangeInfo format:

{
  "filterType": "EXCHANGE_MAX_NUM_ICEBERG_ORDERS",
  "maxNumIcebergOrders": 10000
}

Wallet Endpoints

System Status (System)

Response

{ 
    "status": 0,              // 0: normal,1:system maintenance
    "msg": "normal"           // "normal", "system_maintenance"
}

GET /sapi/v1/system/status

Fetch system status.

Weight(IP): 1

All Coins' Information (USER_DATA)

Get information of coins (available for deposit and withdraw) for user.

Response:

[
    {
        "coin": "BTC",
        "depositAllEnable": true,
        "free": "0.08074558",
        "freeze": "0.00000000",
        "ipoable": "0.00000000",
        "ipoing": "0.00000000",
        "isLegalMoney": false,
        "locked": "0.00000000",
        "name": "Bitcoin",
        "networkList": [
            {
                "addressRegex": "^(bnb1)[0-9a-z]{38}$",
                "coin": "BTC",
                "depositDesc": "Wallet Maintenance, Deposit Suspended", // shown only when "depositEnable" is false.
                "depositEnable": false,
                "isDefault": false,        
                "memoRegex": "^[0-9A-Za-z\\-_]{1,120}$",
                "minConfirm": 1,  // min number for balance confirmation
                "name": "BEP2",
                "network": "BNB",            
                "specialTips": "Both a MEMO and an Address are required to successfully deposit your BEP2-BTCB tokens to Binance.",
                "unLockConfirm": 0,  // confirmation number for balance unlock 
                "withdrawDesc": "Wallet Maintenance, Withdrawal Suspended", // shown only when "withdrawEnable" is false.
                "withdrawEnable": false,
                "withdrawFee": "0.00000220",
                "withdrawIntegerMultiple": "0.00000001",
                "withdrawMax": "9999999999.99999999",
                "withdrawMin": "0.00000440",
                "sameAddress": true,  // If the coin needs to provide memo to withdraw
                "estimatedArrivalTime": 25,
                "busy": false,
                "contractAddressUrl": "https://bscscan.com/token/",
                "contractAddress": "0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c"
            },
            {
                "addressRegex": "^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$|^(bc1)[0-9A-Za-z]{39,59}$",
                "coin": "BTC",
                "depositEnable": true,
                "isDefault": true,
                "memoRegex": "",
                "minConfirm": 1, 
                "name": "BTC",
                "network": "BTC",
                "specialTips": "",
                "unLockConfirm": 2,
                "withdrawEnable": true,
                "withdrawFee": "0.00050000",
                "withdrawIntegerMultiple": "0.00000001",
                "withdrawMax": "750",
                "withdrawMin": "0.00100000",
                "sameAddress": false,
                "estimatedArrivalTime": 25,
                "busy": false,
                "contractAddressUrl": "",
                "contractAddress": ""
            }
        ],
        "storage": "0.00000000",
        "trading": true,
        "withdrawAllEnable": true,
        "withdrawing": "0.00000000"
    }
]

GET /sapi/v1/capital/config/getall

Weight(IP): 10

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Daily Account Snapshot (USER_DATA)

Response:

{
   "code":200, // 200 for success; others are error codes
   "msg":"", // error message
   "snapshotVos":[
      {
         "data":{
            "balances":[
               {
                  "asset":"BTC",
                  "free":"0.09905021",
                  "locked":"0.00000000"
               },
               {
                  "asset":"USDT",
                  "free":"1.89109409",
                  "locked":"0.00000000"
               }
            ],
            "totalAssetOfBtc":"0.09942700"
         },
         "type":"spot",
         "updateTime":1576281599000
      }
   ]
}

OR

{
   "code":200, // 200 for success; others are error codes
   "msg":"", // error message
   "snapshotVos":[
      {
         "data":{
            "marginLevel":"2748.02909813",
            "totalAssetOfBtc":"0.00274803",
            "totalLiabilityOfBtc":"0.00000100",
            "totalNetAssetOfBtc":"0.00274750",
            "userAssets":[
               {
                  "asset":"XRP",
                  "borrowed":"0.00000000",
                  "free":"1.00000000",
                  "interest":"0.00000000",
                  "locked":"0.00000000",
                  "netAsset":"1.00000000"
               }
            ]
         },
         "type":"margin",
         "updateTime":1576281599000
      }
   ]
}

OR

{
   "code":200, // 200 for success; others are error codes
   "msg":"", // error message
   "snapshotVos":[
      {
         "data":{
            "assets":[
               {
                  "asset":"USDT",
                  "marginBalance":"118.99782335", // Not real-time data, can ignore
                  "walletBalance":"120.23811389"
               }
            ],
            "position":[
               {
                  "entryPrice":"7130.41000000",
                  "markPrice":"7257.66239673",
                  "positionAmt":"0.01000000",
                  "symbol":"BTCUSDT",
                  "unRealizedProfit":"1.24029054"  // Only show the value at the time of opening the position
               }
            ]
         },
         "type":"futures",
         "updateTime":1576281599000
      }
   ]
}

GET /sapi/v1/accountSnapshot

Weight(IP): 2400

Parameters:

Name Type Mandatory Description
type STRING YES "SPOT", "MARGIN", "FUTURES"
startTime LONG NO
endTime LONG NO
limit INT NO min 7, max 30, default 7
recvWindow LONG NO
timestamp LONG YES

Disable Fast Withdraw Switch (USER_DATA)

Response:

{}

POST /sapi/v1/account/disableFastWithdrawSwitch

Weight(IP): 1

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Enable Fast Withdraw Switch (USER_DATA)

Response:

{}

POST /sapi/v1/account/enableFastWithdrawSwitch

Weight(IP): 1

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Withdraw(USER_DATA)

Response:

{
    "id":"7213fea8e94b4a5593d507237e5a555b"
}

POST /sapi/v1/capital/withdraw/apply

Submit a withdraw request.

Weight(UID): 600

Parameters:

Name Type Mandatory Description
coin STRING YES
withdrawOrderId STRING NO client id for withdraw
network STRING NO
address STRING YES
addressTag STRING NO Secondary address identifier for coins like XRP,XMR etc.
amount DECIMAL YES
transactionFeeFlag BOOLEAN NO When making internal transfer, true for returning the fee to the destination account; false for returning the fee back to the departure account. Default false.
name STRING NO Description of the address. The upper limit of the address book is 200. Exceeding the limit will cause withdrawal failure. Space in name should be encoded into %20.
walletType INTEGER NO The wallet type for withdraw,0-spot wallet ,1-funding wallet. Default walletType is the current "selected wallet" under wallet->Fiat and Spot/Funding->Deposit
recvWindow LONG NO
timestamp LONG YES

Deposit History (supporting network) (USER_DATA)

Response:

[
    {
        "id": "769800519366885376",
        "amount": "0.001",
        "coin": "BNB",
        "network": "BNB",
        "status": 0,
        "address": "bnb136ns6lfw4zs5hg4n85vdthaad7hq5m4gtkgf23",
        "addressTag": "101764890",
        "txId": "98A3EA560C6B3336D348B6C83F0F95ECE4F1F5919E94BD006E5BF3BF264FACFC",
        "insertTime": 1661493146000,
        "transferType": 0,
        "confirmTimes": "1/1",
        "unlockConfirm": 0,
        "walletType": 0
    },
    {
        "id": "769754833590042625",
        "amount":"0.50000000",
        "coin":"IOTA",
        "network":"IOTA",
        "status":1,
        "address":"SIZ9VLMHWATXKV99LH99CIGFJFUMLEHGWVZVNNZXRJJVWBPHYWPPBOSDORZ9EQSHCZAMPVAPGFYQAUUV9DROOXJLNW",
        "addressTag":"",
        "txId":"ESBFVQUTPIWQNJSPXFNHNYHSQNTGKRVKPRABQWTAXCDWOAKDKYWPTVG9BGXNVNKTLEJGESAVXIKIZ9999",
        "insertTime":1599620082000,
        "transferType":0,
        "confirmTimes": "1/1",
        "unlockConfirm": 0,
        "walletType": 0
    }
]

GET /sapi/v1/capital/deposit/hisrec

Fetch deposit history.

Weight(IP): 1

Parameters:

Name Type Mandatory Description
includeSource Boolean NO default false, if true source address for the transaction will be returned
coin STRING NO
status INT NO 0(0:pending,6: credited but cannot withdraw, 7=Wrong Deposit,8=Waiting User confirm, 1:success)
startTime LONG NO Default: 90 days from current timestamp
endTime LONG NO Default: present timestamp
offset INT NO Default:0
limit INT NO Default:1000, Max:1000
recvWindow LONG NO
timestamp LONG YES
txId STRING NO

Withdraw History (supporting network) (USER_DATA)

Response:

[
  {
    "id": "b6ae22b3aa844210a7041aee7589627c",  // Withdrawal id in Binance
    "amount": "8.91000000",   // withdrawal amount
    "transactionFee": "0.004", // transaction fee
    "coin": "USDT",
    "status": 6,
    "address": "0x94df8b352de7f46f64b01d3666bf6e936e44ce60",
    "txId": "0xb5ef8c13b968a406cc62a93a8bd80f9e9a906ef1b3fcf20a2e48573c17659268"   // withdrawal transaction id
    "applyTime": "2019-10-12 11:12:02",  // UTC time
    "network": "ETH",
    "transferType": 0 // 1 for internal transfer, 0 for external transfer   
    "withdrawOrderId": "WITHDRAWtest123", // // will not be returned if there's no withdrawOrderId for this withdraw.
    "info": "The address is not valid. Please confirm with the recipient",  // reason for withdrawal failure
    "confirmNo":3,  // confirm times for withdraw
    "walletType": 1,  //1: Funding Wallet 0:Spot Wallet
    "txKey": "",
    "completeTime": "2023-03-23 16:52:41" // complete UTC time when user's asset is deduct from withdrawing, only if status =  6(success)
  },
  {
    "id": "156ec387f49b41df8724fa744fa82719",
    "amount": "0.00150000",
    "transactionFee": "0.004",
    "coin": "BTC",
    "status": 6,
    "address": "1FZdVHtiBqMrWdjPyRPULCUceZPJ2WLCsB",
    "txId": "60fd9007ebfddc753455f95fafa808c4302c836e4d1eebc5a132c36c1d8ac354"
    "applyTime": "2019-09-24 12:43:45",
    "network": "BTC",
    "transferType": 0, 
    "info": "",
    "confirmNo": 2,
    "walletType": 1,
    "txKey": "",
    "completeTime": "2023-03-23 16:52:41" 
  }
]

GET /sapi/v1/capital/withdraw/history

Fetch withdraw history.

Weight(UID): 18000

Request Limit: 10 requests per second

Parameters:

Name Type Mandatory Description
coin STRING NO
withdrawOrderId STRING NO
status INT NO 0(0:Email Sent,1:Cancelled 2:Awaiting Approval 3:Rejected 4:Processing 5:Failure 6:Completed)
offset INT NO
limit INT NO Default: 1000, Max: 1000
startTime LONG NO Default: 90 days from current timestamp
endTime LONG NO Default: present timestamp
recvWindow LONG NO
timestamp LONG YES

Deposit Address (supporting network) (USER_DATA)

Response:

{
    "address": "1HPn8Rx2y6nNSfagQBKy27GB99Vbzg89wv",
    "coin": "BTC",
    "tag": "",
    "url": "https://btc.com/1HPn8Rx2y6nNSfagQBKy27GB99Vbzg89wv"
}

GET /sapi/v1/capital/deposit/address

Fetch deposit address with network.

Weight(IP): 10

Parameters:

Name Type Mandatory Description
coin STRING YES
network STRING NO
amount DECIMAL NO
recvWindow LONG NO
timestamp LONG YES

Account Status (USER_DATA)

Response:

{
    "data": "Normal"
}

GET /sapi/v1/account/status

Fetch account status detail.

Weight(IP): 1

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Account API Trading Status (USER_DATA)

Response:

{
    "data": {          // API trading status detail
            "isLocked": false,   // API trading function is locked or not
            "plannedRecoverTime": 0,  // If API trading function is locked, this is the planned recover time
            "triggerCondition": { 
                    "GCR": 150,  // Number of GTC orders
                    "IFER": 150, // Number of FOK/IOC orders
                    "UFR": 300   // Number of orders
            },
            "updateTime": 1547630471725   
    }
}

GET /sapi/v1/account/apiTradingStatus

Fetch account api trading status detail.

Weight(IP): 1

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

DustLog(USER_DATA)

Response

{
        "total": 8,   //Total counts of exchange
        "userAssetDribblets": [
            {
                "operateTime": 1615985535000,
                "totalTransferedAmount": "0.00132256",   // Total transfered BNB amount for this exchange.
                "totalServiceChargeAmount": "0.00002699",    //Total service charge amount for this exchange.
                "transId": 45178372831,
                "userAssetDribbletDetails": [           //Details of  this exchange.
                    {
                        "transId": 4359321,
                        "serviceChargeAmount": "0.000009",
                        "amount": "0.0009",
                        "operateTime": 1615985535000,
                        "transferedAmount": "0.000441",
                        "fromAsset": "USDT"
                    },
                    {
                        "transId": 4359321,
                        "serviceChargeAmount": "0.00001799",
                        "amount": "0.0009",
                        "operateTime": 1615985535000,
                        "transferedAmount": "0.00088156",
                        "fromAsset": "ETH"
                    }
                ]
            },
            {
                "operateTime":1616203180000,
                "totalTransferedAmount": "0.00058795",
                "totalServiceChargeAmount": "0.000012",
                "transId": 4357015,
                "userAssetDribbletDetails": [       
                    {
                        "transId": 4357015,
                        "serviceChargeAmount": "0.00001",
                        "amount": "0.001",
                        "operateTime": 1616203180000,
                        "transferedAmount": "0.00049",
                        "fromAsset": "USDT"
                    },
                    {
                        "transId": 4357015,
                        "serviceChargeAmount": "0.000002",         
                        "amount": "0.0001",
                        "operateTime": 1616203180000,
                        "transferedAmount": "0.00009795",
                        "fromAsset": "ETH"
                    }
                ]
            }
        ]
    }
}

GET /sapi/v1/asset/dribblet

Weight(IP): 1

Parameters:

Name Type Mandatory Description
accountType STRING NO SPOTor MARGIN,default SPOT
startTime LONG NO
endTime LONG NO
recvWindow LONG NO
timestamp LONG YES

Get Assets That Can Be Converted Into BNB (USER_DATA)

Response

{
    "details": [
        {
            "asset": "ADA",         
            "assetFullName": "ADA", 
            "amountFree": "6.21",   //Convertible amount
            "toBTC": "0.00016848",  //BTC amount
            "toBNB": "0.01777302",  //BNB amount(Not deducted commission fee)
            "toBNBOffExchange": "0.01741756", //BNB amount(Deducted commission fee)
            "exchange": "0.00035546" //Commission fee
        }
    ],
    "totalTransferBtc": "0.00016848",
    "totalTransferBNB": "0.01777302",
    "dribbletPercentage": "0.02"     //Commission fee
}  

POST /sapi/v1/asset/dust-btc

Weight(IP): 1

Parameters:

Name Type Mandatory Description
accountType STRING NO SPOTor MARGIN,default SPOT
recvWindow LONG NO
timestamp LONG YES

Dust Transfer (USER_DATA)

Response:

{
    "totalServiceCharge":"0.02102542",
    "totalTransfered":"1.05127099",
    "transferResult":[
        {
            "amount":"0.03000000",
            "fromAsset":"ETH",
            "operateTime":1563368549307,
            "serviceChargeAmount":"0.00500000",
            "tranId":2970932918,
            "transferedAmount":"0.25000000"
        },
        {
            "amount":"0.09000000",
            "fromAsset":"LTC",
            "operateTime":1563368549404,
            "serviceChargeAmount":"0.01548000",
            "tranId":2970932918,
            "transferedAmount":"0.77400000"
        },
        {
            "amount":"248.61878453",
            "fromAsset":"TRX",
            "operateTime":1563368549489,
            "serviceChargeAmount":"0.00054542",
            "tranId":2970932918,
            "transferedAmount":"0.02727099"
        }
    ]
}

POST /sapi/v1/asset/dust

Convert dust assets to BNB.

Weight(UID): 10

Parameters:

Name Type Mandatory Description
asset ARRAY YES The asset being converted. For example: asset=BTC,USDT
accountType STRING NO SPOTor MARGIN,default SPOT
recvWindow LONG NO
timestamp LONG YES

Asset Dividend Record (USER_DATA)

Response:

{
    "rows":[
        {
            "id":1637366104,
            "amount":"10.00000000",
            "asset":"BHFT",
            "divTime":1563189166000,
            "enInfo":"BHFT distribution",
            "tranId":2968885920
        },
        {
            "id":1631750237,
            "amount":"10.00000000",
            "asset":"BHFT",
            "divTime":1563189165000,
            "enInfo":"BHFT distribution",
            "tranId":2968885920
        }
    ],
    "total":2
}

GET /sapi/v1/asset/assetDividend

Query asset dividend record.

Weight(IP): 10

Parameters:

Name Type Mandatory Description
asset STRING NO
startTime LONG NO
endTime LONG NO
limit INT NO Default 20, max 500
recvWindow LONG NO
timestamp LONG YES

Asset Detail (USER_DATA)

Response:

{
        "CTR": {
            "minWithdrawAmount": "70.00000000", //min withdraw amount
            "depositStatus": false,//deposit status (false if ALL of networks' are false)
            "withdrawFee": 35, // withdraw fee
            "withdrawStatus": true, //withdraw status (false if ALL of networks' are false)
            "depositTip": "Delisted, Deposit Suspended" //reason
        },
        "SKY": {
            "minWithdrawAmount": "0.02000000",
            "depositStatus": true,
            "withdrawFee": 0.01,
            "withdrawStatus": true
        }   
}

GET /sapi/v1/asset/assetDetail

Fetch details of assets supported on Binance.

Weight(IP): 1

Parameters:

Name Type Mandatory Description
asset STRING NO
recvWindow LONG NO
timestamp LONG YES

Trade Fee (USER_DATA)

Response:

[
    {
        "symbol": "ADABNB",
        "makerCommission": "0.001",
        "takerCommission": "0.001"
    },
    {
        "symbol": "BNBBTC",
        "makerCommission": "0.001",
        "takerCommission": "0.001"
    }
]

GET /sapi/v1/asset/tradeFee

Fetch trade fee

Weight(IP): 1

Parameters:

Name Type Mandatory Description
symbol STRING NO
recvWindow LONG NO
timestamp LONG YES

User Universal Transfer (USER_DATA)

Response:

{
    "tranId":13526853623
}

POST /sapi/v1/asset/transfer

You need to enable Permits Universal Transfer option for the API Key which requests this endpoint.

Weight(UID): 900

Parameters:

Name Type Mandatory Description
type ENUM YES
asset STRING YES
amount DECIMAL YES
fromSymbol STRING NO
toSymbol STRING NO
recvWindow LONG NO
timestamp LONG YES

Query User Universal Transfer History (USER_DATA)

Response:

{
    "total":2,
    "rows":[
        {
            "asset":"USDT",
            "amount":"1",
            "type":"MAIN_UMFUTURE",
            "status": "CONFIRMED", // status: CONFIRMED / FAILED / PENDING
            "tranId": 11415955596,
            "timestamp":1544433328000
        },
        {
            "asset":"USDT",
            "amount":"2",
            "type":"MAIN_UMFUTURE",
            "status": "CONFIRMED",
            "tranId": 11366865406,
            "timestamp":1544433328000
        }
    ]
}

GET /sapi/v1/asset/transfer

Weight(IP): 1

Parameters:

Name Type Mandatory Description
type ENUM YES
startTime LONG NO
endTime LONG NO
current INT NO Default 1
size INT NO Default 10, Max 100
fromSymbol STRING NO
toSymbol STRING NO
recvWindow LONG NO
timestamp LONG YES

Funding Wallet (USER_DATA)

Response

[
    {
        "asset": "USDT",
        "free": "1",    // avalible balance
        "locked": "0",  // locked asset
        "freeze": "0",  // freeze asset
        "withdrawing": "0",  
        "btcValuation": "0.00000091"  
    }
]

POST /sapi/v1/asset/get-funding-asset

Weight(IP): 1

Parameters:

Name Type Mandatory Description
asset STRING NO
needBtcValuation STRING NO true or false
recvWindow LONG NO
timestamp LONG YES

User Asset (USER_DATA)

Response

[
  {
    "asset": "AVAX",
    "free": "1",
    "locked": "0",
    "freeze": "0",
    "withdrawing": "0",
    "ipoable": "0",
    "btcValuation": "0"
  },
  {
    "asset": "BCH",
    "free": "0.9",
    "locked": "0",
    "freeze": "0",
    "withdrawing": "0",
    "ipoable": "0",
    "btcValuation": "0"
  },
  {
    "asset": "BNB",
    "free": "887.47061626",
    "locked": "0",
    "freeze": "10.52",
    "withdrawing": "0.1",
    "ipoable": "0",
    "btcValuation": "0"
  },
  {
    "asset": "BUSD",
    "free": "9999.7",
    "locked": "0",
    "freeze": "0",
    "withdrawing": "0",
    "ipoable": "0",
    "btcValuation": "0"
  },
  {
    "asset": "SHIB",
    "free": "532.32",
    "locked": "0",
    "freeze": "0",
    "withdrawing": "0",
    "ipoable": "0",
    "btcValuation": "0"
  },
  {
    "asset": "USDT",
    "free": "50300000001.44911105",
    "locked": "0",
    "freeze": "0",
    "withdrawing": "0",
    "ipoable": "0",
    "btcValuation": "0"
  },
  {
    "asset": "WRZ",
    "free": "1",
    "locked": "0",
    "freeze": "0",
    "withdrawing": "0",
    "ipoable": "0",
    "btcValuation": "0"
  }
]

POST /sapi/v3/asset/getUserAsset

Get user assets, just for positive data.

Weight(IP): 5

Parameters:

Name Type Mandatory Description
asset STRING NO If asset is blank, then query all positive assets user have.
needBtcValuation BOOLEAN NO Whether need btc valuation or not.
recvWindow LONG NO
timestamp LONG YES

BUSD Convert (TRADE)

Response

{
  "tranId": 118263407119,
  "status": "S"
}

POST /sapi/v1/asset/convert-transfer

Convert transfer, convert between BUSD and stablecoins.

Weight(UID): 5

Parameters:

Name Type Mandatory Description
clientTranId STRING YES The unique user-defined transaction id, min length 20
asset STRING YES The current asset
amount BigDecimal YES The amount must be positive number
targetAsset String YES Target asset you want to convert
accountType String NO Only MAIN and CARD, default MAIN

BUSD Convert History (USER_DATA)

Response

{
  "total":3,
  "rows":
  [
    {
      "tranId":118263615991,
      "type":244,
      "time":1664442078000,
      "deductedAsset":"BUSD",
      "deductedAmount":"1",
      "targetAsset":"USDC",
      "targetAmount":"1",
      "status":"S",
      "accountType":"MAIN"
    },{
      "tranId":118263598801,
      "type":244,
      "time":1664442061000,
      "deductedAsset":"BUSD",
      "deductedAmount":"1",
      "targetAsset":"USDC",
      "targetAmount":"1",
      "status":"S",
      "accountType":"MAIN"
    },{
      "tranId":118263407119,
      "type":244,
      "time":1664441820000,
      "deductedAsset":"BUSD",
      "deductedAmount":"1",
      "targetAsset":"USDC",
      "targetAmount":"1",
      "status":"S",
      "accountType":"MAIN"
    }
  ]
}

GET /sapi/v1/asset/convert-transfer/queryByPage

Weight(UID): 5

Parameters:

Name Type Mandatory Description
tranId LONG NO The transaction id
clientTranId STRING NO The user-defined transaction id
asset STRING NO If it is blank, we will match deducted asset and target asset.
startTime LONG YES inclusive, unit: ms
endTime LONG YES exclusive, unit: ms
accountType STRING NO MAIN: main account. CARD: funding account. If it is blank, we will query spot and card wallet, otherwise, we just query the corresponding wallet
current INTEGER NO current page, default 1, the min value is 1
size INTEGER NO page size, default 10, the max value is 100

Get Cloud-Mining payment and refund history (USER_DATA)

Response

{
  "total":5,
  "rows":[
    {"createTime":1667880112000,"tranId":121230610120,"type":248,"asset":"USDT","amount":"25.0068","status":"S"},
    {"createTime":1666776366000,"tranId":119991507468,"type":249,"asset":"USDT","amount":"0.027","status":"S"},
    {"createTime":1666764505000,"tranId":119977966327,"type":248,"asset":"USDT","amount":"0.027","status":"S"},
    {"createTime":1666758189000,"tranId":119973601721,"type":248,"asset":"USDT","amount":"0.018","status":"S"},
    {"createTime":1666757278000,"tranId":119973028551,"type":248,"asset":"USDT","amount":"0.018","status":"S"}
  ]
}

GET /sapi/v1/asset/ledger-transfer/cloud-mining/queryByPage

The query of Cloud-Mining payment and refund history

Weight(UID): 600

Parameters:

Name Type Mandatory Description
tranId LONG NO The transaction id
clientTranId STRING NO The unique flag
asset STRING NO If it is blank, we will query all assets
startTime LONG YES inclusive, unit: ms
endTime LONG YES exclusive, unit: ms
current INTEGER NO current page, default 1, the min value is 1
size INTEGER NO page size, default 10, the max value is 100

Get API Key Permission (USER_DATA)

Response

{
  "ipRestrict":false, 
  "createTime":1698645219000,
  "enableInternalTransfer":false,  // This option authorizes this key to transfer funds between your master account and your sub account instantly
  "enableFutures":false,   //  The Futures API cannot be used if the API key was created before the Futures account was opened, or if you have enabled portfolio margin.
  "enablePortfolioMarginTrading":true,  //  API Key created before your activate portfolio margin does not support portfolio margin API service
  "enableVanillaOptions":false,  //  Authorizes this key to Vanilla options trading
  "permitsUniversalTransfer":false, // Authorizes this key to be used for a dedicated universal transfer API to transfer multiple supported currencies. Each business's own transfer API rights are not affected by this authorization
  "enableReading":true, 
  "enableSpotAndMarginTrading":false, // Spot and margin trading
  "enableWithdrawals":false, // This option allows you to withdraw via API. You must apply the IP Access Restriction filter in order to enable withdrawals
  "enableMargin":false  //  This option can be adjusted after the Cross Margin account transfer is completed
}

GET /sapi/v1/account/apiRestrictions

Weight(IP): 1

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Query auto-converting stable coins (USER_DATA)

Response:

{
  "convertEnabled": true,
  "coins": [
    "USDC",
    "USDP",
    "TUSD"
  ],
  "exchangeRates": {
    "USDC": "1",
    "TUSD": "1",
    "USDP": "1"
  }
}

GET /sapi/v1/capital/contract/convertible-coins

Get a user's auto-conversion settings in deposit/withdrawal

Weight(UID): 600

Parameters: None

Switch on/off BUSD and stable coins conversion (USER_DATA)

Response: Returns code 200 on success without body.

POST /sapi/v1/capital/contract/convertible-coins

User can use it to turn on or turn off the BUSD auto-conversion from/to a specific stable coin.

Weight(UID): 600

Parameters:

Name Type Mandatory Description
coin STRING YES Must be USDC, USDP or TUSD
enable BOOLEAN YES true: turn on the auto-conversion. false: turn off the auto-conversion

One click arrival deposit apply (for expired address deposit) (USER_DATA)

Response:

{
    "code": "000000",
    "message": "success",
    "data":true,
    "success": true
}

POST /sapi/v1/capital/deposit/credit-apply

Apply deposit credit for expired address (One click arrival)

Weight(IP): 1

Parameters:

Name Type Mandatory Description
depositId LONG NO Deposit record Id, priority use
txId STRING NO Deposit txId, used when depositId is not specified
subAccountId LONG NO Sub-accountId of Cloud user
subUserId LONG NO Sub-userId of parent user

Fetch deposit address list with network(USER_DATA)

Response:

[
  {
    "coin": "ETH",
    "address": "0xD316E95Fd9E8E237Cb11f8200Babbc5D8D177BA4",
    "tag":"",
    "isDefault": 0
  }, 
  {
    "coin": "ETH",
    "address": "0xD316E95Fd9E8E237Cb11f8200Babbc5D8D177BA4",
    "tag":"",
    "isDefault": 0
  }, 
  {
    "coin": "ETH",
    "address": "0x00003ada75e7da97ba0db2fcde72131f712455e2",
    "tag":"",
    "isDefault": 1  //'isDefault' is 1 means the address is default, same as shown in the app.
  }
]

GET /sapi/v1/capital/deposit/address/list

Fetch deposit address list with network.

Weight(IP): 10

Parameters:

Name Type Mandatory Description
coin STRING YES coin refers to the parent network address format that the address is using
network STRING NO
timestamp LONG YES

Query User Wallet Balance (USER_DATA)

Response:

[
  {
    "activate": true,
    "balance": "0",
    "walletName": "Spot"
  }, 
  {
    "activate": true,
    "balance": "0",
    "walletName": "Funding"
  }, 
  {
    "activate": true,
    "balance": "0",
    "walletName": "Cross Margin"
  }, 
  {
    "activate": true,
    "balance": "0",
    "walletName": "Isolated Margin"
  }, 
  {
    "activate": true,
    "balance": "0.71842752",
    "walletName": "USDⓈ-M Futures"
  }, 
  {
    "activate": true,
    "balance": "0",
    "walletName": "COIN-M Futures"
  }, 
  {
    "activate": true,
    "balance": "0",
    "walletName": "Earn"
  }, 
  {
    "activate": false,
    "balance": "0",
    "walletName": "Options"
  }
]

GET /sapi/v1/asset/wallet/balance

Query User Wallet Balance

Weight(IP): 60

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Query User Delegation History(For Master Account)(USER_DATA)

Response:

{
    "total": 3316,
    "rows": [
      {
        "clientTranId": "293915932290879488",
        "transferType": "Undelegate",
        "asset": "ETH",
        "amount": "1",
        "time": 1695205406000
      }, 
      {
        "clientTranId": "293915892281413632",
        "transferType": "Delegate",
        "asset": "ETH",
        "amount": "1",
        "time": 1695205396000
      }
    ]
}

GET /sapi/v1/asset/custody/transfer-history

Query User Delegation History

Weight(IP): 60

Parameters:

Name Type Mandatory Description
email STRING YES
startTime LONG YES
endTime LONG YES
type ENUM NO Delegate/Undelegate
asset STRING NO
current INTEGER NO default 1
size INTEGER NO default 10, max 100
recvWindow LONG NO
timestamp LONG YES

Get symbols delist schedule for spot (MARKET_DATA)

GET /sapi/v1/spot/delist-schedule

Get symbols delist schedule for spot

Response:

[
  {
    "delistTime": 1686161202000,
    "symbols": [
      "ADAUSDT",
      "BNBUSDT"
    ]
  },
  {
    "delistTime": 1686222232000,
    "symbols": [
      "ETHUSDT"
    ]
  }
]

Weight(IP): 100

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Fetch withdraw address list (USER_DATA)

GET /sapi/v1/capital/withdraw/address/list

Fetch withdraw address list

Response:

[
  {
    "address": "string",
    "addressTag": "string",
    "coin": "string",
    "name": "string",        //is a user-defined name
    "network": "string",
    "origin": "string",      //if originType=='others', the address source manually filled in by the user
    "originType": "string",  //Address source type
    "whiteStatus": true      //Is it whitelisted
  }
]

Weight(IP): 10

Account info (USER_DATA)

GET /sapi/v1/account/info

Fetch account info detail.

Response:

{
  "vipLevel": 0,
  "isMarginEnabled": true,     // true or false for margin
  "isFutureEnabled": true      // true or false for futures.
}

Weight(IP): 1

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Sub-Account Endpoints

Create a Virtual Sub-account(For Master Account)

Response:

{
    "email":"addsdd_virtual@aasaixwqnoemail.com"
}

POST /sapi/v1/sub-account/virtualSubAccount

Weight(IP): 1

Parameters:

Name Type Mandatory Description
subAccountString STRING YES Please input a string. We will create a virtual email using that string for you to register
recvWindow LONG NO
timestamp LONG YES

Query Sub-account List (For Master Account)

Response:

{
    "subAccounts":[
        {
            "email":"testsub@gmail.com",
            "isFreeze":false,
            "createTime":1544433328000,
            "isManagedSubAccount": false,
            "isAssetManagementSubAccount": false
        },
        {
            "email":"virtual@oxebmvfonoemail.com",
            "isFreeze":false,
            "createTime":1544433328000,
            "isManagedSubAccount": false,
            "isAssetManagementSubAccount": false
        }
    ]
}

GET /sapi/v1/sub-account/list

Weight(IP): 1

Parameters:

Name Type Mandatory Description
email STRING NO Sub-account email
isFreeze STRING NO true or false
page INT NO Default value: 1
limit INT NO Default value: 1, Max value: 200
recvWindow LONG NO
timestamp LONG YES

Query Sub-account Spot Asset Transfer History (For Master Account)

Response:

[
    {
        "from":"aaa@test.com",
        "to":"bbb@test.com",
        "asset":"BTC",
        "qty":"10",
        "status": "SUCCESS",
        "tranId": 6489943656,
        "time":1544433328000
    },
    {
        "from":"bbb@test.com",
        "to":"ccc@test.com",
        "asset":"ETH",
        "qty":"2",
        "status": "SUCCESS",
        "tranId": 6489938713,
        "time":1544433328000
    }
]

GET /sapi/v1/sub-account/sub/transfer/history

Weight(IP): 1

Parameters:

Name Type Mandatory Description
fromEmail STRING NO
toEmail STRING NO
startTime LONG NO
endTime LONG NO
page INT NO Default value: 1
limit INT NO Default value: 500
recvWindow LONG NO
timestamp LONG YES

Query Sub-account Futures Asset Transfer History (For Master Account)

Response

{
    "success":true,
    "futuresType": 2,
    "transfers":[
        {
            "from":"aaa@test.com",
            "to":"bbb@test.com",
            "asset":"BTC",
            "qty":"1",
            "tranId":11897001102,
            "time":1544433328000
        },
        {
            "from":"bbb@test.com",
            "to":"ccc@test.com",
            "asset":"ETH",
            "qty":"2",
            "tranId":11631474902,
            "time":1544433328000
        }
    ]
}

GET /sapi/v1/sub-account/futures/internalTransfer

Weight(IP): 1

Parameters:

Name Type Mandatory Description
email STRING YES Sub-account email
futuresType LONG YES 1:USDT-margined Futures,2: Coin-margined Futures
startTime LONG NO Default return the history with in 100 days
endTime LONG NO Default return the history with in 100 days
page INT NO Default value: 1
limit INT NO Default value: 50, Max value: 500
recvWindow LONG NO
timestamp LONG YES

Sub-account Futures Asset Transfer (For Master Account)

Response

{
    "success":true,
    "txnId":"2934662589"
}

POST /sapi/v1/sub-account/futures/internalTransfer

Weight(IP): 1

Parameters:

Name Type Mandatory Description
fromEmail STRING YES Sender email
toEmail STRING YES Recipient email
futuresType LONG YES 1:USDT-margined Futures,2: Coin-margined Futures
asset STRING YES
amount DECIMAL YES
recvWindow LONG NO
timestamp LONG YES

Query Sub-account Assets (For Master Account)

Response:

{
    "balances":[
        {
            "asset":"ADA",
            "free":10000,
            "locked":0
        },
        {
            "asset":"BNB",
            "free":10003,
            "locked":0
        },
        {
            "asset":"BTC",
            "free":11467.6399,
            "locked":0
        },
        {
            "asset":"ETH",
            "free":10004.995,
            "locked":0
        },
        {
            "asset":"USDT",
            "free":11652.14213,
            "locked":0
        }
    ]
}

GET /sapi/v3/sub-account/assets

Fetch sub-account assets

Weight(UID): 60

Parameters:

Name Type Mandatory Description
email STRING YES Sub account email
recvWindow LONG NO
timestamp LONG YES

Query Sub-account Spot Assets Summary (For Master Account)

Response:

{
    "totalCount":2,
    "masterAccountTotalAsset": "0.23231201",
    "spotSubUserAssetBtcVoList":[
        {
            "email":"sub123@test.com",
            "totalAsset":"9999.00000000"
        },
        {
            "email":"test456@test.com",
            "totalAsset":"0.00000000"
        }
    ]
}

Get BTC valued asset summary of subaccounts.

GET /sapi/v1/sub-account/spotSummary

Weight(IP): 1

Parameters:

Name Type Mandatory Description
email STRING NO Sub account email
page LONG NO default 1
size LONG NO default 10, max 20
recvWindow LONG NO
timestamp LONG YES

Get Sub-account Deposit Address (For Master Account)

Response:

{
    "address":"TDunhSa7jkTNuKrusUTU1MUHtqXoBPKETV",
    "coin":"USDT",
    "tag":"",
    "url":"https://tronscan.org/#/address/TDunhSa7jkTNuKrusUTU1MUHtqXoBPKETV"
}

GET /sapi/v1/capital/deposit/subAddress

Fetch sub-account deposit address

Weight(IP): 1

Parameters:

Name Type Mandatory Description
email STRING YES Sub account email
coin STRING YES
network STRING NO
amount DECIMAL NO
recvWindow LONG NO
timestamp LONG YES

Get Sub-account Deposit History (For Master Account)

Response:

[
    {
        "id": "769800519366885376",
        "amount": "0.001",
        "coin": "BNB",
        "network": "BNB",
        "status": 0,
        "address": "bnb136ns6lfw4zs5hg4n85vdthaad7hq5m4gtkgf23",
        "addressTag": "101764890",
        "txId": "98A3EA560C6B3336D348B6C83F0F95ECE4F1F5919E94BD006E5BF3BF264FACFC",
        "insertTime": 1661493146000,
        "transferType": 0,
        "confirmTimes": "1/1",
        "unlockConfirm": 0,
        "walletType": 0
    },
    {
        "id": "769754833590042625",
        "amount":"0.50000000",
        "coin":"IOTA",
        "network":"IOTA",
        "status":1,
        "address":"SIZ9VLMHWATXKV99LH99CIGFJFUMLEHGWVZVNNZXRJJVWBPHYWPPBOSDORZ9EQSHCZAMPVAPGFYQAUUV9DROOXJLNW",
        "addressTag":"",
        "txId":"ESBFVQUTPIWQNJSPXFNHNYHSQNTGKRVKPRABQWTAXCDWOAKDKYWPTVG9BGXNVNKTLEJGESAVXIKIZ9999",
        "insertTime":1599620082000,
        "transferType":0,
        "confirmTimes": "1/1",
        "unlockConfirm": 0,
        "walletType": 0
    }
]

GET /sapi/v1/capital/deposit/subHisrec

Fetch sub-account deposit history

Weight(IP): 1

Parameters:

Name Type Mandatory Description
email STRING YES Sub account email
coin STRING NO
status INT NO 0(0:pending,6: credited but cannot withdraw,7:Wrong Deposit,8:Waiting User confirm,1:success)
startTime LONG NO
endTime LONG NO
limit INT NO
offset INT NO default:0
recvWindow LONG NO
timestamp LONG YES
txId STRING NO

Get Sub-account's Status on Margin/Futures (For Master Account)

Response

[
    {
        "email":"123@test.com",      // user email
        "isSubUserEnabled": true,    // true or false
        "isUserActive": true,        // true or false
        "insertTime": 1570791523523,  // sub account create time
        "isMarginEnabled": true,     // true or false for margin
        "isFutureEnabled": true,      // true or false for futures.
        "mobile": 1570791523523      // user mobile number
    }
]

GET /sapi/v1/sub-account/status

Weight(IP): 10

Parameters:

Name Type Mandatory Description
email STRING NO Sub-account email
recvWindow LONG NO
timestamp LONG YES

Enable Margin for Sub-account (For Master Account)

Response

{

    "email":"123@test.com",
    "isMarginEnabled": true

}

POST /sapi/v1/sub-account/margin/enable

Weight(IP): 1

Parameters:

Name Type Mandatory Description
email STRING YES Sub-account email
recvWindow LONG NO
timestamp LONG YES

Get Detail on Sub-account's Margin Account (For Master Account)

Response

{
      "email":"123@test.com",
      "marginLevel": "11.64405625",
      "totalAssetOfBtc": "6.82728457",
      "totalLiabilityOfBtc": "0.58633215",
      "totalNetAssetOfBtc": "6.24095242",
      "marginTradeCoeffVo": 
            {
                "forceLiquidationBar": "1.10000000",  // Liquidation margin ratio
                "marginCallBar": "1.50000000",        // Margin call margin ratio
                "normalBar": "2.00000000"             // Initial margin ratio
            },
      "marginUserAssetVoList": [
          {
              "asset": "BTC",
              "borrowed": "0.00000000",
              "free": "0.00499500",
              "interest": "0.00000000",
              "locked": "0.00000000",
              "netAsset": "0.00499500"
          },
          {
              "asset": "BNB",
              "borrowed": "201.66666672",
              "free": "2346.50000000",
              "interest": "0.00000000",
              "locked": "0.00000000",
              "netAsset": "2144.83333328"
          },
          {
              "asset": "ETH",
              "borrowed": "0.00000000",
              "free": "0.00000000",
              "interest": "0.00000000",
              "locked": "0.00000000",
              "netAsset": "0.00000000"
          },
          {
              "asset": "USDT",
              "borrowed": "0.00000000",
              "free": "0.00000000",
              "interest": "0.00000000",
              "locked": "0.00000000",
              "netAsset": "0.00000000"
          }
      ]
}

GET /sapi/v1/sub-account/margin/account

Weight(IP): 10

Parameters:

Name Type Mandatory Description
email STRING YES Sub-account email
recvWindow LONG NO
timestamp LONG YES

Get Summary of Sub-account's Margin Account (For Master Account)

Response

{
    "totalAssetOfBtc": "4.33333333", 
    "totalLiabilityOfBtc": "2.11111112", 
    "totalNetAssetOfBtc": "2.22222221",
    "subAccountList":[
        {
            "email":"123@test.com",
            "totalAssetOfBtc": "2.11111111",
            "totalLiabilityOfBtc": "1.11111111",
            "totalNetAssetOfBtc": "1.00000000"
        },
        { 
            "email":"345@test.com",
            "totalAssetOfBtc": "2.22222222", 
            "totalLiabilityOfBtc": "1.00000001", 
            "totalNetAssetOfBtc": "1.22222221"
        }
    ]
}

GET /sapi/v1/sub-account/margin/accountSummary

Weight(IP): 10

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Enable Futures for Sub-account (For Master Account)

Response

{

    "email":"123@test.com",
    "isFuturesEnabled": true  // true or false

}

POST /sapi/v1/sub-account/futures/enable

Weight(IP): 1

Parameters:

Name Type Mandatory Description
email STRING YES Sub-account email
recvWindow LONG NO
timestamp LONG YES

Get Detail on Sub-account's Futures Account (For Master Account)

Response


{
    "email": "abc@test.com",
    "asset": "USDT",
    "assets":[
        {
            "asset": "USDT",
            "initialMargin": "0.00000000",
            "maintenanceMargin": "0.00000000",
            "marginBalance": "0.88308000",
            "maxWithdrawAmount": "0.88308000",
            "openOrderInitialMargin": "0.00000000",
            "positionInitialMargin": "0.00000000",
            "unrealizedProfit": "0.00000000",
            "walletBalance": "0.88308000"
         }
    ],
    "canDeposit": true,
    "canTrade": true,
    "canWithdraw": true,
    "feeTier": 2,
    "maxWithdrawAmount": "0.88308000",
    "totalInitialMargin": "0.00000000",
    "totalMaintenanceMargin": "0.00000000",
    "totalMarginBalance": "0.88308000",
    "totalOpenOrderInitialMargin": "0.00000000",
    "totalPositionInitialMargin": "0.00000000",
    "totalUnrealizedProfit": "0.00000000",
    "totalWalletBalance": "0.88308000",
    "updateTime": 1576756674610
 }

GET /sapi/v1/sub-account/futures/account

Weight(IP): 10

Parameters:

Name Type Mandatory Description
email STRING YES Sub-account email
recvWindow LONG NO
timestamp LONG YES

Get Summary of Sub-account's Futures Account (For Master Account)

Response

{
    "totalInitialMargin": "9.83137400", 
    "totalMaintenanceMargin": "0.41568700", 
    "totalMarginBalance": "23.03235621", 
    "totalOpenOrderInitialMargin": "9.00000000",
    "totalPositionInitialMargin": "0.83137400",
    "totalUnrealizedProfit": "0.03219710",
    "totalWalletBalance": "22.15879444",
    "asset": "USD", 
    "subAccountList":[
        {
            "email": "123@test.com",
            "totalInitialMargin": "9.00000000", 
            "totalMaintenanceMargin": "0.00000000", 
            "totalMarginBalance": "22.12659734", 
            "totalOpenOrderInitialMargin": "9.00000000",
            "totalPositionInitialMargin": "0.00000000",
            "totalUnrealizedProfit": "0.00000000",
            "totalWalletBalance": "22.12659734",
            "asset": "USD" 
        },
        { 
            "email": "345@test.com",
            "totalInitialMargin": "0.83137400", 
            "totalMaintenanceMargin": "0.41568700", 
            "totalMarginBalance": "0.90575887", 
            "totalOpenOrderInitialMargin": "0.00000000",
            "totalPositionInitialMargin": "0.83137400",
            "totalUnrealizedProfit": "0.03219710",
            "totalWalletBalance": "0.87356177",
            "asset": "USD"
        }
    ]
}

GET /sapi/v1/sub-account/futures/accountSummary

Weight(IP): 1

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Get Futures Position-Risk of Sub-account (For Master Account)

Response

[
    {
        "entryPrice": "9975.12000",
        "leverage": "50",              // current initial leverage
        "maxNotional": "1000000",      // notional value limit of current initial leverage
        "liquidationPrice": "7963.54",
        "markPrice": "9973.50770517",
        "positionAmount": "0.010",
        "symbol": "BTCUSDT",
        "unrealizedProfit": "-0.01612295"
    }
]

GET /sapi/v1/sub-account/futures/positionRisk

Weight(IP): 10

Parameters:

Name Type Mandatory Description
email STRING YES Sub-account email
recvWindow LONG NO
timestamp LONG YES

Futures Transfer for Sub-account (For Master Account)

Response

{
    "txnId":"2966662589"
}

POST /sapi/v1/sub-account/futures/transfer

Weight(IP): 1

Parameters:

Name Type Mandatory Description
email STRING YES Sub-account email
asset STRING YES The asset being transferred, e.g., USDT
amount DECIMAL YES The amount to be transferred
type INT YES 1: transfer from subaccount's spot account to its USDT-margined futures account 2: transfer from subaccount's USDT-margined futures account to its spot account 3: transfer from subaccount's spot account to its COIN-margined futures account 4:transfer from subaccount's COIN-margined futures account to its spot account
recvWindow LONG NO
timestamp LONG YES

Margin Transfer for Sub-account (For Master Account)

Response

{
    "txnId":"2966662589"
}

POST /sapi/v1/sub-account/margin/transfer

Weight(IP): 1

Parameters:

Name Type Mandatory Description
email STRING YES Sub-account email
asset STRING YES The asset being transferred, e.g., BTC
amount DECIMAL YES The amount to be transferred
type INT YES 1: transfer from subaccount's spot account to margin account 2: transfer from subaccount's margin account to its spot account
recvWindow LONG NO
timestamp LONG YES

Transfer to Sub-account of Same Master (For Sub-account)

Response

{
    "txnId":"2966662589"
}

POST /sapi/v1/sub-account/transfer/subToSub

Weight(IP): 1

Parameters:

Name Type Mandatory Description
toEmail STRING YES Sub-account email
asset STRING YES
amount DECIMAL YES
recvWindow LONG NO
timestamp LONG YES

Transfer to Master (For Sub-account)

Response

{
    "txnId":"2966662589"
}

POST /sapi/v1/sub-account/transfer/subToMaster

Weight(IP): 1

Parameters:

Name Type Mandatory Description
asset STRING YES
amount DECIMAL YES
recvWindow LONG NO
timestamp LONG YES

Sub-account Transfer History (For Sub-account)

Response

[
  {
    "counterParty":"master",
    "email":"master@test.com",
    "type":1,  // 1 for transfer in, 2 for transfer out
    "asset":"BTC",
    "qty":"1",
    "fromAccountType":"SPOT",
    "toAccountType":"SPOT",
    "status":"SUCCESS", // status: PROCESS / SUCCESS / FAILURE
    "tranId":11798835829,
    "time":1544433325000
  },
  {
    "counterParty":"subAccount",
    "email":"sub2@test.com",
    "type":1,                                 
    "asset":"ETH",
    "qty":"2",
    "fromAccountType":"SPOT",
    "toAccountType":"COIN_FUTURE",
    "status":"SUCCESS",
    "tranId":11798829519,
    "time":1544433326000
  }
]

GET /sapi/v1/sub-account/transfer/subUserHistory

Weight(IP): 1

Parameters:

Name Type Mandatory Description
asset STRING NO If not sent, result of all assets will be returned
type INT NO 1: transfer in, 2: transfer out
startTime LONG NO
endTime LONG NO
limit INT NO Default 500
returnFailHistory BOOLEAN NO Default False, return PROCESS and SUCCESS status history; If True,return PROCESS and SUCCESS and FAILURE status history
recvWindow LONG NO
timestamp LONG YES

Universal Transfer (For Master Account)

Response

{
    "tranId":11945860693,
    "clientTranId":"test"
}

POST /sapi/v1/sub-account/universalTransfer

Weight(IP): 1

Parameters:

Name Type Mandatory Description
fromEmail STRING NO
toEmail STRING NO
fromAccountType STRING YES "SPOT","USDT_FUTURE","COIN_FUTURE","MARGIN"(Cross),"ISOLATED_MARGIN"
toAccountType STRING YES "SPOT","USDT_FUTURE","COIN_FUTURE","MARGIN"(Cross),"ISOLATED_MARGIN"
clientTranId STRING NO Must be unique
symbol STRING NO Only supported under ISOLATED_MARGIN type
asset STRING YES
amount DECIMAL YES
recvWindow LONG NO
timestamp LONG YES

Query Universal Transfer History (For Master Account)

Response

{
    "result": [
        {
            "tranId": 92275823339,
            "fromEmail": "abctest@gmail.com",
            "toEmail": "deftest@gmail.com",
            "asset": "BNB",
            "amount": "0.01",
            "createTimeStamp": 1640317374000,
            "fromAccountType": "USDT_FUTURE",
            "toAccountType": "SPOT",
            "status": "SUCCESS",
            "clientTranId": "test"
        }
    ],
    "totalCount": 1
}

GET /sapi/v1/sub-account/universalTransfer

Weight(IP): 1

Parameters:

Name Type Mandatory Description
fromEmail STRING NO
toEmail STRING NO
clientTranId STRING NO
startTime LONG NO
endTime LONG NO
page INT NO Default 1
limit INT NO Default 500, Max 500
recvWindow LONG NO
timestamp LONG YES

Get Detail on Sub-account's Futures Account V2 (For Master Account)

Response

USDT Margined Futures:


{
    "futureAccountResp": {
    "email": "abc@test.com",
    "assets":[
        {
            "asset": "USDT",
            "initialMargin": "0.00000000",
            "maintenanceMargin": "0.00000000",
            "marginBalance": "0.88308000",
            "maxWithdrawAmount": "0.88308000",
            "openOrderInitialMargin": "0.00000000",
            "positionInitialMargin": "0.00000000",
            "unrealizedProfit": "0.00000000",
            "walletBalance": "0.88308000"
         }
    ],
    "canDeposit": true,
    "canTrade": true,
    "canWithdraw": true,
    "feeTier": 2,
    "maxWithdrawAmount": "0.88308000",
    "totalInitialMargin": "0.00000000",
    "totalMaintenanceMargin": "0.00000000",
    "totalMarginBalance": "0.88308000",
    "totalOpenOrderInitialMargin": "0.00000000",
    "totalPositionInitialMargin": "0.00000000",
    "totalUnrealizedProfit": "0.00000000",
    "totalWalletBalance": "0.88308000",
    "updateTime": 1576756674610
 }
}

COIN Margined Futures:


{
    "deliveryAccountResp": {
        "email": "abc@test.com",
        "assets":[
            {
                "asset": "BTC",
                "initialMargin": "0.00000000",
                "maintenanceMargin": "0.00000000",
                "marginBalance": "0.88308000",
                "maxWithdrawAmount": "0.88308000",
                "openOrderInitialMargin": "0.00000000",
                "positionInitialMargin": "0.00000000",
                "unrealizedProfit": "0.00000000",
                "walletBalance": "0.88308000"
             }
        ],
        "canDeposit": true,
        "canTrade": true,
        "canWithdraw": true,
        "feeTier": 2,
        "updateTime": 1598959682001
    }
 }

GET /sapi/v2/sub-account/futures/account

Weight(IP): 1

Parameters:

Name Type Mandatory Description
email STRING YES Sub-account email
futuresType INT YES 1:USDT Margined Futures, 2:COIN Margined Futures
recvWindow LONG NO
timestamp LONG YES

Get Summary of Sub-account's Futures Account V2 (For Master Account)

Response

USDT Margined Futures:

{
  "futureAccountSummaryResp": {
    "totalInitialMargin": "9.83137400", 
    "totalMaintenanceMargin": "0.41568700", 
    "totalMarginBalance": "23.03235621", 
    "totalOpenOrderInitialMargin": "9.00000000",
    "totalPositionInitialMargin": "0.83137400",
    "totalUnrealizedProfit": "0.03219710",
    "totalWalletBalance": "22.15879444",
    "asset": "USD",  
    "subAccountList":[
        {
            "email": "123@test.com",
            "totalInitialMargin": "9.00000000", 
            "totalMaintenanceMargin": "0.00000000", 
            "totalMarginBalance": "22.12659734", 
            "totalOpenOrderInitialMargin": "9.00000000",
            "totalPositionInitialMargin": "0.00000000",
            "totalUnrealizedProfit": "0.00000000",
            "totalWalletBalance": "22.12659734",
            "asset": "USD" 
        },
        { 
            "email": "345@test.com",
            "totalInitialMargin": "0.83137400", 
            "totalMaintenanceMargin": "0.41568700",
            "totalMarginBalance": "0.90575887",
            "totalOpenOrderInitialMargin": "0.00000000",
            "totalPositionInitialMargin": "0.83137400",
            "totalUnrealizedProfit": "0.03219710",
            "totalWalletBalance": "0.87356177",
            "asset": "USD"
        }
    ]
  }
}

COIN Margined Futures:

{
  "deliveryAccountSummaryResp": {
    "totalMarginBalanceOfBTC": "25.03221121", 
    "totalUnrealizedProfitOfBTC": "0.12233410",
    "totalWalletBalanceOfBTC": "22.15879444",
    "asset": "BTC",
    "subAccountList":[
        {
            "email": "123@test.com",
            "totalMarginBalance": "22.12659734", 
            "totalUnrealizedProfit": "0.00000000",
            "totalWalletBalance": "22.12659734",
            "asset": "BTC"
        },
        { 
            "email": "345@test.com",
            "totalMarginBalance": "0.90575887",
            "totalUnrealizedProfit": "0.03219710",
            "totalWalletBalance": "0.87356177",
            "asset": "BTC"
        }
    ]
  }
}

GET /sapi/v2/sub-account/futures/accountSummary

Weight(IP): 10

Parameters:

Name Type Mandatory Description
futuresType INT YES 1:USDT Margined Futures, 2:COIN Margined Futures
page INT NO default:1
limit INT NO default:10, max:20
recvWindow LONG NO
timestamp LONG YES

Get Futures Position-Risk of Sub-account V2 (For Master Account)

Response

USDT Margined Futures:

{
  "futurePositionRiskVos": [
     {
        "entryPrice": "9975.12000",
        "leverage": "50",              // current initial leverage
        "maxNotional": "1000000",      // notional value limit of current initial leverage
        "liquidationPrice": "7963.54",
        "markPrice": "9973.50770517",
        "positionAmount": "0.010",
        "symbol": "BTCUSDT",
        "unrealizedProfit": "-0.01612295"
     }
   ]
}

COIN Margined Futures:

{
  "deliveryPositionRiskVos": [
     {
        "entryPrice": "9975.12000",
        "markPrice": "9973.50770517",
        "leverage": "20",          
        "isolated": "false",                
        "isolatedWallet": "9973.50770517",
        "isolatedMargin": "0.00000000",
        "isAutoAddMargin": "false",
        "positionSide": "BOTH",
        "positionAmount": "1.230",
        "symbol": "BTCUSD_201225",
        "unrealizedProfit": "-0.01612295"
     }
   ]
}

GET /sapi/v2/sub-account/futures/positionRisk

Weight(IP): 1

Parameters:

Name Type Mandatory Description
email STRING YES Sub-account email
futuresType INT YES 1:USDT Margined Futures, 2:COIN Margined Futures
recvWindow LONG NO
timestamp LONG YES

Get IP Restriction for a Sub-account API Key (For Master Account)

Response:

{
    "ipRestrict": "true",
    "ipList": [
        "69.210.67.14",
        "8.34.21.10"
    ],
    "updateTime": 1636371437000,
    "apiKey": "k5V49ldtn4tszj6W3hystegdfvmGbqDzjmkCtpTvC0G74WhK7yd4rfCTo4lShf"
}

GET /sapi/v1/sub-account/subAccountApi/ipRestriction

Weight(UID): 3000

Parameters:

Name Type Mandatory Description
email STRING YES Sub-account email
subAccountApiKey STRING YES
recvWindow LONG NO
timestamp LONG YES

Delete IP List For a Sub-account API Key (For Master Account)

Response:

{
  "ipRestrict": "true",
  "ipList": [
    "69.210.67.14",
    "8.34.21.10"
  ],
  "updateTime": 1636371437000,
  "apiKey": "k5V49ldtn4tszj6W3hystegdfvmGbqDzjmkCtpTvC0G74WhK7yd4rfCTo4lShf"
}

DELETE /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList

Weight(UID): 3000

Parameters:

Name Type Mandatory Description
email STRING YES Sub-account email
subAccountApiKey STRING YES
ipAddress STRING NO Can be added in batches, separated by commas
recvWindow LONG NO
timestamp LONG YES

Add IP Restriction for Sub-Account API key (For Master Account)

Response:

{
  "status": "2", 
  "ipList": [
    "69.210.67.14",
    "8.34.21.10",  //only return if you open IP restriction and input IP address.
  ],
  "updateTime": 1636371437000,
  "apiKey": "k5V49ldtn4tszj6W3hystegdfvmGbqDzjmkCtpTvC0G74WhK7yd4rfCTo4lShf"
}

POST /sapi/v2/sub-account/subAccountApi/ipRestriction

Weight(UID): 3000

Parameters:

Name Type Mandatory Description
email STRING YES Sub-account email
subAccountApiKey STRING YES
status STRING YES IP Restriction status. 1 = IP Unrestricted. 2 = Restrict access to trusted IPs only.
ipAddress STRING NO Insert static IP in batch, separated by commas.
recvWindow LONG NO
timestamp LONG YES

Deposit Assets Into The Managed Sub-account(For Investor Master Account)

Response

{
    "tranId":66157362489
}

POST /sapi/v1/managed-subaccount/deposit

Weight(IP): 1

Parameters:

Name Type Mandatory Description
toEmail STRING YES
asset STRING YES
amount DECIMAL YES
recvWindow LONG NO
timestamp LONG YES

Query Managed Sub-account Asset Details(For Investor Master Account)

Response

[
  {
     "coin": "INJ",                
     "name": "Injective Protocol", 
     "totalBalance": "0",          
     "availableBalance": "0",      
     "inOrder": "0",                
     "btcValue": "0"               
  },
  {
     "coin": "FILDOWN",
     "name": "FILDOWN",
     "totalBalance": "0",
     "availableBalance": "0",
     "inOrder": "0",
     "btcValue": "0"
  }
]

GET /sapi/v1/managed-subaccount/asset

Weight(IP): 1

Parameters:

Name Type Mandatory Description
email STRING YES
recvWindow LONG NO
timestamp LONG YES

Withdrawl Assets From The Managed Sub-account(For Investor Master Account)

Response

{
    "tranId":66157362489
}

POST /sapi/v1/managed-subaccount/withdraw

Weight(IP): 1

Parameters:

Name Type Mandatory Description
fromEmail STRING YES
asset STRING YES
amount DECIMAL YES
transferDate LONG NO Withdrawals is automatically occur on the transfer date(UTC0). If a date is not selected, the withdrawal occurs right now
recvWindow LONG NO
timestamp LONG YES

Query Managed Sub-account Snapshot(For Investor Master Account)

Response:

{
   "code":200, // 200 for success; others are error codes
   "msg":"", // error message
   "snapshotVos":[
      {
         "data":{
            "balances":[
               {
                  "asset":"BTC",
                  "free":"0.09905021",
                  "locked":"0.00000000"
               },
               {
                  "asset":"USDT",
                  "free":"1.89109409",
                  "locked":"0.00000000"
               }
            ],
            "totalAssetOfBtc":"0.09942700"
         },
         "type":"spot",
         "updateTime":1576281599000
      }
   ]
}

OR

{
   "code":200, // 200 for success; others are error codes
   "msg":"", // error message
   "snapshotVos":[
      {
         "data":{
            "marginLevel":"2748.02909813",
            "totalAssetOfBtc":"0.00274803",
            "totalLiabilityOfBtc":"0.00000100",
            "totalNetAssetOfBtc":"0.00274750",
            "userAssets":[
               {
                  "asset":"XRP",
                  "borrowed":"0.00000000",
                  "free":"1.00000000",
                  "interest":"0.00000000",
                  "locked":"0.00000000",
                  "netAsset":"1.00000000"
               }
            ]
         },
         "type":"margin",
         "updateTime":1576281599000
      }
   ]
}

OR

{
   "code":200, // 200 for success; others are error codes
   "msg":"", // error message
   "snapshotVos":[
      {
         "data":{
            "assets":[
               {
                  "asset":"USDT",
                  "marginBalance":"118.99782335",
                  "walletBalance":"120.23811389"
               }
            ],
            "position":[
               {
                  "entryPrice":"7130.41000000",
                  "markPrice":"7257.66239673",
                  "positionAmt":"0.01000000",
                  "symbol":"BTCUSDT",
                  "unRealizedProfit":"1.24029054"  // Only show the value at the time of opening the position
               }
            ]
         },
         "type":"futures",
         "updateTime":1576281599000
      }
   ]
}

GET /sapi/v1/managed-subaccount/accountSnapshot

Weight(IP): 2400

Parameters:

Name Type Mandatory Description
email STRING YES
type STRING YES "SPOT", "MARGIN"(cross), "FUTURES"(UM)
startTime LONG NO
endTime LONG NO
limit INT NO min 7, max 30, default 7
recvWindow LONG NO
timestamp LONG YES

Query Managed Sub Account Transfer Log (For Investor Master Account) (USER_DATA)

Response

{
    managerSubTransferHistoryVos: [
        {
            fromEmail: "test_0_virtual@kq3kno9imanagedsub.com"
            fromAccountType: "SPOT"
            toEmail: "wdywl0lddakh@test.com"
            toAccountType: "SPOT"
            asset: "BNB"
            amount: "0.01"
            scheduledData: 1679416673000
            createTime: 1679416673000
            status: "SUCCESS"
            tranId: 91077779
        },
        {
            fromEmail: "wdywl0lddakh@test.com"
            fromAccountType: "SPOT"
            toEmail: "test_0_virtual@kq3kno9imanagedsub.com"
            toAccountType: "SPOT"
            asset: "BNB"
            amount: "1"
            scheduledData: 1679416616000
            createTime: 1679416616000
            status: "SUCCESS"
            tranId: 91077676
        }
    ]
    count: 2
}

GET /sapi/v1/managed-subaccount/queryTransLogForInvestor

Investor can use this api to query managed sub account transfer log. This endpoint is available for investor of Managed Sub-Account. A Managed Sub-Account is an account type for investors who value flexibility in asset allocation and account application, while delegating trades to a professional trading team. Please refer to link

Weight(IP): 1

Parameters:

Name Type Mandatory Description
email STRING YES Managed Sub Account Email
startTime LONG YES Start Time
endTime LONG YES End Time (The start time and end time interval cannot exceed half a year)
page INT YES Page
limit INT YES Limit (Max: 500)
transfers STRING NO Transfer Direction (from/to)
transferFunctionAccountType STRING NO Transfer function account type (SPOT/MARGIN/ISOLATED_MARGIN/USDT_FUTURE/COIN_FUTURE)

Query Managed Sub Account Transfer Log (For Trading Team Master Account) (USER_DATA)

Response

{
    managerSubTransferHistoryVos: [
        {
            fromEmail: "test_0_virtual@kq3kno9imanagedsub.com"
            fromAccountType: "SPOT"
            toEmail: "wdywl0lddakh@test.com"
            toAccountType: "SPOT"
            asset: "BNB"
            amount: "0.01"
            scheduledData: 1679416673000
            createTime: 1679416673000
            status: "SUCCESS"
            tranId: 91077779
        },
        {
            fromEmail: "wdywl0lddakh@test.com"
            fromAccountType: "SPOT"
            toEmail: "test_0_virtual@kq3kno9imanagedsub.com"
            toAccountType: "SPOT"
            asset: "BNB"
            amount: "1"
            scheduledData: 1679416616000
            createTime: 1679416616000
            status: "SUCCESS"
            tranId: 91077676
        }
    ]
    count: 2
}

GET /sapi/v1/managed-subaccount/queryTransLogForTradeParent

Trading team can use this api to query managed sub account transfer log. This endpoint is available for trading team of Managed Sub-Account. A Managed Sub-Account is an account type for investors who value flexibility in asset allocation and account application, while delegating trades to a professional trading team. Please refer to link

Weight(UID): 60

Parameters:

Name Type Mandatory Description
email STRING YES Managed Sub Account Email
startTime LONG YES Start Time
endTime LONG YES End Time (The start time and end time interval cannot exceed half a year)
page INT YES Page
limit INT YES Limit (Max: 500)
transfers STRING NO Transfer Direction (FROM/TO)
transferFunctionAccountType STRING NO Transfer function account type (SPOT/MARGIN/ISOLATED_MARGIN/USDT_FUTURE/COIN_FUTURE)

Query Managed Sub-account Futures Asset Details(For Investor Master Account)(USER_DATA)

Response

{
  "code": "200",
  "message": "OK",
  "snapshotVos": [
    {
      "type": "FUTURES",
      "updateTime": 1672893855394,
      "data": {
        "assets": [
          {
            "asset": "USDT",
            "marginBalance": 100,
            "walletBalance": 120
          }
        ],
        "position": [
          {
            "symbol": "BTCUSDT",
            "entryPrice": 17000,
            "markPrice": 17000,
            "positionAmt": 0.0001
          }
        ]
      }
    }
  ]
}

GET /sapi/v1/managed-subaccount/fetch-future-asset

Investor can use this api to query managed sub account futures asset details

Weight(UID): 60

Parameters:

Name Type Mandatory Description
email STRING YES Managed Sub Account Email

Query Managed Sub-account Margin Asset Details (For Investor Master Account) (USER_DATA)

Response

{
  marginLevel:"999"
  totalAssetOfBtc:"0"
  totalLiabilityOfBtc:"0"
  totalNetAssetOfBtc:"0"
  userAssets:[
    0:{
    asset:"MATIC"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    1:{
    asset:"VET"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    2:{
    asset:"BAKE"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    3:{
    asset:"SHIB"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    4:{
    asset:"USDT"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    5:{
    asset:"DOGE"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    6:{
    asset:"AAVE"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    7:{
    asset:"ONT"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    8:{
    asset:"XRP"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    9:{
    asset:"XLM"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    10:{
    asset:"LINK"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    11:{
    asset:"QTUM"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    12:{
    asset:"ETHW"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    13:{
    asset:"XTZ"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    14:{
    asset:"LUNA"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    15:{
    asset:"EUR"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    16:{
    asset:"IOST"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    17:{
    asset:"BCH"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    18:{
    asset:"BTC"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    19:{
    asset:"IOTA"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    20:{
    asset:"CREAM"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    21:{
    asset:"BAT"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    22:{
    asset:"BNB"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    23:{
    asset:"ETH"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    24:{
    asset:"ZEC"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    25:{
    asset:"USDC"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    26:{
    asset:"LTC"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    27:{
    asset:"BUSD"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    28:{
    asset:"ZIL"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
    29:{
    asset:"THETA"
    borrowed:"0"
    free:"0"
    interest:"0"
    locked:"0"
    netAsset:"0"
    }
  ]
}

GET /sapi/v1/managed-subaccount/marginAsset

Investor can use this api to query managed sub account margin asset details

Weight(IP): 1

Parameters:

Name Type Mandatory Description
email STRING YES Managed Sub Account Email

Query Sub-account Assets (For Master Account)(USER_DATA)

Response

{
    "balances":[
        {
            "asset":"ADA",
            "free":"10000",
            "locked":"0"
        },
        {
            "asset":"BNB",
            "free":"10003",
            "locked":"0"
        },
        {
            "asset":"BTC",
            "free":"11467.6399",
            "locked":"0"
        }
    ]
}

GET /sapi/v4/sub-account/assets

Fetch sub-account assets

Weight(UID): 60

Parameters:

Name Type Mandatory Description
email STRING YES Managed Sub Account Email
recvWindow LONG NO
timestamp LONG YES

Query Managed Sub-account List (For Investor)(USER_DATA)

Response

{
    total: 3
    managerSubUserInfoVoList: [
        0: {
            rootUserId: 1000138475670
            managersubUserId: 1000137842513
            bindParentUserId: 1000138475669
            email: "test_0_virtual@kq3kno9imanagedsub.com"
            insertTimeStamp: 1678435149000
            bindParentEmail: "wdyw8xsh8pey@test.com"
            isSubUserEnabled: true
            isUserActive: true
            isMarginEnabled: false
            isFutureEnabled: false
            isSignedLVTRiskAgreement: false
        }
        1: {
            rootUserId: 1000138475670
            managersubUserId: 1000137842514
            bindParentUserId: 1000138475669
            email: "test_1_virtual@4qd2u7zxmanagedsub.com"
            insertTimeStamp: 1678435152000
            bindParentEmail: "wdyw8xsh8pey@test.com"
            isSubUserEnabled: true
            isUserActive: true
            isMarginEnabled: false
            isFutureEnabled: false
            isSignedLVTRiskAgreement: false
        }
        2: {
            rootUserId: 1000138475670
            managersubUserId: 1000137842515
            bindParentUserId: 1000138475669
            email: "test_2_virtual@akc05o8hmanagedsub.com"
            insertTimeStamp: 1678435153000
            bindParentEmail: "wdyw8xsh8pey@test.com"
            isSubUserEnabled: true
            isUserActive: true
            isMarginEnabled: false
            isFutureEnabled: false
            isSignedLVTRiskAgreement: false
        }
    ]
}

GET /sapi/v1/managed-subaccount/info

Get investor's managed sub-account list.

Weight(UID): 60

Parameters:

Name Type Mandatory Description
email STRING NO Managed sub-account email
page INT NO Default value: 1
limit INT NO Default value: 20, Max value: 20
recvWindow LONG NO
timestamp LONG YES

Query Sub-account Transaction Statistics (For Master Account) (USER_DATA)

Response example:

{
    "recent30BtcTotal": "0",
    "recent30BtcFuturesTotal": "0",
    "recent30BtcMarginTotal": "0",
    "recent30BusdTotal": "0",
    "recent30BusdFuturesTotal": "0",
    "recent30BusdMarginTotal": "0",
    "tradeInfoVos": []
}

OR

{
    "recent30BtcTotal": "0",
    "recent30BtcFuturesTotal": "0",
    "recent30BtcMarginTotal": "0",
    "recent30BusdTotal": "0",
    "recent30BusdFuturesTotal": "0",
    "recent30BusdMarginTotal": "0",
    "tradeInfoVos": [
        {
            "userId": 1000138138384,
            "btc": 0,
            "btcFutures": 0,
            "btcMargin": 0,
            "busd": 0,
            "busdFutures": 0,
            "busdMargin": 0,
            "date": 1676851200000
        },
        {
            "userId": 1000138138384,
            "btc": 0,
            "btcFutures": 0,
            "btcMargin": 0,
            "busd": 0,
            "busdFutures": 0,
            "busdMargin": 0,
            "date": 1677110400000
        },
        {
            "userId": 1000138138384,
            "btc": 0,
            "btcFutures": 0,
            "btcMargin": 0,
            "busd": 0,
            "busdFutures": 0,
            "busdMargin": 0,
            "date": 1677369600000
        }
    ]
}

GET /sapi/v1/sub-account/transaction-statistics

Query Sub-account Transaction statistics (For Master Account).

Weight(UID): 60

Parameters:

Name Type Mandatory Description
email STRING YES Sub user email
recvWindow LONG NO
timestamp LONG YES

Get Managed Sub-account Deposit Address (For Investor Master Account) (USER_DATA)

Response:

{
    "coin": "USDT",
    "address": "0x206c22d833bb0bb2102da6b7c7d4c3eb14bcf73d",
    "tag": "",
    "url": "https://etherscan.io/address/0x206c22d833bb0bb2102da6b7c7d4c3eb14bcf73d"
}

GET /sapi/v1/managed-subaccount/deposit/address

Get investor's managed sub-account deposit address.

Weight(UID): 1

Parameters:

Name Type Mandatory Description
email STRING YES Sub user email
coin STRING YES
network STRING NO networks can be found in GET /sapi/v1/capital/deposit/address
recvWindow LONG NO
timestamp LONG YES

Enable Options for Sub-account (For Master Account)(USER_DATA)

Response:

{

    "email":"123@test.com",
    "isEOptionsEnabled": true  // true or false
}

POST /sapi/v1/sub-account/eoptions/enable

Enable Options for Sub-account (For Master Account).

Weight(IP): 1

Parameters:

Name Type Mandatory Description
email STRING YES Sub user email
recvWindow LONG NO
timestamp LONG YES

Query Managed Sub Account Transfer Log (For Trading Team Sub Account)(USER_DATA)

Response:

{
    "managerSubTransferHistoryVos": [
        {
            "fromEmail": "test_0_virtual@kq3kno9imanagedsub.com",
            "fromAccountType": "SPOT",
            "toEmail": "wdywl0lddakh@test.com",
            "toAccountType": "SPOT",
            "asset": "BNB",
            "amount": "0.01",
            "scheduledData": 1679416673000,
            "createTime": 1679416673000,
            "status": "SUCCESS",
            "tranId": 91077779
        },
        {
            "fromEmail": "wdywl0lddakh@test.com",
            "fromAccountType": "SPOT",
            "toEmail": "test_0_virtual@kq3kno9imanagedsub.com",
            "toAccountType": "SPOT",
            "asset": "BNB",
            "amount": "1",
            "scheduledData": 1679416616000,
            "createTime": 1679416616000,
            "status": "SUCCESS",
            "tranId": 91077676
        }
    ],
    "count": 2
}

GET /sapi/v1/managed-subaccount/query-trans-log

Query Managed Sub Account Transfer Log (For Trading Team Sub Account)

Weight(UID): 60

Parameters:

Name Type Mandatory Description
startTime LONG YES Start Time
endTime LONG YES End Time (The start time and end time interval cannot exceed half a year)
page INT YES Page
limit INT YES Limit (Max: 500)
transfers STRING NO Transfer Direction (FROM/TO)
transferFunctionAccountType STRING NO Transfer function account type (SPOT/MARGIN/ISOLATED_MARGIN/USDT_FUTURE/COIN_FUTURE)
recvWindow LONG NO
timestamp LONG YES

Market Data Endpoints

Test Connectivity

Response:

{}

GET /api/v3/ping

Test connectivity to the Rest API.

Weight(IP): 1

Parameters:

NONE

Data Source: Memory

Check Server Time

Response:

{
  "serverTime": 1499827319559
}

GET /api/v3/time

Test connectivity to the Rest API and get the current server time.

Weight(IP): 1

Parameters:

NONE

Data Source: Memory

Exchange Information

Response:

{
  "timezone": "UTC",
  "serverTime": 1565246363776,
  "rateLimits": [
    {
      //These are defined in the `ENUM definitions` section under `Rate Limiters (rateLimitType)`.
      //All limits are optional
    }
  ],
  "exchangeFilters": [
    //These are the defined filters in the `Filters` section.
    //All filters are optional.
  ],
  "symbols": [
    {
      "symbol": "ETHBTC",
      "status": "TRADING",
      "baseAsset": "ETH",
      "baseAssetPrecision": 8,
      "quoteAsset": "BTC",
      "quotePrecision": 8,
      "quoteAssetPrecision": 8,
      "orderTypes": [
        "LIMIT",
        "LIMIT_MAKER",
        "MARKET",
        "STOP_LOSS",
        "STOP_LOSS_LIMIT",
        "TAKE_PROFIT",
        "TAKE_PROFIT_LIMIT"
      ],
      "icebergAllowed": true,
      "ocoAllowed": true,
      "quoteOrderQtyMarketAllowed": true,
      "allowTrailingStop": false,
      "cancelReplaceAllowed": false,
      "isSpotTradingAllowed": true,
      "isMarginTradingAllowed": true,
      "filters": [
        //These are defined in the Filters section.
        //All filters are optional
      ],
      "permissions": [],
      "permissionSets": [
        [
          "SPOT",
          "MARGIN"
        ]
      ],
      "defaultSelfTradePreventionMode": "NONE",
      "allowedSelfTradePreventionModes": [
        "NONE"
      ]
    }
  ]
}

GET /api/v3/exchangeInfo

Current exchange trading rules and symbol information

Weight(IP): 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 symbols that have this tradingStatus. Valid values: TRADING, HALT, BREAK
Cannot be used in combination with symbols or symbol.

Notes:

Examples of Symbol Permissions Interpretation from the Response:

Data Source: Memory

Order Book

Response:

{
  "lastUpdateId": 1027024,
  "bids": [
    [
      "4.00000000",     // PRICE
      "431.00000000"    // QTY
    ]
  ],
  "asks": [
    [
      "4.00000200",
      "12.00000000"
    ]
  ]
}

GET /api/v3/depth

Weight(IP):

Adjusted based on the limit:

Limit 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; max 5000.

If limit > 5000, then the response will truncate to 5000.

Data Source: Memory

Recent Trades List

Response:

[
  {
    "id": 28457,
    "price": "4.00000100",
    "qty": "12.00000000",
    "quoteQty": "48.000012",
    "time": 1499865549590,
    "isBuyerMaker": true,
    "isBestMatch": true
  }
]

GET /api/v3/trades

Get recent trades.

Weight(IP): 25

Parameters:

Name Type Mandatory Description
symbol STRING YES
limit INT NO Default 500; max 1000.

Data Source: Memory

Old Trade Lookup

Response:

[
  {
    "id": 28457,
    "price": "4.00000100",
    "qty": "12.00000000",
    "quoteQty": "48.000012",
    "time": 1499865549590, // Trade executed timestamp, as same as `T` in the stream
    "isBuyerMaker": true,
    "isBestMatch": true
  }
]

GET /api/v3/historicalTrades

Get older market trades.

Weight(IP): 25

Parameters:

Name Type Mandatory Description
symbol STRING YES
limit INT NO Default 500; max 1000.
fromId LONG NO Trade id to fetch from. Default gets most recent trades.

Data Source: Database

Compressed/Aggregate Trades List

Response:

[
  {
    "a": 26129,         // Aggregate tradeId
    "p": "0.01633102",  // Price
    "q": "4.70443515",  // Quantity
    "f": 27781,         // First tradeId
    "l": 27781,         // Last tradeId
    "T": 1498793709153, // Timestamp
    "m": true,          // Was the buyer the maker?
    "M": true           // Was the trade the best price match?
  }
]

GET /api/v3/aggTrades

Get compressed, aggregate trades. Trades that fill at the time, from the same order, with the same price will have the quantity aggregated.

Weight(IP): 2

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; max 1000.

Data Source: Database

Kline/Candlestick Data

Response:

[
  [
    1499040000000,      // Kline open time
    "0.01634790",       // Open price
    "0.80000000",       // High price
    "0.01575800",       // Low price
    "0.01577100",       // Close price
    "148976.11427815",  // Volume
    1499644799999,      // Kline Close time
    "2434.19055334",    // Quote asset volume
    308,                // Number of trades
    "1756.87402397",    // Taker buy base asset volume
    "28.46694368",      // Taker buy quote asset volume
    "0"                 // Unused field, ignore.
  ]
]

GET /api/v3/klines

Kline/candlestick bars for a symbol.
Klines are uniquely identified by their open time.

Weight(IP): 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; max 1000.

Data Source: Database

UIKlines

Response:

[
  [
    1499040000000,      // Kline open time
    "0.01634790",       // Open price
    "0.80000000",       // High price
    "0.01575800",       // Low price
    "0.01577100",       // Close price
    "148976.11427815",  // Volume
    1499644799999,      // Kline close time
    "2434.19055334",    // Quote asset volume
    308,                // Number of trades
    "1756.87402397",    // Taker buy base asset volume
    "28.46694368",      // Taker buy quote asset volume
    "0"                 // Unused field. Ignore.
  ]
]

GET /api/v3/uiKlines

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
startTime LONG NO
endTime LONG NO
timeZone STRING NO Default: 0 (UTC)
limit INT NO Default 500; max 1000.

Data Source: Database

Current Average Price

Response:

{
  "mins": 5,                    // Average price interval (in minutes)
  "price": "9.35751834",        // Average price
  "closeTime": 1694061154503    // Last trade time
}

GET /api/v3/avgPrice

Current average price for a symbol.

Weight(IP): 2

Parameters:

Name Type Mandatory Description
symbol STRING YES

Data Source: Memory

24hr Ticker Price Change Statistics

Response: - FULL

{
  "symbol": "BNBBTC",
  "priceChange": "-94.99999800",
  "priceChangePercent": "-95.960",
  "weightedAvgPrice": "0.29628482",
  "prevClosePrice": "0.10002000",
  "lastPrice": "4.00000200",
  "lastQty": "200.00000000",
  "bidPrice": "4.00000000",
  "bidQty": "100.00000000",
  "askPrice": "4.00000200",
  "askQty": "100.00000000",
  "openPrice": "99.00000000",
  "highPrice": "100.00000000",
  "lowPrice": "0.10000000",
  "volume": "8913.30000000",
  "quoteVolume": "15.30000000",
  "openTime": 1499783499040,
  "closeTime": 1499869899040,
  "firstId": 28385,   // First tradeId
  "lastId": 28460,    // Last tradeId
  "count": 76         // Trade count
}

OR

[
  {
    "symbol": "BNBBTC",
    "priceChange": "-94.99999800",
    "priceChangePercent": "-95.960",
    "weightedAvgPrice": "0.29628482",
    "prevClosePrice": "0.10002000",
    "lastPrice": "4.00000200",
    "lastQty": "200.00000000",
    "bidPrice": "4.00000000",
    "bidQty": "100.00000000",
    "askPrice": "4.00000200",
    "askQty": "100.00000000",
    "openPrice": "99.00000000",
    "highPrice": "100.00000000",
    "lowPrice": "0.10000000",
    "volume": "8913.30000000",
    "quoteVolume": "15.30000000",
    "openTime": 1499783499040,
    "closeTime": 1499869899040,
    "firstId": 28385,   // First tradeId
    "lastId": 28460,    // Last tradeId
    "count": 76         // Trade count
  }
]

Response - MINI

{
  "symbol":      "BNBBTC",          // Symbol Name
  "openPrice":   "99.00000000",     // Opening price of the Interval
  "highPrice":   "100.00000000",    // Highest price in the interval
  "lowPrice":    "0.10000000",      // Lowest  price in the interval
  "lastPrice":   "4.00000200",      // Closing price of the interval
  "volume":      "8913.30000000",   // Total trade volume (in base asset)
  "quoteVolume": "15.30000000",     // Total trade volume (in quote asset)
  "openTime":    1499783499040,     // Start of the ticker interval
  "closeTime":   1499869899040,     // End of the ticker interval
  "firstId":     28385,             // First tradeId considered
  "lastId":      28460,             // Last tradeId considered
  "count":       76                 // Total trade count
}

OR

[
  {
    "symbol": "BNBBTC",
    "openPrice": "99.00000000",
    "highPrice": "100.00000000",
    "lowPrice": "0.10000000",
    "lastPrice": "4.00000200",
    "volume": "8913.30000000",
    "quoteVolume": "15.30000000",
    "openTime": 1499783499040,
    "closeTime": 1499869899040,
    "firstId": 28385,
    "lastId": 28460,
    "count": 76
  },
  {
    "symbol": "LTCBTC",
    "openPrice": "0.07000000",
    "highPrice": "0.07000000",
    "lowPrice": "0.07000000",
    "lastPrice": "0.07000000",
    "volume": "11.00000000",
    "quoteVolume": "0.77000000",
    "openTime": 1656908192899,
    "closeTime": 1656994592899,
    "firstId": 0,
    "lastId": 10,
    "count": 11
  }
]

GET /api/v3/ticker/24hr

24 hour rolling window price change statistics. Careful when accessing this with no symbol.

Weight(IP):

Parameter Symbols Provided Weight
symbol 1 2
symbol parameter is omitted 80
symbols 1-20 2
21-100 40
101 or more 80
symbols parameter is omitted 80

Parameters:

Name Type Mandatory Description
symbol STRING NO Parameter symbol and symbols cannot be used in combination.

If neither parameter is sent, tickers for all symbols will be returned in an array.



Examples of accepted format for the symbols parameter: ["BTCUSDT","BNBUSDT"]

or

%5B%22BTCUSDT%22,%22BNBUSDT%22%5D
symbols STRING NO
type ENUM NO Supported values: FULL or MINI.

If none provided, the default is FULL

Data Source: Memory

Trading Day Ticker

Response: - FULL

{
  "symbol":             "BTCUSDT",
  "priceChange":        "-83.13000000",         // Absolute price change
  "priceChangePercent": "-0.317",               // Relative price change in percent
  "weightedAvgPrice":   "26234.58803036",       // quoteVolume / volume
  "openPrice":          "26304.80000000",
  "highPrice":          "26397.46000000",
  "lowPrice":           "26088.34000000",
  "lastPrice":          "26221.67000000",
  "volume":             "18495.35066000",       // Volume in base asset
  "quoteVolume":        "485217905.04210480",   // Volume in quote asset
  "openTime":           1695686400000,
  "closeTime":          1695772799999,
  "firstId":            3220151555,             // Trade ID of the first trade in the interval
  "lastId":             3220849281,             // Trade ID of the last trade in the interval
  "count":              697727                  // Number of trades in the interval
}

OR

[
  {
    "symbol": "BTCUSDT",
    "priceChange": "-83.13000000",
    "priceChangePercent": "-0.317",
    "weightedAvgPrice": "26234.58803036",
    "openPrice": "26304.80000000",
    "highPrice": "26397.46000000",
    "lowPrice": "26088.34000000",
    "lastPrice": "26221.67000000",
    "volume": "18495.35066000",
    "quoteVolume": "485217905.04210480",
    "openTime": 1695686400000,
    "closeTime": 1695772799999,
    "firstId": 3220151555,
    "lastId": 3220849281,
    "count": 697727
  },
  {
    "symbol": "BNBUSDT",
    "priceChange": "2.60000000",
    "priceChangePercent": "1.238",
    "weightedAvgPrice": "211.92276958",
    "openPrice": "210.00000000",
    "highPrice": "213.70000000",
    "lowPrice": "209.70000000",
    "lastPrice": "212.60000000",
    "volume": "280709.58900000",
    "quoteVolume": "59488753.54750000",
    "openTime": 1695686400000,
    "closeTime": 1695772799999,
    "firstId": 672397461,
    "lastId": 672496158,
    "count": 98698
  }
]

Response: - MINI

{
  "symbol":         "BTCUSDT",
  "openPrice":      "26304.80000000",
  "highPrice":      "26397.46000000",
  "lowPrice":       "26088.34000000",
  "lastPrice":      "26221.67000000",
  "volume":         "18495.35066000",       // Volume in base asset
  "quoteVolume":    "485217905.04210480",   // Volume in quote asset
  "openTime":       1695686400000,
  "closeTime":      1695772799999,
  "firstId":        3220151555,             // Trade ID of the first trade in the interval
  "lastId":         3220849281,             // Trade ID of the last trade in the interval
  "count":          697727                  // Number of trades in the interval
}

OR

[
  {
    "symbol": "BTCUSDT",
    "openPrice": "26304.80000000",
    "highPrice": "26397.46000000",
    "lowPrice": "26088.34000000",
    "lastPrice": "26221.67000000",
    "volume": "18495.35066000",
    "quoteVolume": "485217905.04210480",
    "openTime": 1695686400000,
    "closeTime": 1695772799999,
    "firstId": 3220151555,
    "lastId": 3220849281,
    "count": 697727
  },
  {
    "symbol": "BNBUSDT",
    "openPrice": "210.00000000",
    "highPrice": "213.70000000",
    "lowPrice": "209.70000000",
    "lastPrice": "212.60000000",
    "volume": "280709.58900000",
    "quoteVolume": "59488753.54750000",
    "openTime": 1695686400000,
    "closeTime": 1695772799999,
    "firstId": 672397461,
    "lastId": 672496158,
    "count": 98698
  }
]

GET /api/v3/ticker/tradingDay

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:

Name Type Mandatory Description
symbol STRING YES Either symbol or symbols must be provided.

Examples of accepted format for the symbols parameter:
["BTCUSDT","BNBUSDT"]
or
%5B%22BTCUSDT%22,%22BNBUSDT%22%5D

The maximum number of symbols allowed in a request is 100.
symbols
timeZone STRING NO Default: 0 (UTC)
type ENUM NO Supported values: FULL or MINI.

If none provided, the default is FULL.

Notes:

Data Source: Database

Symbol Price Ticker

Response:

{
  "symbol": "LTCBTC",
  "price": "4.00000200"
}

OR

[
  {
    "symbol": "LTCBTC",
    "price": "4.00000200"
  },
  {
    "symbol": "ETHBTC",
    "price": "0.07946600"
  }
]

GET /api/v3/ticker/price

Latest price for a symbol or symbols.

Weight(IP):

Parameter Symbols Provided Weight
symbol 1 2
symbol parameter is omitted 4
symbols Any 4

Parameters:

Name Type Mandatory Description
symbol STRING NO Parameter symbol and symbols cannot be used in combination.

If neither parameter is sent, prices for all symbols will be returned in an array.



Examples of accepted format for the symbols parameter: ["BTCUSDT","BNBUSDT"]

or

%5B%22BTCUSDT%22,%22BNBUSDT%22%5D
symbols STRING NO

Data Source: Memory

Symbol Order Book Ticker

Response:

{
  "symbol": "LTCBTC",
  "bidPrice": "4.00000000",
  "bidQty": "431.00000000",
  "askPrice": "4.00000200",
  "askQty": "9.00000000"
}

OR

[
  {
    "symbol": "LTCBTC",
    "bidPrice": "4.00000000",
    "bidQty": "431.00000000",
    "askPrice": "4.00000200",
    "askQty": "9.00000000"
  },
  {
    "symbol": "ETHBTC",
    "bidPrice": "0.07946700",
    "bidQty": "9.00000000",
    "askPrice": "100000.00000000",
    "askQty": "1000.00000000"
  }
]

GET /api/v3/ticker/bookTicker

Best price/qty on the order book for a symbol or symbols.

Weight(IP):

Parameter Symbols Provided Weight
symbol 1 2
symbol parameter is omitted 4
symbols Any 4

Parameters:

Name Type Mandatory Description
symbol STRING NO Parameter symbol and symbols cannot be used in combination.

If neither parameter is sent, bookTickers for all symbols will be returned in an array.



Examples of accepted format for the symbols parameter: ["BTCUSDT","BNBUSDT"]

or

%5B%22BTCUSDT%22,%22BNBUSDT%22%5D
symbols STRING NO

Data Source: Memory

Rolling window price change statistics

Response: - FULL

{
  "symbol":             "BNBBTC",
  "priceChange":        "-8.00000000",  // Absolute price change
  "priceChangePercent": "-88.889",      // Relative price change in percent
  "weightedAvgPrice":   "2.60427807",   // QuoteVolume / Volume
  "openPrice":          "9.00000000",
  "highPrice":          "9.00000000",
  "lowPrice":           "1.00000000",
  "lastPrice":          "1.00000000",
  "volume":             "187.00000000",
  "quoteVolume":        "487.00000000", // Sum of (price * volume) for all trades
  "openTime":           1641859200000,  // Open time for ticker window
  "closeTime":          1642031999999,  // Current Time of the Request
  "firstId":            0,              // Trade IDs
  "lastId":             60,
  "count":              61              // Number of trades in the interval
}

OR

[
  {
    "symbol": "BTCUSDT",
    "priceChange": "-154.13000000",        // Absolute price change
    "priceChangePercent": "-0.740",        // Relative price change in percent
    "weightedAvgPrice": "20677.46305250",  // QuoteVolume / Volume
    "openPrice": "20825.27000000",
    "highPrice": "20972.46000000",
    "lowPrice": "20327.92000000",
    "lastPrice": "20671.14000000",
    "volume": "72.65112300",
    "quoteVolume": "1502240.91155513",     // Sum of (price * volume) for all trades
    "openTime": 1655432400000,             // Open time for ticker window
    "closeTime": 1655446835460,            // Close time for ticker window
    "firstId": 11147809,                   // Trade IDs
    "lastId": 11149775,
    "count": 1967                          // Number of trades in the interval
  },
  {
    "symbol": "BNBBTC",
    "priceChange": "0.00008530",
    "priceChangePercent": "0.823",
    "weightedAvgPrice": "0.01043129",
    "openPrice": "0.01036170",
    "highPrice": "0.01049850",
    "lowPrice": "0.01033870",
    "lastPrice": "0.01044700",
    "volume": "166.67000000",
    "quoteVolume": "1.73858301",
    "openTime": 1655432400000,
    "closeTime": 1655446835460,
    "firstId": 2351674,
    "lastId": 2352034,
    "count": 361
  }
]

Response - MINI

{
    "symbol": "LTCBTC",
    "openPrice": "0.10000000",
    "highPrice": "2.00000000",
    "lowPrice": "0.10000000",
    "lastPrice": "2.00000000",
    "volume": "39.00000000",
    "quoteVolume": "13.40000000",  // Sum of (price * volume) for all trades
    "openTime": 1656986580000,     // Open time for ticker window
    "closeTime": 1657001016795,    // Close time for ticker window
    "firstId": 0,                  // Trade IDs
    "lastId": 34,
    "count": 35                    // Number of trades in the interval
}

OR

[
    {
        "symbol": "BNBBTC",
        "openPrice": "0.10000000",
        "highPrice": "2.00000000",
        "lowPrice": "0.10000000",
        "lastPrice": "2.00000000",
        "volume": "39.00000000",
        "quoteVolume": "13.40000000", // Sum of (price * volume) for all trades
        "openTime": 1656986880000,    // Open time for ticker window
        "closeTime": 1657001297799,   // Close time for ticker window
        "firstId": 0,                 // Trade IDs
        "lastId": 34,
        "count": 35                   // Number of trades in the interval
    },
    {
        "symbol": "LTCBTC",
        "openPrice": "0.07000000",
        "highPrice": "0.07000000",
        "lowPrice": "0.07000000",
        "lastPrice": "0.07000000",
        "volume": "33.00000000",
        "quoteVolume": "2.31000000",
        "openTime": 1656986880000,
        "closeTime": 1657001297799,
        "firstId": 0,
        "lastId": 32,
        "count": 33
    }
]

GET /api/v3/ticker

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 UTC)

Weight:(IP)

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

Name Type Mandatory Description
symbol STRING YES Either symbol or symbols must be provided.

Examples of accepted format for the symbols parameter:
["BTCUSDT","BNBUSDT"]
or
%5B%22BTCUSDT%22,%22BNBUSDT%22%5D

The maximum number of symbols allowed in a request is 100.
symbols
windowSize ENUM NO Defaults to 1d if no parameter provided.

Supported windowSize values:
1m,2m....59m for minutes
1h, 2h....23h - for hours
1d...7d - for days

Units cannot be combined (e.g. 1d2h is not allowed).
type ENUM NO Supported values: FULL or MINI.

If none provided, the default is FULL.

Data Source: Database


Websocket Market Streams

Live Subscribing/Unsubscribing to streams

Subscribe to a stream

Response

  {
    "result": null,  
    "id": 1
  }

Unsubscribe to a stream

Response

  {
    "result": null,
    "id": 312
  }

{
"method": "UNSUBSCRIBE",
"params":
[
"btcusdt@depth"
],
"id": 312
}

Listing Subscriptions

Response

  {
    "result": [
      "btcusdt@aggTrade"
    ],
    "id": 3
  }

{
"method": "LIST_SUBSCRIPTIONS",
"id": 3
}

Setting Properties

Currently, the only property can be set is to set whether combined stream payloads are enabled or not. The combined property is set to false when connecting using /ws/ ("raw streams") and true when connecting using /stream/.

Response

{
  "result": null,
  "id": 5
}

{
"method": "SET_PROPERTY",
"params":
[
"combined",
true
],
"id": 5
}

Retrieving Properties

Response

  {
    "result": true, // Indicates that combined is set to true.
    "id": 2
  }

{
"method": "GET_PROPERTY",
"params":
[
"combined"
],
"id": 2
}

Error Messages

Error Message Description
{"code": 0, "msg": "Unknown property", "id": '%s'} Parameter used in the SET_PROPERTY or GET_PROPERTY was invalid
{"code": 1, "msg": "Invalid value type: expected Boolean", "id": '%s'} Value should only be true or false
{"code": 2, "msg": "Invalid request: property name must be a string"} Property name provided was invalid
{"code": 2, "msg": "Invalid request: request ID must be an unsigned integer"} Parameter id had to be provided or the value provided in the id parameter is an unsupported type
{"code": 2, "msg": "Invalid request: unknown variant %s, expected one of SUBSCRIBE, UNSUBSCRIBE, LIST_SUBSCRIPTIONS, SET_PROPERTY, GET_PROPERTY at line 1 column 28"} Possible typo in the provided method or provided method was neither of the expected values
{"code": 2, "msg": "Invalid request: too many parameters"} Unnecessary parameters provided in the data
{"code": 2, "msg": "Invalid request: property name must be a string"} Property name was not provided
{"code": 2, "msg": "Invalid request: missing field method at line 1 column 73"} method was not provided in the data
{"code":3,"msg":"Invalid JSON: expected value at line %s column %s"} JSON data sent has incorrect syntax.

Aggregate Trade Streams

Payload:

{
  "e": "aggTrade",  // Event type
  "E": 1672515782136,   // Event time
  "s": "BNBBTC",    // Symbol
  "a": 12345,       // Aggregate trade ID
  "p": "0.001",     // Price
  "q": "100",       // Quantity
  "f": 100,         // First trade ID
  "l": 105,         // Last trade ID
  "T": 1672515782136,   // Trade time
  "m": true,        // Is the buyer the market maker?
  "M": true         // Ignore
}

The Aggregate Trade Streams push trade information that is aggregated for a single taker order.

Stream Name: <symbol>@aggTrade

Update Speed: Real-time

Trade Streams

Payload:

{
  "e": "trade",     // Event type
  "E": 1672515782136,   // Event time
  "s": "BNBBTC",    // Symbol
  "t": 12345,       // Trade ID
  "p": "0.001",     // Price
  "q": "100",       // Quantity
  "T": 1672515782136,   // Trade time
  "m": true,        // Is the buyer the market maker?
  "M": true         // Ignore
}

The Trade Streams push raw trade information; each trade has a unique buyer and seller.

Stream Name: <symbol>@trade

Update Speed: Real-time

Kline/Candlestick Streams for UTC

Payload:

{
  "e": "kline",     // Event type
  "E": 1672515782136,   // Event time
  "s": "BNBBTC",    // Symbol
  "k": {
    "t": 123400000, // Kline start time
    "T": 123460000, // Kline close time
    "s": "BNBBTC",  // Symbol
    "i": "1m",      // Interval
    "f": 100,       // First trade ID
    "L": 200,       // Last trade ID
    "o": "0.0010",  // Open price
    "c": "0.0020",  // Close price
    "h": "0.0025",  // High price
    "l": "0.0015",  // Low price
    "v": "1000",    // Base asset volume
    "n": 100,       // Number of trades
    "x": false,     // Is this kline closed?
    "q": "1.0000",  // Quote asset volume
    "V": "500",     // Taker buy base asset volume
    "Q": "0.500",   // Taker buy quote asset volume
    "B": "123456"   // Ignore
  }
}

The Kline/Candlestick Stream push updates to the current klines/candlestick every secondin UTC+0 timezone.

Stream Name: <symbol>@kline_<interval>

Update Speed: 1000ms for 1s, 2000ms for the other intervals Kline/Candlestick chart intervals:

s-> seconds; m -> minutes; h -> hours; d -> days; w -> weeks; M -> months

Kline/Candlestick Streams with timezone offset

Payload:

{
  "e": "kline",         // Event type
  "E": 1672515782136,   // Event time
  "s": "BNBBTC",        // Symbol
  "k": {
    "t": 1672515780000, // Kline start time
    "T": 1672515839999, // Kline close time
    "s": "BNBBTC",      // Symbol
    "i": "1m",          // Interval
    "f": 100,           // First trade ID
    "L": 200,           // Last trade ID
    "o": "0.0010",      // Open price
    "c": "0.0020",      // Close price
    "h": "0.0025",      // High price
    "l": "0.0015",      // Low price
    "v": "1000",        // Base asset volume
    "n": 100,           // Number of trades
    "x": false,         // Is this kline closed?
    "q": "1.0000",      // Quote asset volume
    "V": "500",         // Taker buy base asset volume
    "Q": "0.500",       // Taker buy quote asset volume
    "B": "123456"       // Ignore
  }
}

The Kline/Candlestick Stream push updates to the current klines/candlestick every second in UTC+8 timezone.

UTC+8 timezone offset:

Stream Name: <symbol>@kline_<interval>@+08:00

Update Speed: 1000ms for 1s, 2000ms for the other intervals

Supported intervals: See Kline/Candlestick chart intervals

Individual Symbol Mini Ticker Stream

Payload:

  {
    "e": "24hrMiniTicker",  // Event type
    "E": 1672515782136,         // Event time
    "s": "BNBBTC",          // Symbol
    "c": "0.0025",          // Close price
    "o": "0.0010",          // Open price
    "h": "0.0025",          // High price
    "l": "0.0010",          // Low price
    "v": "10000",           // Total traded base asset volume
    "q": "18"               // Total traded quote asset volume
  }

24hr rolling window mini-ticker statistics. These are NOT the statistics of the UTC day, but a 24hr rolling window for the previous 24hrs.

Stream Name: <symbol>@miniTicker

Update Speed: 1000ms

All Market Mini Tickers Stream

Payload:

[
  {
    // Same as <symbol>@miniTicker payload
  }
]

24hr rolling window mini-ticker statistics for all symbols that changed in an array. These are NOT the statistics of the UTC day, but a 24hr rolling window for the previous 24hrs. Note that only tickers that have changed will be present in the array.

Stream Name: !miniTicker@arr

Update Speed: 1000ms

Individual Symbol Ticker Streams

Payload:

{
  "e": "24hrTicker",  // Event type
  "E": 1672515782136,     // Event time
  "s": "BNBBTC",      // Symbol
  "p": "0.0015",      // Price change
  "P": "250.00",      // Price change percent
  "w": "0.0018",      // Weighted average price
  "x": "0.0009",      // First trade(F)-1 price (first trade before the 24hr rolling window)
  "c": "0.0025",      // Last price
  "Q": "10",          // Last quantity
  "b": "0.0024",      // Best bid price
  "B": "10",          // Best bid quantity
  "a": "0.0026",      // Best ask price
  "A": "100",         // Best ask quantity
  "o": "0.0010",      // Open price
  "h": "0.0025",      // High price
  "l": "0.0010",      // Low price
  "v": "10000",       // Total traded base asset volume
  "q": "18",          // Total traded quote asset volume
  "O": 0,             // Statistics open time
  "C": 86400000,      // Statistics close time
  "F": 0,             // First trade ID
  "L": 18150,         // Last trade Id
  "n": 18151          // Total number of trades
}

24hr rolling window ticker statistics for a single symbol. These are NOT the statistics of the UTC day, but a 24hr rolling window for the previous 24hrs.

Stream Name: <symbol>@ticker

Update Speed: 1000ms

Average Price

Payload:

{
  "e": "avgPrice",          // Event type
  "E": 1693907033000,       // Event time
  "s": "BTCUSDT",           // Symbol
  "i": "5m",                // Average price interval
  "w": "25776.86000000",    // Average price
  "T": 1693907032213        // Last trade time
}

Average price streams push changes in the average price over a fixed time interval.

Stream Name: <symbol>@avgPrice

Update Speed: 1000ms

All Market Tickers Stream

Payload:

[
  {
    // Same as <symbol>@ticker payload
  }
]

24hr rolling window ticker statistics for all symbols that changed in an array. These are NOT the statistics of the UTC day, but a 24hr rolling window for the previous 24hrs. Note that only tickers that have changed will be present in the array.

Stream Name: !ticker@arr

Update Speed: 1000ms

Individual Symbol Rolling Window Statistics Streams

Payload:

{
  "e": "1hTicker",    // Event type
  "E": 1672515782136,     // Event time
  "s": "BNBBTC",      // Symbol
  "p": "0.0015",      // Price change
  "P": "250.00",      // Price change percent
  "o": "0.0010",      // Open price
  "h": "0.0025",      // High price
  "l": "0.0010",      // Low price
  "c": "0.0025",      // Last price
  "w": "0.0018",      // Weighted average price
  "v": "10000",       // Total traded base asset volume
  "q": "18",          // Total traded quote asset volume
  "O": 0,             // Statistics open time
  "C": 86400000,      // Statistics close time
  "F": 0,             // First trade ID
  "L": 18150,         // Last trade Id
  "n": 18151          // Total number of trades
}

Rolling window ticker statistics for a single symbol, computed over multiple windows.

Stream Name: <symbol>@ticker_<window_size>

Window Sizes: 1h,4h,1d

Update Speed: 1000ms

Note: This stream is different from the <symbol>@ticker stream. The open time O always starts on a minute, while the closing time C is the current time of the update.

As such, the effective window might be up to 59999ms wider that <window_size>.

All Market Rolling Window Statistics Streams

Payload:

[
  {
    // Same as <symbol>@ticker_<window-size> payload,
    // one for each symbol updated within the interval.
  }
]

Rolling window ticker statistics for all market symbols, computed over multiple windows. Note that only tickers that have changed will be present in the array.

Stream Name: !ticker_<window-size>@arr

Window Size: 1h,4h,1d

Update Speed: 1000ms

Individual Symbol Book Ticker Streams

Payload:

{
  "u":400900217,     // order book updateId
  "s":"BNBUSDT",     // symbol
  "b":"25.35190000", // best bid price
  "B":"31.21000000", // best bid qty
  "a":"25.36520000", // best ask price
  "A":"40.66000000"  // best ask qty
}

Pushes any update to the best bid or ask's price or quantity in real-time for a specified symbol.

Multiple <symbol>@bookTicker streams can be subscribed to over one connection.

Stream Name: <symbol>@bookTicker

Update Speed: 1ms

Partial Book Depth Streams

Payload:

{
  "lastUpdateId": 160,  // Last update ID
  "bids": [             // Bids to be updated
    [
      "0.0024",         // Price level to be updated
      "10"              // Quantity
    ]
  ],
  "asks": [             // Asks to be updated
    [
      "0.0026",         // Price level to be updated
      "100"             // Quantity
    ]
  ]
}

Top bids and asks, Valid are 5, 10, or 20.

Stream Names: <symbol>@depth<levels> OR <symbol>@depth<levels>@100ms.

Update Speed: 1000ms or 100ms

Diff. Depth Stream

Payload:

{
  "e": "depthUpdate", // Event type
  "E": 1672515782136,     // Event time
  "s": "BNBBTC",      // Symbol
  "U": 157,           // First update ID in event
  "u": 160,           // Final update ID in event
  "b": [              // Bids to be updated
    [
      "0.0024",       // Price level to be updated
      "10"            // Quantity
    ]
  ],
  "a": [              // Asks to be updated
    [
      "0.0026",       // Price level to be updated
      "100"           // Quantity
    ]
  ]
}

Stream Name: <symbol>@depth OR <symbol>@depth@100ms

Update Speed: 1000ms or 100ms

Order book price and quantity depth updates used to locally manage an order book.

How to manage a local order book correctly

  1. Open a stream to wss://stream.binance.com:9443/ws/bnbbtc@depth.
  2. Buffer the events you receive from the stream.
  3. Get a depth snapshot from https://api.binance.com/api/v3/depth?symbol=BNBBTC&limit=1000 .
  4. Drop any event where u is <= lastUpdateId in the snapshot.
  5. The first processed event should have U <= lastUpdateId+1 AND u >= lastUpdateId+1.
  6. While listening to the stream, each new event's U should be equal to the previous event's u+1.
  7. The data in each event is the absolute quantity for a price level.
  8. If the quantity is 0, remove the price level.
  9. Receiving an event that removes a price level that is not in your local order book can happen and is normal.

Note: Due to depth snapshots having a limit on the number of price levels, a price level outside of the initial snapshot that doesn't have a quantity change won't have an update in the Diff. Depth Stream. Consequently, those price levels will not be visible in the local order book even when applying all updates from the Diff. Depth Stream correctly and cause the local order book to have some slight differences with the real order book. However, for most use cases the depth limit of 5000 is enough to understand the market and trade effectively.

Spot Trading Endpoints

Test New Order (TRADE)

Response:

{}

OR

{
  "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 commission in BNB.
  }
}

POST /api/v3/order/test

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

Data Source: Memory

New Order (TRADE)

Response ACK:

{
  "symbol": "BTCUSDT",
  "orderId": 28,
  "orderListId": -1, //Unless an order list, value will be -1
  "clientOrderId": "6gCrw2kRUAF9CvJDGP16IP",
  "transactTime": 1507725176595
}

Response RESULT:

{
  "symbol": "BTCUSDT",
  "orderId": 28,
  "orderListId": -1, //Unless an order list, value will be -1
  "clientOrderId": "6gCrw2kRUAF9CvJDGP16IP",
  "transactTime": 1507725176595,
  "price": "0.00000000",
  "origQty": "10.00000000",
  "executedQty": "10.00000000",
  "cummulativeQuoteQty": "10.00000000",
  "status": "FILLED",
  "timeInForce": "GTC",
  "type": "MARKET",
  "side": "SELL",
  "workingTime": 1507725176595,
  "selfTradePreventionMode": "NONE"
}

Response FULL:

{
  "symbol": "BTCUSDT",
  "orderId": 28,
  "orderListId": -1, //Unless an order list, value will be -1
  "clientOrderId": "6gCrw2kRUAF9CvJDGP16IP",
  "transactTime": 1507725176595,
  "price": "0.00000000",
  "origQty": "10.00000000",
  "executedQty": "10.00000000",
  "cummulativeQuoteQty": "10.00000000",
  "status": "FILLED",
  "timeInForce": "GTC",
  "type": "MARKET",
  "side": "SELL",
  "workingTime": 1507725176595,
  "selfTradePreventionMode": "NONE",
  "fills": [
    {
      "price": "4000.00000000",
      "qty": "1.00000000",
      "commission": "4.00000000",
      "commissionAsset": "USDT",
      "tradeId": 56
    },
    {
      "price": "3999.00000000",
      "qty": "5.00000000",
      "commission": "19.99500000",
      "commissionAsset": "USDT",
      "tradeId": 57
    },
    {
      "price": "3998.00000000",
      "qty": "2.00000000",
      "commission": "7.99600000",
      "commissionAsset": "USDT",
      "tradeId": 58
    },
    {
      "price": "3997.00000000",
      "qty": "1.00000000",
      "commission": "3.99700000",
      "commissionAsset": "USDT",
      "tradeId": 59
    },
    {
      "price": "3995.00000000",
      "qty": "1.00000000",
      "commission": "3.99500000",
      "commissionAsset": "USDT",
      "tradeId": 60
    }
  ]
}

POST /api/v3/order

Send in a new order.

Weight(UID): 1 Weight(IP): 1

Parameters:

Name Type Mandatory Description
symbol STRING YES
side ENUM YES
type ENUM YES
timeInForce ENUM NO
quantity DECIMAL NO
quoteOrderQty DECIMAL NO
price DECIMAL NO
newClientOrderId STRING NO A unique id among open orders. Automatically generated if not sent.
strategyId INT 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 Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders. For more details on SPOT implementation on trailing stops, please refer to Trailing Stop 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 EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE.
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Additional mandatory parameters based on type:

Type Additional mandatory parameters
LIMIT timeInForce, quantity, price
MARKET quantity or quoteOrderQty
STOP_LOSS quantity, stopPrice or trailingDelta
STOP_LOSS_LIMIT timeInForce, quantity, price, stopPrice or trailingDelta
TAKE_PROFIT quantity, stopPrice or trailingDelta
TAKE_PROFIT_LIMIT timeInForce, quantity, price, stopPrice or trailingDelta
LIMIT_MAKER quantity, price

Other info:

Trigger order price rules against market price for both MARKET and LIMIT versions:

Data Source: Matching Engine

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

Cancel Order (TRADE)

Response:

{
  "symbol": "LTCBTC",
  "origClientOrderId": "myOrder1",
  "orderId": 4,
  "orderListId": -1, //Unless part of an order list, the value will always be -1.
  "clientOrderId": "cancelMyOrder1",
  "transactTime": 1684804350068,
  "price": "2.00000000",
  "origQty": "1.00000000",
  "executedQty": "0.00000000",
  "cummulativeQuoteQty": "0.00000000",
  "status": "CANCELED",
  "timeInForce": "GTC",
  "type": "LIMIT",
  "side": "BUY",
  "selfTradePreventionMode": "NONE"
}

DELETE /api/v3/order

Cancel an active order.

Weight(IP): 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 LONG NO The value cannot be greater than 60000
timestamp LONG YES

Either orderId or origClientOrderId must be sent. If both orderId and origClientOrderId are provided, orderId takes precedence.

Data Source: Matching Engine

Regarding cancelRestrictions

Note: The payload sample does not show all fields that can appear. Please refer to Conditional fields in Order Responses.

Cancel all Open Orders on a Symbol (TRADE)

Response:

[
  {
    "symbol": "BTCUSDT",
    "origClientOrderId": "E6APeyTJvkMvLMYMqu1KQ4",
    "orderId": 11,
    "orderListId": -1,
    "clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx",
    "transactTime": 1684804350068,
    "price": "0.089853",
    "origQty": "0.178622",
    "executedQty": "0.000000",
    "cummulativeQuoteQty": "0.000000",
    "status": "CANCELED",
    "timeInForce": "GTC",
    "type": "LIMIT",
    "side": "BUY",
    "selfTradePreventionMode": "NONE"
  },
  {
    "symbol": "BTCUSDT",
    "origClientOrderId": "A3EF2HCwxgZPFMrfwbgrhv",
    "orderId": 13,
    "orderListId": -1,
    "clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx",
    "transactTime": 1684804350069,
    "price": "0.090430",
    "origQty": "0.178622",
    "executedQty": "0.000000",
    "cummulativeQuoteQty": "0.000000",
    "status": "CANCELED",
    "timeInForce": "GTC",
    "type": "LIMIT",
    "side": "BUY",
    "selfTradePreventionMode": "NONE"
  },
  {
    "orderListId": 1929,
    "contingencyType": "OCO",
    "listStatusType": "ALL_DONE",
    "listOrderStatus": "ALL_DONE",
    "listClientOrderId": "2inzWQdDvZLHbbAmAozX2N",
    "transactionTime": 1585230948299,
    "symbol": "BTCUSDT",
    "orders": [
      {
        "symbol": "BTCUSDT",
        "orderId": 20,
        "clientOrderId": "CwOOIPHSmYywx6jZX77TdL"
      },
      {
        "symbol": "BTCUSDT",
        "orderId": 21,
        "clientOrderId": "461cPg51vQjV3zIMOXNz39"
      }
    ],
    "orderReports": [
      {
        "symbol": "BTCUSDT",
        "origClientOrderId": "CwOOIPHSmYywx6jZX77TdL",
        "orderId": 20,
        "orderListId": 1929,
        "clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx",
        "transactTime": 1688005070874,
        "price": "0.668611",
        "origQty": "0.690354",
        "executedQty": "0.000000",
        "cummulativeQuoteQty": "0.000000",
        "status": "CANCELED",
        "timeInForce": "GTC",
        "type": "STOP_LOSS_LIMIT",
        "side": "BUY",
        "stopPrice": "0.378131",
        "icebergQty": "0.017083",
        "selfTradePreventionMode": "NONE"
      },
      {
        "symbol": "BTCUSDT",
        "origClientOrderId": "461cPg51vQjV3zIMOXNz39",
        "orderId": 21,
        "orderListId": 1929,
        "clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx",
        "transactTime": 1688005070874,
        "price": "0.008791",
        "origQty": "0.690354",
        "executedQty": "0.000000",
        "cummulativeQuoteQty": "0.000000",
        "status": "CANCELED",
        "timeInForce": "GTC",
        "type": "LIMIT_MAKER",
        "side": "BUY",
        "icebergQty": "0.639962",
        "selfTradePreventionMode": "NONE"
      }
    ]
  }
]

DELETE /api/v3/openOrders

Cancels all active orders on a symbol.

This includes orders that are part of an order list.

Weight(IP): 1

Parameters

Name Type Mandatory Description
symbol STRING YES
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Data Source: Matching Engine

Note: The payload sample does not show all fields that can appear. Please refer to Conditional fields in Order Responses.

Query Order (USER_DATA)

Response:

{
  "symbol": "LTCBTC",
  "orderId": 1,
  "orderListId": -1, //Unless an order list, value will be -1
  "clientOrderId": "myOrder1",
  "price": "0.1",
  "origQty": "1.0",
  "executedQty": "0.0",
  "cummulativeQuoteQty": "0.0",
  "status": "NEW",
  "timeInForce": "GTC",
  "type": "LIMIT",
  "side": "BUY",
  "stopPrice": "0.0",
  "icebergQty": "0.0",
  "time": 1499827319559,
  "updateTime": 1499827319559,
  "isWorking": true,
  "workingTime":1499827319559,
  "origQuoteOrderQty": "0.000000",
  "selfTradePreventionMode": "NONE"
}

GET /api/v3/order

Check an order's status.

Weight(IP): 4

Parameters:

Name Type Mandatory Description
symbol STRING YES
orderId LONG NO
origClientOrderId STRING NO
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Notes:

Data Source: Memory => Database

Cancel an Existing Order and Send a New Order (TRADE)

Response SUCCESS and account has not exceeded the order rate limit:

//Both the cancel order placement and new order placement succeeded.
{
  "cancelResult": "SUCCESS",
  "newOrderResult": "SUCCESS",
  "cancelResponse": {
    "symbol": "BTCUSDT",
    "origClientOrderId": "DnLo3vTAQcjha43lAZhZ0y",
    "orderId": 9,
    "orderListId": -1,
    "clientOrderId": "osxN3JXAtJvKvCqGeMWMVR",
    "transactTime": 1684804350068,
    "price": "0.01000000",
    "origQty": "0.000100",
    "executedQty": "0.00000000",
    "cummulativeQuoteQty": "0.00000000",
    "status": "CANCELED",
    "timeInForce": "GTC",
    "type": "LIMIT",
    "side": "SELL",
    "selfTradePreventionMode": "NONE"
  },
  "newOrderResponse": {
    "symbol": "BTCUSDT",
    "orderId": 10,
    "orderListId": -1,
    "clientOrderId": "wOceeeOzNORyLiQfw7jd8S",
    "transactTime": 1652928801803,
    "price": "0.02000000",
    "origQty": "0.040000",
    "executedQty": "0.00000000",
    "cummulativeQuoteQty": "0.00000000",
    "status": "NEW",
    "timeInForce": "GTC",
    "type": "LIMIT",
    "side": "BUY",
    "workingTime": 1669277163808,
    "fills": [],
    "selfTradePreventionMode": "NONE"
  }
}

Response when Cancel Order Fails with STOP_ON_FAILURE:

{
  "code": -2022,
  "msg": "Order cancel-replace failed.",
  "data": {
    "cancelResult": "FAILURE",
    "newOrderResult": "NOT_ATTEMPTED",
    "cancelResponse": {
      "code": -2011,
      "msg": "Unknown order sent."
    },
    "newOrderResponse": null
  }
}

Response when Cancel Order Succeeds but New Order Placement Fails and account has not exceeded the order rate limit:

{
  "code": -2021,
  "msg": "Order cancel-replace partially failed.",
  "data": {
    "cancelResult": "SUCCESS",
    "newOrderResult": "FAILURE",
    "cancelResponse": {
      "symbol": "BTCUSDT",
      "origClientOrderId": "86M8erehfExV8z2RC8Zo8k",
      "orderId": 3,
      "orderListId": -1,
      "clientOrderId": "G1kLo6aDv2KGNTFcjfTSFq",
      "transactTime": 1684804350068,
      "price": "0.006123",
      "origQty": "10000.000000",
      "executedQty": "0.000000",
      "cummulativeQuoteQty": "0.000000",
      "status": "CANCELED",
      "timeInForce": "GTC",
      "type": "LIMIT_MAKER",
      "side": "SELL",
      "selfTradePreventionMode": "NONE"
    },
    "newOrderResponse": {
      "code": -2010,
      "msg": "Order would immediately match and take."
    }
  }
}

Response when Cancel Order fails with ALLOW_FAILURE and account has not exceeded the order rate limit:

{
  "code": -2021,
  "msg": "Order cancel-replace partially failed.",
  "data": {
    "cancelResult": "FAILURE",
    "newOrderResult": "SUCCESS",
    "cancelResponse": {
      "code": -2011,
      "msg": "Unknown order sent."
    },
    "newOrderResponse": {
      "symbol": "BTCUSDT",
      "orderId": 11,
      "orderListId": -1,
      "clientOrderId": "pfojJMg6IMNDKuJqDxvoxN",
      "transactTime": 1648540168818
    }
  }
}

Response when both Cancel Order and New Order Placement fail using cancelReplaceMode=ALLOW_FAILURE and account has not exceeded the order rate limit:

{
  "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."
    }
  }
}

Response when using orderRateLimitExceededMode=DO_NOTHING and account's order rate limit has been exceeded:

{
  "code": -1015,
  "msg": "Too many new orders; current limit is 1 orders per 10 SECOND." 
}

Response when using orderRateLimitExceededMode=CANCEL_ONLY and account's order rate limit has been exceeded:

{
  "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",
      "cummulativeQuoteQty": "0.00",
      "status": "CANCELED",
      "timeInForce": "GTC",
      "type": "LIMIT",
      "side": "SELL",
      "selfTradePreventionMode": "NONE" 
    },
    "newOrderResponse": {
      "code": -1015,
      "msg": "Too many new orders; current limit is 1 orders per 10 SECOND." 
    }
  }
}

POST /api/v3/order/cancelReplace

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 order count by 1.

Weight(IP): 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 the cancelOrigClientOrderId or cancelOrderId must be provided. If both are provided, cancelOrderId takes precedence.
cancelOrderId LONG NO Either the cancelOrigClientOrderId or cancelOrderId must be provided. If both are provided, cancelOrderId takes precedence.
newClientOrderId STRING NO Used to identify the new order.
strategyId INT NO
strategyType INT NO The value cannot be less than 1000000.
stopPrice DECIMAL NO
trailingDelta LONG NO
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 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
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
recvWindow LONG NO The value cannot be greater than 60000
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

Request Response
cancelReplaceMode orderRateLimitExceededMode Order Count Usage 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

Note: The payload sample does not show all fields that can appear. Please refer to Conditional fields in Order Responses.

Current Open Orders (USER_DATA)

Response:

[
  {
    "symbol": "LTCBTC",
    "orderId": 1,
    "orderListId": -1, //Unless an order list, the value will always be -1
    "clientOrderId": "myOrder1",
    "price": "0.1",
    "origQty": "1.0",
    "executedQty": "0.0",
    "cummulativeQuoteQty": "0.0",
    "status": "NEW",
    "timeInForce": "GTC",
    "type": "LIMIT",
    "side": "BUY",
    "stopPrice": "0.0",
    "icebergQty": "0.0",
    "time": 1499827319559,
    "updateTime": 1499827319559,
    "isWorking": true,
    "workingTime": 1499827319559,
    "origQuoteOrderQty": "0.000000",
    "selfTradePreventionMode": "NONE"
  }
]

GET /api/v3/openOrders

Get all open orders on a symbol. Careful when accessing this with no symbol.

Weight(IP): 6 for a single symbol; 80 when the symbol parameter is omitted;

Parameters:

Name Type Mandatory Description
symbol STRING NO
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Data Source: Memory => Database

Note: The payload sample does not show all fields that can appear. Please refer to Conditional fields in Order Responses.

All Orders (USER_DATA)

Response:

[
  {
    "symbol": "LTCBTC",
    "orderId": 1,
    "orderListId": -1, //Unless an order list, the value will always be -1
    "clientOrderId": "myOrder1",
    "price": "0.1",
    "origQty": "1.0",
    "executedQty": "0.0",
    "cummulativeQuoteQty": "0.0",
    "status": "NEW",
    "timeInForce": "GTC",
    "type": "LIMIT",
    "side": "BUY",
    "stopPrice": "0.0",
    "icebergQty": "0.0",
    "time": 1499827319559,
    "updateTime": 1499827319559,
    "isWorking": true,
    "origQuoteOrderQty": "0.000000",
    "workingTime": 1499827319559,
    "selfTradePreventionMode": "NONE"
  }
]

GET /api/v3/allOrders

Get all account orders; active, canceled, or filled.

Weight(IP): 20

Parameters:

Name Type Mandatory Description
symbol STRING YES
orderId LONG NO
startTime LONG NO
endTime LONG NO
limit INT NO Default 500; max 1000.
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Notes:

Data Source: Database

New OCO - Deprecated (TRADE)

Response:

{
  "orderListId": 0,
  "contingencyType": "OCO",
  "listStatusType": "EXEC_STARTED",
  "listOrderStatus": "EXECUTING",
  "listClientOrderId": "JYVpp3F0f5CAG15DhtrqLp",
  "transactionTime": 1563417480525,
  "symbol": "LTCBTC",
  "orders": [
    {
      "symbol": "LTCBTC",
      "orderId": 2,
      "clientOrderId": "Kk7sqHb9J6mJWTMDVW7Vos"
    },
    {
      "symbol": "LTCBTC",
      "orderId": 3,
      "clientOrderId": "xTXKaGYd4bluPVp78IVRvl"
    }
  ],
  "orderReports": [
    {
      "symbol": "LTCBTC",
      "orderId": 2,
      "orderListId": 0,
      "clientOrderId": "Kk7sqHb9J6mJWTMDVW7Vos",
      "transactTime": 1563417480525,
      "price": "0.000000",
      "origQty": "0.624363",
      "executedQty": "0.000000",
      "cummulativeQuoteQty": "0.000000",
      "status": "NEW",
      "timeInForce": "GTC",
      "type": "STOP_LOSS",
      "side": "BUY",
      "stopPrice": "0.960664",
      "workingTime": -1,
      "selfTradePreventionMode": "NONE"
    },
    {
      "symbol": "LTCBTC",
      "orderId": 3,
      "orderListId": 0,
      "clientOrderId": "xTXKaGYd4bluPVp78IVRvl",
      "transactTime": 1563417480525,
      "price": "0.036435",
      "origQty": "0.624363",
      "executedQty": "0.000000",
      "cummulativeQuoteQty": "0.000000",
      "status": "NEW",
      "timeInForce": "GTC",
      "type": "LIMIT_MAKER",
      "side": "BUY",
      "workingTime": 1563417480525,
      "selfTradePreventionMode": "NONE"
    }
  ]
}

POST /api/v3/order/oco

Send in a new OCO

Weight(UID): 2 Weight(IP): 1

Parameters:

Name Type Mandatory Description
symbol STRING YES
listClientOrderId STRING NO A unique Id for the entire orderList
side ENUM YES
quantity DECIMAL YES
limitClientOrderId STRING NO A unique Id for the limit order
limitStrategyId INT NO
limitStrategyType INT NO The value cannot be less than 1000000.
price DECIMAL YES
limitIcebergQty DECIMAL NO
trailingDelta LONG NO
stopClientOrderId STRING NO A unique Id for the stop loss/stop loss limit leg
stopPrice DECIMAL YES
stopStrategyId INT NO
stopStrategyType INT NO The value cannot be less than 1000000.
stopLimitPrice DECIMAL NO If provided, stopLimitTimeInForce is required.
stopIcebergQty DECIMAL NO
stopLimitTimeInForce ENUM NO Valid values are GTC/FOK/IOC
newOrderRespType ENUM NO Set the response JSON.
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.
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Other Info:

Data Source: Matching Engine

New Order List - OCO (TRADE)

Response:

{
    "orderListId": 1,
    "contingencyType": "OCO",
    "listStatusType": "EXEC_STARTED",
    "listOrderStatus": "EXECUTING",
    "listClientOrderId": "lH1YDkuQKWiXVXHPSKYEIp",
    "transactionTime": 1710485608839,
    "symbol": "LTCBTC",
    "orders": [
        {
            "symbol": "LTCBTC",
            "orderId": 10,
            "clientOrderId": "44nZvqpemY7sVYgPYbvPih"
        },
        {
            "symbol": "LTCBTC",
            "orderId": 11,
            "clientOrderId": "NuMp0nVYnciDiFmVqfpBqK"
        }
    ],
    "orderReports": [
        {
            "symbol": "LTCBTC",
            "orderId": 10,
            "orderListId": 1,
            "clientOrderId": "44nZvqpemY7sVYgPYbvPih",
            "transactTime": 1710485608839,
            "price": "1.00000000",
            "origQty": "5.00000000",
            "executedQty": "0.00000000",
            "cummulativeQuoteQty": "0.00000000",
            "status": "NEW",
            "timeInForce": "GTC",
            "type": "STOP_LOSS_LIMIT",
            "side": "SELL",
            "stopPrice": "1.00000000",
            "workingTime": -1,
            "icebergQty": "1.00000000",
            "selfTradePreventionMode": "NONE"
        },
        {
            "symbol": "LTCBTC",
            "orderId": 11,
            "orderListId": 1,
            "clientOrderId": "NuMp0nVYnciDiFmVqfpBqK",
            "transactTime": 1710485608839,
            "price": "3.00000000",
            "origQty": "5.00000000",
            "executedQty": "0.00000000",
            "cummulativeQuoteQty": "0.00000000",
            "status": "NEW",
            "timeInForce": "GTC",
            "type": "LIMIT_MAKER",
            "side": "SELL",
            "workingTime": 1710485608839,
            "selfTradePreventionMode": "NONE"
        }
    ]
}

POST /api/v3/orderList/oco

Send in an one-cancels-the-other (OCO) pair, where activation of one order immediately cancels the other.

Response format for orderReports is selected using the newOrderRespType parameter. The response example is for the RESULT response type. See POST /api/v3/order for more examples.

Weight(IP): 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 aboveClientOrderId and the belowCLientOrderId.
side ENUM Yes BUY or SELL
quantity DECIMAL Yes Quantity for both legs of the order list.
aboveType ENUM Yes Supported values : STOP_LOSS_LIMIT, STOP_LOSS, LIMIT_MAKER
aboveClientOrderId STRING No Arbitrary unique ID among open orders for the above leg order. Automatically generated if not sent
aboveIcebergQty LONG No Note that this can only be used if aboveTimeInForce is GTC.
abovePrice DECIMAL No
aboveStopPrice DECIMAL No Can be used if aboveType is STOP_LOSS or STOP_LOSS_LIMIT.
Either aboveStopPrice or aboveTrailingDelta or both, must be specified.
aboveTrailingDelta LONG No See Trailing Stop order FAQ.
aboveTimeInForce DECIMAL No Required if the aboveType is STOP_LOSS_LIMIT.
aboveStrategyId INT No Arbitrary numeric value identifying the above leg order within an order strategy.
aboveStrategyType INT No Arbitrary numeric value identifying the above leg order strategy.
Values smaller than 1000000 are reserved and cannot be used.
belowType ENUM Yes Supported values : STOP_LOSS_LIMIT, STOP_LOSS, LIMIT_MAKER
belowClientOrderId STRING No Arbitrary unique ID among open orders for the below leg order. Automatically generated if not sent
belowIcebergQty LONG No Note that this can only be used if belowTimeInForce is GTC.
belowPrice DECIMAL No
belowStopPrice DECIMAL No Can be used if belowType is STOP_LOSS or STOP_LOSS_LIMIT.
Either belowStopPrice or belowTrailingDelta or both, must be specified.
belowTrailingDelta LONG No See Trailing Stop order FAQ.
belowTimeInForce ENUM No Required if the belowType is STOP_LOSS_LIMIT.
belowStrategyId INT No Arbitrary numeric value identifying the below leg order within an order strategy.
belowStrategyType INT No Arbitrary numeric value identifying the below leg 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 EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE.
recvWindow LONG No The value cannot be greater than 60000.
timestamp LONG Yes

Data Source: Matching Engine

New Order List - OTO (TRADE)

Response:

{
    "orderListId": 0,
    "contingencyType": "OTO",
    "listStatusType": "EXEC_STARTED",
    "listOrderStatus": "EXECUTING",
    "listClientOrderId": "yl2ERtcar1o25zcWtqVBTC",
    "transactionTime": 1712289389158,
    "symbol": "ABCDEF",
    "orders": [
        {
            "symbol": "LTCBTC",
            "orderId": 4,
            "clientOrderId": "Bq17mn9fP6vyCn75Jw1xya"
        },
        {
            "symbol": "LTCBTC",
            "orderId": 5,
            "clientOrderId": "arLFo0zGJVDE69cvGBaU0d"
        }
    ],
    "orderReports": [
        {
            "symbol": "LTCBTC",
            "orderId": 4,
            "orderListId": 0,
            "clientOrderId": "Bq17mn9fP6vyCn75Jw1xya",
            "transactTime": 1712289389158,
            "price": "1.00000000",
            "origQty": "1.00000000",
            "executedQty": "0.00000000",
            "cummulativeQuoteQty": "0.00000000",
            "status": "NEW",
            "timeInForce": "GTC",
            "type": "LIMIT",
            "side": "SELL",
            "workingTime": 1712289389158,
            "selfTradePreventionMode": "NONE"
        },
        {
            "symbol": "LTCBTC",
            "orderId": 5,
            "orderListId": 0,
            "clientOrderId": "arLFo0zGJVDE69cvGBaU0d",
            "transactTime": 1712289389158,
            "price": "0.00000000",
            "origQty": "5.00000000",
            "executedQty": "0.00000000",
            "cummulativeQuoteQty": "0.00000000",
            "status": "PENDING_NEW",
            "timeInForce": "GTC",
            "type": "MARKET",
            "side": "BUY",
            "workingTime": -1,
            "selfTradePreventionMode": "NONE"
        }
    ]
}

POST /api/v3/orderList/oto

Weight:(IP) 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: ACK, FULL, RESULT
selfTradePreventionMode ENUM NO The allowed values are dependent on what is configured on the symbol.
workingType ENUM YES Supported values: LIMIT,LIMIT_MAKER
workingSide ENUM YES Supported values: BUY, SELL
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 YES This can only be used if workingTimeInForce is GTC or if workingType is LIMIT_MAKER.
workingTimeInForce ENUM NO Supported values: FOK, IOC, GTC
workingStrategyId INT 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 Note that MARKET orders using quoteOrderQty are not supported.
pendingSide ENUM YES Supported values: BUY, SELL
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: GTC, FOK, IOC
pendingStrategyId INT 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

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

New Order List - OTOCO (TRADE)

Response:

{
    "orderListId": 1,
    "contingencyType": "OTO",
    "listStatusType": "EXEC_STARTED",
    "listOrderStatus": "EXECUTING",
    "listClientOrderId": "RumwQpBaDctlUu5jyG5rs0",
    "transactionTime": 1712291372842,
    "symbol": "ABCDEF",
    "orders": [
        {
            "symbol": "LTCBTC",
            "orderId": 6,
            "clientOrderId": "fM9Y4m23IFJVCQmIrlUmMK"
        },
        {
            "symbol": "LTCBTC",
            "orderId": 7,
            "clientOrderId": "6pcQbFIzTXGZQ1e2MkGDq4"
        },
        {
            "symbol": "LTCBTC",
            "orderId": 8,
            "clientOrderId": "r4JMv9cwAYYUwwBZfbussx"
        }
    ],
    "orderReports": [
        {
            "symbol": "LTCBTC",
            "orderId": 6,
            "orderListId": 1,
            "clientOrderId": "fM9Y4m23IFJVCQmIrlUmMK",
            "transactTime": 1712291372842,
            "price": "1.00000000",
            "origQty": "1.00000000",
            "executedQty": "0.00000000",
            "cummulativeQuoteQty": "0.00000000",
            "status": "NEW",
            "timeInForce": "GTC",
            "type": "LIMIT",
            "side": "SELL",
            "workingTime": 1712291372842,
            "selfTradePreventionMode": "NONE"
        },
        {
            "symbol": "LTCBTC",
            "orderId": 7,
            "orderListId": 1,
            "clientOrderId": "6pcQbFIzTXGZQ1e2MkGDq4",
            "transactTime": 1712291372842,
            "price": "1.00000000",
            "origQty": "5.00000000",
            "executedQty": "0.00000000",
            "cummulativeQuoteQty": "0.00000000",
            "status": "PENDING_NEW",
            "timeInForce": "IOC",
            "type": "STOP_LOSS_LIMIT",
            "side": "BUY",
            "stopPrice": "6.00000000",
            "workingTime": -1,
            "selfTradePreventionMode": "NONE"
        },
        {
            "symbol": "LTCBTC",
            "orderId": 8,
            "orderListId": 1,
            "clientOrderId": "r4JMv9cwAYYUwwBZfbussx",
            "transactTime": 1712291372842,
            "price": "3.00000000",
            "origQty": "5.00000000",
            "executedQty": "0.00000000",
            "cummulativeQuoteQty": "0.00000000",
            "status": "PENDING_NEW",
            "timeInForce": "GTC",
            "type": "LIMIT_MAKER",
            "side": "BUY",
            "workingTime": -1,
            "selfTradePreventionMode": "NONE"
        }
    ]
}

POST /api/v3/orderList/otoco

Place an OTOCO.

Weight:(IP) 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: ACK, FULL, RESPONSE
selfTradePreventionMode ENUM NO The allowed values are dependent on what is configured on the symbol.
workingType ENUM YES Supported values: LIMIT, LIMIT_MAKER
workingSide ENUM YES Supported values: BUY, SELL
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: GTC, IOC, FOK
workingStrategyId INT 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: BUY, SELL
pendingQuantity DECIMAL YES
pendingAboveType ENUM YES Supported values: LIMIT_MAKER, STOP_LOSS, and STOP_LOSS_LIMIT
pendingAboveClientOrderId STRING NO Arbitrary unique ID among open orders for the pending above order.
Automatically generated if not sent.
pendingAbovePrice DECIMAL NO
pendingAboveStopPrice DECIMAL NO
pendingAboveTrailingDelta DECIMAL NO
pendingAboveIcebergQty DECIMAL NO This can only be used if pendingAboveTimeInForce is GTC or if pendingAboveType is LIMIT_MAKER.
pendingAboveTimeInForce ENUM NO
pendingAboveStrategyId INT 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: LIMIT_MAKER, STOP_LOSS, and STOP_LOSS_LIMIT
pendingBelowClientOrderId STRING NO Arbitrary unique ID among open orders for the pending below order.
Automatically generated if not sent.
pendingBelowPrice DECIMAL NO
pendingBelowStopPrice DECIMAL NO
pendingBelowTrailingDelta DECIMAL NO
pendingBelowIcebergQty DECIMAL NO This can only be used if pendingBelowTimeInForce is GTC or if pendingBelowType is LIMIT_MAKER.
pendingBelowTimeInForce ENUM NO
pendingBelowStrategyId INT 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

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 pendingAboveStopPrice and/or pendingAboveTrailingDelta
pendingAboveType=STOP_LOSS_LIMIT pendingAbovePrice, pendingAboveStopPrice and/or pendingAboveTrailingDelta, pendingAboveTimeInForce
pendingBelowType= LIMIT_MAKER pendingBelowPrice
pendingBelowType= STOP_LOSS pendingBelowStopPrice and/or pendingBelowTrailingDelta
pendingBelowType=STOP_LOSS_LIMIT pendingBelowPrice, pendingBelowStopPrice and/or pendingBelowTrailingDelta, pendingBelowTimeInForce

Data Source:

Matching Engine

Cancel Order lists (TRADE)

Response:

{
  "orderListId": 0,
  "contingencyType": "OCO",
  "listStatusType": "ALL_DONE",
  "listOrderStatus": "ALL_DONE",
  "listClientOrderId": "C3wyj4WVEktd7u9aVBRXcN",
  "transactionTime": 1574040868128,
  "symbol": "LTCBTC",
  "orders": [
    {
      "symbol": "LTCBTC",
      "orderId": 2,
      "clientOrderId": "pO9ufTiFGg3nw2fOdgeOXa"
    },
    {
      "symbol": "LTCBTC",
      "orderId": 3,
      "clientOrderId": "TXOvglzXuaubXAaENpaRCB"
    }
  ],
  "orderReports": [
    {
      "symbol": "LTCBTC",
      "origClientOrderId": "pO9ufTiFGg3nw2fOdgeOXa",
      "orderId": 2,
      "orderListId": 0,
      "clientOrderId": "unfWT8ig8i0uj6lPuYLez6",
      "transactTime": 1688005070874,
      "price": "1.00000000",
      "origQty": "10.00000000",
      "executedQty": "0.00000000",
      "cummulativeQuoteQty": "0.00000000",
      "status": "CANCELED",
      "timeInForce": "GTC",
      "type": "STOP_LOSS_LIMIT",
      "side": "SELL",
      "stopPrice": "1.00000000",
      "selfTradePreventionMode": "NONE"
    },
    {
      "symbol": "LTCBTC",
      "origClientOrderId": "TXOvglzXuaubXAaENpaRCB",
      "orderId": 3,
      "orderListId": 0,
      "clientOrderId": "unfWT8ig8i0uj6lPuYLez6",
      "transactTime": 1688005070874,
      "price": "3.00000000",
      "origQty": "10.00000000",
      "executedQty": "0.00000000",
      "cummulativeQuoteQty": "0.00000000",
      "status": "CANCELED",
      "timeInForce": "GTC",
      "type": "LIMIT_MAKER",
      "side": "SELL",
      "selfTradePreventionMode": "NONE"
    }
  ]
}

DELETE /api/v3/orderList

Cancel an entire Order List.

Weight(IP): 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 LONG NO The value cannot be greater than 60000
timestamp LONG YES

Additional notes:

Data Source: Matching Engine

Query Order lists (USER_DATA)

Response:

{
  "orderListId": 27,
  "contingencyType": "OCO",
  "listStatusType": "EXEC_STARTED",
  "listOrderStatus": "EXECUTING",
  "listClientOrderId": "h2USkA5YQpaXHPIrkd96xE",
  "transactionTime": 1565245656253,
  "symbol": "LTCBTC",
  "orders": [
    {
      "symbol": "LTCBTC",
      "orderId": 4,
      "clientOrderId": "qD1gy3kc3Gx0rihm9Y3xwS"
    },
    {
      "symbol": "LTCBTC",
      "orderId": 5,
      "clientOrderId": "ARzZ9I00CPM8i3NhmU9Ega"
    }
  ]
}

GET /api/v3/orderList

Retrieves a specific Order list based on provided optional parameters

Weight(IP): 4

Parameters:

Name Type Mandatory Description
orderListId LONG NO Either orderListId or origClientOrderId must be provided
origClientOrderId STRING NO Either orderListId or origClientOrderId must be provided
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Data Source: Database

Query all Order lists (USER_DATA)

Response:

[
  {
    "orderListId": 29,
    "contingencyType": "OCO",
    "listStatusType": "EXEC_STARTED",
    "listOrderStatus": "EXECUTING",
    "listClientOrderId": "amEEAXryFzFwYF1FeRpUoZ",
    "transactionTime": 1565245913483,
    "symbol": "LTCBTC",
    "orders": [
      {
        "symbol": "LTCBTC",
        "orderId": 4,
        "clientOrderId": "oD7aesZqjEGlZrbtRpy5zB"
      },
      {
        "symbol": "LTCBTC",
        "orderId": 5,
        "clientOrderId": "Jr1h6xirOxgeJOUuYQS7V3"
      }
    ]
  },
  {
    "orderListId": 28,
    "contingencyType": "OCO",
    "listStatusType": "EXEC_STARTED",
    "listOrderStatus": "EXECUTING",
    "listClientOrderId": "hG7hFNxJV6cZy3Ze4AUT4d",
    "transactionTime": 1565245913407,
    "symbol": "LTCBTC",
    "orders": [
      {
        "symbol": "LTCBTC",
        "orderId": 2,
        "clientOrderId": "j6lFOfbmFMRjTYA7rRJ0LP"
      },
      {
        "symbol": "LTCBTC",
        "orderId": 3,
        "clientOrderId": "z0KCjOdditiLS5ekAFtK81"
      }
    ]
  }
]

GET /api/v3/allOrderList

Retrieves all Order lists based on provided optional parameters

Weight(IP): 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 Value: 500; Max Value: 1000
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Data Source: Database

Query Open Order lists (USER_DATA)

Response:

[
  {
    "orderListId": 31,
    "contingencyType": "OCO",
    "listStatusType": "EXEC_STARTED",
    "listOrderStatus": "EXECUTING",
    "listClientOrderId": "wuB13fmulKj3YjdqWEcsnp",
    "transactionTime": 1565246080644,
    "symbol": "LTCBTC",
    "orders": [
      {
        "symbol": "LTCBTC",
        "orderId": 4,
        "clientOrderId": "r3EH2N76dHfLoSZWIUw1bT"
      },
      {
        "symbol": "LTCBTC",
        "orderId": 5,
        "clientOrderId": "Cv1SnyPD3qhqpbjpYEHbd2"
      }
    ]
  }
]

GET /api/v3/openOrderList

Weight(IP): 6

Parameters

Name Type Mandatory Description
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Data Source: Database

New order using SOR (TRADE)

Response:

{
  "symbol": "BTCUSDT",
  "orderId": 2,
  "orderListId": -1,
  "clientOrderId": "sBI1KM6nNtOfj5tccZSKly",
  "transactTime": 1689149087774,
  "price": "31000.00000000",
  "origQty": "0.50000000",
  "executedQty": "0.50000000",
  "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
}

POST /api/v3/sor/order

Places an order using smart order routing (SOR).

Weight: 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 INT 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 EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE.
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Note: POST /api/v3/sor/order only supports LIMIT and MARKET orders. quoteOrderQty is not supported.

Data Source: Matching Engine

Test new order using SOR (TRADE)

Response:

{}

OR

{
  "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 commission in BNB.
  }
}

POST /api/v3/sor/order/test

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

Spot Account Endpoints

Account Information (USER_DATA)

Response:

{
  "makerCommission": 15,
  "takerCommission": 15,
  "buyerCommission": 0,
  "sellerCommission": 0,
  "commissionRates": {
    "maker": "0.00150000",
    "taker": "0.00150000",
    "buyer": "0.00000000",
    "seller": "0.00000000"
  },
  "canTrade": true,
  "canWithdraw": true,
  "canDeposit": true,
  "brokered": false,
  "requireSelfTradePrevention": false,
  "preventSor": false,
  "updateTime": 123456789,
  "accountType": "SPOT",
  "balances": [
    {
      "asset": "BTC",
      "free": "4723846.89208129",
      "locked": "0.00000000"
    },
    {
      "asset": "LTC",
      "free": "4763368.68006011",
      "locked": "0.00000000"
    }
  ],
  "permissions": [
    "SPOT"
  ],
  "uid": 354937868
}

GET /api/v3/account

Get current account information.

Weight(IP): 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 LONG NO The value cannot be greater than 60000
timestamp LONG YES

Data Source: Memory => Database

Account Trade List (USER_DATA)

Response:

[
  {
    "symbol": "BNBBTC",
    "id": 28457,
    "orderId": 100234,
    "orderListId": -1, //Unless an order list, the value will always be -1
    "price": "4.00000100",
    "qty": "12.00000000",
    "quoteQty": "48.000012",
    "commission": "10.10000000",
    "commissionAsset": "BNB",
    "time": 1499865549590,
    "isBuyer": true,
    "isMaker": false,
    "isBestMatch": true
  }
]

GET /api/v3/myTrades

Get trades for a specific account and symbol.

Weight(IP): 20

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; max 1000.
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Notes:

Data Source: Memory => Database

Query Unfilled Order Count (USER_DATA)

Response:

[

  {
    "rateLimitType": "ORDERS",
    "interval": "SECOND",
    "intervalNum": 10,
    "limit": 10000,
    "count": 0
  },
  {
    "rateLimitType": "ORDERS",
    "interval": "DAY",
    "intervalNum": 1,
    "limit": 20000,
    "count": 0
  }
]

GET /api/v3/rateLimit/order

Displays the user's unfilled order count for all intervals.

Weight(IP): 40

Parameters:

Name Type Mandatory Description
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Data Source: Memory

Query Prevented Matches (USER_DATA)

Response:

[
  {
    "symbol": "BTCUSDT",
    "preventedMatchId": 1,
    "takerOrderId": 5,
    "makerOrderId": 3,
    "tradeGroupId": 1,
    "selfTradePreventionMode": "EXPIRE_MAKER",
    "price": "1.100000",
    "makerPreventedQuantity": "1.300000",
    "transactTime": 1669101687094
  }
]

GET /api/v3/myPreventedMatches

Displays the list of orders that were expired because of STP.

For additional information on what a Prevented match is, as well as Self Trade Prevention (STP), please refer to our STP FAQ page.

These are the combinations supported:

Parameters:

Name Type Mandatory Description
symbol STRING YES
preventedMatchId LONG NO
orderId LONG NO
fromPreventedMatchId LONG NO
limit INT NO Default: 500; Max: 1000
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Weight(IP)

Case Weight
If symbol is invalid 2
Querying by preventedMatchId 2
Querying by orderId 20

Data Source:

Database

Query Allocations (USER_DATA)

Response:

[
  {
    "symbol": "BTCUSDT",
    "allocationId": 0,
    "allocationType": "SOR",
    "orderId": 1,
    "orderListId": -1,
    "price": "1.00000000",
    "qty": "5.00000000",
    "quoteQty": "5.00000000",
    "commission": "0.00000000",
    "commissionAsset": "BTC",
    "time": 1687506878118,
    "isBuyer": true,
    "isMaker": false,
    "isAllocator": false
  }
]

GET /api/v3/myAllocations

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;Max 1000
orderId LONG No
recvWindow LONG No The value cannot be greater than 60000.
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

Query Commission Rates (USER_DATA)

Response:

{
  "symbol": "BTCUSDT",
  "standardCommission": {         //Standard commission rates on trades from the order.
    "maker": "0.00000010",
    "taker": "0.00000020",
    "buyer": "0.00000030",
    "seller": "0.00000040" 
  },
  "taxCommission": {              //Tax commission rates for trades from the order.
    "maker": "0.00000112",
    "taker": "0.00000114",
    "buyer": "0.00000118",
    "seller": "0.00000116" 
  },
  "discount": {                   //Discount commission when paying in BNB
    "enabledForAccount": true,
    "enabledForSymbol": true,
    "discountAsset": "BNB",
    "discount": "0.75000000"      //Standard commission is reduced by this rate when paying commission in BNB.
  }
}

GET /api/v3/account/commission

Get current account commission rates.

Weight: 20

Parameters:

Name Type Mandatory Description
symbol STRING YES

Data Source: Database

Margin Account/Trade

Margin account borrow/repay(MARGIN)

Response:

{
  //transaction id
  "tranId": 100000001
}

POST /sapi/v1/margin/borrow-repay

Margin account borrow/repay(MARGIN)

Weight(UID): 1500

Parameters:

Name Type Mandatory Description
asset STRING YES
isIsolated STRING YES TRUE for Isolated Margin, FALSE for Cross Margin, Default FALSE
symbol STRING YES Only for Isolated margin
amount STRING YES
type STRING YES BORROW or REPAY
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Query borrow/repay records in Margin account(USER_DATA)

Response:

{
  "rows": [
      {
        "isolatedSymbol": "BNBUSDT",     // isolated symbol, will not be returned for crossed margin
        "amount": "14.00000000",   // Total amount borrowed/repaid
        "asset": "BNB",   
        "interest": "0.01866667",    // Interest repaid
        "principal": "13.98133333",   // Principal repaid
        "status": "CONFIRMED",   //one of PENDING (pending execution), CONFIRMED (successfully execution), FAILED (execution failed, nothing happened to your account);
        "timestamp": 1563438204000,
        "txId": 2970933056
      }
  ],
  "total": 1
}

GET /sapi/v1/margin/borrow-repay

Query borrow/repay records in Margin account

Weight(IP): 10

Parameters:

Name Type Mandatory Description
asset STRING NO
isolatedSymbol STRING NO Symbol in Isolated Margin
txId LONG NO tranId in POST /sapi/v1/margin/loan
startTime LONG NO
endTime LONG NO
current LONG NO Current querying page. Start from 1. Default:1
size LONG NO Default:10 Max:100
type STRING YES BORROW or REPAY
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Get All Margin Assets (MARKET_DATA)

Response:

[
  {
    "assetFullName": "USD coin",
    "assetName": "USDC",
    "isBorrowable": true,
    "isMortgageable": true,
    "userMinBorrow": "0.00000000",
    "userMinRepay": "0.00000000",
    "delistTime": 1704973040
  }
]

GET /sapi/v1/margin/allAssets

Weight(IP): 1

Parameters:

Name Type Mandatory Description
asset STRING NO

Get All Cross Margin Pairs (MARKET_DATA)

Response:

[
    {
        "base": "BNB",
        "id": 351637150141315861,
        "isBuyAllowed": true,
        "isMarginTrade": true,
        "isSellAllowed": true,
        "quote": "BTC",
        "symbol": "BNBBTC"
    },
    {
        "base": "TRX",
        "id": 351637923235429141,
        "isBuyAllowed": true,
        "isMarginTrade": true,
        "isSellAllowed": true,
        "quote": "BTC",
        "symbol": "TRXBTC",
        "delistTime": 1704973040
    },
    {
        "base": "XRP",
        "id": 351638112213990165,
        "isBuyAllowed": true,
        "isMarginTrade": true,
        "isSellAllowed": true,
        "quote": "BTC",
        "symbol": "XRPBTC"
    },
    {
        "base": "ETH",
        "id": 351638524530850581,
        "isBuyAllowed": true,
        "isMarginTrade": true,
        "isSellAllowed": true,
        "quote": "BTC",
        "symbol": "ETHBTC"
    }
]

GET /sapi/v1/margin/allPairs

Weight(IP): 1

Parameters:

Name Type Mandatory Description
symbol STRING NO

Query Margin PriceIndex (MARKET_DATA)

Response:

{
   "calcTime": 1562046418000,
   "price": "0.00333930",
   "symbol": "BNBBTC"
}

GET /sapi/v1/margin/priceIndex

Weight(IP): 10

Parameters:

Name Type Mandatory Description
symbol STRING YES

Margin Account New Order (TRADE)

Response ACK:

{
  "symbol": "BTCUSDT",
  "orderId": 28,
  "clientOrderId": "6gCrw2kRUAF9CvJDGP16IP",
  "isIsolated": true,       // if isolated margin
  "transactTime": 1507725176595
}

Response RESULT:

{
  "symbol": "BTCUSDT",
  "orderId": 28,
  "clientOrderId": "6gCrw2kRUAF9CvJDGP16IP",
  "transactTime": 1507725176595,
  "price": "1.00000000",
  "origQty": "10.00000000",
  "executedQty": "10.00000000",
  "cummulativeQuoteQty": "30000",
  "status": "FILLED",
  "timeInForce": "GTC",
  "type": "MARKET",
  "isIsolated": true,       // if isolated margin
  "side": "SELL",
  "selfTradePreventionMode": "NONE"
}

Response FULL:

{
  "symbol": "BTCUSDT",
  "orderId": 28,
  "clientOrderId": "6gCrw2kRUAF9CvJDGP16IP",
  "transactTime": 1507725176595,
  "price": "1.00000000",
  "origQty": "10.00000000",
  "executedQty": "10.00000000",
  "cummulativeQuoteQty": "39983.00000000",
  "status": "FILLED",
  "timeInForce": "GTC",
  "type": "MARKET",
  "side": "SELL",
  "marginBuyBorrowAmount": 5,       // will not return if no margin trade happens
  "marginBuyBorrowAsset": "BTC",    // will not return if no margin trade happens
  "isIsolated": true,       // if isolated margin
  "selfTradePreventionMode": "NONE",
  "fills": [
    {
      "price": "4000.00000000",
      "qty": "1.00000000",
      "commission": "4.00000000",
      "commissionAsset": "USDT"
    },
    {
      "price": "3999.00000000",
      "qty": "5.00000000",
      "commission": "19.99500000",
      "commissionAsset": "USDT"
    },
    {
      "price": "3998.00000000",
      "qty": "2.00000000",
      "commission": "7.99600000",
      "commissionAsset": "USDT"
    },
    {
      "price": "3997.00000000",
      "qty": "1.00000000",
      "commission": "3.99700000",
      "commissionAsset": "USDT"
    },
    {
      "price": "3995.00000000",
      "qty": "1.00000000",
      "commission": "3.99500000",
      "commissionAsset": "USDT"
    }
  ]
}

POST /sapi/v1/margin/order

Post a new order for margin account.

Weight(UID): 6

Parameters:

Name Type Mandatory Description
symbol STRING YES
isIsolated STRING NO for isolated margin or not, "TRUE", "FALSE",default "FALSE"
side ENUM YES BUY

SELL
type ENUM YES
quantity DECIMAL NO
quoteOrderQty DECIMAL NO
price DECIMAL NO
stopPrice DECIMAL NO Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
newClientOrderId STRING NO A unique id among open orders. Automatically generated if not sent.
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.
sideEffectType ENUM NO NO_SIDE_EFFECT, MARGIN_BUY, AUTO_REPAY,AUTO_BORROW_REPAY; default NO_SIDE_EFFECT. More info in FAQ
timeInForce ENUM NO GTC,IOC,FOK
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
autoRepayAtCancel BOOLEAN NO Only when MARGIN_BUY or AUTO_BORROW_REPAY order takes effect, true means that the debt generated by the order needs to be repay after the order is cancelled. The default is true
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Margin Account Cancel Order (TRADE)

Response:

{
  "symbol": "LTCBTC",
  "isIsolated": true,       // if isolated margin
  "orderId": "28",
  "origClientOrderId": "myOrder1",
  "clientOrderId": "cancelMyOrder1",
  "price": "1.00000000",
  "origQty": "10.00000000",
  "executedQty": "8.00000000",
  "cummulativeQuoteQty": "8.00000000",
  "status": "CANCELED",
  "timeInForce": "GTC",
  "type": "LIMIT",
  "side": "SELL"
}

DELETE /sapi/v1/margin/order

Cancel an active order for margin account.

Weight(IP): 10

Parameters:

Name Type Mandatory Description
symbol STRING YES
isIsolated STRING NO for isolated margin or not, "TRUE", "FALSE",default "FALSE"
orderId LONG NO
origClientOrderId STRING NO
newClientOrderId STRING NO Used to uniquely identify this cancel. Automatically generated by default.
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Margin Account Cancel all Open Orders on a Symbol (TRADE)

Response:

[
  {
    "symbol": "BTCUSDT",
    "isIsolated": true,       // if isolated margin
    "origClientOrderId": "E6APeyTJvkMvLMYMqu1KQ4",
    "orderId": 11,
    "orderListId": -1,
    "clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx",
    "price": "0.089853",
    "origQty": "0.178622",
    "executedQty": "0.000000",
    "cummulativeQuoteQty": "0.000000",
    "status": "CANCELED",
    "timeInForce": "GTC",
    "type": "LIMIT",
    "side": "BUY",
    "selfTradePreventionMode": "NONE"
  },
  {
    "symbol": "BTCUSDT",
    "isIsolated": false,       // if isolated margin
    "origClientOrderId": "A3EF2HCwxgZPFMrfwbgrhv",
    "orderId": 13,
    "orderListId": -1,
    "clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx",
    "price": "0.090430",
    "origQty": "0.178622",
    "executedQty": "0.000000",
    "cummulativeQuoteQty": "0.000000",
    "status": "CANCELED",
    "timeInForce": "GTC",
    "type": "LIMIT",
    "side": "BUY",
    "selfTradePreventionMode": "NONE"
  },
  {
    "orderListId": 1929,
    "contingencyType": "OCO",
    "listStatusType": "ALL_DONE",
    "listOrderStatus": "ALL_DONE",
    "listClientOrderId": "2inzWQdDvZLHbbAmAozX2N",
    "transactionTime": 1585230948299,
    "symbol": "BTCUSDT",
    "isIsolated": true,       // if isolated margin
    "orders": [
      {
        "symbol": "BTCUSDT",
        "orderId": 20,
        "clientOrderId": "CwOOIPHSmYywx6jZX77TdL"
      },
      {
        "symbol": "BTCUSDT",
        "orderId": 21,
        "clientOrderId": "461cPg51vQjV3zIMOXNz39"
      }
    ],
    "orderReports": [
      {
        "symbol": "BTCUSDT",
        "origClientOrderId": "CwOOIPHSmYywx6jZX77TdL",
        "orderId": 20,
        "orderListId": 1929,
        "clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx",
        "price": "0.668611",
        "origQty": "0.690354",
        "executedQty": "0.000000",
        "cummulativeQuoteQty": "0.000000",
        "status": "CANCELED",
        "timeInForce": "GTC",
        "type": "STOP_LOSS_LIMIT",
        "side": "BUY",
        "stopPrice": "0.378131",
        "icebergQty": "0.017083"
      },
      {
        "symbol": "BTCUSDT",
        "origClientOrderId": "461cPg51vQjV3zIMOXNz39",
        "orderId": 21,
        "orderListId": 1929,
        "clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx",
        "price": "0.008791",
        "origQty": "0.690354",
        "executedQty": "0.000000",
        "cummulativeQuoteQty": "0.000000",
        "status": "CANCELED",
        "timeInForce": "GTC",
        "type": "LIMIT_MAKER",
        "side": "BUY",
        "icebergQty": "0.639962"
      }
    ]
  }
]

DELETE /sapi/v1/margin/openOrders

Cancels all active orders on a symbol for margin account.

This includes Order list orders.

Weight(IP): 1

Parameters

Name Type Mandatory Description
symbol STRING YES
isIsolated STRING NO for isolated margin or not, "TRUE", "FALSE",default "FALSE"
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Adjust cross margin max leverage (USER_DATA)

Response:

{
    "success": true
}

POST /sapi/v1/margin/max-leverage

Adjust cross margin max leverage

Weight(UID): 3000

Request Limit: 1 times/min per UID

Parameters

Name Type Mandatory Description
maxLeverage Integer YES Can only adjust 3 , 5 or 10,Example: maxLeverage=10 for Cross Margin Pro ,maxLeverage = 5 or 3 for Cross Margin Classic

Get Cross Margin Transfer History (USER_DATA)

Response:

{
  "rows": [
    {
      "amount": "0.10000000",
      "asset": "BNB",
      "status": "CONFIRMED",
      "timestamp": 1566898617,
      "txId": 5240372201,
      "type": "ROLL_IN",
      "transFrom": "SPOT", //SPOT,FUTURES,FIAT,DELIVERY,MINING,ISOLATED_MARGIN,FUNDING,MOTHER_SPOT,OPTION,SUB_SPOT,SUB_MARGIN,CROSS_MARGIN
      "transTo": "ISOLATED_MARGIN",//SPOT,FUTURES,FIAT,DELIVERY,MINING,ISOLATED_MARGIN,FUNDING,MOTHER_SPOT,OPTION,SUB_SPOT,SUB_MARGIN,CROSS_MARGIN
    },
    {
      "amount": "5.00000000",
      "asset": "USDT",
      "status": "CONFIRMED",
      "timestamp": 1566888436,
      "txId": 5239810406,
      "type": "ROLL_OUT",
      "transFrom": "ISOLATED_MARGIN",//SPOT,FUTURES,FIAT,DELIVERY,MINING,ISOLATED_MARGIN,FUNDING,MOTHER_SPOT,OPTION,SUB_SPOT,SUB_MARGIN,CROSS_MARGIN
      "transTo": "ISOLATED_MARGIN", //SPOT,FUTURES,FIAT,DELIVERY,MINING,ISOLATED_MARGIN,FUNDING,MOTHER_SPOT,OPTION,SUB_SPOT,SUB_MARGIN,CROSS_MARGIN
      "fromSymbol": "BNBUSDT",
      "toSymbol": "BTCUSDT"
    },
    {
      "amount": "1.00000000",
      "asset": "EOS",
      "status": "CONFIRMED",
      "timestamp": 1566888403,
      "txId": 5239808703,
      "type": "ROLL_IN"
    }
  ],
  "total": 3
}

GET /sapi/v1/margin/transfer

Weight(IP): 1

Parameters:

Name Type Mandatory Description
asset STRING NO
type STRING NO Transfer Type: ROLL_IN, ROLL_OUT
startTime LONG NO
endTime LONG NO
current LONG NO Currently querying page. Start from 1. Default:1
size LONG NO Default:10 Max:100
isolatedSymbol STRING NO Symbol in Isolated Margin
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Get Interest History (USER_DATA)

Response:

{
  "rows": [
    {            
      "txId": 1352286576452864727,           
      "interestAccuredTime": 1672160400000,            
      "asset": "USDT", 
      "rawAsset": "USDT",  // will not be returned for isolated margin           
      "principal": "45.3313",            
      "interest": "0.00024995",            
      "interestRate": "0.00013233",            
      "type": "ON_BORROW",           
      "isolatedSymbol": "BNBUSDT"  // isolated symbol, will not be returned for crossed margin      
    }
  ],
  "total": 1
}

GET /sapi/v1/margin/interestHistory

Weight(IP): 1

Parameters:

Name Type Mandatory Description
asset STRING NO
isolatedSymbol STRING NO isolated symbol
startTime LONG NO per-second accuracy. milliseconds input will be ignored. e.g. XXXXXXXXXX000ms
endTime LONG NO per-second accuracy. milliseconds input will be ignored. e.g. XXXXXXXXXX000ms
current LONG NO Currently querying page. Start from 1. Default:1
size LONG NO Default:10 Max:100
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Get Force Liquidation Record (USER_DATA)

Response:

  {
      "rows": [
          {
              "avgPrice": "0.00388359",
              "executedQty": "31.39000000",
              "orderId": 180015097,
              "price": "0.00388110",
              "qty": "31.39000000",
              "side": "SELL",
              "symbol": "BNBBTC",
              "timeInForce": "GTC",
              "isIsolated": true,
              "updatedTime": 1558941374745
          }
      ],
      "total": 1
  }

GET /sapi/v1/margin/forceLiquidationRec

Weight(IP): 1

Parameters:

Name Type Mandatory Description
startTime LONG NO
endTime LONG NO
isolatedSymbol STRING NO
current LONG NO Currently querying page. Start from 1. Default:1
size LONG NO Default:10 Max:100
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Query Cross Margin Account Details (USER_DATA)

Response:

{
      "created" : true, // True means margin account created , false means margin account not created.
      "borrowEnabled": true,
      "marginLevel": "11.64405625",
      "collateralMarginLevel" : "3.2",
      "totalAssetOfBtc": "6.82728457",
      "totalLiabilityOfBtc": "0.58633215",
      "totalNetAssetOfBtc": "6.24095242",
      "totalCollateralValueInUSDT": "5.82728457",
      "tradeEnabled": true,
      "transferEnabled": true,
      "accountType": "MARGIN_1",  // //MARGIN_1 for Cross Margin Classic, MARGIN_2 for Cross Margin Pro
      "userAssets": [
          {
              "asset": "BTC",
              "borrowed": "0.00000000",
              "free": "0.00499500",
              "interest": "0.00000000",
              "locked": "0.00000000",
              "netAsset": "0.00499500"
          },
          {
              "asset": "BNB",
              "borrowed": "201.66666672",
              "free": "2346.50000000",
              "interest": "0.00000000",
              "locked": "0.00000000",
              "netAsset": "2144.83333328"
          },
          {
              "asset": "ETH",
              "borrowed": "0.00000000",
              "free": "0.00000000",
              "interest": "0.00000000",
              "locked": "0.00000000",
              "netAsset": "0.00000000"
          },
          {
              "asset": "USDT",
              "borrowed": "0.00000000",
              "free": "0.00000000",
              "interest": "0.00000000",
              "locked": "0.00000000",
              "netAsset": "0.00000000"
          }
      ]
}

GET /sapi/v1/margin/account

Weight(IP): 10

Parameters:

Name Type Mandatory Description
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Query Margin Account's Order (USER_DATA)

Response:

{
   "clientOrderId": "ZwfQzuDIGpceVhKW5DvCmO",
   "cummulativeQuoteQty": "0.00000000",
   "executedQty": "0.00000000",
   "icebergQty": "0.00000000",
   "isWorking": true,
   "orderId": 213205622,
   "origQty": "0.30000000",
   "price": "0.00493630",
   "side": "SELL",
   "status": "NEW",
   "stopPrice": "0.00000000",
   "symbol": "BNBBTC",
   "isIsolated": true,
   "time": 1562133008725,
   "timeInForce": "GTC",
   "type": "LIMIT",
   "selfTradePreventionMode": "NONE",
   "updateTime": 1562133008725
}

GET /sapi/v1/margin/order

Weight(IP): 10

Parameters:

Name Type Mandatory Description
symbol STRING YES
isIsolated STRING NO for isolated margin or not, "TRUE", "FALSE",default "FALSE"
orderId LONG NO
origClientOrderId STRING NO
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Query Margin Account's Open Orders (USER_DATA)

Response:

[
   {
       "clientOrderId": "qhcZw71gAkCCTv0t0k8LUK",
       "cummulativeQuoteQty": "0.00000000",
       "executedQty": "0.00000000",
       "icebergQty": "0.00000000",
       "isWorking": true,
       "orderId": 211842552,
       "origQty": "0.30000000",
       "price": "0.00475010",
       "side": "SELL",
       "status": "NEW",
       "stopPrice": "0.00000000",
       "symbol": "BNBBTC",
       "isIsolated": true,
       "time": 1562040170089,
       "timeInForce": "GTC",
       "type": "LIMIT",
       "selfTradePreventionMode": "NONE",
       "updateTime": 1562040170089
    }
]

GET /sapi/v1/margin/openOrders

Weight(IP): 10

Parameters:

Name Type Mandatory Description
symbol STRING NO
isIsolated STRING NO for isolated margin or not, "TRUE", "FALSE",default "FALSE"
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Query Margin Account's All Orders (USER_DATA)

Response:

[
      {
          "clientOrderId": "D2KDy4DIeS56PvkM13f8cP",
          "cummulativeQuoteQty": "0.00000000",
          "executedQty": "0.00000000",
          "icebergQty": "0.00000000",
          "isWorking": false,
          "orderId": 41295,
          "origQty": "5.31000000",
          "price": "0.22500000",
          "side": "SELL",
          "status": "CANCELED",
          "stopPrice": "0.18000000",
          "symbol": "BNBBTC",
          "isIsolated": false,
          "time": 1565769338806,
          "timeInForce": "GTC",
          "type": "TAKE_PROFIT_LIMIT",
          "selfTradePreventionMode": "NONE",
          "updateTime": 1565769342148
      },
      {
          "clientOrderId": "gXYtqhcEAs2Rn9SUD9nRKx",
          "cummulativeQuoteQty": "0.00000000",
          "executedQty": "0.00000000",
          "icebergQty": "1.00000000",
          "isWorking": true,
          "orderId": 41296,
          "origQty": "6.65000000",
          "price": "0.18000000",
          "side": "SELL",
          "status": "CANCELED",
          "stopPrice": "0.00000000",
          "symbol": "BNBBTC",
          "isIsolated": false,
          "time": 1565769348687,
          "timeInForce": "GTC",
          "type": "LIMIT",
          "selfTradePreventionMode": "NONE",
          "updateTime": 1565769352226
      }
]

GET /sapi/v1/margin/allOrders

Weight(IP): 200

Request Limit
60times/min per IP

Parameters:

Name Type Mandatory Description
symbol STRING YES
isIsolated STRING NO for isolated margin or not, "TRUE", "FALSE",default "FALSE"
orderId LONG NO
startTime LONG NO
endTime LONG NO
limit INT NO Default 500; max 500.
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Margin Account New OCO (TRADE)

Response:

{
  "orderListId": 0,
  "contingencyType": "OCO",
  "listStatusType": "EXEC_STARTED",
  "listOrderStatus": "EXECUTING",
  "listClientOrderId": "JYVpp3F0f5CAG15DhtrqLp",
  "transactionTime": 1563417480525,
  "symbol": "LTCBTC",
  "marginBuyBorrowAmount": "5",       // will not return if no margin trade happens
  "marginBuyBorrowAsset": "BTC",    // will not return if no margin trade happens
  "isIsolated": false,       // if isolated margin
  "orders": [
    {
      "symbol": "LTCBTC",
      "orderId": 2,
      "clientOrderId": "Kk7sqHb9J6mJWTMDVW7Vos"
    },
    {
      "symbol": "LTCBTC",
      "orderId": 3,
      "clientOrderId": "xTXKaGYd4bluPVp78IVRvl"
    }
  ],
  "orderReports": [
    {
      "symbol": "LTCBTC",
      "orderId": 2,
      "orderListId": 0,
      "clientOrderId": "Kk7sqHb9J6mJWTMDVW7Vos",
      "transactTime": 1563417480525,
      "price": "0.000000",
      "origQty": "0.624363",
      "executedQty": "0.000000",
      "cummulativeQuoteQty": "0.000000",
      "status": "NEW",
      "timeInForce": "GTC",
      "type": "STOP_LOSS",
      "side": "BUY",
      "stopPrice": "0.960664",
      "selfTradePreventionMode": "NONE"
    },
    {
      "symbol": "LTCBTC",
      "orderId": 3,
      "orderListId": 0,
      "clientOrderId": "xTXKaGYd4bluPVp78IVRvl",
      "transactTime": 1563417480525,
      "price": "0.036435",
      "origQty": "0.624363",
      "executedQty": "0.000000",
      "cummulativeQuoteQty": "0.000000",
      "status": "NEW",
      "timeInForce": "GTC",
      "type": "LIMIT_MAKER",
      "side": "BUY",
      "selfTradePreventionMode": "NONE"
    }
  ]
}

POST /sapi/v1/margin/order/oco

Send in a new OCO for a margin account

Weight(UID): 6

Parameters:

Name Type Mandatory Description
symbol STRING YES
isIsolated STRING NO for isolated margin or not, "TRUE", "FALSE",default "FALSE"
listClientOrderId STRING NO A unique Id for the entire orderList
side ENUM YES
quantity DECIMAL YES
limitClientOrderId STRING NO A unique Id for the limit order
price DECIMAL YES
limitIcebergQty DECIMAL NO
stopClientOrderId STRING NO A unique Id for the stop loss/stop loss limit leg
stopPrice DECIMAL YES
stopLimitPrice DECIMAL NO If provided, stopLimitTimeInForce is required.
stopIcebergQty DECIMAL NO
stopLimitTimeInForce ENUM NO Valid values are GTC/FOK/IOC
newOrderRespType ENUM NO Set the response JSON.
sideEffectType ENUM NO NO_SIDE_EFFECT, MARGIN_BUY, AUTO_REPAY,AUTO_BORROW_REPAY; default NO_SIDE_EFFECT. More info in FAQ
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
autoRepayAtCancel BOOLEAN NO Only when MARGIN_BUY or AUTO_BORROW_REPAY order takes effect, true means that the debt generated by the order needs to be repay after the order is cancelled. The default is true
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Other Info:

Margin Account Cancel OCO (TRADE)

Response:

{
  "orderListId": 0,
  "contingencyType": "OCO",
  "listStatusType": "ALL_DONE",
  "listOrderStatus": "ALL_DONE",
  "listClientOrderId": "C3wyj4WVEktd7u9aVBRXcN",
  "transactionTime": 1574040868128,
  "symbol": "LTCBTC",
  "isIsolated": false,       // if isolated margin
  "orders": [
    {
      "symbol": "LTCBTC",
      "orderId": 2,
      "clientOrderId": "pO9ufTiFGg3nw2fOdgeOXa"
    },
    {
      "symbol": "LTCBTC",
      "orderId": 3,
      "clientOrderId": "TXOvglzXuaubXAaENpaRCB"
    }
  ],
  "orderReports": [
    {
      "symbol": "LTCBTC",
      "origClientOrderId": "pO9ufTiFGg3nw2fOdgeOXa",
      "orderId": 2,
      "orderListId": 0,
      "clientOrderId": "unfWT8ig8i0uj6lPuYLez6",
      "price": "1.00000000",
      "origQty": "10.00000000",
      "executedQty": "0.00000000",
      "cummulativeQuoteQty": "0.00000000",
      "status": "CANCELED",
      "timeInForce": "GTC",
      "type": "STOP_LOSS_LIMIT",
      "side": "SELL",
      "stopPrice": "1.00000000",
      "selfTradePreventionMode": "NONE"
    },
    {
      "symbol": "LTCBTC",
      "origClientOrderId": "TXOvglzXuaubXAaENpaRCB",
      "orderId": 3,
      "orderListId": 0,
      "clientOrderId": "unfWT8ig8i0uj6lPuYLez6",
      "price": "3.00000000",
      "origQty": "10.00000000",
      "executedQty": "0.00000000",
      "cummulativeQuoteQty": "0.00000000",
      "status": "CANCELED",
      "timeInForce": "GTC",
      "type": "LIMIT_MAKER",
      "side": "SELL",
      "selfTradePreventionMode": "NONE"
    }
  ]
}

DELETE /sapi/v1/margin/orderList

Cancel an entire Order List for a margin account.

Weight(UID): 1

Parameters:

Name Type Mandatory Description
symbol STRING YES
isIsolated STRING NO for isolated margin or not, "TRUE", "FALSE",default "FALSE"
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 LONG NO The value cannot be greater than 60000
timestamp LONG YES

Additional notes:

Query Margin Account's OCO (USER_DATA)

Response:

{
  "orderListId": 27,
  "contingencyType": "OCO",
  "listStatusType": "EXEC_STARTED",
  "listOrderStatus": "EXECUTING",
  "listClientOrderId": "h2USkA5YQpaXHPIrkd96xE",
  "transactionTime": 1565245656253,
  "symbol": "LTCBTC",
  "isIsolated": false,       // if isolated margin
  "orders": [
    {
      "symbol": "LTCBTC",
      "orderId": 4,
      "clientOrderId": "qD1gy3kc3Gx0rihm9Y3xwS"
    },
    {
      "symbol": "LTCBTC",
      "orderId": 5,
      "clientOrderId": "ARzZ9I00CPM8i3NhmU9Ega"
    }
  ]
}

GET /sapi/v1/margin/orderList

Retrieves a specific OCO based on provided optional parameters

Weight(IP): 10

Parameters:

Name Type Mandatory Description
isIsolated STRING NO for isolated margin or not, "TRUE", "FALSE",default "FALSE"
symbol STRING NO mandatory for isolated margin, not supported for cross margin
orderListId LONG NO Either orderListId or origClientOrderId must be provided
origClientOrderId STRING NO Either orderListId or origClientOrderId must be provided
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Query Margin Account's all OCO (USER_DATA)

Response:

[
  {
    "orderListId": 29,
    "contingencyType": "OCO",
    "listStatusType": "EXEC_STARTED",
    "listOrderStatus": "EXECUTING",
    "listClientOrderId": "amEEAXryFzFwYF1FeRpUoZ",
    "transactionTime": 1565245913483,
    "symbol": "LTCBTC",
    "isIsolated": true,       // if isolated margin
    "orders": [
      {
        "symbol": "LTCBTC",
        "orderId": 4,
        "clientOrderId": "oD7aesZqjEGlZrbtRpy5zB"
      },
      {
        "symbol": "LTCBTC",
        "orderId": 5,
        "clientOrderId": "Jr1h6xirOxgeJOUuYQS7V3"
      }
    ]
  },
  {
    "orderListId": 28,
    "contingencyType": "OCO",
    "listStatusType": "EXEC_STARTED",
    "listOrderStatus": "EXECUTING",
    "listClientOrderId": "hG7hFNxJV6cZy3Ze4AUT4d",
    "transactionTime": 1565245913407,
    "symbol": "LTCBTC",
    "orders": [
      {
        "symbol": "LTCBTC",
        "orderId": 2,
        "clientOrderId": "j6lFOfbmFMRjTYA7rRJ0LP"
      },
      {
        "symbol": "LTCBTC",
        "orderId": 3,
        "clientOrderId": "z0KCjOdditiLS5ekAFtK81"
      }
    ]
  }
]

GET /sapi/v1/margin/allOrderList

Retrieves all OCO for a specific margin account based on provided optional parameters

Weight(IP): 200

Parameters

Name Type Mandatory Description
isIsolated STRING NO for isolated margin or not, "TRUE", "FALSE",default "FALSE"
symbol STRING NO mandatory for isolated margin, not supported for cross margin
fromId LONG NO If supplied, neither startTime or endTime can be provided
startTime LONG NO
endTime LONG NO
limit INT NO Default Value: 500; Max Value: 1000
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Query Margin Account's Open OCO (USER_DATA)

Response:

[
  {
    "orderListId": 31,
    "contingencyType": "OCO",
    "listStatusType": "EXEC_STARTED",
    "listOrderStatus": "EXECUTING",
    "listClientOrderId": "wuB13fmulKj3YjdqWEcsnp",
    "transactionTime": 1565246080644,
    "symbol": "LTCBTC",
    "isIsolated": false,       // if isolated margin
    "orders": [
      {
        "symbol": "LTCBTC",
        "orderId": 4,
        "clientOrderId": "r3EH2N76dHfLoSZWIUw1bT"
      },
      {
        "symbol": "LTCBTC",
        "orderId": 5,
        "clientOrderId": "Cv1SnyPD3qhqpbjpYEHbd2"
      }
    ]
  }
]

GET /sapi/v1/margin/openOrderList

Weight(IP): 10

Parameters

Name Type Mandatory Description
isIsolated STRING NO for isolated margin or not, "TRUE", "FALSE",default "FALSE"
symbol STRING NO mandatory for isolated margin, not supported for cross margin
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Query Margin Account's Trade List (USER_DATA)

Response:

[
    {
        "commission": "0.00006000",
        "commissionAsset": "BTC",
        "id": 34,
        "isBestMatch": true,
        "isBuyer": false,
        "isMaker": false,
        "orderId": 39324,
        "price": "0.02000000",
        "qty": "3.00000000",
        "symbol": "BNBBTC",
        "isIsolated": false,
        "time": 1561973357171
    }
]

GET /sapi/v1/margin/myTrades

Weight(IP): 10

Parameters:

Name Type Mandatory Description
symbol STRING YES
isIsolated STRING NO for isolated margin or not, "TRUE", "FALSE",default "FALSE"
orderId LONG NO
startTime LONG NO
endTime LONG NO
fromId LONG NO TradeId to fetch from. Default gets most recent trades.
limit INT NO Default 500; max 1000.
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Query Max Borrow (USER_DATA)

Response:

{
  "amount": "1.69248805", // account's currently max borrowable amount with sufficient system availability
  "borrowLimit": "60" // max borrowable amount limited by the account level
}

GET /sapi/v1/margin/maxBorrowable

Weight(IP): 50

Parameters:

Name Type Mandatory Description
asset STRING YES
isolatedSymbol STRING NO isolated symbol
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Query Max Transfer-Out Amount (USER_DATA)

Response:

 {
      "amount": "3.59498107"
 }

GET /sapi/v1/margin/maxTransferable

Weight(IP): 50

Parameters:

Name Type Mandatory Description
asset STRING YES
isolatedSymbol STRING NO isolated symbol
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Get Summary of Margin account (USER_DATA)

Response:

{
  "normalBar": "1.5",
  "marginCallBar": "1.3",
  "forceLiquidationBar": "1.1"
}

GET /sapi/v1/margin/tradeCoeff

Get personal margin level information

Weight(IP): 10

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Query Isolated Margin Account Info (USER_DATA)

Response:

If "symbols" is not sent

{
   "assets":[
      {
        "baseAsset": 
        {
          "asset": "BTC",
          "borrowEnabled": true,
          "borrowed": "0.00000000",
          "free": "0.00000000",
          "interest": "0.00000000",
          "locked": "0.00000000",
          "netAsset": "0.00000000",
          "netAssetOfBtc": "0.00000000",
          "repayEnabled": true,
          "totalAsset": "0.00000000"
        },
        "quoteAsset": 
        {
          "asset": "USDT",
          "borrowEnabled": true,
          "borrowed": "0.00000000",
          "free": "0.00000000",
          "interest": "0.00000000",
          "locked": "0.00000000",
          "netAsset": "0.00000000",
          "netAssetOfBtc": "0.00000000",
          "repayEnabled": true,
          "totalAsset": "0.00000000"
        },
        "symbol": "BTCUSDT",
        "isolatedCreated": true, 
        "enabled": true, // true-enabled, false-disabled
        "marginLevel": "0.00000000", 
        "marginLevelStatus": "EXCESSIVE", // "EXCESSIVE", "NORMAL", "MARGIN_CALL", "PRE_LIQUIDATION", "FORCE_LIQUIDATION"
        "marginRatio": "0.00000000",
        "indexPrice": "10000.00000000",
        "liquidatePrice": "1000.00000000",
        "liquidateRate": "1.00000000",
        "tradeEnabled": true
      }
    ],
    "totalAssetOfBtc": "0.00000000",
    "totalLiabilityOfBtc": "0.00000000",
    "totalNetAssetOfBtc": "0.00000000" 
}

If "symbols" is sent

{
   "assets":[
      {
        "baseAsset": 
        {
          "asset": "BTC",
          "borrowEnabled": true,
          "borrowed": "0.00000000",
          "free": "0.00000000",
          "interest": "0.00000000",
          "locked": "0.00000000",
          "netAsset": "0.00000000",
          "netAssetOfBtc": "0.00000000",
          "repayEnabled": true,
          "totalAsset": "0.00000000"
        },
        "quoteAsset": 
        {
          "asset": "USDT",
          "borrowEnabled": true,
          "borrowed": "0.00000000",
          "free": "0.00000000",
          "interest": "0.00000000",
          "locked": "0.00000000",
          "netAsset": "0.00000000",
          "netAssetOfBtc": "0.00000000",
          "repayEnabled": true,
          "totalAsset": "0.00000000"
        },
        "symbol": "BTCUSDT",
        "isolatedCreated": true, 
        "enabled": true, // true-enabled, false-disabled
        "marginLevel": "0.00000000", 
        "marginLevelStatus": "EXCESSIVE", // "EXCESSIVE", "NORMAL", "MARGIN_CALL", "PRE_LIQUIDATION", "FORCE_LIQUIDATION"
        "marginRatio": "0.00000000",
        "indexPrice": "10000.00000000",
        "liquidatePrice": "1000.00000000",
        "liquidateRate": "1.00000000",
        "tradeEnabled": true
      }
    ]
}

GET /sapi/v1/margin/isolated/account

Weight(IP): 10

Parameters:

Name Type Mandatory Description
symbols STRING NO Max 5 symbols can be sent; separated by ",". e.g. "BTCUSDT,BNBUSDT,ADAUSDT"
recvWindow LONG NO No more than 60000
timestamp LONG YES

Disable Isolated Margin Account (TRADE)

Response:

{
  "success": true,
  "symbol": "BTCUSDT"
}

DELETE /sapi/v1/margin/isolated/account (HMAC SHA256)

Disable isolated margin account for a specific symbol. Each trading pair can only be deactivated once every 24 hours.

Weight(UID): 300

Parameters:

Name Type Mandatory Description
symbol STRING YES
recvWindow LONG NO No more than 60000
timestamp LONG YES

Enable Isolated Margin Account (TRADE)

Response:

{
  "success": true,
  "symbol": "BTCUSDT"
}

POST /sapi/v1/margin/isolated/account

Enable isolated margin account for a specific symbol(Only supports activation of previously disabled accounts).

Weight(UID): 300

Parameters:

Name Type Mandatory Description
symbol STRING YES
recvWindow LONG NO No more than 60000
timestamp LONG YES

Query Enabled Isolated Margin Account Limit (USER_DATA)

Response:

{
  "enabledAccount": 5,
  "maxAccount": 20
}

GET /sapi/v1/margin/isolated/accountLimit

Query enabled isolated margin account limit.

Weight(IP): 1

Parameters:

Name Type Mandatory Description
recvWindow LONG NO No more than 60000
timestamp LONG YES

Get All Isolated Margin Symbol(MARKET_DATA)

Response:

[
    {
        "base": "BNB",
        "isBuyAllowed": true,
        "isMarginTrade": true,
        "isSellAllowed": true,
        "quote": "BTC",
        "symbol": "BNBBTC"
    },
    {
        "base": "TRX",
        "isBuyAllowed": true,
        "isMarginTrade": true,
        "isSellAllowed": true,
        "quote": "BTC",
        "symbol": "TRXBTC",
        "delistTime": 1704973040
    },
    {
        "base": "XRP",
        "isBuyAllowed": true,
        "isMarginTrade": true,
        "isSellAllowed": true,
        "quote": "BTC",
        "symbol": "XRPBTC"
    },
    {
        "base": "ETH",
        "isBuyAllowed": true,
        "isMarginTrade": true,
        "isSellAllowed": true,
        "quote": "BTC",
        "symbol": "ETHBTC"
    }   
]

GET /sapi/v1/margin/isolated/allPairs

Weight(IP): 10

Parameters:

Name Type Mandatory Description
symbol STRING NO

Toggle BNB Burn On Spot Trade And Margin Interest (USER_DATA)

Response:

{
   "spotBNBBurn":true,
   "interestBNBBurn": false   
}

POST /sapi/v1/bnbBurn

Weight(IP): 1

Parameters:

Name Type Mandatory Description
spotBNBBurn STRING NO "true" or "false"; Determines whether to use BNB to pay for trading fees on SPOT
interestBNBBurn STRING NO "true" or "false"; Determines whether to use BNB to pay for margin loan's interest
recvWindow LONG NO No more than 60000
timestamp LONG YES

Get BNB Burn Status (USER_DATA)

Response:

{
   "spotBNBBurn":true,
   "interestBNBBurn": false   
}

GET /sapi/v1/bnbBurn

Weight(IP): 1

Parameters:

Name Type Mandatory Description
recvWindow LONG NO No more than 60000
timestamp LONG YES

Query Margin Interest Rate History (USER_DATA)

Response:

[
    {
        "asset": "BTC",
        "dailyInterestRate": "0.00025000",
        "timestamp": 1611544731000,
        "vipLevel": 1    
    },
    {
        "asset": "BTC",
        "dailyInterestRate": "0.00035000",
        "timestamp": 1610248118000,
        "vipLevel": 1    
    }
]

GET /sapi/v1/margin/interestRateHistory

Weight(IP): 1

Parameters:

Name Type Mandatory Description
asset STRING YES
vipLevel INT NO Default: user's vip level
startTime LONG NO Default: 7 days ago
endTime LONG NO Default: present. Maximum range: 1 months.
recvWindow LONG NO No more than 60000
timestamp LONG YES

Query Cross Margin Fee Data (USER_DATA)

Response:

[
    {
        "vipLevel": 0,
        "coin": "BTC",
        "transferIn": true,
        "borrowable": true,
        "dailyInterest": "0.00026125",
        "yearlyInterest": "0.0953",
        "borrowLimit": "180",
        "marginablePairs": [
            "BNBBTC",
            "TRXBTC",
            "ETHBTC",
            "BTCUSDT"
        ]
    }
]

GET /sapi/v1/margin/crossMarginData

Get cross margin fee data collection with any vip level or user's current specific data as https://www.binance.com/en/margin-fee

Weight(IP): 1 when coin is specified; 5 when the coin parameter is omitted

Parameters:

Name Type Mandatory Description
vipLevel INT NO when parameter vipLevel is not sent, it returns data associated with the user's specific config; when parameter vipLevel is sent, it returns the default tier data (assuming user is not logged in)
coin STRING NO
recvWindow LONG NO No more than 60000
timestamp LONG YES

Query Isolated Margin Fee Data (USER_DATA)

Response:

[
    {
        "vipLevel": 0,
        "symbol": "BTCUSDT",
        "leverage": "10",
        "data": [
            {
                "coin": "BTC",
                "dailyInterest": "0.00026125",
                "borrowLimit": "270"
            },
            {
                "coin": "USDT",
                "dailyInterest": "0.000475",
                "borrowLimit": "2100000"
            }
        ]
    }
]

GET /sapi/v1/margin/isolatedMarginData

Get isolated margin fee data collection with any vip level or user's current specific data as https://www.binance.com/en/margin-fee

Weight(IP): 1 when a single is specified; 10 when the symbol parameter is omitted

Parameters:

Name Type Mandatory Description
vipLevel INT NO User's current specific margin data will be returned if vipLevel is omitted
symbol STRING NO
recvWindow LONG NO No more than 60000
timestamp LONG YES

Query Isolated Margin Tier Data (USER_DATA)

Response:

[
    {
        "symbol": "BTCUSDT",
        "tier": 1,
        "effectiveMultiple": "10",
        "initialRiskRatio": "1.111",
        "liquidationRiskRatio": "1.05",
        "baseAssetMaxBorrowable": "9",
        "quoteAssetMaxBorrowable": "70000"
    }
]

GET /sapi/v1/margin/isolatedMarginTier

Get isolated margin tier data collection with any tier as https://www.binance.com/en/margin-data

Weight(IP): 1

Parameters:

Name Type Mandatory Description
symbol STRING YES
tier INTEGER NO All margin tier data will be returned if tier is omitted
recvWindow LONG NO No more than 60000
timestamp LONG YES

Query Current Margin Order Count Usage (TRADE)

Response:

[

  {
    "rateLimitType": "ORDERS",
    "interval": "SECOND",
    "intervalNum": 10,
    "limit": 10000,
    "count": 0
  },
  {
    "rateLimitType": "ORDERS",
    "interval": "DAY",
    "intervalNum": 1,
    "limit": 20000,
    "count": 0
  }
]

GET /sapi/v1/margin/rateLimit/order

Displays the user's current margin order count usage for all intervals.

Weight(IP): 20

Parameters:

Name Type Mandatory Description
isIsolated STRING NO for isolated margin or not, "TRUE", "FALSE",default "FALSE"
symbol STRING NO isolated symbol, mandatory for isolated margin
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Cross margin collateral ratio (MARKET_DATA)

Response:

[
  {
    "collaterals": [
      {
        "minUsdValue": "0",
        "maxUsdValue": "13000000",
        "discountRate": "1"
      },
      {
        "minUsdValue": "13000000",
        "maxUsdValue": "20000000",
        "discountRate": "0.975"
      },
      {
        "minUsdValue": "20000000",
        "discountRate": "0"
      }
    ],
    "assetNames": [
      "BNX"
    ]
  },
  {
    "collaterals": [
      {
        "minUsdValue": "0",
        "discountRate": "1"
      }
    ],
    "assetNames": [
      "BTC",
      "BUSD",
      "ETH",
      "USDT"
    ]
  }
]

GET /sapi/v1/margin/crossMarginCollateralRatio

Weight(IP): 100

Parameters: None

Get Small Liability Exchange Coin List (USER_DATA)

Query the coins which can be small liability exchange

Response:

[
    {
      "asset": "ETH",
      "interest": "0.00083334",
      "principal": "0.001",
      "liabilityAsset": "USDT",
      "liabilityQty": 0.3552
    }
]

GET /sapi/v1/margin/exchange-small-liability

Weight(IP): 100

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Small Liability Exchange (MARGIN)

Cross Margin Small Liability Exchange

POST /sapi/v1/margin/exchange-small-liability

Weight(UID): 3000

Parameters:

Name Type Mandatory Description
assetNames ARRAY YES The assets list of small liability exchange, Example: assetNames = BTC,ETH
recvWindow LONG NO
timestamp LONG YES

Get Small Liability Exchange History (USER_DATA)

Get Small liability Exchange History

Response:

{
    "total": 1,
    "rows": [
      {
        "asset": "ETH",
        "amount": "0.00083434",
        "targetAsset": "BUSD",
        "targetAmount": "1.37576819",
        "bizType": "EXCHANGE_SMALL_LIABILITY",
        "timestamp": 1672801339253
      }
    ]
}

GET /sapi/v1/margin/exchange-small-liability-history

Weight(UID): 100

Parameters:

Name Type Mandatory Description
current INT YES Currently querying page. Start from 1. Default:1
size INT YES Default:10, Max:100
startTime LONG NO Default: 30 days from current timestamp
endTime LONG NO Default: present timestamp
recvWindow LONG NO
timestamp LONG YES

Get a future hourly interest rate (USER_DATA)

GET /sapi/v1/margin/next-hourly-interest-rate

Get user the next hourly estimate interest

Response:

[
    {
        "asset": "BTC",
        "nextHourlyInterestRate": "0.00000571"
    },
    {
        "asset": "ETH",
        "nextHourlyInterestRate": "0.00000578"
    }
]

Weight(IP): 100

Parameters:

Name Type Mandatory Description
assets String YES List of assets, separated by commas, up to 20
isIsolated Boolean YES for isolated margin or not, "TRUE", "FALSE"

Get cross or isolated margin capital flow(USER_DATA)

GET /sapi/v1/margin/capital-flow

Get cross or isolated margin capital flow

Response:

[
  { 
    "id": 123456,
    "tranId": 123123,
    "timestamp": 1691116657000,
    "asset": "USDT",
    "symbol": "BTCUSDT",
    "type": "BORROW",
    "amount": "101"
  },
  {
    "id": 123457,
    "tranId": 123124,
    "timestamp": 1691116658000,
    "asset": "BTC",
    "symbol": "BTCUSDT",
    "type": "REPAY",
    "amount": "10"
  }
]

Weight(IP): 100

Parameters:

Name Type Mandatory Description
asset STRING NO
symbol STRING NO Required when querying isolated data
type STRING NO
startTime LONG NO Only supports querying the data of the last 90 days
endTime LONG NO
fromId LONG NO
If fromId is set, the data with id > fromId will be returned. Otherwise the latest data will be returned
limit LONG NO The number of data items returned each time is limited. Default 500; Max 1000.
recvWindow LONG NO
timestamp LONG YES

Get tokens or symbols delist schedule for cross margin and isolated margin (MARKET_DATA)

GET /sapi/v1/margin/delist-schedule

Get tokens or symbols delist schedule for cross margin and isolated margin

Response:

[
  {
    "delistTime": 1686161202000,
    "crossMarginAssets": [
      "BTC",
      "USDT"
    ],
    "isolatedMarginSymbols": [
      "ADAUSDT",
      "BNBUSDT"
    ]
  },
  {
    "delistTime": 1686222232000,
    "crossMarginAssets": [
      "ADA"
    ],
    "isolatedMarginSymbols": []
  },
   "updateTime": 1699272487
]

Weight(IP): 100

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Query Margin Available Inventory (USER_DATA)

GET /sapi/v1/margin/available-inventory

Margin available Inventory query

Response:

{
    "assets": {
        "MATIC": "100000000",
        "STPT": "100000000",
        "TVK": "100000000",
        "SHIB": "97409653"
    },
    "updateTime": 1699272487
}

Weight(UID): 50

Parameters:

Name Type Mandatory Description
type STRING YES MARGIN,ISOLATED
recvWindow LONG NO
timestamp LONG YES

Margin manual liquidation(MARGIN)

POST /sapi/v1/margin/manual-liquidation

Margin manual liquidation

Response:

[
    {
      "asset": "ETH",
      "interest": "0.00083334",
      "principal": "0.001",
      "liabilityAsset": "USDT",
      "liabilityQty": 0.3552
    }
]

Weight(UID): 3000

Parameters:

Name Type Mandatory Description
type STRING YES MARGIN,ISOLATED
symbol STRING NO When type selects ISOLATED, symbol must be filled in
recvWindow LONG NO
timestamp LONG YES

Query Liability Coin Leverage Bracket in Cross Margin Pro Mode(MARKET_DATA)

GET /sapi/v1/margin/leverageBracket

Liability Coin Leverage Bracket in Cross Margin Pro Mode

Response:

[
  {
     "assetNames":[
        "SHIB",
        "FDUSD",
        "BTC",
        "ETH",
        "USDC"
     ],          
     "rank":1,
     "brackets":[
        {
           "leverage":10,
           "maxDebt":1000000.00000000,
           "maintenanceMarginRate":0.02000000,
           "initialMarginRate":0.1112,
           "fastNum":0
        },
        {
           "leverage":3,
           "maxDebt":4000000.00000000,
           "maintenanceMarginRate":0.07000000,
           "initialMarginRate":0.5000,
           "fastNum":60000.0000000000000000
        }
     ]
  }
]

Weight(IP): 1

User Data Streams

LISTEN KEY (SPOT)

Create a ListenKey (USER_STREAM)

Response:

{
  "listenKey": "pqia91ma19a5s61cv6a81va65sdf19v8a65a1a5s61cv6a81va65sdf19v8a65a1"
}

POST /api/v3/userDataStream

Start a new user data stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has an active listenKey, that listenKey will be returned and its validity will be extended for 60 minutes.

Weight: 2

Parameters:

NONE

Data Source: Memory

Ping/Keep-alive a ListenKey (USER_STREAM)

Response:

{}

PUT /api/v3/userDataStream

Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It's recommended to send a ping about every 30 minutes.

Weight: 2

Parameters:

Name Type Mandatory Description
listenKey STRING YES

Data Source: Memory

Close a ListenKey (USER_STREAM)

Response:

{}

DELETE /api/v3/userDataStream

Close out a user data stream.

Weight: 2

Parameters:

Name Type Mandatory Description
listenKey STRING YES

Data Source: Memory

LISTEN KEY (MARGIN)

Create a ListenKey (USER_STREAM)

Response:

{"listenKey":  "T3ee22BIYuWqmvne0HNq2A2WsFlEtLhvWCtItw6ffhhdmjifQ2tRbuKkTHhr"}

POST /sapi/v1/userDataStream

Weight: 1

Parameters:

NONE

Ping/Keep-alive a ListenKey (USER_STREAM)

Response:

{}

PUT /sapi/v1/userDataStream

Weight: 1

Parameters:

Name Type Mandatory Description
listenKey STRING YES

Close a ListenKey (USER_STREAM)

Response:

{}

DELETE /sapi/v1/userDataStream

Weight: 1

Parameters:

Name Type Mandatory Description
listenKey STRING YES

LISTEN KEY (ISOLATED MARGIN)

Generate a Listen Key (USER_STREAM)

Response:

{
    "listenKey":  "T3ee22BIYuWqmvne0HNq2A2WsFlEtLhvWCtItw6ffhhdmjifQ2tRbuKkTHhr"
}

POST /sapi/v1/userDataStream/isolated

Weight: 1

Parameters:

Name Type Mandatory Description
symbol STRING YES

Ping/Keep-alive a Listen Key (USER_STREAM)

Response:

{}

PUT /sapi/v1/userDataStream/isolated

Weight: 1

Parameters:

Name Type Mandatory Description
symbol STRING YES
listenKey STRING YES

Close a ListenKey (USER_STREAM)

Response:

{}

DELETE /sapi/v1/userDataStream/isolated

Weight: 1

Parameters:

Name Type Mandatory Description
symbol STRING YES
listenKey STRING YES

Payload: Account Update

outboundAccountPosition is sent any time an account balance has changed and contains the assets that were possibly changed by the event that generated the balance change.

Payload:

{
  "e": "outboundAccountPosition", //Event type
  "E": 1564034571105,             //Event Time
  "u": 1564034571073,             //Time of last account update
  "B": [                          //Balances Array
    {
      "a": "ETH",                 //Asset
      "f": "10000.000000",        //Free
      "l": "0.000000"             //Locked
    }
  ]
}

Payload: Balance Update

Balance Update occurs during the following:

Payload

{
  "e": "balanceUpdate",         //Event Type
  "E": 1573200697110,           //Event Time
  "a": "BTC",                   //Asset
  "d": "100.00000000",          //Balance Delta
  "T": 1573200697068            //Clear Time
}

Payload: Order Update

Orders are updated with the executionReport event.

Execution types:

Check the Public API Definitions for more relevant enum definitions.

Payload:

{
  "e": "executionReport",        // Event type
  "E": 1499405658658,            // Event time
  "s": "ETHBTC",                 // Symbol
  "c": "mUvoqJxFIILMdfAW5iGSOW", // Client order ID
  "S": "BUY",                    // Side
  "o": "LIMIT",                  // Order type
  "f": "GTC",                    // Time in force
  "q": "1.00000000",             // Order quantity
  "p": "0.10264410",             // Order price
  "P": "0.00000000",             // Stop price
  "F": "0.00000000",             // Iceberg quantity
  "g": -1,                       // OrderListId
  "C": "",                       // Original client order ID; This is the ID of the order being canceled
  "x": "NEW",                    // Current execution type
  "X": "NEW",                    // Current order status
  "r": "NONE",                   // Order reject reason; will be an error code.
  "i": 4293153,                  // Order ID
  "l": "0.00000000",             // Last executed quantity
  "z": "0.00000000",             // Cumulative filled quantity
  "L": "0.00000000",             // Last executed price
  "n": "0",                      // Commission amount
  "N": null,                     // Commission asset
  "T": 1499405658657,            // Transaction time
  "t": -1,                       // Trade ID
  "I": 8641984,                  // Ignore
  "w": true,                     // Is the order on the book?
  "m": false,                    // Is this trade the maker side?
  "M": false,                    // Ignore
  "O": 1499405658657,            // Order creation time
  "Z": "0.00000000",             // Cumulative quote asset transacted quantity
  "Y": "0.00000000",             // Last quote asset transacted quantity (i.e. lastPrice * lastQty)
  "Q": "0.00000000",             // Quote Order Quantity
  "W": 1499405658657,            // Working Time; This is only visible if the order has been placed on the book.
  "V": "NONE"                    // selfTradePreventionMode
}

Note: Average price can be found by doing Z divided by z.

Conditional Fields in Execution Report

These are fields that appear in the payload only if certain conditions are met.

Field Name Description Examples
d Trailing Delta Appears only for trailing stop orders. "d": 4
D Trailing Time "D": 1668680518494
j Strategy Id Appears only if the strategyId parameter was provided upon order placement. "j": 1
J Strategy Type Appears only if the strategyType parameter was provided upon order placement. "J": 1000000
v Prevented Match Id Appears only for orders that expired due to STP. "v": 3
A Prevented Quantity "A":"3.000000"
B Last Prevented Quantity "B":"3.000000"
u Trade Group Id "u":1
U Counter Order Id "U":37
Cs Counter Symbol "Cs": "BTCUSDT"
pl Prevented Execution Quantity "pl":"2.123456"
pL Prevented Execution Price "pL":"0.10000001"
pY Prevented Execution Quote Qty "pY":"0.21234562"
W Working Time Appears when the order is working on the book "W": 1668683798379
b Match Type Appears for orders that have allocations "b":"ONE_PARTY_TRADE_REPORT"
a Allocation ID "a":1234
k Working Floor Appears for orders that could potentially have allocations "k":"SOR"
uS UsedSor Appears for orders that used SOR "uS":true

If the order is an order list, an event will be displayed named ListStatus in addition to the executionReport event.

Payload

{
  "e": "listStatus",                //Event Type
  "E": 1564035303637,               //Event Time
  "s": "ETHBTC",                    //Symbol
  "g": 2,                           //OrderListId
  "c": "OCO",                       //Contingency Type
  "l": "EXEC_STARTED",              //List Status Type
  "L": "EXECUTING",                 //List Order Status
  "r": "NONE",                      //List Reject Reason
  "C": "F4QN4G8DlFATFlIUQ0cjdD",    //List Client Order ID
  "T": 1564035303625,               //Transaction Time
  "O": [                            //An array of objects
    {
      "s": "ETHBTC",                //Symbol
      "i": 17,                      // orderId
      "c": "AJYsMjErWJesZvqlJCTUgL" //ClientOrderId
    },
    {
      "s": "ETHBTC",
      "i": 18,
      "c": "bfYPSQdLoqAJeNrOr9adzq"
    }
  ]
}

Payload: Listen Key Expired

This event is sent when the listen key expires.

No more events will be sent after this until a new listenKey is created.

This event will not be pushed when the stream is closed normally.

Payload

{
  "e": "listenKeyExpired",  // Event type
  "E": 1699596037418,     // Event time
  "listenKey": "OfYGbUzi3PraNagEkdKuFwUHn48brFsItTdsuiIXrucEvD0rhRXZ7I6URWfE8YE8" 
}

Margin User Data Streams

LISTEN KEY

Create a Margin ListenKey (USER_STREAM)

Response:

{
  "listenKey": "T3ee22BIYuWqmvne0HNq2A2WsFlEtLhvWCtItw6ffhhd"
}

POST /sapi/v1/margin/listen-key

Start a new margin user data stream.

Weight(UID): 1

Parameters:

NONE

Keep-alive a Margin ListenKey (USER_STREAM)

Response:

{}

PUT /sapi/v1/margin/listen-key

Keepalive a user data stream to prevent a time out.

Weight(UID): 1

Parameters:

Name Type Mandatory Description
listenKey STRING YES

Close a Margin ListenKey(USER_STREAM)

Response:

{}

DELETE /sapi/v1/margin/listen-key

Close out a user data stream.

Weight(UID): 3000 3000

Parameters:

Name Type Mandatory Description
listenKey STRING YES

Payload: liability update

Liability update during the following :

Payload:

{
  "e": "USER_LIABILITY_CHANGE", // Event Type
  "E": 1701949801133, // Event Time
  "a": "BTC", // Asset
  "t": "BORROW", // Liability Update Type
  "p": "0.00000100", // Principle Quantity
  "i": "0.00000000" // Interest Quantity
}

Payload: Margin Call

Margin call trigger the event

Payload

{
   "e": "MARGIN_LEVEL_STATUS_CHANGE", // Event Type
   "E": 1701949763462, // Event Time
   "l": "1.1", // margin level
   "s": "MARGIN_CALL" // margin call status
}

Simple Earn Endpoints

Get Simple Earn Flexible Product List (USER_DATA)

Response:

{
  "rows":[
    {
      "asset": "BTC",
      "latestAnnualPercentageRate": "0.05000000",
      "tierAnnualPercentageRate": {
        "0-5BTC": 0.05,
        "5-10BTC": 0.03
      },
      "airDropPercentageRate": "0.05000000",
      "canPurchase": true,
      "canRedeem": true,
      "isSoldOut": true,
      "hot": true,
      "minPurchaseAmount": "0.01000000",
      "productId": "BTC001",
      "subscriptionStartTime": "1646182276000",
      "status": "PURCHASING"
    }
  ],
  "total": 1
}

GET /sapi/v1/simple-earn/flexible/list

Get available Simple Earn flexible product list

Weight(IP): 150

Parameters:

Name Type Mandatory Description
asset STRING NO
current LONG NO Currently querying page. Start from 1. Default:1
size LONG NO Default:10, Max:100
recvWindow LONG NO
timestamp LONG YES

Get Simple Earn Locked Product List (USER_DATA)

Response:

{
  "rows": [
    {
      "projectId": "Axs*90",
      "detail": {
        "asset": "AXS",
        "rewardAsset": "AXS",
        "duration": 90,
        "renewable": true,
        "isSoldOut": true,
        "apr": "1.2069",
        "status": "CREATED",
        "subscriptionStartTime": "1646182276000",
        "extraRewardAsset": "BNB",
        "extraRewardAPR": "0.23"
      },
      "quota": {
        "totalPersonalQuota": "2",
        "minimum": "0.001"
      }
    }
  ],
  "total": 1
}

GET /sapi/v1/simple-earn/locked/list

Weight(IP): 150

Parameters:

Name Type Mandatory Description
asset STRING NO
current LONG NO Currently querying page. Start from 1. Default:1
size LONG NO Default:10, Max:100
recvWindow LONG NO
timestamp LONG YES

Get available Simple Earn locked product list

Subscribe Flexible Product (TRADE)

Response:

{
  "purchaseId": 40607,
  "success": true
}

POST /sapi/v1/simple-earn/flexible/subscribe

Weight(IP): 1

Rate Limit: 1/3s per account

Parameters:

Name Type Mandatory Description
productId STRING YES
amount DECIMAL YES
autoSubscribe BOOLEAN NO true or false, default true.
sourceAccount ENUM NO SPOT,FUND,ALL, default SPOT
recvWindow LONG NO
timestamp LONG YES

Subscribe Locked Product (TRADE)

Response:

{
  "purchaseId": 40607,
  "positionId": "12345",
  "success": true
}

POST /sapi/v1/simple-earn/locked/subscribe

Weight(IP): 1

Rate Limit: 1/3s per account

Parameters:

Name Type Mandatory Description
projectId STRING YES
amount DECIMAL YES
autoSubscribe BOOLEAN NO true or false, default true.
sourceAccount ENUM NO SPOT,FUND,ALL, default SPOT
recvWindow LONG NO
timestamp LONG YES

Redeem Flexible Product (TRADE)

Response:

{
  "redeemId": 40607,
  "success": true
}

POST /sapi/v1/simple-earn/flexible/redeem

Weight(IP): 1

Rate Limit: 1/3s per account

Parameters:

Name Type Mandatory Description
productId STRING YES
redeemAll BOOLEAN NO true or false, default to false
amount DECIMAL NO if redeemAll is false, amount is mandatory
destAccount ENUM NO SPOT,FUND, default SPOT
recvWindow LONG NO
timestamp LONG YES

Redeem Locked Product (TRADE)

Response:

{
  "redeemId": 40607,
  "success": true
}

POST /sapi/v1/simple-earn/locked/redeem

Weight(IP): 1

Rate Limit: 1/3s per account

Parameters:

Name Type Mandatory Description
positionId STRING YES "1234"
recvWindow LONG NO
timestamp LONG YES

Get Flexible Product Position (USER_DATA)

Response:

{
  "rows":[
    {
      "totalAmount": "75.46000000",
      "tierAnnualPercentageRate": {
        "0-5BTC": 0.05,
        "5-10BTC": 0.03
      },
      "latestAnnualPercentageRate": "0.02599895",
      "yesterdayAirdropPercentageRate": "0.02599895",
      "asset": "USDT",
      "airDropAsset": "BETH",
      "canRedeem": true,
      "collateralAmount": "232.23123213",
      "productId": "USDT001",
      "yesterdayRealTimeRewards": "0.10293829",
      "cumulativeBonusRewards": "0.22759183",
      "cumulativeRealTimeRewards": "0.22759183",
      "cumulativeTotalRewards": "0.45459183",
      "autoSubscribe": true
    }
  ],
  "total": 1
}

GET /sapi/v1/simple-earn/flexible/position

Weight(IP): 150

Parameters:

Name Type Mandatory Description
asset STRING NO
productId STRING NO
current LONG NO Currently querying the page. Start from 1. Default:1
size LONG NO Default:10, Max:100
recvWindow LONG NO
timestamp LONG YES

Get Locked Product Position (USER_DATA)

Response:

{
  "rows":[
    {
      "positionId": "123123",
      "projectId": "Axs*90",
      "asset": "AXS",
      "amount": "122.09202928",
      "purchaseTime": "1646182276000",
      "duration": "60",
      "accrualDays": "4",
      "rewardAsset": "AXS",
      "APY": "0.23",
      "isRenewable": true,
      "isAutoRenew": true,
      "redeemDate": "1732182276000"
    }
  ],
  "total": 1
}

GET /sapi/v1/simple-earn/locked/position

Weight(IP): 150

Parameters:

Name Type Mandatory Description
asset STRING NO
positionId STRING NO
projectId STRING NO
current LONG NO Currently querying the page. Start from 1. Default:1
size LONG NO Default:10, Max:100
recvWindow LONG NO
timestamp LONG YES

Simple Account (USER_DATA)

Response:

{
  "totalAmountInBTC": "0.01067982",
  "totalAmountInUSDT": "77.13289230",
  "totalFlexibleAmountInBTC": "0.00000000",
  "totalFlexibleAmountInUSDT": "0.00000000",
  "totalLockedInBTC": "0.01067982",
  "totalLockedInUSDT": "77.13289230"
}

GET /sapi/v1/simple-earn/account

Weight(IP): 150

Parameters:

Name Type Mandatory Description
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Get Flexible Subscription Record (USER_DATA)

Response:

{
  "rows": [
    {
      "amount": "100.00000000",
      "asset": "USDT",
      "time": 1575018510000,
      "purchaseId": 26055,
      "type": "AUTO", // AUTO for auto subscribe, NORMAL for normal subscription, CONVERT for Locked to Flexible, LOAN for flexible loan collateral, AI for Auto Invest subscribe, TRANSFER for Locked Savings to Flexible
      "sourceAccount": "SPOT", // SPOT, FUNDING, SPOTANDFUNDING   
      "amtFromSpot": "30", // Display if sourceAccount is SPOTANDFUNDING 
      "amtFromFunding": "70", // Display if sourceAccount is SPOTANDFUNDING 
      "status": "SUCCESS" // PURCHASING/SUCCESS/FAILED
    }
  ],
  "total": 1
}

GET /sapi/v1/simple-earn/flexible/history/subscriptionRecord

Weight(IP): 150

Parameters:

Name Type Mandatory Description
productId STRING NO
purchaseId STRING NO
asset STRING NO
startTime LONG NO
endTime LONG NO
current LONG NO Currently querying the page. Start from 1. Default:1
size LONG NO Default:10, Max:100
recvWindow LONG NO
timestamp LONG YES

Get Locked Subscription Record (USER_DATA)

Response:

{
  "rows":[
    {
      "positionId": "123123",
      "purchaseId": 26055,
      "time": 1575018510000,
      "asset": "BNB",
      "amount": "21312.23223",
      "lockPeriod": "30",
      "type": "AUTO", // NORMAL for normal subscription, AUTO for auto-subscription order, ACTIVITY for activity order, TRIAL for trial fund order, RESTAKE for restake order
      "sourceAccount": "SPOT",     // SPOT, FUNDING, SPOTANDFUNDING   
      "amtFromSpot": "30", // Display if sourceAccount is SPOTANDFUNDING 
      "amtFromFunding": "70", // Display if sourceAccount is SPOTANDFUNDING 
      "status": "SUCCESS" // PURCHASING/SUCCESS/FAILED
    }
  ],
  "total": 1
}

GET /sapi/v1/simple-earn/locked/history/subscriptionRecord

Weight(IP): 150

Parameters:

Name Type Mandatory Description
purchaseId STRING NO
asset STRING NO
startTime LONG NO
endTime LONG NO
current LONG NO Currently querying the page. Start from 1. Default:1
size LONG NO Default:10, Max:100
recvWindow LONG NO
timestamp LONG YES

Get Flexible Redemption Record (USER_DATA)

Response:

{
  "rows": [
    {
      "amount": "10.54000000",
      "asset": "USDT",
      "time": 1577257222000,
      "productId": "USDT001",
      "redeemId": 40607,
      "destAccount":"SPOT", // SPOT, FUNDING
      "status": "PAID"
    }
  ],
  "total": 1
}

GET /sapi/v1/simple-earn/flexible/history/redemptionRecord

Weight(IP): 150

Parameters:

Name Type Mandatory Description
productId STRING NO
redeemId STRING NO
asset STRING NO
startTime LONG NO
endTime LONG NO
current LONG NO Currently querying the page. Start from 1. Default:1
size LONG NO Default:10, Max:100

Get Locked Redemption Record (USER_DATA)

Response:

{
  "rows": [
    {
      "positionId": "123123",
      "redeemId": 40607,
      "time": 1575018510000,
      "asset": "BNB",
      "lockPeriod": "30",
      "amount": "21312.23223",
       "type": "MATURE", //MATURE for redeem to Spot Wallet, NEW_TRANSFERRED for redeem to Flexible product, AHEAD for early redemption
      "deliverDate": "1575018510000",
      "status": "PAID"
    }
  ],
  "total": 1
}

GET /sapi/v1/simple-earn/locked/history/redemptionRecord

Weight(IP): 150

Parameters:

Name Type Mandatory Description
positionId STRING NO
redeemId STRING NO
asset STRING NO
startTime LONG NO
endTime LONG NO
current LONG NO Currently querying the page. Start from 1. Default:1
size LONG NO Default:10, Max:100
recvWindow LONG NO
timestamp LONG YES

Get Flexible Rewards History (USER_DATA)

Response:

{
  "rows": [
    {
      "asset": "BUSD",
      "rewards": "0.00006408",
      "projectId": "USDT001",
      "type": "BONUS",
      "time": 1577233578000
    },
    {
      "asset": "USDT",
      "rewards": "0.00687654",
      "projectId": "USDT001",
      "type": "REALTIME",
      "time": 1577233562000
    }
  ],
  "total": 2
}

GET /sapi/v1/simple-earn/flexible/history/rewardsRecord

Weight(IP): 150

Parameters:

Name Type Mandatory Description
productId STRING NO
asset STRING NO
startTime LONG NO
endTime LONG NO
type ENUM YES BONUS - Bonus tiered APR, REALTIME Real-time APR, REWARDS Historical rewards
current LONG NO current page 1, default 1
size LONG NO default 10,max 100
recvWindow LONG NO
timestamp LONG YES

Get Locked Rewards History (USER_DATA)

Response:

{
  "rows": [
    {
      "positionId": "123123",
      "time": 1575018510000,
      "asset": "BNB",
      "lockPeriod": "30",
      "amount": "21312.23223"
    }
  ],
  "total": 1
}

GET /sapi/v1/simple-earn/locked/history/rewardsRecord

Weight(IP): 150

Parameters:

Name Type Mandatory Description
positionId STRING NO
asset STRING NO
startTime LONG NO
endTime LONG NO
current LONG NO Currently querying the page. Start from 1. Default:1
size LONG NO Default:10, Max:100
recvWindow LONG NO
timestamp LONG YES

Set Flexible Auto Subscribe (USER_DATA)

Response:

{
  "success": true
}

POST /sapi/v1/simple-earn/flexible/setAutoSubscribe

Weight(IP): 150

Parameters:

Name Type Mandatory Description
productId STRING YES
autoSubscribe BOOLEAN YES true or false
recvWindow LONG NO
timestamp LONG YES

Set Locked Auto Subscribe (USER_DATA)

Response:

{
  "success": true
}

POST /sapi/v1/simple-earn/locked/setAutoSubscribe

Weight(IP): 150

Parameters:

Name Type Mandatory Description
positionId STRING YES
autoSubscribe BOOLEAN YES true or false
recvWindow LONG NO
timestamp LONG YES

Get Flexible Personal Left Quota (USER_DATA)

Response:

{
  "leftPersonalQuota": "1000"
}

GET /sapi/v1/simple-earn/flexible/personalLeftQuota

Weight(IP): 150

Parameters:

Name Type Mandatory Description
productId STRING YES
recvWindow LONG NO
timestamp LONG YES

Get Locked Personal Left Quota (USER_DATA)

Response:

{
  "leftPersonalQuota": "1000"
}

GET /sapi/v1/simple-earn/locked/personalLeftQuota

Weight(IP): 150

Parameters:

Name Type Mandatory Description
projectId STRING YES
recvWindow LONG NO
timestamp LONG YES

Get Flexible Subscription Preview (USER_DATA)

Response:

{
  "totalAmount": "1232.32230982",
  "rewardAsset": "BUSD",
  "airDropAsset": "BETH",
  "estDailyBonusRewards": "0.22759183",
  "estDailyRealTimeRewards": "0.22759183",
  "estDailyAirdropRewards": "0.22759183"
}

GET /sapi/v1/simple-earn/flexible/subscriptionPreview

Weight(IP): 150

Parameters:

Name Type Mandatory Description
productId STRING YES
amount DECIMAL YES
recvWindow LONG NO
timestamp LONG YES

Get Locked Subscription Preview (USER_DATA)

Response:

[
  {
    "rewardAsset": "AXS",
    "totalRewardAmt": "5.17181528",
    "extraRewardAsset": "BNB",
    "estTotalExtraRewardAmt": "5.17181528",
    "nextPay": "1.29295383",
    "nextPayDate": "1646697600000",
    "valueDate": "1646697600000",
    "rewardsEndDate": "1651449600000",
    "deliverDate": "1651536000000",
    "nextSubscriptionDate": "1651536000000"
  }
]

GET /sapi/v1/simple-earn/locked/subscriptionPreview

Weight(IP): 150

Parameters:

Name Type Mandatory Description
projectId STRING YES
amount DECIMAL YES
autoSubscribe BOOLEAN NO true or false, default true.
recvWindow LONG NO
timestamp LONG YES

Get Rate History (USER_DATA)

Response:

{
  "rows": [
    {
      "productId": "BUSD001",
      "asset": "BUSD",
      "annualPercentageRate": "0.00006408",
      "time": 1577233578000
    }
  ],
  "total": "1"
}

GET /sapi/v1/simple-earn/flexible/history/rateHistory

Weight(IP): 150

Parameters:

Name Type Mandatory Description
productId STRING YES
startTime LONG NO
endTime LONG NO
current LONG NO Currently querying page. Start from 1. Default:1
size LONG NO Default:10, Max:100
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Get Collateral Record (USER_DATA)

Response:

{
  "rows": [
    {
      "amount": "100.00000000",
      "productId": "BUSD001",
      "asset": "USDT",
      "createTime": 1575018510000,
      "type": "REPAY",
      "productName": "USDT",
      "orderId": 26055
    }
  ],
  "total": "1"
}

GET /sapi/v1/simple-earn/flexible/history/collateralRecord

Weight(IP): 1

Parameters:

Name Type Mandatory Description
productId STRING NO
startTime LONG NO
endTime LONG NO
current LONG NO Currently querying page. Start from 1. Default:1
size LONG NO Default:10, Max:100
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Dual Investment Endpoints

Get Dual Investment product list(USER_DATA)

Response:

{
    "total": 1,
    "list": [
        {
            "id": "741590",
            "investCoin": "USDT",
            "exercisedCoin": "BNB",
            "strikePrice": "380",
            "duration": 4,
            "settleDate": 1709020800000,
            "purchaseDecimal": 8,
            "purchaseEndTime": 1708934400000,
            "canPurchase": true, //true, false
            "apr": "0.6076",
            "orderId": 8257205859,
            "minAmount": "0.1",
            "maxAmount": "25265.7",
            "createTimestamp": 1708560084000,
            "optionType": "PUT",
            "isAutoCompoundEnable": true, //true, false
            "autoCompoundPlanList": [
                "STANDARD",
                "ADVANCE"
            ]
        }
    ]
}

GET /sapi/v1/dci/product/list

Get Dual Investment product list

Weight(IP): 1

Parameters:

Name Type Mandatory Description
optionType STRING YES Input CALL or PUT
exercisedCoin STRING YES Target exercised asset, e.g.: if you subscribe to a high sell product (call option), you should input: optionType:CALL,exercisedCoin:USDT,investCoin:BNB; if you subscribe to a low buy product (put option), you should input: optionType:PUT,exercisedCoin:BNB,investCoin:USDT
investCoin STRING YES Asset used for subscribing, e.g.: if you subscribe to a high sell product (call option), you should input: optionType:CALL,exercisedCoin:USDT,investCoin:BNB; if you subscribe to a low buy product (put option), you should input: optionType:PUT,exercisedCoin:BNB,investCoin:USDT
pageSize LONG NO Default: 10, Maximum: 100
pageIndex INT NO Default: 1
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Subscribe Dual Investment products(USER_DATA)

Response:

{
  "positionId": 10208824,
  "investCoin": "BNB",
  "exercisedCoin": "USDT",
  "subscriptionAmount": "0.002",
  "duration": 4,
  "autoCompoundPlan": "STANDARD", //STANDARD, ADVANCED, this field won't display when autocompound is set to None
  "strikePrice": "380",
  "settleDate": 1709020800000,
  "purchaseStatus": "PURCHASE_SUCCESS",
  "apr": "0.7397",
  "orderId": 8259117597,
  "purchaseTime": 1708677583874,
  "optionType": "CALL"
}

POST /sapi/v1/dci/product/subscribe

Subscribe Dual Investment products

Weight(IP): 1

Parameters:

Name Type Mandatory Description
id STRING YES get id from /sapi/v1/dci/product/list
orderId STRING YES get orderId from /sapi/v1/dci/product/list
depositAmount DECIMAL YES the amount for subscribing
autoCompoundPlan ENUM YES NONE: switch off the plan, STANDARD:standard plan,ADVANCED:advanced plan
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Failed messages:

Get Dual Investment positions(USER_DATA)

Response:

{
    "total": 1,
    "list": [
        {
            "id": "10160533", //positionId
            "investCoin": "USDT",
            "exercisedCoin": "BNB",
            "subscriptionAmount": "0.5",
            "strikePrice": "330",
            "duration": 4,
            "settleDate": 1708416000000,
            "purchaseStatus": "PURCHASE_SUCCESS",
            "apr": "0.0365",
            "orderId": 7973677530,
            "purchaseEndTime": 1708329600000, //申购中, 申购成功, 已结算, 申购失败, 退款中, 退款成功, 结算中
            "optionType": "PUT",
            "autoCompoundPlan": "STANDARD" //关闭计划, 基础计划, 进阶计划
        }
    ]
}

GET /sapi/v1/dci/product/positions

Get Dual Investment positions (batch)

Weight(IP): 1

Parameters:

Name Type Mandatory Description
status ENUM NO PENDING:Products are purchasing, will give results later;PURCHASE_SUCCESS:purchase successfully;SETTLED: Products are finish settling;PURCHASE_FAIL:fail to purchase;REFUNDING:refund ongoing;REFUND_SUCCESS:refund to spot account successfully; SETTLING:Products are settling. If don't fill this field, will response all the position status.
pageSize LONG NO Default: 10, Max:100
pageIndex INT NO Default:1
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Check Dual Investment accounts(USER_DATA)

Response:

{
   "totalAmountInBTC": "0.01067982",  //Total BTC amounts in Dual Investment
   "totalAmountInUSDT": "77.13289230" //Total USDT equivalents in BTC in Dual Investment
}

GET /sapi/v1/dci/product/accounts

Check Dual Investment accounts

Weight(IP): 1

Parameters:

Name Type Mandatory Description
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Change Auto-Compound status(USER_DATA)

Response:

{
    "positionId":"123456789"
    "autoCompoundPlan":"ADVANCED", //NONE,STANDARD,ADVANCED
}

POST /sapi/v1/dci/product/auto_compound/edit-status

Change Auto-Compound status

Weight(IP): 1

Rate Limit: Maximum 1 time/s per account

Parameters:

Name Type Mandatory Description
positionId STRING YES Get positionId from /sapi/v1/dci/product/positions
autoCompoundPlan STRING YES NONE, STANDARD,ADVANCED
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Notes:

Auto-Invest Endpoints

Get target asset list(USER_DATA)

Response:

{
    "targetAssets": [
        "BTC"
    ],
    "autoInvestAssetList": [
        {
            "targetAsset": "BTC",
            "roiAndDimensionTypeList": [
                {
                    "simulateRoi": "5.004",
                    "dimensionValue": "3",
                    "dimensionUnit": "year"
                },
                {
                    "simulateRoi": "2.004",
                    "dimensionValue": "1",
                    "dimensionUnit": "year"
                },
                {
                    "simulateRoi": "1.004",
                    "dimensionValue": "6",
                    "dimensionUnit": "month"
                },
                {
                    "simulateRoi": "0.904",
                    "dimensionValue": "3",
                    "dimensionUnit": "month"
                },
                {
                    "simulateRoi": "0.14",
                    "dimensionValue": "7",
                    "dimensionUnit": "day"
                }
            ]
        }
    ]
}

GET /sapi/v1/lending/auto-invest/target-asset/list

Weight(IP): 1

Parameters:

Name Type Mandatory Description
targetAsset STRING NO
size LONG NO Default: 8, Max:100
current LONG NO Current query page. Default: 1, start from 1
recvWindow LONG NO no more than 60000
timestamp LONG YES

Get target asset ROI data(USER_DATA)

Response:

[
    {
        "date": "1648378800000", // date of the ROI accumulation
        "simulateRoi": "1.75" // value of calculated ROI till the date
    },
    {
        "date": "1648478800000",
        "simulateRoi": "2.9"
    }
]

GET /sapi/v1/lending/auto-invest/target-asset/roi/list

ROI return list for target asset

Weight(IP): 1

Parameters:

Name Type Mandatory Description
targetAsset STRING YES e.g "BTC"
hisRoiType ENUM YES FIVE_YEAR,THREE_YEAR,ONE_YEAR,SIX_MONTH,THREE_MONTH,SEVEN_DAY
recvWindow LONG NO no more than 60000
timestamp LONG YES

Query all source asset and target asset(USER_DATA)

Response:

{    
    "targetAssets": [
        "BTC",
        "BNB"
    ],    
   "sourceAssets": [
        "USDT",
        "BUSD"
    ],
}

GET /sapi/v1/lending/auto-invest/all/asset

Query all source assets and target assets

Weight(IP): 1

Parameters:

Name Type Mandatory Description
recvWindow LONG NO no more than 60000
timestamp LONG YES

Query source asset list(USER_DATA)

Response:

{
    "feeRate": "0.002",
    "taxRate": "0.001",
    "sourceAssets": [
        {
            "sourceAsset": "USDT",
            "assetMinAmount": "0.1" ,
            "assetMaxAmount": "1000000",
            "scale": "2",
            "flexibleAmount":"1111"       
        },
        {
            "sourceAsset": "BUSD",
            "assetMinAmount": "0.1" ,
            "assetMaxAmount": "1000000",
            "scale": "2",
            "flexibleAmount":"1111"              
        }
    ]
}

GET /sapi/v1/lending/auto-invest/source-asset/list

Query Source Asset to be used for investment

Weight(IP): 1

Parameters:

Name Type Mandatory Description
targetAsset Array<STRING> NO BTC、ETH、BNB
indexId Long NO 指数identifier, value = 1
usageType STRING YES "RECURRING", "ONE_TIME"
flexibleAllowedToUse BOOLEAN NO
sourceType ENUM NO MAIN_SITE for Binance user,TR for Binance Turkey user
recvWindow LONG NO no more than 60000
timestamp LONG YES

Investment plan creation(USER_DATA)

Response:

{
  "planId": 12345, //for success creation, planId is associated. PlanId remains constant when plan is being updated
  "nextExecutionDateTime":1648378800000, //plan next excute timestamp
}

POST /sapi/v1/lending/auto-invest/plan/add

Post an investment plan creation

Weight(IP): 1

Parameters:

Name Type Mandatory Description
sourceType ENUM YES "MAIN_SITE" for Binance,“TR” for Binance Turkey
requestId STRING NO if not null, must follow sourceType + unique string, e.g: TR12354859
planType ENUM YES “SINGLE”,”PORTFOLIO”,”INDEX”
indexId LONG NO Only for planType = INDEX , value = 1
subscriptionAmount DECIMAL YES Fiat&stablecoin: 2dp, BNB/ETH/BTC: 4dp
subscriptionCycle ENUM YES "H1", "H4", "H8","H12", "WEEKLY","DAILY","MONTHLY","BI_WEEKLY"
subscriptionStartDay INTEGER NO “1”,...”31”; Mandatory if “subscriptionCycleNumberUnit” = “MONTHLY”, Must be sent in form of UTC+0
subscriptionStartWeekday ENUM NO “MON”,”TUE”,”WED”,”THU”,”FRI”,”SAT”,”SUN”; Mandatory if “subscriptionCycleNumberUnit” = “WEEKLY” or “BI_WEEKLY”, Must be sent in form of UTC+0
subscriptionStartTime INTEGER YES “0,1,2,3,4,5,6,7,8,..23”;Must be sent in form of UTC+0
sourceAsset STRING YES like “USDT”
flexibleAllowedToUse BOOLEAN NO true/false;true: use flexible wallet
details Array<PortfolioDetail> YES sum(all node's percentage) == 100,sum(all node's percentage) == 100, When input request parameter, each entry should be like details[0].targetAsset=BTC, Example of the request parameter array:
details[0].targetAsset=BTC details[0].percentage=60 details[1].targetAsset=ETH details[1].percentage=40
recvWindow LONG NO no more than 60000
timestamp LONG YES

Investment plan adjustment (TRADE)

Response:

{
  "planId": 12345, //for success creation, planId is associated. PlanId remains constant when plan is being updated 
  "nextExecutionDateTime":1648378800000
}

POST /sapi/v1/lending/auto-invest/plan/edit

Query Source Asset to be used for investment

Weight(IP): 1

Parameters:

Name Type Mandatory Description
planId LONG YES Plan identifier
subscriptionAmount DECIMAL YES Fiat&Stablecoin: 2dp, BNB/ETH/BTC: 4dp
subscriptionCycle ENUM YES "H1", "H4", "H8","H12", "WEEKLY","DAILY","MONTHLY","BI_WEEKLY"
subscriptionStartDay INTEGER NO “1”,...”31”;Mandatory if “subscriptionCycleNumberUnit” = “MONTHLY”,Must be sent in form of UTC+0
subscriptionStartWeekday ENUM NO “MON”,”TUE”,”WED”,”THU”,”FRI”,”SAT”,”SUN”;Mandatory if “subscriptionCycleNumberUnit” = “WEEKLY” or “BI_WEEKLY”, Must be sent in form of UTC+0
subscriptionStartTime INTEGER YES “0,1, 2,3,4,5,6,7,8,..23”; Must be sent in form of UTC+0
sourceAsset STRING YES e.g. “USDT”
flexibleAllowedToUse BOOLEAN NO true/false;true:use flexible wallet
details Array<PortfolioDetail> YES sum(all node's percentage) == 100,sum(all node's percentage) == 100, When input request parameter, each entry should be like details[0].targetAsset=BTC, Example of the request parameter array:
details[0].targetAsset=BTC details[0].percentage=60 details[1].targetAsset=ETH details[1].percentage=40
recvWindow LONG NO no more than 60000
timestamp LONG YES

Change Plan Status (TRADE)

Response:

{
  "planId": 12345, //planId is constant regardless the change of the status
  "nextExecutionDateTime":1648378800000,
  "status":"ONGOING" //ONGOING, PAUSED, REMOVED
}

POST /sapi/v1/lending/auto-invest/plan/edit-status

Change Plan Status

Weight(IP): 1

Parameters:

Name Type Mandatory Description
planId LONG YES Plan identifier
status ENUM YES “ONGOING”,”PAUSED","REMOVED"
recvWindow LONG NO no more than 60000
timestamp LONG YES

Get list of plans (USER_DATA)

Response:

SINGLE/PORTFOLIO

{
        "planValueInUSD": "123",
        "planValueInBTC":"0.1",
        "pnlInUSD":"120",
        "roi":"2.3",
        "plans": [
            {
                "planId": 12345,
                "planType": "SINGLE",
                "editAllowed": "true",
                "creationDateTime": 1648378800000,
                "firstExecutionDateTime": 1648378800000, //first subscription date time
                "nextExecutionDateTime": 1648378800000,
                "status": "ONGOING", // ONGOING,PAUSED
                "lastUpdatedDateTime": 1648378800000,
                "targetAsset": "BTC",
                "totalTargetAmount":"0.111",
                "sourceAsset": "BUSD",
                "totalInvestedInUSD":"4.555",
                "subscriptionAmount": "0.1",
                "subscriptionCycle": "WEEKLY",
                "subscriptionStartDay": null,
                "subscriptionStartWeekday" : "MON",
                "subscriptionStartTime": "1",
                "sourceWallet": "SPOT_WALLET",
                "flexibleAllowedToUse": "false",
                "planValueInUSD": "101.2",
                "pnlInUSD": "101.2",
                "roi": "1.02"
            }
        ]
} 

OR INDEX

{
    "planValueInUSD": "123",
    "planValueInBTC": "0.1",
     "plans": [
        {
            "planId": 12345,
            "planType": "INDEX",
            "editAllowed": "true",
            "creationDateTime": 1648378800000,
            "firstExecutionDateTime": 1648378800000, //first subscription date time
            "nextExecutionDateTime": 1648378800000,
            "status": "ONGOING",
            "lastUpdatedDateTime": 1648378800000,
            "targetAsset": "BTC",
            "sourceAsset": "BUSD",
            "totalInvestedInUSD":"4.555",
            "subscriptionAmount": "0.1",
            "subscriptionCycle": "DAILY",
            "subscriptionStartDay": "1",
            "subscriptionStartWeekday" : null,
            "subscriptionStartTime": "2",
            "sourceWallet": "SPOT",
            "flexibleAllowedToUse": "false",

        }
    ]
}  

GET /sapi/v1/lending/auto-invest/plan/list

Query plan lists

Weight(IP): 1

Parameters:

Name Type Mandatory Description
planType STRING YES Plan identifier
recvWindow LONG NO no more than 60000
timestamp LONG YES

Query holding details of the plan (USER_DATA)

Response:

{    
    "planId": 111212,
    "planType": "INDEX", // this is the plan type: "SINGLE","PORTFOLIO","INDEX"
    "editAllowed": "true",  //whether this plan is allowed to be modified
    "flexibleAllowedToUse": "false",
    "creationDateTime": 1648378800000,  // date time that this plan is created. YYYY-MM-DD HH:mm:SS e.g 2022-01-07 08:00:00
    "firstExecutionDateTime": 1648378800000, //first subscription date time
    "nextExecutionDateTime": 1648378800000, //next subscription date time
    "status": "ONGOING", //plan status of the selected plan
    "targetAsset": "BTC",
    "sourceAsset": "BUSD", //source asset of the plan created
    "planValueInUSD": "101.2",  //market value of the plan
    "pnlInUSD": "101.2",    // PNL of the plan in USD
    "roi": "1.023",         //ROI of the plan
    "totalInvestedInUSD": "122",  //total source asset invested in equivilent of USD
    "details": [
        {
            "targetAsset": "ADA",
            "averagePriceInUSD": "3.4",  //average price of the asset in USD
            "totalInvestedInUSD": "222.21", //total source asset invested for this target asset in equivilent of USD
            "purchasedAmount": "122.12345678", //purchased amount of target asset
            "purchasedAmountUnit": "ADA",
            "pnlInUSD": "109.2",   //PNL denominated in USD
            "roi": "0.1",    //ROI calculated in decimal
            "percentage": "50", //asset allocation in the plan. If it's single plan, then it's 100
            "assetStatus":"ACTIVE", // ACTIVE / INACTIVE whether this asset is still being subscribed in this plan
            "availableAmount": "122.12345678", // Only for planType = INDEX
            "availableAmountUnit": "ADA",      // Only for planType = INDEX
            "redeemedAmout": "122.12345678",   // Only for planType = INDEX
            "redeemedAmoutUnit": "ADA",        // Only for planType = INDEX
            "assetValueInUSD": "101.2"         // Only for planType = INDEX
        }
    ]
}  

GET /sapi/v1/lending/auto-invest/plan/id

Query holding details of the plan

Weight(IP): 1

Parameters:

Name Type Mandatory Description
planId LONG NO Plan identifier
requestId STRING NO requestId when create
recvWindow LONG NO no more than 60000
timestamp LONG YES

Query subscription transaction history (USER_DATA)

Response:

[
  {
    "id":1111,
    "targetAsset":"BTC", //name of the asset
    "planType":"SINGLE", //plan type of which this transaction is from
    "planName":"BTC", // plan name of which this transaction is from
    "planId":1234, // plan identifier of which this transaction is from
    "transactionDateTime":1648378800000, //transaction timestamp
    "transactionStatus":"SUCCESS", //status of the transaction: "SUCCESS","FAILED","PENDING"
    "failedType":"INSUFFICIENT_BALANCE",// only show when transactionStatus = FAILED,  INSUFFICIENT_BALANCE,TRANSACTION_REJECT/GCC_RJECT
    "sourceAsset":"BUSD", //source asset of the transaction
    "sourceAssetAmount":"297.12345", //amount of source asset used
    "targetAssetAmount":"0.005", //purchased amount of the asset
    "sourceWallet":"SPOT_WALLET", // SPOT_WALLET,FLEXIBLE_SAVINGS,SPOT_WALLET_FLEXIBLE_SAVINGS,REWARDS    
    "flexibleUsed":"false", //whether simple earn wallet is used
    "transactionFee":"0.002", //transaction fee amount
    "transactionFeeUnit":"BUSD", //denominated coin of the transaction fee
    "executionPrice":"2342" //price of the subscription price. It's amount of source asset equivilent of 1 unit of target asset
    "executionType":"RECURRING", //ONE_TIME,RECURRING
    "subscriptionCycle": "WEEKLY"
  }
]

GET /sapi/v1/lending/auto-invest/history/list

Query subscription transaction history of a plan

Weight(IP): 1

Parameters:

Name Type Mandatory Description
planId LONG NO Plan identifier
startTime LONG NO
endTime LONG NO
targetAsset STRING NO
planType ENUM NO SINGLE, PORTFOLIO, INDEX, ALL
size LONG NO Default:10, Max:100
current LONG NO Currently querying page. Start from 1. Default:1
recvWindow LONG NO no more than 60000
timestamp LONG YES

Query Index Details(USER_DATA)

Response:

{    
    "indexId": 1,
    "indexName":"BINANCE TOP 10 EW ",
    "status": "RUNNING",        // RUNNING/REBALANCING/PAUSED
    "assetAllocation": [
         {
          "targetAsset": "ADA", // for pie chart
          "allocation":"10"
         },
         {
          "targetAsset": "BTC",
          "allocation":"10"
         } 
    ]
}

GET /sapi/v1/lending/auto-invest/index/info

Query index details

Weight(IP): 1

Parameters:

Name Type Mandatory Description
indexId LONG YES
recvWindow LONG NO no more than 60000
timestamp LONG YES

Query Index Linked Plan Position Details(USER_DATA)

Response:

{    
    "indexId": 1,
    "totalInvestedInUSD":"114.555",
    "currentInvestedInUSD": "101.2",  //current invest
    "pnlInUSD": "101.2",    // PNL of the plan in USD based on current amount
    "roi": "1.023",         //ROI of the plan based on current amount
    "assetAllocation": [
         {
          "targetAsset": "ADA", // for pie chart
          "allocation":"10"
         },
         {
          "targetAsset": "BTC",
          "allocation":"10"
         } 
    ]
    "details": [
        {
            "targetAsset": "ADA",
            "averagePriceInUSD": "3.4",  //average price of the asset in USD
            "totalInvestedInUSD": "222.21", //total source asset invested for this target asset in equivilent of USD

            "currentInvestedInUSD": "101.2",  //current invest
            "purchasedAmount": "122.12345678", //purchased amount of target asset
            "pnlInUSD": "109.2",   //PNL denominated in USD
            "roi": "0.1",    //ROI calculated in decimal
            "percentage": "10", //asset allocation in the plan. If it's single plan, then it's 100
            "availableAmount": "122.12345678",
            "redeemedAmount": "122.12345678", 
            "assetValueInUSD": "101.2"
        },
        {
            "targetAsset": "MATIC",
            "averagePriceInUSD": "3.4",  //average price of the asset in USD
            "totalInvestedInUSD": "222.21", //total source asset invested for this target asset in equivilent of USD
            "currentInvestedInUSD": "101.2",  //current invest
            "purchasedAmount": "122.12345678", //purchased amount of target asset
            "pnlInUSD": "109.2",   //PNL denominated in USD
            "roi": "0.1",    //ROI calculated in decimal
            "percentage": "10", //asset allocation in the plan. If it's single plan, then it's 100
            "availableAmount": "122.12345678",
            "redeemedAmount": "122.12345678", 
            "assetValueInUSD": "101.2"
        }
    ]
}

GET /sapi/v1/lending/auto-invest/index/user-summary

Details on users Index-Linked plan position details

Weight(IP): 1

Parameters:

Name Type Mandatory Description
indexId LONG YES
recvWindow LONG NO no more than 60000
timestamp LONG YES

One Time Transaction(TRADE)

Response:

{
  "transactionId": 12345, //transaction identifier
  "waitSecond": 5 // wait this second,then check the result
}

POST /sapi/v1/lending/auto-invest/one-off

One time transaction

Weight(IP): 1

Rate Limit: once every 3s per account

Parameters:

Name Type Mandatory Description
sourceType STRING YES "MAIN_SITE" for Binance,“TR” for Binance Turkey
requestId STRING NO if not null, must follow sourceType + unique string, e.g: TR12354859
subscriptionAmount DECIMAL YES
sourceAsset STRING YES e.g “USDT”
flexibleAllowedToUse BOOLEAN NO true/false;true: using flexible wallet
planId LONG NO PORTFOLIO plan's Id
indexId LONG NO now only can set = 1
details Array<PortfolioDetail> YES sum(all node's percentage) == 100,sum(all node's percentage) == 100, When input request parameter, each entry should be like details[0].targetAsset=BTC, Example of the request parameter array:
details[0].targetAsset=BTC details[0].percentage=60 details[1].targetAsset=ETH details[1].percentage=40
recvWindow LONG NO no more than 60000
timestamp LONG YES

Query One-Time Transaction Status(USER_DATA)

Response:

{
  "transactionId": 12345, //transaction identifier
  "status": "SUCCESS" //status of transaction"SUCCESS"/"CONVERTING"
}

GET /sapi/v1/lending/auto-invest/one-off/status

Transaction status for one-time transaction

Weight(IP): 1

Parameters:

Name Type Mandatory Description
transactionId LONG YES PORTFOLIO plan's Id
requestId STRING NO sourceType + unique, transactionId and requestId cannot be empty at the same time
recvWindow LONG NO no more than 60000
timestamp LONG YES

Index Linked Plan Redemption(TRADE)

Response:

{
  "redemptionId":19, //This is the identifier for this redemption requests         
}

POST /sapi/v1/lending/auto-invest/redeem

To redeem index-Linked plan holdings

Weight(IP): 1

Rate Limit: once every 3s per account

Parameters:

Name Type Mandatory Description
indexId LONG YES PORTFOLIO plan's Id
requestId STRING NO sourceType + unique, transactionId and requestId cannot be empty at the same time
redemptionPercentage LONG YES user redeem percentage,10/20/100..
recvWindow LONG NO no more than 60000
timestamp LONG YES

Index Linked Plan Redemption(USER_DATA)

Response:

[
  {
    "indexId":1,                        //index identifier
    "indexName":"BINANCE TOP 10 EW",    //index name
    "redemptionId":11                   //redemption record identifier
    "status":"SUCCESS",                 //redemption SUCCESS/FAILED  
    "asset":"BTC",                      //asset invovled
    "amount":"0.005",                   //redemption amount
    "redemptionDateTime":1648378800000, //redemption timestamp
    "transactionFee":"0",               //redemption fee
    "transactionFeeUnit":"USDT"         //denomination of redemption fee amount
  },
  {
    "indexId":1, 
    "indexName":"BINANCE TOP 10 EW", 
    "redemptionId":12 
    "status":"SUCCESS",  
    "asset":"BNB", 
    "amount":"0.005",
    "redemptionDateTime":1648378800000, 
    "transactionFee":"0", 
    "transactionFeeUnit":"USDT" 
  }
]

GET /sapi/v1/lending/auto-invest/redeem/history

Get the history of Index Linked Plan Redemption transactions

Weight(IP): 1

Parameters:

Name Type Mandatory Description
requestId LONG YES request id
startTime LONG NO
endTime LONG NO
current LONG NO Currently querying page. Start from 1,Default:1
asset STRING NO
size LONG NO Default:10, Max:100
recvWindow LONG NO no more than 60000
timestamp LONG YES

Index Linked Plan Rebalance Details(USER_DATA)

Response:

[
  {
    "indexId":1,                     //index identifier
    "indexName":"BINANCE TOP 10 EW", //index name
    "rebalanceId":11,                //rebalance identifier
    "status":"SUCCESS",              //rebalance status  SUCCESS/INIT
    "rebalanceFee":"10",             //rebalance fee
    "rebalanceFeeUnit":"USDT",       // rebalance fee unit
    "transactionDetails":[
      {
        "asset":"BTC",               //assets to be rebalanced
        "transactionDateTime":1648378800000, //rebalance transaction timestamp
        "rebalanceDirection":"BUY",  //rebalance direction
        "rebalanceAmount":"0.005",   //rebalance amount for the asset
      },                                     
      {
        "asset":"ETH",
        "transactionDateTime":1648378800000,
        "rebalanceDirection":"BUY",
        "rebalanceAmount":"0.005",
      }
    ]
  }
]

GET /sapi/v1/lending/auto-invest/rebalance/history

Get the history of Index Linked Plan Redemption transactions

Weight(IP): 1

Parameters:

Name Type Mandatory Description
startTime LONG NO
endTime LONG NO
current LONG NO Currently querying page. Start from 1,Default:1
size LONG NO Default:10, Max:100
recvWindow LONG NO no more than 60000
timestamp LONG YES

Staking Endpoints

The endpoints below allow you to interact with Staking. For more information on this, please refer to the Staking page

Subscribe ETH Staking(TRADE)

Response:

{
  "success": true
}

POST /sapi/v1/eth-staking/eth/stake

Weight(IP): 150

Rate Limit: 1/3s per account

Parameters:

Name Type Mandatory Description
amount DECIMAL YES Amount in ETH, limit 4 decimals
recvWindow LONG NO
timestamp LONG YES

Subscribe ETH Staking V2(TRADE)

Response:

{
  "success": true,
  "wbethAmount":"0.23092091",
  "conversionRatio": "1.001212342342"  // ETH amount per 1 WBETH
}

POST /sapi/v2/eth-staking/eth/stake

Stake ETH to get WBETH

Weight(IP): 150

Rate Limit: 1/3s per account

Parameters:

Name Type Mandatory Description
amount DECIMAL YES Amount in ETH, limit 4 decimals
recvWindow LONG NO
timestamp LONG YES

Redeem ETH (TRADE)

Response:

{
  "success": true,
  "arrivalTime": 1575018510000,
  "ethAmount":"0.23092091",
  "conversionRatio": "1.00121234"
}

POST /sapi/v1/eth-staking/eth/redeem

Redeem WBETH or BETH and get ETH

Weight(IP):

150

Rate Limit:

1/3s per account

Parameters:

Name Type Mandatory Description
asset STRING NO WBETH or BETH, default to BETH
amount DECIMAL YES Amount in BETH, limit 8 decimals
recvWindow LONG NO
timestamp LONG YES

Get ETH staking history (USER_DATA)

Response:

{
  "rows": [
    {
      "time": 1575018510000,
      "asset": "ETH",
      "amount": "21312.23223",
      "status": "SUCCESS"   //PENDING,SUCCESS,FAILED
      "distributeAmount":"21286.42584",
      "conversionRatio":"1.00121234"
    }
  ],
  "total": 1
}

GET /sapi/v1/eth-staking/eth/history/stakingHistory

Weight(IP):

150

Parameters:

Name Type Mandatory Description
startTime LONG NO
endTime LONG NO
current LONG NO Currently querying page. Start from 1. Default: 1
size LONG NO Default: 10, Max: 100
recvWindow LONG NO
timestamp LONG YES

Get ETH redemption history (USER_DATA)

Response:

{
  "rows": [
    {
      "time": 1575018510000,
      "arrivalTime": 1575018510000,
      "amount": "21312.23223",
      "status": "SUCCESS",
      "asset":"WBETH", 
      "distributeAsset": "ETH",  //PENDING,SUCCESS,FAILED
      "distributeAmount": "21338.0699",
      "conversionRatio": "1.00121234"
    }
  ],
  "total": 1
}

GET /sapi/v1/eth-staking/eth/history/redemptionHistory

Weight(IP):

150

Parameters:

Name Type Mandatory Description
startTime LONG NO
endTime LONG NO
current LONG NO Currently querying page. Start from 1. Default: 1
size LONG NO Default: 10, Max: 100
recvWindow LONG NO
timestamp LONG YES

Get BETH rewards distribution history(USER_DATA)

Response:

{
  "rows": [
    {
      "time": 1575018510000,
      "asset": "BETH",
      "holding": "2.3223", // BETH holding balance
      "amount": "0.23223", // Distributed rewards
      "annualPercentageRate": "0.5", // 0.5 means 50% here
      "status": "SUCCESS"
    }
  ],
  "total": 1
}

GET /sapi/v1/eth-staking/eth/history/rewardsHistory

Weight(IP):

150

Parameters:

Name Type Mandatory Description
startTime LONG NO
endTime LONG NO
current LONG NO Currently querying page. Start from 1. Default: 1
size LONG NO Default: 10, Max: 100
recvWindow LONG NO
timestamp LONG YES

Get current ETH staking quota (USER_DATA)

Response:

{
  "leftStakingPersonalQuota": "1000", // Show min(Daily available limit, total personal staking quota)
  "leftRedemptionPersonalQuota": "1000" // Show min(Daily personal redeem quota, total redemption limit)
}

GET /sapi/v1/eth-staking/eth/quota

Weight(IP):

150

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Get WBETH Rate History (USER_DATA)

Response:

{
  "rows": [
    {
      "annualPercentageRate": "0.00006408",  // BETH APR
      "exchangeRate": "1.00121234",  // BETH value per 1 WBETH
      "time": 1577233578000
    }
  ],
  "total": "1"
}

GET /sapi/v1/eth-staking/eth/history/rateHistory

Weight(IP):

150

Parameters:

Name Type Mandatory Description
startTime LONG NO
endTime LONG NO
current LONG NO Currently querying page. Start from 1. Default:1
size LONG NO Default:10, Max:100
recvWindow LONG NO
timestamp LONG YES

ETH Staking account (USER_DATA)

Response:

{
  "cumulativeProfitInBETH": "0.01067982",
  "lastDayProfitInBETH": "0.01067982"
}

GET /sapi/v1/eth-staking/account

Weight(IP):

150

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

ETH Staking account V2(USER_DATA)

Response:

{
  "holdingInETH":"1.22330928",
  "holdings":{
    wbethAmount="1.10928781",
    bethAmount="1.90002112"
  },
  "thirtyDaysProfitInETH":"0.22330928",  
  "profit":{
    amountFromWBETH="0.12330928", //Profit accrued within WBETH
    amountFromBETH="0.1"  //BETH distributed to your Spot Wallet
  }
}

GET /sapi/v2/eth-staking/account

Weight(IP):

150

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Wrap BETH(TRADE)

Response:

{
  "success": true,
  "wbethAmount": "0.23092091",
  "exchangeRate": "1.001212343432"
}

POST /sapi/v1/eth-staking/wbeth/wrap

Weight(IP):

150

Rate Limit:

1/3s per account

Parameters:

Name Type Mandatory Description
amount DECIMAL YES Amount in BETH, limit 4 decimals
recvWindow LONG NO
timestamp LONG YES

Get WBETH wrap history (USER_DATA)

Response:

{
  "rows": [
    {
      "time": 1575018510000,
      "fromAsset": "BETH",
      "fromAmount": "21312.23223",
      "toAsset": "WBETH",
      "toAmount": "21312.23223",
      "exchangeRate": "1.01243253",  // BETH amount per 1 WBETH
      "status": "SUCCESS"            //PENDING,SUCCESS,FAILED
    }
  ],
  "total": 1
}

GET /sapi/v1/eth-staking/wbeth/history/wrapHistory

Weight(IP):

150

Parameters:

Name Type Mandatory Description
startTime LONG NO
endTime LONG NO
current LONG NO Currently querying page. Start from 1. Default:1
size LONG NO Default:10, Max:100
recvWindow LONG NO
timestamp LONG YES

Get WBETH unwrap history (USER_DATA)

Response:

{
  "rows": [
    {
      "time": 1575018510000,
      "fromAsset": "WBETH",
      "fromAmount": "21312.23223",
      "toAsset": "BETH",
      "toAmount": "21312.23223",
      "exchangeRate": "1.01243253", // BETH value per 1 WBETH
      "status": "SUCCESS"   //PENDING,SUCCESS,FAILED
    }
  ],
  "total": 1
}

GET /sapi/v1/eth-staking/wbeth/history/unwrapHistory

Weight(IP):

150

Parameters:

Name Type Mandatory Description
startTime LONG NO
endTime LONG NO
current LONG NO Currently querying page. Start from 1. Default:1
size LONG NO Default:10, Max:100
recvWindow LONG NO
timestamp LONG YES

Get WBETH rewards history(USER_DATA)

Response:

{
  "estRewardsInETH":"1.23230920",
  "rows":[
    {
      "time":1575018510000,
      "amountInETH":"0.23223", // Estimated rewards accrued within WBETH
      "holding":"2.3223", // WBETH holding balance
      "holdingInETH":"2.4231",
      "annualPercentageRate":"0.5", 
    }
  ],
  "total": 1
}

GET /sapi/v1/eth-staking/eth/history/wbethRewardsHistory

Weight(IP):

150

Parameters:

Name Type Mandatory Description
startTime LONG NO
endTime LONG NO
current LONG NO Currently querying page. Start from 1. Default:1
size LONG NO Default:10, Max:100
recvWindow LONG NO
timestamp LONG YES

Mining Endpoints

Acquiring Algorithm (MARKET_DATA)

Response:

{
  "code": 0,
  "msg": "",
  "data": [
    {
      "algoName": "sha256",                        //  Algorithm name
      "algoId": 1,                                 // Algorithm ID
      "poolIndex": 0,                              // Sequence 
      "unit": "h/s"                                //   Unit
    }
  ]
}

GET /sapi/v1/mining/pub/algoList

Weight(IP): 1

Parameter:

None

Acquiring CoinName (MARKET_DATA)

GET /sapi/v1/mining/pub/coinList

Weight(IP): 1

Parameter:

None

Response:

{
  "code": 0,
  "msg": "",
  "data": [
    {
      "coinName": "BTC",                      //  Currencyname
      "coinId": 1,                            // id
      "poolIndex": 0,                         // Sort
      "algoId": 1,                            // Algorithm
      "algoName": "sha256"                    //Name of algorithm
    }
  ]
}

Request for Detail Miner List (USER_DATA)

Response:

{
  "code": 0,
  "msg": "",
  "data": [
    {
      "workerName": "bhdc1.16A10404B",     //Mining Account name
      "type": "H_hashrate",               // Type of hourly hashrate
      "hashrateDatas": [
        {
          "time": 1587902400000,         //  Time
          "hashrate": "0",               // Hashrate
          "reject": 0                    //Rejection Rate
        },
        {
          "time": 1587906000000,
          "hashrate": "0",
          "reject": 0
        }
      ]
    },
    {
      "workerName": "bhdc1.16A10404B",    //Mining Account name
      "type": "D_hashrate",                //Type of daily hashrate
      "hashrateDatas": [
        {
          "time": 1587902400000,          //  Time
          "hashrate": "0",                // Hashrate 
          "reject": 0                     //Rejection Rate
        },
        {
          "time": 1587906000000,
          "hashrate": "0",
          "reject": 0
        }
      ]
    }
  ]
}

GET /sapi/v1/mining/worker/detail

Weight(IP): 5

Parameter:

Name Type Mandatory Description For Example
algo STRING YES Algorithm(sha256) sha256
userName STRING YES Mining account test
workerName STRING YES Miner’s name(required) bhdc1.16A10404B
recvWindow LONG NO
timestamp LONG YES

Request for Miner List (USER_DATA)

Response:

{
  "code": 0,
  "msg": "",
  "data": {
    "workerDatas": [
      {
        "workerId": "1420554439452400131",  //Miner ID
        "workerName": "2X73",               //Miner's name  
        "status": 3,                        // Status:1 valid, 2 invalid, 3 no longer valid
        "hashRate": 0,                      // Real-time rate
        "dayHashRate": 0,                   //24H Hashrate
        "rejectRate": 0,                    //Real-time Rejection Rate
        "lastShareTime": 1587712919000      // Last submission time 
      },
      {
        "workerId": "7893926126382807951",
        "workerName": "AZDC1.1A10101",
        "status": 2,
        "hashRate": 29711247541680,
        "dayHashRate": 12697781298013.66,
        "rejectRate": 0,
        "lastShareTime": 1587969727000
      }
    ],
    "totalNum": 18530,           // Total amount
    "pageSize": 20               // Rows per page
  }
}

GET /sapi/v1/mining/worker/list

Weight(IP): 5

Parameter:

Name Type Mandatory Description For Example
algo STRING YES Algorithm(sha256) sha256
userName STRING YES Mining account test
pageIndex INTEGER NO Page number,default is first page,start from 1
sort INTEGER NO sort sequence(default=0)0 positive sequence,1 negative sequence
sortColumn INTEGER NO Sort by( default 1):

1: miner name,

2: real-time computing power,

3: daily average computing power,

4: real-time rejection rate,

5: last submission time
workerStatus INTEGER NO miners status(default=0), 0 all, 1 valid,2 invalid, 3 failure
recvWindow LONG NO
timestamp LONG YES

Earnings List(USER_DATA)

Response:

{
  "code": 0,
  "msg": "",
  "data": {
    "accountProfits": [
      {
        "time": 1586188800000,            // Mining date
        "type": 31, // 0:Mining Wallet,5:Mining Address,7:Pool Savings,8:Transferred,31:Income Transfer ,32:Hashrate Resale-Mining Wallet 33:Hashrate Resale-Pool Savings
        "hashTransfer": null,            // Transferred Hashrate
        "transferAmount": null,          // Transferred Income   
        "dayHashRate": 129129903378244,  // Daily Hashrate
        "profitAmount": 8.6083060304,   //Earnings Amount
        "coinName":"BTC",              // Coin Type
        "status": 2    //Status:0:Unpaid, 1:Paying  2:Paid
      },
      {
        "time": 1607529600000,
        "coinName": "BTC",
        "type": 0,
        "dayHashRate": 9942053925926,
        "profitAmount": 0.85426469,
        "hashTransfer": 200000000000,
        "transferAmount": 0.02180958,
        "status": 2
      },
      {
        "time": 1607443200000,
        "coinName": "BTC",
        "type": 31,
        "dayHashRate": 200000000000,
        "profitAmount": 0.02905916,
        "hashTransfer": null,
        "transferAmount": null,
        "status": 2
      }
    ],
    "totalNum": 3,          // Total Rows
    "pageSize": 20          // Rows per page
  }
}

GET /sapi/v1/mining/payment/list

Weight(IP): 5

Parameter:

Name Type Mandatory Description Example
algo STRING YES Transfer algorithm(sha256) sha256
userName STRING YES Mining account test
coin STRING NO Coin name
startDate Long NO Search date, millisecond timestamp, while empty query all
endDate Long NO Search date, millisecond timestamp, while empty query all
pageIndex INTEGER NO Page number, empty default first page, starting from 1
pageSize INTEGER NO Number of pages, minimum 10, maximum 200
recvWindow LONG NO
timestamp LONG YES

Extra Bonus List (USER_DATA)

Response:

{
  "code": 0,
  "msg": "",
  "data": {
    "otherProfits": [
      {
        "time": 1607443200000,      // Mining date
        "coinName": "BTC",    // Coin Name
        "type": 4,            // 1: Merged Mining, 2: Activity Bonus, 3:Rebate 4:Smart Pool 6:Income Transfer 7:Pool Savings
        "profitAmount": 0.0011859,  //Amount
        "status": 2         //Status:0:Unpaid, 1:Paying  2:Paid
      }
    ],
    "totalNum": 3,          // Total Rows
    "pageSize": 20          // Rows per page
  }
}

GET /sapi/v1/mining/payment/other

Weight(IP): 5

Parameter:

Name Type Mandatory Description Example
algo STRING YES Transfer algorithm(sha256) sha256
userName STRING YES Mining Account test
coin STRING NO Coin Name
startDate Long NO Search date, millisecond timestamp, while empty query all
endDate Long NO Search date, millisecond timestamp, while empty query all
pageIndex INTEGER NO Page number, empty default first page, starting from 1
pageSize INTEGER NO Number of pages, minimum 10, maximum 200
recvWindow LONG NO
timestamp LONG YES

Hashrate Resale List (USER_DATA)

Response:

{
  "code": 0,
  "msg": "",
  "data": {
    "configDetails": [
      {
        "configId": 168,     // Mining ID
        "poolUsername": "123",  //Transfer out of subaccount
        "toPoolUsername": "user1", //  Transfer into subaccount
        "algoName": "Ethash",     // Transfer algorithm
        "hashRate": 5000000,     //  Transferred Hashrate quantity
        "startDay": 20201210,   // Start date
        "endDay": 20210405,   //End date
        "status": 1       //Status:0 Processing,1:Cancelled,2:Terminated 
      },
      {
        "configId": 166,
        "poolUsername": "pop",
        "toPoolUsername": "111111",
        "algoName": "Ethash",
        "hashRate": 3320000,
        "startDay": 20201226,
        "endDay": 20201227,
        "status": 0
      }
    ],
    "totalNum": 21,
    "pageSize": 200
  }
}

GET /sapi/v1/mining/hash-transfer/config/details/list

Weight(IP): 5

Parameter:

Name Type Mandatory Description Example
pageIndex INTEGER NO Page number, empty default first page, starting from 1
pageSize INTEGER NO Number of pages, minimum 10, maximum 200
recvWindow LONG NO
timestamp LONG YES

Hashrate Resale Detail (USER_DATA)

Response:

{
    "code": 0,
    "msg": "",
    "data": {
        "profitTransferDetails": [{
                "poolUsername": "test4001",  // Transfer out of sub-account

                "toPoolUsername": "pop",    // Transfer into subaccount
                "algoName": "sha256",      // Transfer algorithm
                "hashRate": 200000000000,  // Transferred Hashrate quantity
                "day": 20201213,          // Transfer date
                "amount": 0.2256872,     // Transferred income
                "coinName": "BTC"        // Coin Name
            },
            {
                "poolUsername": "test4001",
                "toPoolUsername": "pop",
                "algoName": "sha256",
                "hashRate": 200000000000,
                "day": 20201213,
                "amount": 0.2256872,
                "coinName": "BTC"
            }
        ],
        "totalNum": 8,
        "pageSize": 200
    }
}

GET /sapi/v1/mining/hash-transfer/profit/details

Weight(IP): 5

Parameter:

Name Type Mandatory Description Example
configId INTEGER YES Mining ID 168
userName STRING YES Mining Account test
pageIndex INTEGER NO Page number, empty default first page, starting from 1
pageSize INTEGER NO Number of pages, minimum 10, maximum 200
recvWindow LONG NO
timestamp LONG YES

Hashrate Resale Request (USER_DATA)

Response:

{
  "code": 0,
  "msg": "",
  "data": 171  // Mining Account
}

POST /sapi/v1/mining/hash-transfer/config

Weight(IP): 5

Parameter:

Name Type Mandatory Description Example
userName STRING YES Mining Account test
algo STRING YES Transfer algorithm(sha256) sha256
endDate Long YES Resale End Time (Millisecond timestamp) 1617659086000
startDate Long YES Resale Start Time(Millisecond timestamp) 1607659086000
toPoolUser STRING YES Mining Account S19pro
hashRate Long YES Resale hashrate h/s must be transferred (BTC is greater than 500000000000 ETH is greater than 500000) 100000000
recvWindow LONG NO
timestamp LONG YES

Cancel hashrate resale configuration(USER_DATA)

Response:

{
  "code": 0,
  "msg": "",
  "data": true
}

POST /sapi/v1/mining/hash-transfer/config/cancel

Weight(IP): 5

Parameter:

Name Type Mandatory Description Example
configId INTEGER YES Mining ID 168
userName STRING YES Mining Account test
recvWindow LONG NO
timestamp LONG YES

Statistic List (USER_DATA)

Response:

{
  "code": 0,
  "msg": "",
  "data": {
    "fifteenMinHashRate": "457835490067496409.00000000",          // 15 mins hashrate
    "dayHashRate": "214289268068874127.65000000",                 //  24H Hashrate
    "validNum": 0,                                                // Effective quantity
    "invalidNum": 17562,                                          // Invalid quantity
    "profitToday":{                                              // Today's estimate
      "BTC":"0.00314332",       
      "BSV":"56.17055953",
      "BCH":"106.61586001"
     },
    "profitYesterday":{                                       //  Yesterday's earnings
      "BTC":"0.00314332",
       "BSV":"56.17055953",
       "BCH":"106.61586001"
     },

    "userName": "test",                                    // Mining account
    "unit": "h/s",                                        //  Hashrate unit
    "algo": "sha256"                                      // Algorithm
  }
}

GET /sapi/v1/mining/statistics/user/status

Weight(IP): 5

Parameter:

Name Type Mandatory Description For Example
algo STRING YES Algorithm(sha256) sha256
userName STRING YES Mining account test
recvWindow LONG NO
timestamp LONG YES

Account List (USER_DATA)

Response:

{
  "code": 0,
  "msg": "",
  "data": [
    {
      "type": "H_hashrate",        //Type of hourly hashrate
      "userName": "test",         // Mining account
      "list": [
        {
          "time": 1585267200000,    // Time
          "hashrate": "0.00000000", // Hashrate
          "reject": "0.00000000"    //Rejection Rate
        },
        {
          "time": 1585353600000,
          "hashrate": "0.00000000",
          "reject": "0.00000000"
        }
      ]
    },
    {
      "type": "D_hashrate",        //Type of daily hashrate
      "userName": "test",          // Mining account
      "list": [
        {
          "time": 1587906000000,     // Time
          "hashrate": "0.00000000", // Hashrate
          "reject": "0.00000000"    //Rejection Rate
        },
        {
          "time": 1587909600000,
          "hashrate": "0.00000000",
          "reject": "0.00000000"
        }
      ]
    }
  ]
}

GET /sapi/v1/mining/statistics/user/list

Weight(IP): 5

Parameter:

Name Type Mandatory Description For Example
algo STRING YES Algorithm(sha256) sha256
userName STRING YES Mining account test
recvWindow LONG NO
timestamp LONG YES

Mining Account Earning (USER_DATA)

Response:

{
  "code": 0,
  "msg": "",
  "data": {
    "accountProfits": [
      {
        "time": 1607443200000,      
        "coinName": "BTC",   // Coin
        "type": 2,           // 0:Referral 1:Refund 2:Rebate
        "puid": 59985472,    //Sub-account id
        "subName": "vdvaghani", //Mining account
        "amount": 0.09186957    //Amount
      }
    ],
    "totalNum": 3,          // Total records
    "pageSize": 20          // Size of one page
  }
}

GET /sapi/v1/mining/payment/uid

Weight(IP): 5

Parameter:

Name Type Mandatory Description For Example
algo STRING YES Algorithm(sha256) sha256
startDate Long NO Millisecond timestamp
endDate Long NO Millisecond timestamp
pageIndex INTEGER NO Default 1
pageSize INTEGER NO Min 10,Max 200
recvWindow LONG NO
timestamp LONG YES

Futures

New Future Account Transfer (USER_DATA)

Response:

{
    "tranId": 100000001    //transaction id
}

POST /sapi/v1/futures/transfer

Execute transfer between spot account and futures account.

Weight(IP): 1

Parameters:

Name Type Mandatory Description
asset STRING YES The asset being transferred, e.g., USDT
amount DECIMAL YES The amount to be transferred
type INT YES 1: transfer from spot account to USDT-Ⓜ futures account.

2: transfer from USDT-Ⓜ futures account to spot account.

3: transfer from spot account to COIN-Ⓜ futures account.

4: transfer from COIN-Ⓜ futures account to spot account.
recvWindow LONG NO
timestamp LONG YES

Get Future Account Transaction History List (USER_DATA)

Response:

{
  "rows": [
    {
      "asset": "USDT",
      "tranId": 100000001,
      "amount": "40.84624400",
      "type": "1",  // one of 1( from spot to USDT-Ⓜ), 2( from USDT-Ⓜ to spot), 3( from spot to COIN-Ⓜ), and 4( from COIN-Ⓜ to spot)
      "timestamp": 1555056425000,
      "status": "CONFIRMED" //one of PENDING (pending to execution), CONFIRMED (successfully transfered), FAILED (execution failed, nothing happened to your account);
    }
  ],
  "total": 1
}

GET /sapi/v1/futures/transfer

Weight(IP): 10

Parameters:

Name Type Mandatory Description
asset STRING NO
startTime LONG YES
endTime LONG NO
current LONG NO Currently querying page. Start from 1. Default:1
size LONG NO Default:10 Max:100
recvWindow LONG NO
timestamp LONG YES

Response:

{
    "data": [
        {
            "day": "2023-06-30",
            "url": "https://bin-prod-user-rebate-bucket.s3.ap-northeast-1.amazonaws.com/future-data-symbol-update/2023-06-30/BTCUSDT_T_DEPTH_2023-06-30.tar.gz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20230925T025710Z&X-Amz-SignedHeaders=host&X-Amz-Expires=86399&X-Amz-Credential=AKIAVL364M5ZNFZ74IPP%2F20230925%2Fap-northeast-1%2Fs3%2Faws4_request&X-Amz-Signature=5fffcb390d10f34d71615726f81f99e42d80a11532edeac77b858c51a88cbf59"
        }
    ]
}

GET /sapi/v1/futures/histDataLink

Weight(IP): 200

Parameters:

Name Type Mandatory Description
symbol STRING YES symbol name, e.g. BTCUSDT or BTCUSD_PERP |
dataType ENUM YES T_DEPTH for ticklevel orderbook data, S_DEPTH for orderbook snapshot data
startTime LONG YES
endTime LONG YES
recvWindow LONG NO
timestamp LONG YES

Futures Algo Endpoints

Binance Futures Execution Algorithm API solution aims to provide users ability to programmatically leverage Binance in-house algorithmic trading capability to automate order execution strategy, improve execution transparency and give users smart access to the available market liquidity.

FAQ: Volume Participation(VP) Introduction

FAQ: Time-Weighted Average Price(Twap) Introduction

Volume Participation(VP) New Order (TRADE)

Response:

{
    "clientAlgoId": "00358ce6a268403398bd34eaa36dffe7",
    "success": true,
    "code": 0,
    "msg": "OK"
}

POST /sapi/v1/algo/futures/newOrderVp

Send in a VP new order. Only support on USDⓈ-M Contracts.

Weight(UID): 3000

Noted:

Parameters:

Name Type Mandatory Description
symbol STRING YES Trading symbol eg. BTCUSDT
side ENUM YES Trading side ( BUY or SELL )
positionSide ENUM NO Default BOTH for One-way Mode ; LONG or SHORT for Hedge Mode. It must be sent in Hedge Mode.
quantity DECIMAL YES Quantity of base asset; The notional (quantity * mark price(base asset)) must be more than the equivalent of 1,000 USDT and less than the equivalent of 1,000,000 USDT
urgency ENUM YES Represent the relative speed of the current execution; ENUM: LOW, MEDIUM, HIGH
clientAlgoId STRING NO A unique id among Algo orders (length should be 32 characters), If it is not sent, we will give default value
reduceOnly BOOLEAN NO "true" or "false". Default "false"; Cannot be sent in Hedge Mode; Cannot be sent when you open a position
limitPrice DECIMAL NO Limit price of the order; If it is not sent, will place order by market price by default
recvWindow LONG NO
timestamp LONG YES

Other Info:

Time-Weighted Average Price(Twap) New Order (TRADE)

Response:

{
    "clientAlgoId": "65ce1630101a480b85915d7e11fd5078",
    "success": true,
    "code": 0,
    "msg": "OK"
}

POST /sapi/v1/algo/futures/newOrderTwap

Send in a Twap new order. Only support on USDⓈ-M Contracts.

Weight(UID): 3000

Noted:

Parameters:

Name Type Mandatory Description
symbol STRING YES Trading symbol eg. BTCUSDT
side ENUM YES Trading side ( BUY or SELL )
positionSide ENUM NO Default BOTH for One-way Mode ; LONG or SHORT for Hedge Mode. It must be sent in Hedge Mode.
quantity DECIMAL YES Quantity of base asset; The notional (quantity * mark price(base asset)) must be more than the equivalent of 1,000 USDT and less than the equivalent of 1,000,000 USDT
duration LONG YES Duration for TWAP orders in seconds. [300, 86400]
clientAlgoId STRING NO A unique id among Algo orders (length should be 32 characters), If it is not sent, we will give default value
reduceOnly BOOLEAN NO "true" or "false". Default "false"; Cannot be sent in Hedge Mode; Cannot be sent when you open a position
limitPrice DECIMAL NO Limit price of the order; If it is not sent, will place order by market price by default
recvWindow LONG NO
timestamp LONG YES

Other Info:

Cancel Algo Order (TRADE)

Response:

{
    "algoId": 14511,
    "success": true,
    "code": 0,
    "msg": "OK"
}

DELETE /sapi/v1/algo/futures/order

Cancel an active order.

Weight(IP): 1

Noted:

Parameters:

Name Type Mandatory Description
algoId LONG YES eg. 14511
recvWindow LONG NO
timestamp LONG YES

Query Current Algo Open Orders (USER_DATA)

Response:

{
    "total": 1,
    "orders": [
        {
            "algoId": 14517,
            "symbol": "ETHUSDT",
            "side": "SELL",
            "positionSide": "SHORT",
            "totalQty": "5.000",
            "executedQty": "0.000",
            "executedAmt": "0.00000000",
            "avgPrice": "0.00",
            "clientAlgoId": "d7096549481642f8a0bb69e9e2e31f2e",
            "bookTime": 1649756817004,
            "endTime": 0,
            "algoStatus": "WORKING",
            "algoType": "VP",
            "urgency": "LOW"
        }
    ]
}

GET /sapi/v1/algo/futures/openOrders

Weight(IP): 1

Noted:

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Query Historical Algo Orders (USER_DATA)

Response:

{
    "total": 1,
    "orders": [
        {
            "algoId": 14518,
            "symbol": "BNBUSDT",
            "side": "BUY",
            "positionSide": "BOTH",
            "totalQty": "100.00",
            "executedQty": "0.00",
            "executedAmt": "0.00000000",
            "avgPrice": "0.000",
            "clientAlgoId": "acacab56b3c44bef9f6a8f8ebd2a8408",
            "bookTime": 1649757019503,
            "endTime": 1649757088101,
            "algoStatus": "CANCELLED",
            "algoType": "VP",
            "urgency": "LOW"
        }
    ]
}

GET /sapi/v1/algo/futures/historicalOrders

Weight(IP): 1

Noted:

Parameters:

Name Type Mandatory Description
symbol STRING NO Trading symbol eg. BTCUSDT
side ENUM NO BUY or SELL
startTime LONG NO in milliseconds eg.1641522717552
endTime LONG NO in milliseconds eg.1641522526562
page INT NO Default is 1
pageSize INT NO MIN 1, MAX 100; Default 100
recvWindow LONG NO
timestamp LONG YES

Query Sub Orders (USER_DATA)

Response:

{
    "total": 1,
    "executedQty": "1.000",
    "executedAmt": "3229.44000000",
    "subOrders": [
        {
            "algoId": 13723,
            "orderId": 8389765519993908929,
            "orderStatus": "FILLED",
            "executedQty": "1.000",
            "executedAmt": "3229.44000000",
            "feeAmt": "-1.61471999",
            "feeAsset": "USDT",
            "bookTime": 1649319001964,
            "avgPrice": "3229.44",
            "side": "SELL",
            "symbol": "ETHUSDT",
            "subId": 1,
            "timeInForce": "IMMEDIATE_OR_CANCEL",
            "origQty": "1.000"
        }
    ]
}

GET /sapi/v1/algo/futures/subOrders

Get respective sub orders for a specified algoId

Weight(IP): 1

Noted:

Parameters:

Name Type Mandatory Description
algoId LONG YES
page INT NO Default is 1
pageSize INT NO MIN 1, MAX 100; Default 100
recvWindow LONG NO
timestamp LONG YES

Spot Algo Endpoints

Binance Spot Execution Algorithm API solution aims to provide users ability to programmatically leverage Binance in-house algorithmic trading capability to automate order execution strategy, improve execution transparency and give users smart access to the available market liquidity. During the introductory period, there will be no additional fees for TWAP orders. Standard trading fees apply. Order size exceeds to maximum API supported size (100,000 USDT). Please contact liquidity@binance.com for larger sizes.

Time-Weighted Average Price (Twap) New Order (TRADE)

Response:

{
    "clientAlgoId": "65ce1630101a480b85915d7e11fd5078",
    "success": true,
    "code": 0,
    "msg": "OK"
}

POST /sapi/v1/algo/spot/newOrderTwap

Place a new spot TWAP order with Algo service.

Weight(UID): 3000

Parameters:

Name Type Mandatory Description
symbol STRING YES Trading symbol eg. BTCUSDT
side ENUM YES Trading side ( BUY or SELL )
quantity DECIMAL YES Quantity of base asset; The notional (quantity * last price(base asset)) must be more than the equivalent of 1,000 USDT and less than the equivalent of 100,000 USDT
duration LONG YES Duration for TWAP orders in seconds. [300, 86400]
clientAlgoId STRING NO A unique id among Algo orders (length should be 32 characters), If it is not sent, we will give default value
limitPrice DECIMAL NO Limit price of the order; If it is not sent, will place order by market price by default
stpMode 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
recvWindow LONG NO
timestamp LONG YES

Other Info:

Cancel Algo Order (TRADE)

Response:

{
    "algoId": 14511,
    "success": true,
    "code": 0,
    "msg": "OK"
}

DELETE /sapi/v1/algo/spot/order

Cancel an open TWAP order

Weight(IP): 1

Parameters:

Name Type Mandatory Description
algoId LONG YES eg. 14511
recvWindow LONG NO
timestamp LONG YES

Query Current Algo Open Orders (USER_DATA)

Response:

{
    "total": 1,
    "orders": [
        {
            "algoId": 14517,
            "symbol": "ETHUSDT",
            "side": "SELL",
            "totalQty": "5.000",
            "executedQty": "0.000",
            "executedAmt": "0.00000000",
            "avgPrice": "0.00",
            "clientAlgoId": "d7096549481642f8a0bb69e9e2e31f2e",
            "bookTime": 1649756817004,
            "endTime": 0,
            "algoStatus": "WORKING",
            "algoType": "TWAP",
            "urgency": "LOW"
        }
    ]
}

GET /sapi/v1/algo/spot/openOrders

Weight(IP): 1

Get all open SPOT TWAP orders

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Query Historical Algo Orders (USER_DATA)

Response:

{
    "total": 1,
    "orders": [
        {
            "algoId": 14518,
            "symbol": "BNBUSDT",
            "side": "BUY",
            "totalQty": "100.00",
            "executedQty": "0.00",
            "executedAmt": "0.00000000",
            "avgPrice": "0.000",
            "clientAlgoId": "acacab56b3c44bef9f6a8f8ebd2a8408",
            "bookTime": 1649757019503,
            "endTime": 1649757088101,
            "algoStatus": "CANCELLED",
            "algoType": "VP",
            "urgency": "LOW"
        }
    ]
}

GET /sapi/v1/algo/spot/historicalOrders

Weight(IP): 1

Get all historical SPOT TWAP orders

Parameters:

Name Type Mandatory Description
symbol STRING NO Trading symbol eg. BTCUSDT
side ENUM NO BUY or SELL
startTime LONG NO in milliseconds eg.1641522717552
endTime LONG NO in milliseconds eg.1641522526562
page INT NO Default is 1
pageSize INT NO MIN 1, MAX 100; Default 100
recvWindow LONG NO
timestamp LONG YES

Query Sub Orders (USER_DATA)

Response:

{
    "total": 1,
    "executedQty": "1.000",
    "executedAmt": "3229.44000000",
    "subOrders": [
        {
            "algoId": 13723,
            "orderId": 8389765519993908929,
            "orderStatus": "FILLED",
            "executedQty": "1.000",
            "executedAmt": "3229.44000000",
            "feeAmt": "-1.61471999",
            "feeAsset": "USDT",
            "bookTime": 1649319001964,
            "avgPrice": "3229.44",
            "side": "SELL",
            "symbol": "ETHUSDT",
            "subId": 1,
            "timeInForce": "IMMEDIATE_OR_CANCEL",
            "origQty": "1.000"
        }
    ]
}

GET /sapi/v1/algo/spot/subOrders

Get respective sub orders for a specified algoId

Weight(IP): 1

Parameters:

Name Type Mandatory Description
algoId LONG YES
page INT NO Default is 1
pageSize INT NO MIN 1, MAX 100; Default 100
recvWindow LONG NO
timestamp LONG YES

Portfolio Margin Pro Endpoints

The Binance Portfolio Margin Pro Program is a cross-asset margin program supporting consolidated margin balance across trading products with over 200+ effective crypto collaterals. It is designed for professional traders, market makers, and institutional users looking to actively trade & hedge cross-asset and optimize risk-management in a consolidated setup.

FAQ: Portfolio Margin Pro Program

Only Portfolio Margin Pro Account is accessible to these endpoints. To enroll, kindly refer to: How to Enroll into the Binance Portfolio Margin Program

Get Portfolio Margin Pro Account Info (USER_DATA)

Response:

{
        "uniMMR": "5167.92171923",        // Portfolio Margin Pro account maintenance margin rate
        "accountEquity": "122607.35137903",  // Account equity, unit:USD
        "actualEquity": "142607.35137903",   // Actual equity, unit:USD
        "accountMaintMargin": "23.72469206", // Portfolio Margin Pro account maintenance margin, unit:USD
        "accountStatus": "NORMAL",   // Portfolio Margin Pro account status:"NORMAL", "MARGIN_CALL", "SUPPLY_MARGIN", "REDUCE_ONLY", "ACTIVE_LIQUIDATION", "FORCE_LIQUIDATION", "BANKRUPTED"
        "accountType": "PM_1"     //PM_1 for PM Pro, PM_2 for PM ,PM_3 for PM Pro(SPAN) 
}

GET /sapi/v1/portfolio/account

Weight(IP): 5

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Portfolio Margin Pro Collateral Rate (MARKET_DATA)

Response:

[
   {
       "asset": "USDC",
       "collateralRate": "1.0000"
   },
   {
       "asset": "BUSD",
       "collateralRate": "1.0000"
   },
]

GET /sapi/v1/portfolio/collateralRate

Portfolio Margin Pro Collateral Rate

Weight(IP): 50

Parameters: None

Query Portfolio Margin Pro Bankruptcy Loan Amount (USER_DATA)

Response:

{
        "asset": "BUSD",   
        "amount":  "579.45", // portfolio margin bankruptcy loan amount in BUSD
}

GET /sapi/v1/portfolio/pmLoan

Query Portfolio Margin Pro Bankruptcy Loan Amount

Weight(UID): 500

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Portfolio Margin Pro Bankruptcy Loan Repay

Response:

{
    "tranId": 58203331886213504
}

POST /sapi/v1/portfolio/repay

Repay Portfolio Margin Pro Bankruptcy Loan

Weight(UID): 3000

Parameters:

Name Type Mandatory Description
from STRING NO SPOT or MARGIN,default SPOT
recvWindow LONG NO
timestamp LONG YES

Query Portfolio Margin Pro Negative Balance Interest History(USER_DATA)

Response:

[
    {
        "asset": "USDT",    
        "interest": "24.4440",               //interest amount
        "interestAccruedTime": 1670227200000,
        "interestRate": "0.0001164",         //daily interest rate
        "principal": "210000"
    } 
]

GET /sapi/v1/portfolio/interest-history

Query interest history of negative balance for portfolio margin.

Weight(IP): 50

Parameters:

Name Type Mandatory Description
asset STRING NO
startTime LONG NO
endTime LONG NO
size LONG NO Default:10 Max:100
recvWindow LONG NO
timestamp LONG YES

Query Portfolio Margin Asset Index Price (MARKET_DATA)

Response:

[
   {
       "asset": "BTC",
       "assetIndexPrice": "28251.9136906",  // in USD
       "time": 1683518338121
   }
]

GET /sapi/v1/portfolio/asset-index-price

Query Portfolio Margin Asset Index Price

Weight(IP):

1 if send asset or 50 if not send asset

Parameters:

Name Type Mandatory Description
asset STRING NO

Fund Auto-collection (USER_DATA)

Response:

{
    "msg": "success"
}

POST /sapi/v1/portfolio/auto-collection

Transfers all assets from Futures Account to Margin account

Weight(IP):

1500

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Fund Collection by Asset(USER_DATA)

Response:

{
    "msg": "success"
}

POST /sapi/v1/portfolio/asset-collection

Transfers specific asset from Futures Account to Margin account

Weight(IP):

60

Parameters:

Name Type Mandatory Description
asset STRING YES
recvWindow LONG NO
timestamp LONG YES

BNB transfer(USER_DATA)

Response:

{
     "tranId": 100000001
} 

POST /sapi/v1/portfolio/bnb-transfer

BNB transfer can be between Margin Account and USDM Account

Weight(IP):

1500

Parameters:

Name Type Mandatory Description
amount DECIMAL YES
transferSide STRING YES "TO_UM","FROM_UM"
recvWindow LONG NO
timestamp LONG YES

Change Auto-repay-futures Status (TRADE)

Response:

{
    "msg": "success"
}

POST /sapi/v1/portfolio/repay-futures-switch

Change Auto-repay-futures Status

Weight(IP):

1500

Parameters:

Name Type Mandatory Description
autoRepay STRING YES Default: true; false for turn off the auto-repay futures negative balance function
recvWindow LONG NO
timestamp LONG YES

Get Auto-repay-futures Status (USER_DATA)

Response:

{
    "autoRepay": true  //  "true" for turn on the auto-repay futures; "false" for turn off the auto-repay futures 
}

GET /sapi/v1/portfolio/repay-futures-switch

Query Auto-repay-futures Status

Weight(IP):

30

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Repay futures Negative Balance (USER_DATA)

Response:

{
    "msg": "success"
}

POST /sapi/v1/portfolio/repay-futures-negative-balance

Repay futures Negative Balance

Weight(IP):

1500

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Get Portfolio Margin Asset Leverage (USER_DATA)

Response:

[
   {
       "asset": "USDC",
       "leverage": 10
   },
   {
       "asset": "USDT",
       "leverage": 10
   }
]

GET /sapi/v1/portfolio/margin-asset-leverage

Weight(IP):

50

Fiat Endpoints

Get Fiat Deposit/Withdraw History (USER_DATA)

Response:

{
   "code": "000000",
   "message": "success",
   "data": [
   {
      "orderNo":"7d76d611-0568-4f43-afb6-24cac7767365",
      "fiatCurrency": "BRL",
      "indicatedAmount": "10.00",  
      "amount": "10.00", 
      "totalFee": "0.00",   // Trade fee
      "method": "BankAccount",  // Trade method
      "status": "Expired",  // Processing, Failed, Successful, Finished, Refunding, Refunded, Refund Failed, Order Partial credit Stopped
      "createTime": 1626144956000,
      "updateTime": 1626400907000   
   }
   ],
   "total": 1,
   "success": true
}

GET /sapi/v1/fiat/orders

Weight(UID): 90000

Parameters:

Name Type Mandatory Description
transactionType STRING YES 0-deposit,1-withdraw
beginTime LONG NO
endTime LONG NO
page INT NO default 1
rows INT NO default 100, max 500
recvWindow LONG NO
timestamp LONG YES

Get Fiat Payments History (USER_DATA)

Response:

{
   "code": "000000",
   "message": "success",
   "data": [
   {
      "orderNo": "353fca443f06466db0c4dc89f94f027a",
      "sourceAmount": "20.0",  // Fiat trade amount
      "fiatCurrency": "EUR",   // Fiat token
      "obtainAmount": "4.462", // Crypto trade amount
      "cryptoCurrency": "LUNA",  // Crypto token
      "totalFee": "0.2",     // Trade fee
      "price": "4.437472", 
      "status": "Failed",  // Processing, Completed, Failed, Refunded
      "paymentMethod": "Credit Card",
      "createTime": 1624529919000,
      "updateTime": 1624529919000  
   }
   ],
   "total": 1,
   "success": true
}

GET /sapi/v1/fiat/payments

Weight(IP): 1

Parameters:

Name Type Mandatory Description
transactionType STRING YES 0-buy,1-sell
beginTime LONG NO
endTime LONG NO
page INT NO default 1
rows INT NO default 100, max 500
recvWindow LONG NO
timestamp LONG YES

C2C Endpoints

Get C2C Trade History (USER_DATA)

Response:

{
   "code": "000000",
   "message": "success",
   "data": [
   {
      "orderNumber":"20219644646554779648",
      "advNo": "11218246497340923904",
      "tradeType": "SELL",  
      "asset": "BUSD", 
      "fiat": "CNY",  
      "fiatSymbol": "¥",
      "amount": "5000.00000000",  // Quantity (in Crypto)
      "totalPrice": "33400.00000000",
      "unitPrice": "6.68", // Unit Price (in Fiat)
      "orderStatus": "COMPLETED",  // PENDING, TRADING, BUYER_PAYED, DISTRIBUTING, COMPLETED, IN_APPEAL, CANCELLED, CANCELLED_BY_SYSTEM
      "createTime": 1619361369000,
      "commission": "0",   // Transaction Fee (in Crypto)
      "counterPartNickName": "ab***",
      "advertisementRole": "TAKER"        
     }
   ],
   "total": 1,
   "success": true
}

GET /sapi/v1/c2c/orderMatch/listUserOrderHistory

Weight(IP): 1

Parameters:

Name Type Mandatory Description
tradeType STRING YES BUY, SELL
startTimestamp LONG NO
endTimestamp LONG NO
page INT NO default 1
rows INT NO default 100, max 100
recvWindow LONG NO
timestamp LONG YES

VIP Loans Endpoints

Get VIP Loan Ongoing Orders (USER_DATA)

Response:

{
  "rows": [
    {
      "orderId": 100000001,
      "loanCoin": "BUSD",
      "totalDebt": "10000",
      "loanRate": "0.0123",  // "flexible rate" for flexible rate loan
      "residualInterest": "10.27687923",
      "collateralAccountId": "12345678,23456789",
      "collateralCoin": "BNB,BTC,ETH",
      "totalCollateralValueAfterHaircut": "25000.27565492", 
      "lockedCollateralValue": "25000.27565492", 
      "currentLTV": "0.57",
      "expirationTime": 1575018510000,
      "loanDate": "1676851200000",
      "loanTerm": "30days",                 //  "open term" for open term loan
      "expirationTime": 1575018510000 or 0,  // 0 means open term
      "initialLtv": "72%",
      "marginCallLtv": "77%",
      "liquidationLtv": "91%"
    }
  ],
  "total": 1
}

GET /sapi/v1/loan/vip/ongoing/orders

VIP loan is available for VIP users only.

Weight(IP): 400

Parameters:

Name Type Mandatory Description
orderId LONG NO
collateralAccountId LONG NO
loanCoin STRING NO
collateralCoin STRING NO
current LONG NO Currently querying page. Start from 1, Default:1, Max: 1000.
limit LONG NO Default: 10, Max: 100
recvWindow LONG NO
timestamp LONG YES

VIP Loan Repay (TRADE)

Response:

{
  "loanCoin": "BUSD",
  "repayAmount": "200.5",
  "remainingPrincipal": "100.5",
  "remainingInterest": "0",
  "collateralCoin": "BNB,BTC,ETH",
  "currentLTV": "0.25",
  "repayStatus": "Repaid" // Repaid, Repaying, Failed
}

POST /sapi/v1/loan/vip/repay

VIP loan is available for VIP users only.

Weight(UID): 6000

Parameters:

Name Type Mandatory Description
orderId LONG YES
amount DECIMAL YES
recvWindow LONG NO
timestamp LONG YES

Get VIP Loan Repayment History (USER_DATA)

Response:

{
  "rows": [
    {
      "loanCoin": "BUSD",
      "repayAmount": "10000",
      "collateralCoin": "BNB,BTC,ETH",
      "repayStatus": "Repaid", // Repaid, Repaying, Failed
      "loanDate": "1676851200000",
      "repayTime": "1575018510000",
      "orderId": "756783308056935434"
    }
  ],
  "total": 1
}

GET /sapi/v1/loan/vip/repay/history

VIP loan is available for VIP users only.

Weight(IP): 400

Parameters:

Name Type Mandatory Description
orderId LONG NO
loanCoin STRING NO
startTime LONG NO
endTime LONG NO
current LONG NO Currently querying page. Start from 1, Default:1, Max: 1000
limit LONG NO Default: 10, Max: 100
recvWindow LONG NO
timestamp LONG YES

VIP Loan Renew (TRADE)

Response:

{
  "loanAccountId": "12345678", //loan receiving account
  "loanCoin": "BTC", 
  "loanAmount": "100.55", 
  "collateralAccountId": "12345677,12345678,12345679",
  "collateralCoin": "BUSD,USDT,ETH",   
  "loanTerm": "30",
}

POST /sapi/v1/loan/vip/renew

VIP loan is available for VIP users only.

Weight(UID): 6000

Parameters:

Name Type Mandatory Description
orderId LONG YES
loanTerm INT NO 30/60 days
recvWindow LONG NO
timestamp LONG YES

Check Locked Value of VIP Collateral Account (USER_DATA)

Response:

{
  "rows": [
    {
      "collateralAccountId": "12345678",
      "collateralCoin": "BNB,BTC,ETH",
    }
  ],
  [
    {
      "collateralAccountId": "23456789",
      "collateralCoin": "BNB,BTC,ETH",
    }
  ],
  "total": 2
}

GET /sapi/v1/loan/vip/collateral/account

VIP loan is available for VIP users only.

Weight(IP): 6000

Parameters:

Name Type Mandatory Description
orderId LONG NO
collateralAccountId LONG NO
recvWindow LONG NO
timestamp LONG YES

VIP Loan Borrow (TRADE)

Response:

{
   "loanAccountId": "12345678", //loan receiving account
   "requestId": "12345678",
   "loanCoin": "BTC",
   "isFlexibleRate": "No",
   "loanAmount": "100.55",
   "collateralAccountId": "12345678,12345678,12345678",
   "collateralCoin": "BUSD,USDT,ETH",  
   "loanTerm": "30"
}

or

{
   "loanAccountId": "12345678",   //loan receiving account
   "requestId": "12345678",
   "loanCoin": "BTC",
   "isFlexibleRate": "Yes",
   "loanAmount": "100.55",
   "collateralAccountId": "12345678,12345678,12345678",
   "collateralCoin": "BUSD,USDT,ETH"
}

POST /sapi/v1/loan/vip/borrow

VIP loan is available for VIP users only.

Weight(UID): 6000

Request Limit: 1 time/2 seconds per UID

Parameters:

Name Type Mandatory Description
loanAccountId LONG YES
loanCoin STRING YES
loanAmount DECIMAL YES
collateralAccountId STRING YES Multiple split by ,
collateralCoin STRING YES Multiple split by ,
isFlexibleRate BOOLEAN YES Default: TRUE. TRUE : flexible rate; FALSE: fixed rate
loanTerm INT NO Mandatory for fixed rate. Optional for fixed interest rate. Eg: 30/60 days
recvWindow LONG NO
timestamp LONG YES

Get Loanable Assets Data (USER_DATA)

Response:

{
  "rows": [ 
    { 
    "loanCoin": "BUSD", 
    "_flexibleHourlyInterestRate": "0.000103",
    "_flexibleYearlyInterestRate": "0.548595",
    "_30dDailyInterestRate": "0.000136", 
    "_30dYearlyInterestRate": "0.03450", 
    "_60dDailyInterestRate": "0.000145", 
    "_60dYearlyInterestRate": "0.04103", 
    "minLimit": "100" 
    "maxLimit": "1000000" 
    "vipLevel": 1
    } 
  ], 
  "total": 1 
}

GET /sapi/v1/loan/vip/loanable/data

Get interest rate and borrow limit of loanable assets. The borrow limit is shown in USD value.

Weight(IP): 400

Parameters:

Name Type Mandatory Description
loanCoin STRING NO
vipLevel INT NO default:user's vip level
recvWindow LONG NO
timestamp LONG YES

Get Collateral Asset Data (USER_DATA)

Response:

{
  "rows": [
    {
    "collateralCoin": "BUSD",
    "_1stCollateralRatio": "100%",
    "_1stCollateralRange": "1-10000000",  
    "_2ndCollateralRatio": "80%",
    "_2ndCollateralRange": "10000000-100000000",  
    "_3rdCollateralRatio": "60%",
    "_3rdCollateralRange": "100000000-1000000000",  
    "_4thCollateralRatio": "0%",
    "_4thCollateralRange": ">10000000000",  
    }
    ],
  "total": 1
}

GET /sapi/v1/loan/vip/collateral/data

Get Collateral Asset Data

Weight(IP): 400

Parameters:

Name Type Mandatory Description
collateralCoin STRING NO
recvWindow LONG NO
timestamp LONG YES

Query Application Status (USER_DATA)

Response:

{
  "rows": [
     {
     "loanAccountId": "12345678", //loan receiving account
     "orderId": "12345678",
     "requestId": "12345678", 
     "loanCoin": "BTC", 
     "loanAmount": "100.55", 
     "collateralAccountId": "12345678,12345678,12345678",
     "collateralCoin": "BUSD,USDT,ETH",   
     "loanTerm": "30",
     "status": "Repaid", // Accruing_Interest, Overdue, Liquidating, Repaying, Repaid, Liquidated, Pending, Failed
     "loanDate":"1676851200000"
     }
  ],
  "total": 1
}

GET /sapi/v1/loan/vip/request/data

Weight(UID): 400

Request Limit: 1 time/second per UID

Parameters:

Name Type Mandatory Description
current LONG NO Currently querying page. Start from 1, Default:1, Max: 1000
limit LONG NO Default: 10, Max: 100
recvWindow LONG NO
timestamp LONG YES

Get Borrow Interest Rate (USER_DATA)

Response:

[
    {
      "asset": "BUSD",
     "flexibleDailyInterestRate": "0.001503",
     "flexibleYearlyInterestRate": "0.548595",
     "time": 1577233578000
    },

    {
     "asset": "BTC",
     "flexibleDailyInterestRate": "0.001503",
     "flexibleYearlyInterestRate": "0.548595",
     "time": 1577233562000
    }
]

GET /sapi/v1/loan/vip/request/interestRate

Weight(UID): 400

Parameters:

Name Type Mandatory Description
loanCoin STRING YES Max 10 assets, Multiple split by ","
recvWindow LONG NO
timestamp LONG YES

Crypto Loans Endpoints

Get Crypto Loans Income History (USER_DATA)

Response:

[
   {
        "asset": "BUSD",
        "type": "borrowIn",
        "amount": "100",
        "timestamp": 1633771139847,
        "tranId": "80423589583"
    },
    {
        "asset": "BUSD",
        "type": "borrowIn",
        "amount": "100",
        "timestamp": 1634638371496,
        "tranId": "81685123491"
    }
 ]

GET /sapi/v1/loan/income

Weight(UID): 6000

Parameters:

Name Type Mandatory Description
asset STRING NO
type STRING NO All types will be returned by default. Enum:borrowIn ,collateralSpent, repayAmount, collateralReturn(Collateral return after repayment), addCollateral, removeCollateral, collateralReturnAfterLiquidation
startTime LONG NO
endTime LONG NO
limit INT NO default 20, max 100
recvWindow LONG NO
timestamp LONG YES

Borrow - Crypto Loan Borrow (TRADE)

Response:

{
  "loanCoin": "BUSD",
  "loanAmount": "100.5",
  "collateralCoin": "BNB",
  "collateralAmount": "50.5",
  "hourlyInterestRate": "0.001234",
  "orderId": "100000001"
}

POST /sapi/v1/loan/borrow

Weight(UID): 36000

Request Limit: 1 time/second per UID

Parameters:

Name Type Mandatory Description
loanCoin STRING YES
loanAmount DECIMAL NO Mandatory when collateralAmount is empty
collateralCoin STRING YES
collateralAmount DECIMAL NO Mandatory when loanAmount is empty
loanTerm INT YES 7/30 days
recvWindow LONG NO
timestamp LONG YES

Borrow - Get Loan Borrow History (USER_DATA)

Response:

{
  "rows": [
    {
    "orderId": 100000001,
    "loanCoin": "BUSD",
    "initialLoanAmount": "10000",
    "hourlyInterestRate": "0.000057"
    "loanTerm": "7"
    "collateralCoin": "BNB",
    "initialCollateralAmount": "49.27565492"
    "borrowTime": 1575018510000
    "status": "Repaid" // Accruing_Interest, Overdue, Liquidating, Repaying, Repaid, Liquidated, Pending, Failed
    }
  ],
  "total": 1
}

GET /sapi/v1/loan/borrow/history

Weight(IP): 400

Parameters:

Name Type Mandatory Description
orderId LONG NO orderId in POST /sapi/v1/loan/borrow
loanCoin STRING NO
collateralCoin STRING NO
startTime LONG NO
endTime LONG NO
current LONG NO Current querying page. Start from 1; default: 1; max: 1000.
limit LONG NO Default: 10; max: 100.
recvWindow LONG NO
timestamp LONG YES

Borrow - Get Loan Ongoing Orders (USER_DATA)

Response:

{
  "rows": [
    {
    "orderId": 100000001,
    "loanCoin": "BUSD",
    "totalDebt": "10000",
    "residualInterest":"10.27687923"
    "collateralCoin": "BNB",
    "collateralAmount": "49.27565492"
    "currentLTV": "0.57"
    "expirationTime": 1575018510000
    }
  ],
  "total": 1
}

GET /sapi/v1/loan/ongoing/orders

Weight(IP): 300

Parameters:

Name Type Mandatory Description
orderId LONG NO orderId in POST /sapi/v1/loan/borrow
loanCoin STRING NO
collateralCoin STRING NO
current LONG NO Current querying page. Start from 1; default: 1; max: 1000
limit LONG NO Default: 10; max: 100
recvWindow LONG NO
timestamp LONG YES

Repay - Crypto Loan Repay (TRADE)

Response:

{
  "loanCoin": "BUSD"
  "remainingPrincipal": "100.5"
  "remainingInterest": "0"
  "collateralCoin": "BNB"
  "remainingCollateral": "5.253"
  "currentLTV": "0.25"
  "repayStatus": "Repaid" // Repaid, Repaying
}

or

{
  "loanCoin": "BUSD"
  "collateralCoin": "BNB"
  "repayStatus": "Repaying" // Repaid, Repaying
}

POST /sapi/v1/loan/repay

Weight(UID): 6000

Parameters:

Name Type Mandatory Description
orderId LONG YES
amount DECIMAL YES
type INT NO Default: 1. 1 for "repay with borrowed coin"; 2 for "repay with collateral".
collateralReturn BOOLEAN NO Default: TRUE. TRUE: Return extra collateral to spot account; FALSE: Keep extra collateral in the order.
recvWindow LONG NO
timestamp LONG YES

Repay - Get Loan Repayment History (USER_DATA)

Response:

{
  "rows": [
    {
    "loanCoin": "BUSD",
    "repayAmount": "10000",
    "collateralCoin": "BNB",
    "collateralUsed": "0"
    "collateralReturn": "49.27565492"
    "repayType": "1" // 1 for "repay with borrowed coin", 2 for "repay with collateral"
    "repayStatus": "Repaid" // Repaid, Repaying, Failed
    "repayTime": 1575018510000
    "orderId": 756783308056935434
    }
  ],
  "total": 1
}

GET /sapi/v1/loan/repay/history

Weight(IP): 400

Parameters:

Name Type Mandatory Description
orderId LONG NO
loanCoin STRING NO
collateralCoin STRING NO
startTime LONG NO
endTime LONG NO
current LONG NO Current querying page. Start from 1; default: 1; max: 1000
limit LONG NO Default: 10; max: 100
recvWindow LONG NO
timestamp LONG YES

Adjust LTV - Crypto Loan Adjust LTV (TRADE)

Response:

{
  "loanCoin": "BUSD",
  "collateralCoin": "BNB",
  "direction": "ADDITIONAL",
  "amount": "5.235",
  "currentLTV": "0.52"
}

POST /sapi/v1/loan/adjust/ltv

Weight(UID): 6000

Parameters:

Name Type Mandatory Description
orderId LONG YES
amount DECIMAL YES
direction ENUM YES "ADDITIONAL", "REDUCED"
recvWindow LONG NO
timestamp LONG YES

Adjust LTV - Get Loan LTV Adjustment History (USER_DATA)

Response:

{
  "rows": [
    {
    "loanCoin": "BUSD",
    "collateralCoin": "BNB",
    "direction": "ADDITIONAL",
    "amount": "5.235",
    "preLTV": "0.78",
    "afterLTV": "0.56",
    "adjustTime": 1575018510000,
    "orderId": 756783308056935434
    }
  ],
  "total": 1
}

GET /sapi/v1/loan/ltv/adjustment/history

Weight(IP): 400

Parameters:

Name Type Mandatory Description
orderId LONG NO
loanCoin STRING NO
collateralCoin STRING NO
startTime LONG NO
endTime LONG NO
current LONG NO Current querying page. Start from 1; default: 1; max: 1000
limit LONG NO Default: 10; max: 100
recvWindow LONG NO
timestamp LONG YES

Get Loanable Assets Data (USER_DATA)

Response:

{
  "rows": [
    {
      "loanCoin": "BUSD",
      "_7dHourlyInterestRate": "0.00000491",
      "_7dDailyInterestRate": "0.000118",
      "_14dHourlyInterestRate": "0.00000491",
      "_14dDailyInterestRate": "0.000118",
      "_30dHourlyInterestRate": "0.00000567",
      "_30dDailyInterestRate": "0.000136",
      "_90dHourlyInterestRate": "0.00000596",
      "_90dDailyInterestRate": "0.000143",
      "_180dHourlyInterestRate": "0.00000631",
      "_180dDailyInterestRate": "0.000151",
      "minLimit": "100"
      "maxLimit": "1000000"
      "vipLevel": 1
    }
  ],
  "total": 1
}

GET /sapi/v1/loan/loanable/data

Get interest rate and borrow limit of loanable assets. The borrow limit is shown in USD value.

Weight(IP): 400

Request Limit: 1 time/2 seconds per UID

Parameters:

Name Type Mandatory Description
loanCoin STRING NO
vipLevel INT NO Default: user's vip level. Send "-1" to check specified configuration
recvWindow LONG NO
timestamp LONG YES

Get Collateral Assets Data (USER_DATA)

Response:

{
  "rows": [
    {
      "collateralCoin": "BNB",
      "initialLTV": "0.65",
      "marginCallLTV": "0.75",
      "liquidationLTV": "0.83",
      "maxLimit": "1000000"
      "vipLevel": 1
    }
  ],
  "total": 1
}

GET /sapi/v1/loan/collateral/data

Get LTV information and collateral limit of collateral assets. The collateral limit is shown in USD value.

Weight(IP): 400

Request Limit: 1 time/2 seconds per UID

Parameters:

Name Type Mandatory Description
collateralCoin STRING NO
vipLevel INT NO Default: user's vip level. Send "-1" to check specified configuration
recvWindow LONG NO
timestamp LONG YES

Check Collateral Repay Rate (USER_DATA)

Response:

{
  "loanlCoin": "BUSD",
  "collateralCoin": "BNB",
  "repayAmount": "1000",
  "rate": "300.36781234" // rate of collateral coin/loan coin
}

GET /sapi/v1/loan/repay/collateral/rate

Get the the rate of collateral coin / loan coin when using collateral repay, the rate will be valid within 8 second.

Weight(IP): 6000

Parameters:

Name Type Mandatory Description
loanCoin STRING YES
collateralCoin STRING YES
repayAmount DECIMAL YES repay amount of loanCoin
recvWindow LONG NO
timestamp LONG YES

Crypto Loan Customize Margin Call (TRADE)

Response:

{
  "rows": [
    {
    "orderId": "100000001"
    "collateralCoin": "BNB"
    "preMarginCall": "0.8"
    "afterMarginCall": "0.7"
    "customizeTime": 1575018510000
    }
  ],
  "total": 1
}

POST /sapi/v1/loan/customize/margin_call

Customize margin call for ongoing orders only.

Weight(UID): 6000

Parameters:

Name Type Mandatory Description
orderId LONG NO Mandatory when collateralCoin is empty. Send either orderId or collateralCoin, if both parameters are sent, take orderId only.
collateralCoin STRING NO Mandatory when orderID is empty. Send either orderId or collateralCoin, if both parameters are sent, take orderId only.
marginCall DECIMAL YES
recvWindow LONG NO
timestamp LONG YES

Borrow - Flexible Loan Borrow (TRADE)

Response:

{
  "loanCoin": "BUSD",
  "loanAmount": "100.5",
  "collateralCoin": "BNB",
  "collateralAmount": "50.5",
  "status": "Succeeds" //Succeeds, Failed, Processing
}

POST /sapi/v1/loan/flexible/borrow (deprecated)

Please switch to:

POST /sapi/v2/loan/flexible/borrow

Weight(UID): 6000

Request Limit: 1 time/2 seconds per UID

Parameters:

Name Type Mandatory Description
loanCoin STRING YES
loanAmount DECIMAL NO Mandatory when collateralAmount is empty
collateralCoin STRING YES
collateralAmount DECIMAL NO Mandatory when loanAmount is empty
recvWindow LONG NO
timestamp LONG YES

Borrow - Get Flexible Loan Ongoing Orders (USER_DATA)

Response:

{
  "rows": [
    {
      "loanCoin": "BUSD",
      "totalDebt": "10000",
      "collateralCoin": "BNB",
      "collateralAmount": "49.27565492",
      "currentLTV": "0.57"
    }
  ],
  "total": 1
}

GET /sapi/v1/loan/flexible/ongoing/orders (To be deprecated)

Please switch to:

GET /sapi/v2/loan/flexible/ongoing/orders

Weight(IP): 300

Parameters:

Name Type Mandatory Description
loanCoin STRING NO
collateralCoin STRING NO
current LONG NO Current querying page. Start from 1; default: 1; max: 1000
limit LONG NO Default: 10; max: 100
recvWindow LONG NO
timestamp LONG YES

Borrow - Get Flexible Loan Borrow History (USER_DATA)

Response:

{
  "rows": [
    {
      "loanCoin": "BUSD",
      "initialLoanAmount": "10000",
      "collateralCoin": "BNB",
      "initialCollateralAmount": "49.27565492",
      "borrowTime": 1575018510000,
      "status": "Succeeds" //Succeeds, Failed, Processing
    }
  ],
  "total": 1
}

GET /sapi/v1/loan/flexible/borrow/history (To be deprecated)

Please switch to:

GET /sapi/v2/loan/flexible/borrow/history ``

Weight(IP): 400

Parameters:

Name Type Mandatory Description
loanCoin STRING NO
collateralCoin STRING NO
startTime LONG NO
endTime LONG NO
current LONG NO Current querying page. Start from 1; default: 1; max: 1000
limit LONG NO Default: 10; max: 100
recvWindow LONG NO
timestamp LONG YES

Repay - Flexible Loan Repay (TRADE)

Response:

{
  "loanCoin": "BUSD",
  "collateralCoin": "BNB",
  "remainingDebt": "100.5",
  "remainingCollateral": "5.253",
  "fullRepayment": false,
  "currentLTV": "0.25",
  "repayStatus": "Repaid" // Repaid, Repaying, Failed
}

POST /sapi/v1/loan/flexible/repay (To be deprecated)

Please switch to:

POST /sapi/v2/loan/flexible/repay

Weight(UID): 6000

Parameters:

Name Type Mandatory Description
loanCoin STRING YES
collateralCoin DECIMAL YES
repayAmount DECIMAL YES
collateralReturn BOOLEAN NO Default: TRUE. TRUE: Return extra collateral to earn account; FALSE: Keep extra collateral in the order, and lower LTV.
fullRepayment BOOLEAN NO Default: FALSE. TRUE: Full repayment; FALSE: Partial repayment, based on loanAmount
recvWindow LONG NO
timestamp LONG YES

Repay - Get Flexible Loan Repayment History (USER_DATA)

Response:

{
  "rows": [
    {
      "loanCoin": "BUSD",
      "repayAmount": "10000",
      "collateralCoin": "BNB",
      "collateralReturn": "49.27565492",
      "repayStatus": "Repaid", // Repaid, Repaying, Failed
      "repayTime": 1575018510000
    }
  ],
  "total": 1
}

GET /sapi/v1/loan/flexible/repay/history (To be (To be deprecated))

Please switch to:

GET /sapi/v2/loan/flexible/repay/history

Weight(IP): 400

Parameters:

Name Type Mandatory Description
loanCoin STRING NO
collateralCoin STRING NO
startTime LONG NO
endTime LONG NO
current LONG NO Current querying page. Start from 1; default: 1; max: 1000
limit LONG NO Default: 10; max: 100
recvWindow LONG NO
timestamp LONG YES

Adjust LTV - Flexible Loan Adjust LTV (TRADE)

Response:

{
  "loanCoin": "BUSD",
  "collateralCoin": "BNB",
  "direction": "ADDITIONAL",
  "adjustmentAmount": "5.235",
  "currentLTV": "0.52"
}

POST /sapi/v1/loan/flexible/adjust/ltv (To be deprecated)

Please switch to:

POST /sapi/v2/loan/flexible/adjust/ltv

Weight(UID): 6000

Request Limit: 1 time/2 seconds per UID

Parameters:

Name Type Mandatory Description
loanCoin STRING YES
collateralCoin STRING YES
adjustmentAmount DECIMAL YES
direction ENUM YES "ADDITIONAL", "REDUCED"
recvWindow LONG NO
timestamp LONG YES

Adjust LTV - Get Flexible Loan LTV Adjustment History (USER_DATA)

Response:

{
  "rows": [
    {
      "loanCoin": "BUSD",
      "collateralCoin": "BNB",
      "direction": "ADDITIONAL",
      "collateralAmount": "5.235",
      "preLTV": "0.78",
      "afterLTV": "0.56",
      "adjustTime": 1575018510000
    }
  ],
  "total": 1
}

GET /sapi/v1/loan/flexible/ltv/adjustment/history (To be deprecated)

Please switch to:

GET /sapi/v2/loan/flexible/ltv/adjustment/history

Weight(IP): 400

Parameters:

Name Type Mandatory Description
loanCoin STRING NO
collateralCoin STRING NO
startTime LONG NO
endTime LONG NO
current LONG NO Current querying page. Start from 1; default: 1; max: 1000
limit LONG NO Default: 10; max: 100
recvWindow LONG NO
timestamp LONG YES

Get Flexible Loan Assets Data (USER_DATA)

Response:

{
  "rows": [
    {
      "loanCoin": "BUSD",
      "flexibleInterestRate": "0.00000491",
      "flexibleMinLimit": "100",
      "flexibleMaxLimit": "1000000"
    }
  ],
  "total": 1
}

GET /sapi/v1/loan/flexible/loanable/data (deprecated)

Please switch to:

GET /sapi/v2/loan/flexible/loanable/data

Get interest rate and borrow limit of flexible loanable assets. The borrow limit is shown in USD value.

Weight(IP): 400

Request Limit: 1 time/2 seconds per UID

Parameters:

Name Type Mandatory Description
loanCoin STRING NO
recvWindow LONG NO
timestamp LONG YES

Get Flexible Loan Collateral Assets Data (USER_DATA)

Response:

{
  "rows": [
    {
      "collateralCoin": "BNB",
      "initialLTV": "0.65",
      "marginCallLTV": "0.75",
      "liquidationLTV": "0.83",
      "maxLimit": "1000000"
    }
  ],
  "total": 1
}

GET /sapi/v1/loan/flexible/collateral/data (deprecated)

Please switch to:

GET /sapi/v2/loan/flexible/collateral/data

Get LTV information and collateral limit of flexible loan's collateral assets. The collateral limit is shown in USD value.

Weight(IP): 400

Request Limit: 1 time/2 seconds per UID

Parameters:

Name Type Mandatory Description
collateralCoin STRING NO
recvWindow LONG NO
timestamp LONG YES

Copy Trading Endpoints

Get Futures Lead Trader Status (USER_DATA)

Response:

{
  "code": "000000",
  "message": "success",
  "data": {
     "isLeadTrader": true,
     "time": 1717382310843
   },
  "success": true
}

GET /sapi/v1/copyTrading/futures/userStatus

Weight(UID): 20

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Get Futures Lead Trading Symbol Whitelist(USER_DATA)

Response:

{
   "code": "000000",
   "message": "success",
   "data": [
     {
        "symbol": "BTCUSDT",
        "baseAsset": "BTC",
        "quoteAsset": "USDT"
     },
     {
        "symbol": "ETHUSDT",
        "baseAsset": "ETH",
        "quoteAsset": "USDT"
     }
   ],
}

GET /sapi/v1/copyTrading/futures/leadSymbol 

Weight(UID): 20

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Pay Endpoints

Get Pay Trade History (USER_DATA)

Response:

{
   "code": "000000",
   "message": "success",
   "data": [
   {
       "orderType": "C2C", // Enum:PAY(C2B Merchant Acquiring Payment), PAY_REFUND(C2B Merchant Acquiring Payment,refund), C2C(C2C Transfer Payment),CRYPTO_BOX(Crypto box), CRYPTO_BOX_RF(Crypto Box, refund), C2C_HOLDING(Transfer to new Binance user), C2C_HOLDING_RF(Transfer to new Binance user,refund), PAYOUT(B2C Disbursement Payment), REMITTANCE(Send cash)
       "transactionId": "M_P_71505104267788288", 
       "transactionTime": 1610090460133, //trade timestamp
       "amount": "23.72469206", //order amount(up to 8 decimal places), positive is income, negative is expenditure
       "currency": "BNB",
       "walletType": 1, //main wallet type, 1 for funding wallet, 2 for spot wallet, 3 for fiat wallet, 4 or 6 for card payment, 5 for earn wallet
       "walletTypes": [1,2], //array format,there are multiple values when using combination payment
       "fundsDetail": [ // details
               {
                "currency": "USDT", //asset
                "amount": "1.2",
                "walletAssetCost":[ //details of asset cost per wallet
                    {"1":"0.6"},
                    {"2":"0.6"}
                ]
               },
               {
                 "currency": "ETH",
                 "amount": "0.0001",
                 "walletAssetCost":[
                    {"1":"0.00005"},
                    {"2":"0.00005"}
                 ]
               }
          ],
       "payerInfo":{
               "name":"Jack", //nickname or merchant name
               "type":"USER", //account type,USER for personal,MERCHANT for merchant
               "binanceId":"12345678", //binance uid
               "accountId":"67736251" //binance pay id
           },
       "receiverInfo":{
               "name":"Alan", //nickname or merchant name
               "type":"MERCHANT", //account type,USER for personal,MERCHANT for merchant
               "email":"alan@binance.com", //email
               "binanceId":"34355667", //binance uid
               "accountId":"21326891", //binance pay id
               "countryCode":"1", //International area code
               "phoneNumber":"8057651210",
               "mobileCode":"US", //country code
               "extend":[ //extension field
                    "institutionName": "",
                    "cardNumber": "",  
                    "digitalWalletId": ""
               ]
           }
     }
   ],
  "success": true
}

GET /sapi/v1/pay/transactions

Weight(UID): 3000

Parameters:

Name Type Mandatory Description
startTime LONG NO
endTime LONG NO
limit INT NO default 100, max 100
recvWindow LONG NO
timestamp LONG YES

Convert Endpoints

Would you like to have access to Binance Convert API? Please complete the questionnaire to submit your request for access. The Convert API service is created for users who wish to automate their trading on Binance Convert. You will receive a confirmation email after we have approved your application.

Note: All users of this service are subject to the Binance Terms of Use and the use of the API services is not suitable for purposes including price arbitrage, high frequency trading or price exploitation. Binance may restrict or terminate a Binance API Connection at any time for any reason in its sole discretion and is not obliged to provide any prior notice to the User of any such restriction or termination or any reason therefore.

List All Convert Pairs

Response:

[
  {
    "fromAsset":"BTC",
    "toAsset":"USDT",
    "fromAssetMinAmount":"0.0004",
    "fromAssetMaxAmount":"50",
    "toAssetMinAmount":"20",
    "toAssetMaxAmount":"2500000",
    "fromIsBase": True
  }
]

GET /sapi/v1/convert/exchangeInfo

Query for all convertible token pairs and the tokens’ respective upper/lower limits

Weight(IP): 20

Parameters:

Name Type Mandatory Description
fromAsset STRING EITHER OR BOTH User spends coin
toAsset STRING EITHER OR BOTH User receives coin

Query order quantity precision per asset (USER_DATA)

Response:

[
  {
    "asset": "BTC", 
    "fraction": 8
  },
  {
    "asset": "SHIB", 
    "fraction": 2
  }
]

GET /sapi/v1/convert/assetInfo

Query for supported asset’s precision information

Weight(IP): 100

Parameters:

Name Type Mandatory Description
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Send quote request (USER_DATA)

Response:

{
   "quoteId":"12415572564",
   "ratio":"38163.7",
   "inverseRatio":"0.0000262",
   "validTimestamp":1623319461670,
   "toAmount":"3816.37",
   "fromAmount":"0.1"
}

POST /sapi/v1/convert/getQuote

Request a quote for the requested token pairs

Weight(UID): 200

Parameters:

Name Type Mandatory Description
fromAsset STRING YES
toAsset STRING YES
fromAmount DECIMAL EITHER When specified, it is the amount you will be debited after the conversion
toAmount DECIMAL EITHER When specified, it is the amount you will be credited after the conversion
walletType ENUM NO SPOT or FUNDING. Default is SPOT
validTime ENUM NO 10s, 30s, 1m, 2m, default 10s
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Accept Quote (TRADE)

Response:

{
  "orderId":"933256278426274426",
  "createTime":1623381330472,
  "orderStatus":"PROCESS" //PROCESS/ACCEPT_SUCCESS/SUCCESS/FAIL
}

POST /sapi/v1/convert/acceptQuote

Accept the offered quote by quote ID.

Weight(UID): 500

Parameters:

Name Type Mandatory Description
quoteId STRING YES
recvWindow LONG NO The value cannot be greater than 60000
timestamp LONG YES

Order status (USER_DATA)

Response:

{
  "orderId":933256278426274426,
  "orderStatus":"SUCCESS",
  "fromAsset":"BTC",
  "fromAmount":"0.00054414",
  "toAsset":"USDT",
  "toAmount":"20",
  "ratio":"36755",
  "inverseRatio":"0.00002721",
  "createTime":1623381330472
}

GET /sapi/v1/convert/orderStatus

Query order status by order ID.

Weight(UID): 100

Parameters:

Name Type Mandatory Description
orderId STRING NO Either orderId or quoteId is required
quoteId STRING NO Either orderId or quoteId is required

Place limit order (USER_DATA)

Response:

{
    "orderId": 1603680255057330400, 
    "status": "PROCESS"
}

POST /sapi/v1/convert/limit/placeOrder

Enable users to place a limit order

Weight(UID): 500

Parameters:

Name Type Mandatory Description
baseAsset STRING YES base asset (use the response fromIsBase from GET /sapi/v1/convert/exchangeInfo api to check which one is baseAsset )
quoteAsset STRING YES quote asset
limitPrice DECIMAL YES Symbol limit price (from baseAsset to quoteAsset)
baseAmount DECIMAL NO Base asset amount. (One of baseAmount or quoteAmount is required)
quoteAmount DECIMAL NO Quote asset amount. (One of baseAmount or quoteAmount is required)
side ENUM YES BUY or SELL
walletType ENUM NO SPOT or FUNDING or SPOT_FUNDING. It is to use which type of assets. Default is SPOT.
expiredType ENUM YES 1_D, 3_D, 7_D, 30_D (D means day)
recvWindow LONG NO
timestamp LONG YES

Cancel limit order (USER_DATA)

Response:

{
    "orderId": 1603680255057330400, 
    "status": "CANCELED"
}

POST /sapi/v1/convert/limit/cancelOrder

Enable users to cancel a limit order

Weight(UID): 200

Parameters:

Name Type Mandatory Description
orderId LONG YES The orderId from placeOrder api
recvWindow LONG NO
timestamp LONG YES

Query limit open orders (USER_DATA)

Response:

{
    "list": [
        {
            "quoteId": "18sdf87kh9df", 
            "orderId": 1150901289839, 
            "orderStatus": "SUCCESS", 
            "fromAsset": "BNB", 
            "fromAmount": "10", 
            "toAsset": "USDT", 
            "toAmount": "2317.89", 
            "ratio": "231.789", 
            "inverseRatio": "0.00431427", 
            "createTime": 1614089498000,
           "expiredTimestamp": 1614099498000
        }
    ]
}

GET /sapi/v1/convert/limit/queryOpenOrders

Enable users to query for all existing limit orders

Weight(UID): 3000

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Get Convert Trade History (USER_DATA)

Response:

{
   "list": [
        {
            "quoteId": "f3b91c525b2644c7bc1e1cd31b6e1aa6",
            "orderId": 940708407462087195,  
            "orderStatus": "SUCCESS",  // order status
            "fromAsset": "USDT",       // from asset
            "fromAmount": "20",        // from amount
            "toAsset": "BNB",          // to asset
            "toAmount": "0.06154036",  // to amount
            "ratio": "0.00307702",     // price ratio
            "inverseRatio": "324.99",  // inverse price 
            "createTime": 1624248872184
        }
   ],
    "startTime": 1623824139000,
    "endTime": 1626416139000,
    "limit": 100,
    "moreData": false
}

GET /sapi/v1/convert/tradeFlow

Weight(UID): 3000

Parameters:

Name Type Mandatory Description
startTime LONG YES
endTime LONG YES
limit INT NO Default 100, Max 1000
recvWindow LONG NO
timestamp LONG YES

Rebate Endpoints

Get Spot Rebate History Records (USER_DATA)

Response:

{
   "status": "OK",
   "type": "GENERAL",
   "code": "000000000",
   "data": {
        "page": 1,  // current page
        "totalRecords": 2,  // total records
        "totalPageNum": 1,  // total pages
        "data": [
            {
                "asset": "USDT",  // rebate asset
                "type": 1,        // rebate type:1 is commission rebate,2 is referral kickback
                "amount": "0.0001126", 
                "updateTime": 1637651320000
            },
            {
                "asset": "ETH",
                "type": 1,
                "amount": "0.00000056",
                "updateTime": 1637928379000
            }
        ]
    }

}

GET /sapi/v1/rebate/taxQuery

Weight(UID): 12000

Parameters:

Name Type Mandatory Description
startTime LONG NO
endTime LONG NO
page INT NO Default 1
recvWindow LONG NO
timestamp LONG YES

NFT Endpoints

Get NFT Transaction History (USER_DATA)

Response:

{
  "total": 2,  //total records
  "list": [
    {
      "orderNo": "1_470502070600699904", // 0: purchase order, 1: sell order, 2: royalty income, 3: primary market order, 4: mint fee
      "tokens": [
        {
          "network": "BSC",  // NFT Network
          "tokenId": "216000000496",  // NFT Token ID
          "contractAddress": "MYSTERY_BOX0000087"  // NFT Contract Address
        }
      ],
      "tradeTime": 1626941236000,     
      "tradeAmount": "19.60000000",  
      "tradeCurrency": "BNB"            
    },
    {
      "orderNo": "1_488306442479116288",
      "tokens": [
        {
          "network": "BSC",
          "tokenId": "132900000007",
          "contractAddress": "0xAf12111a592e408DAbC740849fcd5e68629D9fb6"
        }
      ],
      "tradeTime": 1631186130000,
      "tradeAmount": "192.00000000",
      "tradeCurrency": "BNB"
    }
  ]
}

GET /sapi/v1/nft/history/transactions

Weight(UID): 3000

Parameters:

Name Type Mandatory Description
orderType INT YES 0: purchase order, 1: sell order, 2: royalty income, 3: primary market order, 4: mint fee
startTime LONG NO
endTime LONG NO
limit INT NO Default 50, Max 50
page INT NO Default 1
recvWindow LONG NO
timestamp LONG YES

Get NFT Deposit History(USER_DATA)

Response:

{
  "total": 2,
  "list": [
    {
      "network": "ETH",  // NFT Network
      "txID": null,      // Transaction ID
      "contractAdrress": "0xe507c961ee127d4439977a61af39c34eafee0dc6",  // NFT Contract Address
      "tokenId": "10014",   // NFT Token ID
      "timestamp": 1629986047000  
    },
    {
      "network": "BSC",
      "txID": null,
      "contractAdrress": "0x058451b463bab04f52c0799d55c4094f507acfa9",
      "tokenId": "10016",
      "timestamp": 1630083581000
    }
  ]
}

GET /sapi/v1/nft/history/deposit

Weight(UID): 3000

Parameters:

Name Type Mandatory Description
startTime LONG NO
endTime LONG NO
limit INT NO Default 50, Max 50
page INT NO Default 1
recvWindow LONG NO
timestamp LONG YES

Get NFT Withdraw History (USER_DATA)

Response:

{
  "total": 178,
  "list": [
    {
      "network": "ETH",
      "txID": "0x2be5eed31d787fdb4880bc631c8e76bdfb6150e137f5cf1732e0416ea206f57f",
      "contractAdrress": "0xe507c961ee127d4439977a61af39c34eafee0dc6",  // NFT Contract Address
      "tokenId": "1000001247",    // NFT Token ID
      "timestamp": 1633674433000, 
      "fee": 0.1,         // Withdraw Fee
      "feeAsset": "ETH"   // Asset
    },
    {
      "network": "ETH",
      "txID": "0x3b3aea5c0a4faccd6f306641e6deb9713ab229ac233be3be227f580311e4362a",
      "contractAdrress": "0xe507c961ee127d4439977a61af39c34eafee0dc6",
      "tokenId": "40000030",
      "timestamp": 1633677022000,
      "fee": 0.1,
      "feeAsset": "ETH"
    }
  ]
}

GET /sapi/v1/nft/history/withdraw

Weight(UID): 3000

Parameters:

Name Type Mandatory Description
startTime LONG NO
endTime LONG NO
limit INT NO Default 50, Max 50
page INT NO Default 1
recvWindow LONG NO
timestamp LONG YES

Get NFT Asset (USER_DATA)

Response:

{
  "total": 347,
  "list": [
    {
      "network": "BSC",  // NFT Network
      "contractAddress": "REGULAR11234567891779", // NFT Contract Address
      "tokenId": "100900000017"  // NFT Token ID
    },
    {
      "network": "BSC",
      "contractAddress": "SSMDQ8W59",
      "tokenId": "200500000011"
    },
    {
      "network": "BSC",
      "contractAddress": "SSMDQ8W59",
      "tokenId": "200500000019"
    }
  ]
}

GET /sapi/v1/nft/user/getAsset

Weight(UID): 3000

Parameters:

Name Type Mandatory Description
limit INT NO Default 50, Max 50
page INT NO Default 1
recvWindow LONG NO
timestamp LONG YES

Binance Gift Card Endpoints

Binance Gift Card allows simple crypto transfer and exchange through secured and prepaid codes. Binance Gift Card API solution is to facilitate instant creation, redemption and value-checking for Binance Gift Card. Binance Gift Card product feature consists of two parts: “Gift Card Number” and “Binance Gift Card Redemption Code”. The Gift Card Number can be circulated in public, and it is used to verify the validity of the Binance Gift Card; Binance Gift Card Redemption Code should be kept confidential, because as long as someone knows the redemption code, that person can redeem it anytime.

By using any of the Binance Gift Card endpoints you are confirming your agreement to the Terms of Use for Binance Gift Cards and Binance Pay Terms of Use.

Creating gift cards is limited only to entity accounts which have passed KYB verification.

Effective from 21 Aug 2023, a 1% transaction fee will apply when you buy or create gift cards in Binance directly.

Create a single-token gift card (USER_DATA)

Response:

{
    "code": "000000",
    "message": "success",
    "data": {
        "referenceNo": "0033002144060553",
        "code": "6H9EKF5ECCWFBHGE",
        "expiredTime": 1727417154000
    },
    "success": true
}

POST /sapi/v1/giftcard/createCode

This API is for creating a Binance Gift Card.

To get started with, please make sure:

Weight(IP): 1

Parameters:

Name Type Mandatory Description
token STRING YES The token type contained in the Binance Gift Card
amount DOUBLE YES The amount of the token contained in the Binance Gift Card
recvWindow LONG NO
timestamp LONG YES

Create a dual-token gift card (fixed value, discount feature) (TRADE)

Response:

{
    "code": "000000",
    "message": "success",
    "data": {
        "referenceNo": "0033002144060553",
        "code": "6H9EKF5ECCWFBHGE",
        "expiredTime": 1727417154000
    },
    "success": true
}

POST /sapi/v1/giftcard/buyCode

Weight(IP): 1

Parameters:

Name Type Mandatory Description
baseToken STRING YES The token you want to pay, example: BUSD
faceToken STRING YES The token you want to buy, example: BNB. If faceToken = baseToken, it's the same as createCode endpoint.
baseTokenAmount DOUBLE YES The base token asset quantity, example : 1.002
discount DOUBLE NO Stablecoin-denominated card discount percentage, Example: 1 for 1% discount. Scale should be less than 6.
recvWindow LONG NO
timestamp LONG YES

Redeem a Binance Gift Card (USER_DATA)

Response:

{
  "code":"000000",
  "message":"success",
  "data":{
    "referenceNo":"0033002328060227",
    "identityNo":"10317392647411060736",
    "token":"BNB",
    "amount":"0.00000001"
  },
  "success":true
}

POST /sapi/v1/giftcard/redeemCode

This API is for redeeming a Binance Gift Card

Once redeemed, the coins will be deposited in your funding wallet.

Please note that if you enter the wrong redemption code 5 times within 24 hours, you will no longer be able to redeem any Binance Gift Cards that day

Weight(IP): 1

Parameters:

Name Type Mandatory Description
code STRING YES Redemption code of Binance Gift Card to be redeemed, supports both Plaintext & Encrypted code.
externalUid STRING NO Each external unique ID represents a unique user on the partner platform. The function helps you to identify the redemption behavior of different users, such as redemption frequency and amount. It also helps risk and limit control of a single account, such as daily limit on redemption volume, frequency, and incorrect number of entries. This will also prevent a single user account reach the partner's daily redemption limits. We strongly recommend you to use this feature and transfer us the User ID of your users if you have different users redeeming Binance Gift Cards on your platform. To protect user data privacy, you may choose to transfer the user id in any desired format (max. 400 characters).
recvWindow LONG NO
timestamp LONG YES

Notes:

A sample code snippet (JAVA) is stated below for reference, the same approach can be used for different languages like C#, PERL, PYTHON, SHELL etc.:

  private static PublicKey getPublicKey(String publicKey) throws Exception {
     KeyFactory keyFactory = KeyFactory.getInstance("RSA");
     byte[] decodedKey = Base64.decodeBase64(publicKey.getBytes());
     X509EncodedKeySpec keySpec = new X509EncodedKeySpec(decodedKey);
     return keyFactory.generatePublic(keySpec);
  }

  public static String encrypt(String content, String publicKeyString) throws Exception {
     if (StringUtils.isAnyEmpty(new CharSequence[]{content, publicKeyString})) {
        throw new IllegalArgumentException("invalid content or privateKey.");
     } else {
        Cipher cipher = Cipher.getInstance("RSA/ECB/OAEPWITHSHA-256ANDMGF1PADDING", "BC");
        cipher.init(Cipher.ENCRYPT_MODE, getPublicKey(publicKeyString));
        return new String(Base64.encodeBase64URLSafe(cipher.doFinal(content.getBytes("UTF-8"))));
     }
  }

  static {
     Security.addProvider(new BouncyCastleProvider());
  }

Verify Binance Gift Card by Gift Card Number (USER_DATA)

Response:

{
   "code": "000000",
   "message": "success",
   "data": {
    "valid":true,  
    "token":"BNB",  // coin
    "amount":"0.00000001"  // amount
  }, 
   "success": true
}

GET /sapi/v1/giftcard/verify

This API is for verifying whether the Binance Gift Card is valid or not by entering Gift Card Number.

Please note that if you enter the wrong Gift Card Number 5 times within an hour, you will no longer be able to verify any Gift Card Number for that hour.

Weight(IP): 1

Parameters:

Name Type Mandatory Description
referenceNo STRING YES Enter the Gift Card Number
recvWindow LONG NO
timestamp LONG YES

Fetch RSA Public Key (USER_DATA)

Response:

{
   "code": "000000",
   "message": "success",
    "data": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCXBBVKLAc1GQ5FsIFFqOHrPTox5noBONIKr+IAedTR9FkVxq6e65updEbfdhRNkMOeYIO2i0UylrjGC0X8YSoIszmrVHeV0l06Zh1oJuZos1+7N+WLuz9JvlPaawof3GUakTxYWWCa9+8KIbLKsoKMdfS96VT+8iOXO3quMGKUmQIDAQAB",
   "success": true
}

GET /sapi/v1/giftcard/cryptography/rsa-public-key

This API is for fetching the RSA Public Key. This RSA Public key will be used to encrypt the card code.

Please note that the RSA Public key fetched is valid only for the current day.

Weight(IP): 1

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Fetch Token Limit (USER_DATA)

Response:

{
  "code": "000000",
  "message": "success",
  "data": [
    {
      "coin": "BNB",
      "fromMin": "0.01",
      "fromMax": "1"
    }
  ],
  "success":true
}

GET /sapi/v1/giftcard/buyCode/token-limit

This API is to help you verify which tokens are available for you to create Stablecoin-Denominated gift cards as mentioned in section 2 and its’ limitation.

Weight(IP): 1

Parameters:

Name Type Mandatory Description
baseToken STRING YES The token you want to pay, example: BUSD
recvWindow LONG NO
timestamp LONG YES

Error Codes

The error JSON payload:

{
  "code":-1121,
  "msg":"Invalid symbol."
}

Errors consist of two parts: an error code and a message. Codes are universal, but messages can vary.

10xx - General Server or Network issues

-1000 UNKNOWN

-1001 DISCONNECTED

-1002 UNAUTHORIZED

-1003 TOO_MANY_REQUESTS

-1004 SERVER_BUSY

-1006 UNEXPECTED_RESP

-1007 TIMEOUT

-1008 SERVER_BUSY

-1014 UNKNOWN_ORDER_COMPOSITION

-1015 TOO_MANY_ORDERS

-1016 SERVICE_SHUTTING_DOWN

-1020 UNSUPPORTED_OPERATION

-1021 INVALID_TIMESTAMP

-1022 INVALID_SIGNATURE

-1099 Not found, authenticated, or authorized

11xx - 2xxx Request issues

-1100 ILLEGAL_CHARS

-1101 TOO_MANY_PARAMETERS

-1102 MANDATORY_PARAM_EMPTY_OR_MALFORMED

-1103 UNKNOWN_PARAM

-1104 UNREAD_PARAMETERS

-1105 PARAM_EMPTY

-1106 PARAM_NOT_REQUIRED

-1111 BAD_PRECISION

-1112 NO_DEPTH

-1114 TIF_NOT_REQUIRED

-1115 INVALID_TIF

-1116 INVALID_ORDER_TYPE

-1117 INVALID_SIDE

-1118 EMPTY_NEW_CL_ORD_ID

-1119 EMPTY_ORG_CL_ORD_ID

-1120 BAD_INTERVAL

-1121 BAD_SYMBOL

-1122 INVALID_SYMBOLSTATUS

-1125 INVALID_LISTEN_KEY

-1127 MORE_THAN_XX_HOURS

-1128 OPTIONAL_PARAMS_BAD_COMBO

-1130 INVALID_PARAMETER

-1131 BAD_RECV_WINDOW

-1134 BAD_STRATEGY_TYPE

-1139 INVALID_TICKER_TYPE

-1145 INVALID_CANCEL_RESTRICTIONS

-1151 DUPLICATE_SYMBOLS

-1152 INVALID_SBE_HEADER

-1153 UNSUPPORTED_SCHEMA_ID

-1155 SBE_DISABLED

-1158 OCO_ORDER_TYPE_REJECTED

-1160 OCO_ICEBERGQTY_TIMEINFORCE

-2010 NEW_ORDER_REJECTED

-2011 CANCEL_REJECTED

-2013 NO_SUCH_ORDER

-2014 BAD_API_KEY_FMT

-2015 REJECTED_MBX_KEY

-2016 NO_TRADING_WINDOW

-2026 ORDER_ARCHIVED

3xxx-5xxx SAPI-specific issues

-3000 INNER_FAILURE

-3001 NEED_ENABLE_2FA

-3002 ASSET_DEFICIENCY

-3003 NO_OPENED_MARGIN_ACCOUNT

-3004 TRADE_NOT_ALLOWED

-3005 TRANSFER_OUT_NOT_ALLOWED

-3006 EXCEED_MAX_BORROWABLE

-3007 HAS_PENDING_TRANSACTION

-3008 BORROW_NOT_ALLOWED

-3009 ASSET_NOT_MORTGAGEABLE

-3010 REPAY_NOT_ALLOWED

-3011 BAD_DATE_RANGE

-3012 ASSET_ADMIN_BAN_BORROW

-3013 LT_MIN_BORROWABLE

-3014 ACCOUNT_BAN_BORROW

-3015 REPAY_EXCEED_LIABILITY

-3016 LT_MIN_REPAY

-3017 ASSET_ADMIN_BAN_MORTGAGE

-3018 ACCOUNT_BAN_MORTGAGE

-3019 ACCOUNT_BAN_ROLLOUT

-3020 EXCEED_MAX_ROLLOUT

-3021 PAIR_ADMIN_BAN_TRADE

-3022 ACCOUNT_BAN_TRADE

-3023 WARNING_MARGIN_LEVEL

-3024 FEW_LIABILITY_LEFT

-3025 INVALID_EFFECTIVE_TIME

-3026 VALIDATION_FAILED

-3027 NOT_VALID_MARGIN_ASSET

-3028 NOT_VALID_MARGIN_PAIR

-3029 TRANSFER_FAILED

-3036 ACCOUNT_BAN_REPAY

-3037 PNL_CLEARING

-3038 LISTEN_KEY_NOT_FOUND

-3041 BALANCE_NOT_CLEARED

-3042 PRICE_INDEX_NOT_FOUND

-3043 TRANSFER_IN_NOT_ALLOWED

-3044 SYSTEM_BUSY

-3045 SYSTEM

-3999 NOT_WHITELIST_USER

-4001 CAPITAL_INVALID

-4002 CAPITAL_IG

-4003 CAPITAL_IEV

-4004 CAPITAL_UA

-4005 CAPITAL_TOO_MANY_REQUEST

-4006 CAPITAL_ONLY_SUPPORT_PRIMARY_ACCOUNT

-4007 CAPITAL_ADDRESS_VERIFICATION_NOT_PASS

-4008 CAPITAL_ADDRESS_TAG_VERIFICATION_NOT_PASS

-4010 CAPITAL_WHITELIST_EMAIL_CONFIRM

-4011 CAPITAL_WHITELIST_EMAIL_EXPIRED

-4012 CAPITAL_WHITELIST_CLOSE

-4013 CAPITAL_WITHDRAW_2FA_VERIFY

-4014 CAPITAL_WITHDRAW_LOGIN_DELAY

-4015 CAPITAL_WITHDRAW_RESTRICTED_MINUTE

-4016 CAPITAL_WITHDRAW_RESTRICTED_PASSWORD

-4017 CAPITAL_WITHDRAW_RESTRICTED_UNBIND_2FA

-4018 CAPITAL_WITHDRAW_ASSET_NOT_EXIST

-4019 CAPITAL_WITHDRAW_ASSET_PROHIBIT

-4021 CAPITAL_WITHDRAW_AMOUNT_MULTIPLE

-4022 CAPITAL_WITHDRAW_MIN_AMOUNT

-4023 CAPITAL_WITHDRAW_MAX_AMOUNT

-4024 CAPITAL_WITHDRAW_USER_NO_ASSET

-4025 CAPITAL_WITHDRAW_USER_ASSET_LESS_THAN_ZERO

-4026 CAPITAL_WITHDRAW_USER_ASSET_NOT_ENOUGH

-4027 CAPITAL_WITHDRAW_GET_TRAN_ID_FAILURE

-4028 CAPITAL_WITHDRAW_MORE_THAN_FEE

-4029 CAPITAL_WITHDRAW_NOT_EXIST

-4030 CAPITAL_WITHDRAW_CONFIRM_SUCCESS

-4031 CAPITAL_WITHDRAW_CANCEL_FAILURE

-4032 CAPITAL_WITHDRAW_CHECKSUM_VERIFY_FAILURE

-4033 CAPITAL_WITHDRAW_ILLEGAL_ADDRESS

-4034 CAPITAL_WITHDRAW_ADDRESS_CHEAT

-4035 CAPITAL_WITHDRAW_NOT_WHITE_ADDRESS

-4036 CAPITAL_WITHDRAW_NEW_ADDRESS

-4037 CAPITAL_WITHDRAW_RESEND_EMAIL_FAIL

-4038 CAPITAL_WITHDRAW_RESEND_EMAIL_TIME_OUT

-4039 CAPITAL_USER_EMPTY

-4040 CAPITAL_NO_CHARGE

-4041 CAPITAL_MINUTE_TOO_SMALL

-4042 CAPITAL_CHARGE_NOT_RESET

-4043 CAPITAL_ADDRESS_TOO_MUCH

-4044 CAPITAL_BLACKLIST_COUNTRY_GET_ADDRESS

-4045 CAPITAL_GET_ASSET_ERROR

-4046 CAPITAL_AGREEMENT_NOT_CONFIRMED

-4047 CAPITAL_DATE_INTERVAL_LIMIT

-4060 CAPITAL_WITHDRAW_USER_ASSET_LOCK_DEPOSIT

-5001 ASSET_DRIBBLET_CONVERT_SWITCH_OFF

-5002 ASSET_ASSET_NOT_ENOUGH

-5003 ASSET_USER_HAVE_NO_ASSET

-5004 USER_OUT_OF_TRANSFER_FLOAT

-5005 USER_ASSET_AMOUNT_IS_TOO_LOW

-5006 USER_CAN_NOT_REQUEST_IN_24_HOURS

-5007 AMOUNT_OVER_ZERO

-5008 ASSET_WITHDRAW_WITHDRAWING_NOT_ENOUGH

-5009 PRODUCT_NOT_EXIST

-5010 TRANSFER_FAIL

-5011 FUTURE_ACCT_NOT_EXIST

-5012 TRANSFER_PENDING

-5021 PARENT_SUB_HAVE_NO_RELATION

-5012 FUTURE_ACCT_OR_SUBRELATION_NOT_EXIST

6XXX - Savings Issues

-6001 DAILY_PRODUCT_NOT_EXIST

-6003 DAILY_PRODUCT_NOT_ACCESSIBLE

-6004 DAILY_PRODUCT_NOT_PURCHASABLE

-6005 DAILY_LOWER_THAN_MIN_PURCHASE_LIMIT

-6006 DAILY_REDEEM_AMOUNT_ERROR

-6007 DAILY_REDEEM_TIME_ERROR

-6008 DAILY_PRODUCT_NOT_REDEEMABLE

-6009 REQUEST_FREQUENCY_TOO_HIGH

-6011 EXCEEDED_USER_PURCHASE_LIMIT

-6012 BALANCE_NOT_ENOUGH

-6013 PURCHASING_FAILED

-6014 UPDATE_FAILED

-6015 EMPTY_REQUEST_BODY

-6016 PARAMS_ERR

-6017 NOT_IN_WHITELIST

-6018 ASSET_NOT_ENOUGH

-6019 PENDING

-6020 PROJECT_NOT_EXISTS

70xx - Futures

-7001 FUTURES_BAD_DATE_RANGE

-7002 FUTURES_BAD_TYPE

20xxx - Futures/Spot Algo

-20121

-20124

-20130

-20132

-20194

-20195

-20196

-20198

-20204

Filter failures

Error message Description
"Filter failure: PRICE_FILTER" price is too high, too low, and/or not following the tick size rule for the symbol.
"Filter failure: PERCENT_PRICE" price is X% too high or X% too low from the average weighted price over the last Y minutes.
"Filter failure: PERCENT_PRICE_BY_SIDE" price is X% too high or Y% too low from the lastPrice on that side (i.e. BUY/SELL)
"Filter failure: LOT_SIZE" quantity is too high, too low, and/or not following the step size rule for the symbol.
"Filter failure: MIN_NOTIONAL" price * quantity is too low to be a valid order for the symbol.
"Filter failure: ICEBERG_PARTS" ICEBERG order would break into too many parts; icebergQty is too small.
"Filter failure: MARKET_LOT_SIZE" MARKET order's quantity is too high, too low, and/or not following the step size rule for the symbol.
"Filter failure: MAX_POSITION" The account's position has reached the maximum defined limit.

This is composed of the sum of the balance of the base asset, and the sum of the quantity of all open BUYorders.
"Filter failure: MAX_NUM_ORDERS" Account has too many open orders on the symbol.
"Filter failure: MAX_NUM_ALGO_ORDERS" Account has too many open stop loss and/or take profit orders on the symbol.
"Filter failure: MAX_NUM_ICEBERG_ORDERS" Account has too many open iceberg orders on the symbol.
"Filter failure: TRAILING_DELTA" trailingDelta is not within the defined range of the filter for that order type.
"Filter failure: EXCHANGE_MAX_NUM_ORDERS" Account has too many open orders on the exchange.
"Filter failure: EXCHANGE_MAX_NUM_ALGO_ORDERS" Account has too many open stop loss and/or take profit orders on the exchange.

10xxx - Crypto Loans

-10001 SYSTEM_MAINTENANCE

-10002 INVALID_INPUT

-10005 NO_RECORDS

-10007 COIN_NOT_LOANABLE

-10008 COIN_NOT_LOANABLE

-10009 COIN_NOT_COLLATERAL

-10010 COIN_NOT_COLLATERAL

-10011 INSUFFICIENT_ASSET

-10012 INVALID_AMOUNT

-10013 INSUFFICIENT_AMOUNT

-10015 DEDUCTION_FAILED

-10016 LOAN_FAILED

-10017 REPAY_EXCEED_DEBT

-10018 INVALID_AMOUNT

-10019 CONFIG_NOT_EXIST

-10020 UID_NOT_EXIST

-10021 ORDER_NOT_EXIST

-10022 INVALID_AMOUNT

-10023 ADJUST_LTV_FAILED

-10024 ADJUST_LTV_NOT_SUPPORTED

-10025 REPAY_FAILED

-10026 INVALID_PARAMETER

-10028 INVALID_PARAMETER

-10029 AMOUNT_TOO_SMALL

-10030 AMOUNT_TOO_LARGE

-10031 QUOTA_REACHED

-10032 REPAY_NOT_AVAILABLE

-10034 REPAY_NOT_AVAILABLE

-10039 AMOUNT_TOO_SMALL

-10040 AMOUNT_TOO_LARGE

-10041 INSUFFICIENT_AMOUNT

-10042 ASSET_NOT_SUPPORTED

-10043 ASSET_NOT_SUPPORTED

-10044 QUOTA_REACHED

-10045 COLLTERAL_REPAY_NOT_SUPPORTED

-10046 EXCEED_MAX_ADJUSTMENT

-10047 REGION_NOT_SUPPORTED

18xxx - Binance Code

-18002

-18003

-18004

-18005

-18006

-18007

21xxx - Portfolio Margin Account

-21001 USER_IS_NOT_UNIACCOUNT

-21002 UNI_ACCOUNT_CANT_TRANSFER_FUTURE

-21003 NET_ASSET_MUST_LTE_RATIO

-21004 USER_NO_LIABILITY

-21005 NO_ENOUGH_ASSET

-21006 HAD_IN_PROCESS_REPAY

-21007 IN_FORCE_LIQUIDATION

Order Rejection Issues

Error messages like these are indicated when the error is coming specifically from the matching engine:

The following messages which will indicate the specific error:

Error message Description
"Unknown order sent." The order (by either orderId, clientOrderId, origClientOrderId) could not be found.
"Duplicate order sent." The clientOrderId is already in use.
"Market is closed." The symbol is not trading.
"Account has insufficient balance for requested action." Not enough funds to complete the action.
"Market orders are not supported for this symbol." MARKET is not enabled on the symbol.
"Iceberg orders are not supported for this symbol." icebergQty is not enabled on the symbol
"Stop loss orders are not supported for this symbol." STOP_LOSS is not enabled on the symbol
"Stop loss limit orders are not supported for this symbol." STOP_LOSS_LIMIT is not enabled on the symbol
"Take profit orders are not supported for this symbol." TAKE_PROFIT is not enabled on the symbol
"Take profit limit orders are not supported for this symbol." TAKE_PROFIT_LIMIT is not enabled on the symbol
"Price * QTY is zero or less." price * quantity is too low
"IcebergQty exceeds QTY." icebergQty must be less than the order quantity
"This action is disabled on this account." Contact customer support; some actions have been disabled on the account.
"This account may not place or cancel orders." Contact customer support; the account has trading ability disabled.
"Unsupported order combination" The orderType, timeInForce, stopPrice, and/or icebergQty combination isn't allowed.
"Order would trigger immediately." The order's stop price is not valid when compared to the last traded price.
"Cancel order is invalid. Check origClientOrderId and orderId." No origClientOrderId or orderId was sent in.
"Order would immediately match and take." LIMIT_MAKER order type would immediately match and trade, and not be a pure maker order.
"The relationship of the prices for the orders is not correct." The prices set in the OCO is breaking the Price restrictions.
For reference:
BUY : LIMIT_MAKER price < Last Traded Price < stopPrice
SELL : LIMIT_MAKER price > Last Traded Price > stopPrice
"OCO orders are not supported for this symbol" OCO is not enabled on the symbol.
"Quote order qty market orders are not support for this symbol." MARKET orders using the parameter quoteOrderQty are not enabled on this symbol.
"Trailing stop orders are not supported for this symbol." Orders using trailingDelta are not enabled on the symbol.
"Order cancel-replace is not supported for this symbol." POST /api/v3/order/cancelReplace (REST API) or order.cancelReplace (WebSocket API) is on enabled the symbol.
"This symbol is not permitted for this account." Account and symbol do not have the same permissions. (e.g. SPOT, MARGIN, etc)
"This symbol is restricted for this account." Account is unable to trade on that symbol. (e.g. An ISOLATED_MARGIN account cannot place SPOT orders.)
"Order was not canceled due to cancel restrictions." Either cancelRestrictions was set to ONLY_NEW but the order status was not NEW
or
cancelRestrictions was set to ONLY_PARTIALLY_FILLED but the order status was not PARTIALLY_FILLED.
"Rest API trading is not enabled." / "WebSocket API trading is not enabled." Order is being placed or a server that is not configured to allow access to TRADE endpoints.
"Order book liquidity is less than LOT_SIZE filter minimum quantity." Quote quantity market orders cannot be placed when the order book liquidity is less than minimum quantity configured for the LOT_SIZE filter.
"Order book liquidity is less than MARKET_LOT_SIZE filter minimum quantity." Quote quantity market orders cannot be placed when the order book liquidity is less than the minimum quantity for MARKET_LOT_SIZE filter.
"Order book liquidity is less than symbol minimum quantity." Quote quantity market orders cannot be placed when there are no orders on the book.

Errors regarding POST /api/v3/order/cancelReplace

-2021 Order cancel-replace partially failed

This code is sent when either the cancellation of the order failed or the new order placement failed but not both.

-2022 Order cancel-replace failed.

This code is sent when both the cancellation of the order failed and the new order placement failed.

Notes

Request Parameters

Email Address