# Spot Trading API

## Public

### Security: None

{% hint style="info" %}
**Public** section can be accessed freely without requiring any API-key or signatures.
{% endhint %}

***

## Test Connectivity

<mark style="color:blue;">`GET`</mark> `https://openapi.xxx.com/sapi/v1/ping`

This interface checks connectivity to the host

{% tabs %}
{% tab title="200 Successfully connected" %}

```
{}
```

{% endtab %}
{% endtabs %}

***

## Check Server Time

<mark style="color:blue;">`GET`</mark> `https://openapi.xxx.com/sapi/v1/time`

This interface checks connectivity to the server and retrieves server timestamp

{% tabs %}
{% tab title="200  Successfully obtained server time" %}

```java
{
    "timezone": "China Standard Time",
    "serverTime": 1595563624731
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Response" %}

<table><thead><tr><th>Parameter</th><th width="113">Type</th><th>Example</th><th>Describe</th></tr></thead><tbody><tr><td>timezone</td><td>string</td><td>China Standard Time</td><td>Server time zone</td></tr><tr><td>serverTime</td><td>long</td><td>1705039779880</td><td>Server timestamp</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

***

## Symbol Pair List&#x20;

<mark style="color:blue;">`GET`</mark> `https://openapi.xxx.com/sapi/v1/symbols`

The supported symbol pair collection which in the exchange

{% tabs %}
{% tab title="200 Successfully obtain symbol pair list" %}

```java
{
    "symbols": [
        {
            "quantityPrecision": 3,
            "limitVolumeMin":0.0001,
            "symbol": "sccadai",
            "pricePrecision": 6,
            "marketBuyMin":0.0001,
            "marketSellMin":0.0001,
            "baseAsset": "SCCA",
            "limitPriceMin":0.001,
            "quoteAsset": "DAI",
        },
        {
            "quantityPrecision": 8,
            "limitVolumeMin":0.0001,
            "symbol": "btcusdt",
            "pricePrecision": 2,
            "marketBuyMin":0.0001,
            "marketSellMin":0.0001,
            "baseAsset": "BTC",
            "limitPriceMin":0.001,
            "quoteAsset": "USDT"
        },
        {
            "quantityPrecision": 3,
            "limitVolumeMin":0.0001,
            "symbol": "bchusdt",
            "pricePrecision": 2,
            "marketBuyMin":0.0001,
            "marketSellMin":0.0001,
            "baseAsset": "BCH",
            "limitPriceMin":0.001,
            "quoteAsset": "USDT"
        },
        {
            "quantityPrecision": 2,
            "limitVolumeMin":0.0001,
            "symbol": "etcusdt",
            "pricePrecision": 2,
            "marketBuyMin":0.0001,
            "marketSellMin":0.0001,
            "baseAsset": "ETC",
            "limitPriceMin":0.001,
            "quoteAsset": "USDT"
        },
        {
            "quantityPrecision": 2,
            "limitVolumeMin":0.0001,
            "symbol": "ltcbtc",
            "pricePrecision": 6,
            "marketBuyMin":0.0001,
            "marketSellMin":0.0001,
            "baseAsset": "LTC",
            "limitPriceMin":0.001,
            "quoteAsset": "BTC"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Response:" %}

<table><thead><tr><th>Parameter</th><th>Type</th><th width="135">Exmaple</th><th>Describe</th></tr></thead><tbody><tr><td>symbol</td><td>string</td><td>btcusdt</td><td>Lower case symbol name</td></tr><tr><td>baseAsset</td><td>string</td><td><code>BTC</code></td><td>Underlying asset for the symbol</td></tr><tr><td>quoteAsset</td><td>string</td><td><code>USDT</code></td><td>Quote asset for the symbol</td></tr><tr><td>pricePrecision</td><td>integer</td><td><code>2</code></td><td>Price accuracy</td></tr><tr><td>quantityPrecision</td><td>integer</td><td><code>6</code></td><td>Quantity accuracy</td></tr><tr><td>limitVolumeMin</td><td>BigDecimal</td><td>0.00001</td><td>Minimum quantity limit for limit order</td></tr><tr><td>marketBuyMin</td><td>BigDecimal</td><td>0.00001</td><td>Minimum purchase quantity for market order</td></tr><tr><td>marketSellMin</td><td>BigDecimal</td><td>0.00001</td><td>Minimum selling quantity for market orders</td></tr><tr><td>limitPriceMin</td><td>BigDecimal</td><td>0.00001</td><td>Minimum price limit for limit orders</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

***

## Market

### Security: None

**Market** section can be accessed freely without requiring any API-key or signatures.

***

## Depth

<mark style="color:blue;">`GET`</mark> `https://openapi.xxx.com/sapi/v1/depth`

Market detpth data

#### Query Parameters

| Name                                     | Type    | Description                       |
| ---------------------------------------- | ------- | --------------------------------- |
| limit<mark style="color:red;">\*</mark>  | integer | Default 100; Maximum 100          |
| symbol<mark style="color:red;">\*</mark> | string  | Uppercase symbol name E.g.BTCUSDT |

{% tabs %}
{% tab title="200  Successfully obtain market depth data" %}

```java
{
  "bids": [
    [
      "3.90000000",   // Price
      "431.00000000"  // Vol
    ],
    [
      "4.00000000",
      "431.00000000"
    ]
  ],
  "asks": [
    [
      "4.00000200",  // Price
      "12.00000000"  // Volume
    ],
    [
      "5.10000000",
      "28.00000000"
    ]
  ],
  "time": 1701658276000
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Response:" %}

<table><thead><tr><th width="130">Parameter</th><th width="75">Type</th><th width="206">Example</th><th>Describe</th></tr></thead><tbody><tr><td>time</td><td>long</td><td><code>1595563624731</code></td><td>Current timestamp (ms)</td></tr><tr><td>bids</td><td>array</td><td>[[1.3200,2.04],[0.2,0.4]]</td><td>Order book buying information, the array length is 2, subscript one is the price, type is float; subscript two is the quantity corresponding to the current price, type is float</td></tr><tr><td>asks</td><td>array</td><td>[[1.3200,2.04],[0.2,0.4]]</td><td>Order book selling information, the array length is 2, subscript one is the price, type is float; subscript two is the quantity corresponding to the current price, type is float</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

{% hint style="info" %}
The information corresponding to bids and asks represents all the prices in the order book and the quantity information corresponding to the prices, arranged from top to bottom from the best price
{% endhint %}

***

## &#x20;24hrs ticker

<mark style="color:blue;">`GET`</mark> `https://openapi.xxx.com/sapi/v1/ticker`

24-hour price change data

#### Query Parameters

| Name                                     | Type   | Description                       |
| ---------------------------------------- | ------ | --------------------------------- |
| symbol<mark style="color:red;">\*</mark> | string | Uppercase symbol name E.g.BTCUSDT |

{% tabs %}
{% tab title="200  Successfully obtained ticker data" %}

```java
{
    "amount":"23.20",
    "high": "9279.03",
    "vol": "1302.00",
    "last": "9200.00",
    "low": "9279.03",
    "buy":130.00,
    "sell":0.00,
    "rose": "+0.05",
    "time": 1595563624731
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Response:" %}

<table><thead><tr><th width="139">Parameter</th><th width="154">Type</th><th width="176">Example</th><th>Describe</th></tr></thead><tbody><tr><td>time</td><td>long</td><td><code>1595563624731</code></td><td>Timestamp (ms)</td></tr><tr><td>high</td><td>float</td><td><code>9900</code></td><td>Highest price</td></tr><tr><td>low</td><td>float</td><td><code>8800.34</code></td><td>Lowest price</td></tr><tr><td>last</td><td>float</td><td><code>8900</code></td><td>Latest deal price</td></tr><tr><td>vol</td><td>float</td><td><code>4999</code></td><td>Trade volume</td></tr><tr><td>amount</td><td>float</td><td>23.20</td><td>Trade amount</td></tr><tr><td>buy</td><td>float</td><td>130</td><td>The price in the buying book order at the first one</td></tr><tr><td>sell</td><td>float</td><td>120</td><td>The price in the selling book order at the first one</td></tr><tr><td>rose</td><td>string</td><td>+0.05</td><td>Range of increase and decrease, + is increase, - is decrease, +0.05 means increase by 5%</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

***

## Recent Trades List

<mark style="color:blue;">`GET`</mark> `https://openapi.xxx.com/sapi/v1/trades`

#### Query Parameters

| Name                                     | Type   | Description                       |
| ---------------------------------------- | ------ | --------------------------------- |
| symbol<mark style="color:red;">\*</mark> | string | Uppercase symbol name E.g.BTCUSDT |
| limit<mark style="color:red;">\*</mark>  | string | Default 100; Maximum 1000         |

{% tabs %}
{% tab title="200 " %}

```java
[
    {
        "side": "buy",
        "price": 130.0000000000000000,
        "qty": 0.1000000000000000,
        "time": 1704788645416
    },
    {
        "side": "buy",
        "price": 130.0000000000000000,
        "qty": 0.1000000000000000,
        "time": 1704788282332
    }
]
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Response:" %}

<table><thead><tr><th width="150">Parameter</th><th width="115">Type</th><th width="181">Example</th><th>Describe</th></tr></thead><tbody><tr><td><code>price</code></td><td>float</td><td><code>0.055</code></td><td>Trade price</td></tr><tr><td><code>time</code></td><td>long</td><td><code>1537797044116</code></td><td>Timestamp(ms)</td></tr><tr><td><code>qty</code></td><td>float</td><td><code>5</code></td><td>The quantity traded</td></tr><tr><td><code>side</code></td><td>string</td><td><code>buy/sell</code></td><td>Taker side</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

***

## Kline/candlestick data

<mark style="color:blue;">`GET`</mark> `https://openapi.xxx.com/sapi/v1/klines`

#### Query Parameters

| Name                                       | Type    | Description                                                                                                    |
| ------------------------------------------ | ------- | -------------------------------------------------------------------------------------------------------------- |
| symbol<mark style="color:red;">\*</mark>   | string  | Uppercase symbol name E.g.BTCUSDT                                                                              |
| interval<mark style="color:red;">\*</mark> | string  | Interval of the Kline. Possible values include:  `1min`,`5min`,`15min`,`30min`,`60min`,`1day`,`1week`,`1month` |
| limit                                      | integer | Default 100; Maximum 300                                                                                       |

{% tabs %}
{% tab title="200 " %}

```java
[
    {
        "high": "6228.77",
        "vol": "111",
        "low": "6228.77",
        "idx": 1594640340,
        "close": "6228.77",
        "open": "6228.77"
    },
    {
        "high": "6228.77",
        "vol": "222",
        "low": "6228.77",
        "idx": 1587632160,
        "close": "6228.77",
        "open": "6228.77"
    },
    {
        "high": "6228.77",
        "vol": "333",
        "low": "6228.77",
        "idx": 1587632100,
        "close": "6228.77",
        "open": "6228.77"
    }
]
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Response:" %}

<table><thead><tr><th width="165">Parameter</th><th width="127">Type</th><th width="167">Example</th><th>Describe</th></tr></thead><tbody><tr><td><code>idx</code></td><td>long</td><td><code>1538728740000</code></td><td>Open time (timestamp,ms)</td></tr><tr><td><code>open</code></td><td>float</td><td><code>36.00</code></td><td>Open price</td></tr><tr><td><code>close</code></td><td>float</td><td><code>33.00</code></td><td>Close price</td></tr><tr><td><code>high</code></td><td>float</td><td><code>36.00</code></td><td>Highest price</td></tr><tr><td><code>low</code></td><td>float</td><td><code>30.00</code></td><td>Lowest price</td></tr><tr><td><code>vol</code></td><td>float</td><td><code>2456.11</code></td><td>Trade volume</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

***

## Trade

### Security: TRADE

The interface in Trade requires API-key and signature for access.

***

## &#x20;Create new order

<mark style="color:green;">`POST`</mark> `https://openapi.xxx.com/sapi/v1/order`

Rate Limi&#x74;**: 100times/2s**

#### Headers

| Name                                          | Type    | Description  |
| --------------------------------------------- | ------- | ------------ |
| X-CH-SIGN<mark style="color:red;">\*</mark>   | string  | Sign         |
| X-CH-APIKEY<mark style="color:red;">\*</mark> | string  | User API-KEY |
| X-CH-TS<mark style="color:red;">\*</mark>     | integer | Timestamp    |

#### Request Body

| Name                                     | Type   | Description                                                                                                                                                                                                                                                                                 |
| ---------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| symbol<mark style="color:red;">\*</mark> | string | Symbol name, Case-insensitivet  E.g.BTCUSDT or btcusdt                                                                                                                                                                                                                                      |
| volume<mark style="color:red;">\*</mark> | number | Order quantity, there is a precision limit, the precision is configured by the administrator                                                                                                                                                                                                |
| side<mark style="color:red;">\*</mark>   | string | Order side, `BUY/SELL`                                                                                                                                                                                                                                                                      |
| type<mark style="color:red;">\*</mark>   | string | Order type, `LIMIT/MARKET`                                                                                                                                                                                                                                                                  |
| price                                    | number | Order price, for LIMIT orders must be sent, there is a precision limit, the precision is configured by the administrator                                                                                                                                                                    |
| newClientOrderId                         | string | The field is a third-party identifier and is not involved in the exchange's business logic or stored in the database. It is only returned as-is in the response. <mark style="color:red;">(Note: This field is not the exchange’s business order ID, please distinguish accordingly)</mark> |

{% tabs %}
{% tab title="200  Successfully ordered" %}

```json
{
    "symbol": "ETHUSDT",
    "side": "BUY",
    "executedQty": 0,
    "orderId": [
        "2012274607240433332"
    ],
    "price": 0,
    "origQty": 0.01,
    "clientOrderId": "1212",
    "transactTime": 1704959985403,
    "type": "MARKET",
    "status": "NEW"
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Response:" %}

<table><thead><tr><th width="186">Parameter</th><th width="111">Type</th><th width="191">Example</th><th>Describe</th></tr></thead><tbody><tr><td><code>orderId</code></td><td>long</td><td><code>150695552109032492</code></td><td>Order ID (system generated)</td></tr><tr><td><code>clientOrderId</code></td><td>string</td><td><code>213443</code></td><td>Order ID (sent by user)</td></tr><tr><td><code>symbol</code></td><td>string</td><td><code>BTCUSDT</code></td><td>Uppercase symbol name</td></tr><tr><td><code>transactTime</code></td><td>integer</td><td><code>1273774892913</code></td><td>The time of place order</td></tr><tr><td><code>price</code></td><td>float</td><td><code>4765.29</code></td><td>Order price</td></tr><tr><td><code>origQty</code></td><td>float</td><td><code>1.01</code></td><td>Order volume</td></tr><tr><td><code>executedQty</code></td><td>float</td><td><code>1.01</code></td><td>The number of already deal order</td></tr><tr><td><code>type</code></td><td>string</td><td><code>LIMIT</code></td><td>Type of the order<code>LIMIT/MARKET</code></td></tr><tr><td><code>side</code></td><td>string</td><td><code>BUY</code></td><td>Side of the order<code>BUY/</code> <code>SELL</code></td></tr><tr><td><code>status</code></td><td>string</td><td><code>New Order</code></td><td>Order status:<code>New Order</code>(new order or not transaction yet)</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

***

## &#x20;Test New Order

<mark style="color:green;">`POST`</mark> `https://openapi.xxx.com/sapi/v1/order/test`

Test new order creation and signature/recvWindow length. Creates and validates a new order but does not send the order into the matching engine.

#### Headers

| Name                                          | Type    | Description |
| --------------------------------------------- | ------- | ----------- |
| X-CH-SIGN<mark style="color:red;">\*</mark>   | string  | Sign        |
| X-CH-APIKEY<mark style="color:red;">\*</mark> | string  | Usr API-KEY |
| X-CH-TS<mark style="color:red;">\*</mark>     | integer | Timestamp   |

#### Request Body

| Name                                     | Type   | Description                                                                                                                                                                                                                                                                                 |
| ---------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| symbol<mark style="color:red;">\*</mark> | string | Uppercase symbol name E.g.BTCUSDT                                                                                                                                                                                                                                                           |
| volume<mark style="color:red;">\*</mark> | number | Order quantity, with precision limits, configured by the administrator                                                                                                                                                                                                                      |
| side<mark style="color:red;">\*</mark>   | string | Order side , `BUY/SELL`                                                                                                                                                                                                                                                                     |
| type<mark style="color:red;">\*</mark>   | string | Order type, `LIMIT/MARKET`                                                                                                                                                                                                                                                                  |
| price                                    | number | Order price, for LIMIT orders must be sent, there is a precision limit, configured by the administrator                                                                                                                                                                                     |
| newClientOrderId                         | string | The field is a third-party identifier and is not involved in the exchange's business logic or stored in the database. It is only returned as-is in the response. <mark style="color:red;">(Note: This field is not the exchange’s business order ID, please distinguish accordingly)</mark> |

{% tabs %}
{% tab title="200  Successfully created test order" %}

```
{}
```

{% endtab %}
{% endtabs %}

***

## &#x20;Batch Orders

<mark style="color:green;">`POST`</mark> `https://openapi.xxx.com/sapi/v1/batchOrders`

Rate Limit **: 50times/2s** Maximum 10 orders in one batch order request

#### Headers

| Name                                          | Type    | Description  |
| --------------------------------------------- | ------- | ------------ |
| X-CH-SIGN<mark style="color:red;">\*</mark>   | string  | Sign         |
| X-CH-APIKEY<mark style="color:red;">\*</mark> | string  | User API-KEY |
| X-CH-TS<mark style="color:red;">\*</mark>     | integer | Timestamp    |

#### Request Body

| Name                                     | Type   | Description                           |
| ---------------------------------------- | ------ | ------------------------------------- |
| orders<mark style="color:red;">\*</mark> | array  | Batch order param, Maxinum 10 orders  |
| symbol<mark style="color:red;">\*</mark> | string | Uppercase symbol name E.g.  `BTCUSDT` |

{% tabs %}
{% tab title="200 " %}

```java
{
    "ids": [
        165964665990709251,
        165964665990709252,
        165964665990709253
    ]
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Response:" %}

<table><thead><tr><th width="167">Parameter</th><th width="163">Type</th><th>Example</th><th>Describe</th></tr></thead><tbody><tr><td><code>price</code></td><td>float</td><td>1000.00</td><td>Trade pice</td></tr><tr><td><code>volume</code></td><td>float</td><td>20.10</td><td>Trade volume</td></tr><tr><td><code>side</code></td><td>string</td><td><code>BUY/SELL</code></td><td>Order side</td></tr><tr><td><code>batchType</code></td><td>string</td><td><code>LIMIT/MARKET</code></td><td>Order type</td></tr><tr><td>symbol</td><td>string</td><td>ETHUSDT</td><td>Uppercase symbol name</td></tr></tbody></table>
{% endtab %}

{% tab title="Example of request" %}
{% code title="Example of request" %}

```json
{"symbol":"ETHUSDT","orders":[{"side":"BUY","price":1980.00,"volume":1,"batchType":"MARKET"}]}
```

{% endcode %}
{% endtab %}
{% endtabs %}

***

## &#x20;Query Order

<mark style="color:blue;">`GET`</mark> `https://openapi.xxx.com/sapi/v1/order`

\
\
Rate Limi&#x74;**: 20 times/2s**

#### Query Parameters

| Name                                      | Type   | Description                         |
| ----------------------------------------- | ------ | ----------------------------------- |
| orderId<mark style="color:red;">\*</mark> | string | Order id                            |
| symbol<mark style="color:red;">\*</mark>  | string | Lowercase symbol name E.g.`ethusdt` |

#### Headers

| Name                                          | Type    | Description  |
| --------------------------------------------- | ------- | ------------ |
| X-CH-SIGN<mark style="color:red;">\*</mark>   | string  | Sign         |
| X-CH-APIKEY<mark style="color:red;">\*</mark> | string  | User API-KEY |
| X-CH-TS<mark style="color:red;">\*</mark>     | integer | Timestamp    |

{% tabs %}
{% tab title="200 " %}

```json
{
    "symbol": "ethusdt",
    "side": "BUY",
    "executedQty": 0E-16,
    "orderId": 53,
    "price": 20200.00,
    "origQty": 0.024,
    "avgPrice": 0E-16,
    "transactTime": 1672274311107,
    "type": "LIMIT",
    "status": "PENDING_CANCEL"
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Response:" %}

<table><thead><tr><th width="185">Parameter</th><th width="91">Type</th><th width="216">Example</th><th>Describe</th></tr></thead><tbody><tr><td><code>orderId</code></td><td>long</td><td><code>150695552109032492</code></td><td>Order ID（system generated）</td></tr><tr><td><code>clientOrderId</code></td><td>string</td><td><code>213443</code></td><td>Order ID（sent by user）</td></tr><tr><td><code>symbol</code></td><td>string</td><td>ethusdt</td><td>Lowercase symbol name</td></tr><tr><td><code>price</code></td><td>float</td><td><code>4765.29</code></td><td>Order price</td></tr><tr><td><code>origQty</code></td><td>float</td><td><code>1.01</code></td><td>Order volume</td></tr><tr><td><code>executedQty</code></td><td>float</td><td><code>1.01</code></td><td>The number of already deal order</td></tr><tr><td><code>avgPrice</code></td><td>float</td><td><code>4754.24</code></td><td>The average price of already deal order</td></tr><tr><td><code>type</code></td><td>string</td><td><code>LIMIT</code></td><td>Order type :<code>LIMIT/MARKET</code></td></tr><tr><td>transactTime</td><td>long</td><td>1672274311107</td><td>Timestamp</td></tr><tr><td><code>side</code></td><td>string</td><td><code>BUY</code></td><td>Order side: <code>BUY/SELL</code></td></tr><tr><td><code>status</code></td><td>string</td><td><code>New Order</code></td><td>Order status: New Order (new order, no transaction), Partially Filled(partial transaction), Filled (full transaction), Cancelled (cancelled), Partially Filled/Cancelled (partial transaction but order canceled).</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

***

## &#x20;Cancel Order

<mark style="color:green;">`POST`</mark> `https://openapi.xxx.com/sapi/v1/cancel`

\
\
Rate Limi&#x74;**:  100times/2s**

#### Headers

| Name                                          | Type    | Description  |
| --------------------------------------------- | ------- | ------------ |
| X-CH-SIGN<mark style="color:red;">\*</mark>   | string  | Sign         |
| X-CH-APIKEY<mark style="color:red;">\*</mark> | string  | User API-KEY |
| X-CH-TS<mark style="color:red;">\*</mark>     | integer | Timestamp    |

#### Request Body

| Name                                      | Type   | Description                        |
| ----------------------------------------- | ------ | ---------------------------------- |
| orderId<mark style="color:red;">\*</mark> | string | Order id                           |
| symbol<mark style="color:red;">\*</mark>  | string | Lowercase symbol name E.g. ethusdt |

{% tabs %}
{% tab title="200  Successfully cancel order" %}

```json
{
    "symbol": "ethusdt",
    "orderId": [
        "1938321163093079425"
    ],
    "status": "PENDING_CANCEL"
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Response:" %}

<table><thead><tr><th width="148">Parameter</th><th width="97">Type</th><th width="220">Example</th><th>Describe</th></tr></thead><tbody><tr><td><code>orderId</code></td><td>long</td><td><code>150695552109032492</code></td><td>Order ID（system generated）</td></tr><tr><td><code>symbol</code></td><td>string</td><td>ethusdt</td><td>Lowercase symbol name</td></tr><tr><td><code>status</code></td><td>string</td><td>To be Cancelled</td><td>Order Status：To be Cancelled</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

***

## &#x20;Batch Cancel Order

<mark style="color:green;">`POST`</mark> `https://openapi.xxx.com/sapi/v1/batchCancel`

Rate Limi&#x74;**: 50times/2s  Every batch cancel request contains at most 10 orders**

#### Headers

| Name                                          | Type    | Description  |
| --------------------------------------------- | ------- | ------------ |
| X-CH-SIGN<mark style="color:red;">\*</mark>   | string  | Sign         |
| X-CH-APIKEY<mark style="color:red;">\*</mark> | string  | User API-KEY |
| X-CH-TS<mark style="color:red;">\*</mark>     | integer | Timestamp    |

#### Request Body

| Name                                       | Type   | Description                                                                                                                                           |
| ------------------------------------------ | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| symbol<mark style="color:red;">\*</mark>   | string | Uppercase symbol name E.g. `BTCUSDT`                                                                                                                  |
| orderIds<mark style="color:red;">\*</mark> | array  | Collection of order IDs to be canceled. <mark style="color:red;">The order id must be of numeric type rather than String type.</mark> e.g.`[123,456]` |

{% tabs %}
{% tab title="200 " %}
{% code title="Return successful" %}

```java
{
    "success": [
        165964665990709251,
        165964665990709252,
        165964665990709253
    ],
    "failed": [ //Cancellation failure is usually because the order does not exist or the order status has reached the final state.
        165964665990709250  
    ]
}
```

{% endcode %}

{% code title="Return failed" %}

```json
{} //Usually it is because the order number is wrong and you need to check whether the content in orderIds is correct.
```

{% endcode %}
{% endtab %}
{% endtabs %}

***

## &#x20;Current Open Orders

<mark style="color:blue;">`GET`</mark> `https://openapi.xxx.com/sapi/v1/openOrders`

Rate Limit: **20times/2s**

#### Query Parameters

| Name                                     | Type    | Description                        |
| ---------------------------------------- | ------- | ---------------------------------- |
| symbol<mark style="color:red;">\*</mark> | string  | Lowercase symbol name E.g. ethusdt |
| limit<mark style="color:red;">\*</mark>  | integer | Maximum 1000                       |

#### Headers

| Name                                          | Type    | Description  |
| --------------------------------------------- | ------- | ------------ |
| X-CH-SIGN<mark style="color:red;">\*</mark>   | string  | Sign         |
| X-CH-APIKEY<mark style="color:red;">\*</mark> | string  | User API-KEY |
| X-CH-TS<mark style="color:red;">\*</mark>     | integer | Timestamp    |

{% tabs %}
{% tab title="200 " %}

```json
[
    {
        "symbol": "ETHUSDT",
        "side": "BUY",
        "executedQty": "0",
        "orderId": 1938321163093077686,
        "price": "0",
        "origQty": "0.10",
        "avgPrice": "0",
        "time": 1701240367864,
        "type": "MARKET",
        "status": "NEW_"
    },
    {
        "symbol": "ETHUSDT",
        "side": "BUY",
        "executedQty": "0",
        "orderId": 1938321163093078022,
        "price": "0",
        "origQty": "0.01",
        "avgPrice": "0",
        "time": 1701243281850,
        "type": "MARKET",
        "status": "NEW_"
    }
]
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Response:" %}

<table><thead><tr><th width="168">Parameter</th><th width="87">Type</th><th width="219">Example</th><th>Describe</th></tr></thead><tbody><tr><td><code>orderId</code></td><td>long</td><td><code>150695552109032492</code></td><td>Order ID（system generated）</td></tr><tr><td><code>symbol</code></td><td>string</td><td><code>BTCUSDT</code></td><td>Uppercase symbol name</td></tr><tr><td><code>price</code></td><td>float</td><td><code>4765.29</code></td><td>Order price</td></tr><tr><td><code>origQty</code></td><td>float</td><td><code>1.01</code></td><td>Order volume</td></tr><tr><td><code>executedQty</code></td><td>float</td><td><code>1.01</code></td><td>The number of already deal order</td></tr><tr><td><code>avgPrice</code></td><td>float</td><td><code>4754.24</code></td><td>The average price of already deal order</td></tr><tr><td><code>type</code></td><td>string</td><td><code>LIMIT</code></td><td>Order type :<code>LIMIT</code>/<code>MARKET</code></td></tr><tr><td>time</td><td>long</td><td>1701243281850</td><td>Timestamp</td></tr><tr><td><code>side</code></td><td>string</td><td><code>BUY</code></td><td>Order side <code>BUY</code>/ <code>SELL</code></td></tr><tr><td><code>status</code></td><td>string</td><td><code>New Order</code></td><td>Order status: New Order (new order, no transaction), Partially Filled(partial transaction), Filled (full transaction), Cancelled (cancelled), Partially Filled/Cancelled (partial transaction but order canceled).</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

***

## &#x20;Trading records

<mark style="color:blue;">`GET`</mark> `https://openapi.xxx.com/sapi/v1/myTrades`

Rate Limi&#x74;**: 20times/2s**

#### Query Parameters

| Name                                     | Type   | Description                          |
| ---------------------------------------- | ------ | ------------------------------------ |
| symbol<mark style="color:red;">\*</mark> | string | Uppercase symbol name E.g. `BTCUSDT` |
| limit<mark style="color:red;">\*</mark>  | string | Default100; Maximum 1000             |

#### Headers

| Name                                          | Type    | Description  |
| --------------------------------------------- | ------- | ------------ |
| X-CH-SIGN<mark style="color:red;">\*</mark>   | string  | Sign         |
| X-CH-APIKEY<mark style="color:red;">\*</mark> | string  | User API-KEY |
| X-CH-TS<mark style="color:red;">\*</mark>     | integer | Timestamp    |

{% tabs %}
{% tab title="200 " %}

```json
[
    {
        "symbol": "ETHUSDT",
        "side": "BUY",
        "fee": "0.00000000428",
        "isMaker": false,
        "isBuyer": true,
        "bidId": 1954603951049381893,
        "bidUserId": 10083,
        "feeCoin": "ETH",
        "price": "2334",
        "qty": "0.00000428",
        "askId": 1856176838352995447,
        "id": 159,
        "time": 1701623660989,
        "isSelf": false,
        "askUserId": 10671
    },
    {
        "symbol": "ETHUSDT",
        "side": "BUY",
        "fee": "0.00000004284",
        "isMaker": false,
        "isBuyer": true,
        "bidId": 1938321163093068889,
        "bidUserId": 10083,
        "feeCoin": "ETH",
        "price": "2334",
        "qty": "0.00004284",
        "askId": 1856176838352995447,
        "id": 158,
        "time": 1701165091964,
        "isSelf": false,
        "askUserId": 10671
    }
]
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Response:" %}

<table><thead><tr><th width="131">Parameter</th><th width="96">Type</th><th width="221">Example</th><th>Describe</th></tr></thead><tbody><tr><td><code>symbol</code></td><td>string</td><td><code>ETHBTC</code></td><td>Uppercase symbol name</td></tr><tr><td><code>id</code></td><td>integer</td><td><code>28457</code></td><td>Trade id</td></tr><tr><td><code>bidId</code></td><td>long</td><td><code>150695552109032492</code></td><td>Buy side order ID</td></tr><tr><td><code>askId</code></td><td>long</td><td><code>150695552109032493</code></td><td>Sell side order ID</td></tr><tr><td><code>price</code></td><td>integer</td><td><code>4.01</code></td><td>Trade timestamp</td></tr><tr><td><code>qty</code></td><td>float</td><td><code>12</code></td><td>Trade volume</td></tr><tr><td><code>time</code></td><td>number</td><td><code>1499865549590</code></td><td>Trade timestamp</td></tr><tr><td><code>isBuyer</code></td><td>boolean</td><td><code>true</code></td><td><code>true</code>= Buyer <code>false</code>= Seller</td></tr><tr><td><code>isMaker</code></td><td>boolean</td><td><code>false</code></td><td><code>true</code>=Maker <code>false</code>=Taker</td></tr><tr><td><code>feeCoin</code></td><td>string</td><td><code>ETH</code></td><td>Trade fee coin</td></tr><tr><td><code>fee</code></td><td>number</td><td><code>0.01</code></td><td>Trade fee</td></tr><tr><td>bidUserId</td><td>integer</td><td>10083</td><td>Buy side user id</td></tr><tr><td>askUserId</td><td>integer</td><td>10094</td><td>Sell side user id</td></tr><tr><td>isSelf</td><td>boolean</td><td>false</td><td>self deal status<br>true = is self deal<br>false = not self deal</td></tr><tr><td>side</td><td>string</td><td>BUY</td><td>Taker order side: BUY/SELL</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

***

## Account

### Security: USER\_DATA

The interface in Trade requires API-key and signature for access.

***

## &#x20;Account Information

<mark style="color:blue;">`GET`</mark> `https://openapi.xxx.com/sapi/v1/account`

Rate Limi&#x74;**: 20times/2s**

#### Headers

| Name                                          | Type    | Description  |
| --------------------------------------------- | ------- | ------------ |
| X-CH-SIGN<mark style="color:red;">\*</mark>   | string  | Sign         |
| X-CH-APIKEY<mark style="color:red;">\*</mark> | string  | User API-KEY |
| X-CH-TS<mark style="color:red;">\*</mark>     | integer | Timestamp    |

{% tabs %}
{% tab title="200 Successfully obtained account information" %}

```json
{
    "balances": [
        {
            "asset": "ABAT",
            "free": "10.00",
            "locked": "20.00"
        },
        {
            "asset": "DOT",
            "free": "10.00",
            "locked": "10.00"
        },
        {
            "asset": "TT",
            "free": "50.00",
            "locked": "50.00"
        }
]
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Response:" %}

| Parameter    | Type | Describe                          |
| ------------ | ---- | --------------------------------- |
| `balances`   | `[]` | The collection or account balance |
| {% endtab %} |      |                                   |

{% tab title="Balances field:" %}

<table><thead><tr><th width="178">Parameter</th><th width="150">Type</th><th width="179">Example</th><th>Describe</th></tr></thead><tbody><tr><td><code>asset</code></td><td>string</td><td><code>USDT</code></td><td>Coin name</td></tr><tr><td><code>free</code></td><td>float</td><td>1000.30</td><td>Account available amount</td></tr><tr><td><code>locked</code></td><td>float</td><td>400</td><td>Account frozen amount</td></tr></tbody></table>
{% endtab %}
{% endtabs %}
