NAV Navbar
json

API Introduction

General

Welcome to the Coinsuper Exchange API, a document designed to provide API users with a convenient trading experience. You can use the API to get market data, trade, and manage your account.

The API is divided into three categories: query, trading and market data. After registering an account with Coinsuper, you can create API Keys with different permissions according to your needs. It also allows you to access the API using the specified IP address.

We offter REST, WebSocket, and FIX. You can choose the way that suits you based on your usage scenarios and preferences.

We have code example in JSON, You can view code examples to the right.

Trading Rules

Matching Machine

Orders are handled by the sequencing principle of “price-> time priority” in Coinsuper.

Price priority means that a higher-priced buy order takes precedence over a lower-priced buy order, and that a lower-priced sell order takes precedence over a higher-priced sell order.

Time priority means that pending orders of the same price and user type are handled one after another. The sequence is determined by the time of placing orders; the earlier placed orders are prioritized than the later placed orders in the process of making deals.

Orders are matched and executed at the maker price rather than taker price.

Order Lifecycle

Valid orders sent to the matching engine are confirmed immediately and are in the UNDEAL state.

If an order executes wholly against another order, the order is considered deal. An order can execute in part, a partial order will be considered PARTDEAL. And it will remain in the matching engine until canceled or subsequently filled by new orders.

If an unfilled order is successfully cancelled, its status will change to the CANCEL.

There is a process status PENDING_CANCEL during the process of initiating cancellation to completion cancellation;

Orders that are cancelled or all completed will be removed from the matching queue.

Fees

Here is an introduction to the fee rules. Please see the Fee Schedule for details.

Fee Tier

The fee schedule is volume-based. To qualify for a tier, you need to meet the minimum trading volume required, calculated on the average trading volume in the past 30 days. The higher the tier you are in, the lower the fees.

In the meanwhile, to enhance market liquidity and participation, Coinsuper adopts a maker-taker fee schedule, in which the maker fee is lower than the taker fee.

Use CEN for discounted transaction fees

When trading any token on the Coinsuper platform, if you hold CEN and agree to use CEN to pay the transaction fee, you can pay the commission at CEN at a discount rate.

Market Making Incentive Program

Coinsuper offers Market Making Incentive Scheme for professional liquidity providers and quantitative traders. As a market maker, if you provide consistent liquidity and competitive bid-ask spreads, you can share the fee income or enjoy maker fee refund. Please click here to check out. Send the application email to vip@coinsuper.com.

Server Location

Coinsuper servers are based in Hong Kong. To reduce API latency, we suggest choosing an ISP with stable connection to servers located in Hong Kong.

API Key

Create API Key

Before being able to sign any requests, you must create an API key via the Coinsuper website. Click here to view the tutorial.

Upon creating a key you will have 2 pieces of information which you must remember:

API Key Permissions

You can restrict the functionality of API keys. Before creating the key, you must choose what permissions you would like the key to have. The permissions are:

URLs

REST API

Index URL Prefix Description
1 https://api.coinsuper.info Active
2 https://api.coinsuper.net Standby 1

API Request URI example(Personal Asset Information) :

WebSocket Feed(Quote)

Index host port isSSL Description
1 apimqtt.coinsuper.info 1883 false mqtt server name and port
2 apiwss.coinsuper.info 443 true Javascript WebSocket server name and port

WebSocket Feed(Assets and Orders)

Index host port isSSL Description
1 apimqtt.coinsuper.info 1883 false mqtt server name and port
2 apiwss.coinsuper.info 443 true Javascript WebSocket server name and port

Fix

Index API Access Address Description
1 apifix.coinsuper.info 主域名

SDK & Code Demo

SDK

Python SDK

Install the command with python SDK:pip install coinsuper_api_rest_sdk

Code Demo

REST Code Demo:https://github.com/coinsuperapi/REST_API_demos

WebSocket Code Demohttps://github.com/coinsuperapi/websocket_API_demos

FIX Code Demohttps://github.com/coinsuperapi/FIX_API_demos

REST API Access

API Access Format

Request Format

Sample JSON POST Body

{
    "common":{
        "accesskey" : "1900000109",            // Personal Accesskey
        "sign":"sdfsdfa1231231sdfsdfsd",        // MD5 Encrypted Secret Key
        "timestamp":"1500000000000"        //UTC Time (Milliseconds)
    },
    "data":{
        ......                                //Data Specific to Request
    }
}

Sample JSON Response

{
        "code":"1000",    // Status Code
        "msg":"success",    // Message Corresponding With Status Code
        "data":{
                    "timestamp":"1500000000000", //System UTC Time (Milliseconds)
                    "result":{
                                ....
                             }                  //Returned Data Specific to Request
                ..... 
               }    // Return Data
}

All API requests are made as REST POST requests. A request must contain a common part and a data part.

Common part

Common is the public parameter. Every non-public request needs the same "common" parameters to be transmitted. , and common must contain the following three parameters.

Data Part

Data is the private parameter and must be passed every time the interface is called. Each interface defines required and optional parameters for the API call. The data category may vary from interface to interface. The call interface passes data even if the data category is empty.

Response Format

All response will be returned in JSON format. The top level JSON is a wrapper object which provides two metadata in "code" and "msg". The actual per API response data is in "data" field.

Code returns "1000" for success, and returns other values indicating an exception in the business request. Refer to the provided table below for specific exception description.

Authentication

Complete Request Body :

{   
  "common":{    
    "accesskey":"zhangsan",
    "sign":"sdfsdfa1231231sdfsdfsd",
    "timestamp":"1500000000000"
  },
  "data":{
    "symbol":"BTC/USD",
    "num"   :"50"
  }
}

To protect API communication from unauthorized change, all non-public API calls are required to be signed. Please check each endpoint below for its permission type. Only the API Key with proper permission could access the respective endpoints requiring authentication.

Signature Method

Take the query of the Detailed Market Data Quote as an example:

Request Parameters:
symbol : BTC/USD
num: 50

Common Request Parameters:
accesskey : zhangsan
secretkey : zhangsan
timestamp : 1500000000000

1.Sort all request parameters from small to large according to ASCII code (alphabetical order)

2.Splice these sorted parameter with character '&':
accesskey=zhangsan&num=50&secretkey=zhangsan&symbol=BTC/USD&timestamp=1500000000000

3.Finally, we encrypt the raw signature string and assign it to signValue. This will be the "sign" for the actual request body.
signValue = md5(string)

Rules

Timestamp

All timestamps received or sent must use UTC time, specified down to atomic milliseconds.

Quotation Accuracy

Use this interface to query available pairs list: POST /api/v1/market/symbolList

The response parameter will return the accuracy "quantityScale", "priceScale" and "amountScale" of the order amount of the transaction pair. The accuracy is subject to the three Scale data.

Decimal numbers are returned as "Strings" in order to preserve full precision. It is recommended that the numbers are converted to “Strings” to avoid truncation and precision loss.

Status Code Table

Code Number Code Message Description and Suggestion
1000 success Interface call succeeds.
2000 system upgrading System upgrade is in progress, please try again later (refer to the official WEB announcement for details).
2001 system internal error Non-business exception. Please check whether the interface is used correctly according to the interface document (refer to the general "Parameter Details" above and the request parameters of the specific interface below for details).
2002 interface is unavailability Interface is not available. Please check on the official WEB API apply page whether your current API key has access to calling the interface (refer to "Interface Grouping and Rate Limiting" below for the specific interface).
2003 request is too frequently Too many requests. Request frequency exceeds the current limit (please refer to "Interface Grouping and Rate Limiting" below for specific current limit values).
2004 fail to check sign Interface parameter verification failure. Please make sure that parameter signatures are properly executed according to the interface document instruction (refer to "Signature Generation Method" and "Signature Generation Sample" above for the specific signature mode, or call the sample code directly by referring to the REST interface).
2005 parameter is invalid Invalid parameter. Lack of necessary parameters, or parameter errors (refer to the general "Parameter Details" above and the request parameters of the specific interface below for details).
2006 request failure Interface call exception. Please check whether the interface is used correctly according to the interface document (refer to the general "Parameter Details" above and the request parameters of the specific interface below for details).
2007 accesskey has been forbidden The current user has been banned from calling the API interface.
2008 user not exist The user did not open API. Please first check whether the accessKey is correct and whether the environment of application for the accessKey is consistent with that of the interface call.
3001 account balance is not enough Insufficient account balance. Please confirm the available balance of the corresponding asset account with "Personal Asset Information" below, or log on to official WEB or APP for viewing.
3002 orderNo is not exist Specified order number does not exist. Please make sure that the incoming orderNo is correct (if the last three numbers of the incoming orderNo are 0, it is likely that you has not saved the last three numbers correctly after the ordering interface responds to the number and hence lost the accuracy of the last three numbers. It is recommended to save the numbers in strings).
3003 price is invalid Invalid price. Please make sure that the price parameter is properly input as described in this API document.
3004 symbol is invalid Invalid trading pair. Please make sure that the symbol parameters are properly input as that described in this API document (if the ordering interface is called, you can check the valid tradable trading pair through the "List of tradable trading pairs" interface below).
3005 quantity is invalid Invalid quantity. Please make sure that the quantity parameter is correctly input as that described in this API document.
3006 ordertype is invalid Invalid order type. Please make sure that the orderType parameter is properly input as that described in this API document.
3007 action is invalid Invalid order action. Please make sure that the action parameter is correctly input as that described in this API document.
3008 state is invalid Invalid state value. Please make sure that the state parameter is properly input as that described in this API document.
3009 num is invalid Invalid num parameter. Please make sure that num parameter is properly input as that described in this API document.
3010 amount is invalid Invalid amount parameter. Please make sure that the amount parameter is properly input as that described in this API document.
3011 cancel order failure Withdrawal failure. Failure to cancel order due to other undefined reasons (What have been defined are 3002, 3021 and 3018, etc.).
3012 create order failure Order failure. Failure to place an order due to other undefined reasons (What have been defined are 3001, 3003, 3004 and 3005, etc.).
3013 orderList is invalid Invalid orderList parameter. The parameters in the orderList are empty or the number exceeds the limit or contains the wrong order parameter.
3014 symbol not trading Trading pair transaction is not open. The transaction is not open for the time being.
3015 order amount or quantity less than min setting The amount or quantity is less than the minimum number of entry orders. Refer to the "Supported Currency Pairs List" interface below for the minimum number of entry orders of each currency in specific trading pairs.
3016 price greater than max setting Price exceeds the maximum price of entry orders. Refer to the "Supported Currency Pairs List" interface below for specific values.
3017 user account forbidden User’s corresponding currency account has been banned from trading.
3018 order has execute Order has been closed. If you are using the order cancel interface, it means that the order is closed and cannot be cancel again.
3019 orderNo num is more than the max setting Order number quantity exceeds the maximum upper limit. Please refer to the instructions for the upper limit of the order number of the corresponding interface.
3020 price out of range The price of entry orders exceeds the range. (Calculation method of price range is as follows: Maximum=(1+deviationRatio)x latest transaction price; minimum=(1-deviationRatio)xlatest transaction price. Specifically, the latest transaction price comes from the price of the first data of /api/v1/market/tickers interface, and deviationRatio comes from /api/v1/market/symboList interface).
3021 order has canceled Order already has been canceled.
3027 this symbol's API trading channel is not available The transaction does not allow trading through API.
3028 duplicate clientOrderId Duplicate clientOrderId. The clientOrderId should be unique.
3029 Market price deviation is too large, market order is not recommended Cannot place a market order when price deviation is too large.
3030 Market price deviation is too large, market order is not recommended It is not recommended to place a market order when price deviation is too large.
3031 batch create order more or less than limit The number of orders is more or less than limit.
3032 batch create order symbol not unique The symbol is should be unique.
3033 batch create order action not unique The action should be unique.
3034 clientOrderIdList and orderNoList should and only pass one The clientOrderIdList and orderNoList should and only pass one.
3035 order cancel param error One or more parameters are wrong for cancel order.
3036 not usual ip Not the usual IP you used.

Interface Grouping and Rate Limiting

Interface Grouping Containing Interface Rate Limiting Values
1.Public Market Data Detailed Market Quote (1-50) (/api/public/v1/market/orderBook)
Real Time Price Quotes (/api/public/v1/market/kline)
Real-Time Transaction Quotes (/api/public/v1/market/tickers)
10/s
2. Trade Place a Buy Order (/api/v1/order/buy)
Place a Sell Order (/api/v1/order/sell)
Cancel an Order (/api/v1/order/cancel)
Place orders in batch (/api/v1/order/batchPlace)
Batch Cancellation of Orders (/api/v1/order/batchCancel)
10/s
3. Query Personal Asset Information (/api/v1/asset/userAssetInfo)
Get Detailed Open Orders (/api/v1/order/list)
Get Historical Orders(by orderNoList)(/api/v1/order/details)
Get Historical Orders(by clientOrderIdList) (/api/v1/order/clList)
List open Orders (/api/v1/order/openList)
Get Order History (/api/v1/order/history)
Get Match History(/api/v1/order/tradeHistory)
Get Pairs List (/api/v1/market/symbolList)
10/s

Public Market Data

1. Public Detailed Market Quote

Request Sample:

{
    "data":{
        "symbol":"ETC/BTC",                  //  Trading Pair
        "num":"50"                             //  Number of Results
    }
}

Response Sample:

{
    "code":"1000",
    "msg":"success",
    "data":{
        "timestamp":"1500000000000",
        "result":{
                    "asks":[{"limitPrice":"123.00000000","quantity":"161.1300"},...],
                    "bids":[{"limitPrice":"86.06000000","quantity":"0.7800"},..],
                   }
    }
}
Description:

Get asks and bids for the specified pair.

Endpoint Request Details

POST /api/public/v1/market/orderBook

Request Parameters:
Parameter Mandatory Description
num Yes Number of results to return
symbol Yes Trading Pair
Response Parameters:
Parameter Description
timestamp Timestamp
result Results
asks Ask Offers
bids Bid Offers
limitPrice Price Limit (Note: Please refer to the symbolList interface for price accuracy of trading pairs.)
quantity Quantity on Offer (Note: Please refer to the symbolList interface for quantity accuracy of trading pairs.)

2. Public Real Time Price Quotes

Request Sample:

{
    "data":{
        "symbol":"ETC/BTC",                  //  Trade Piar
        "num":"300"                            //  Data Points
    }
}

Response Sample:

{
    "code":"1000",
    "msg":"success",
    "data":{
            "timestamp":"1500000000000",
            "result":[
                            {
                              "close": "0.00205900",
                              "high": "0.00206080",
                              "low": "0.00205340",
                              "open": "0.00205660",
                              "volume": "100.1218",
                              "timestamp": "1500000000000"
                            },
                            ...
                      ]
            }
}
Description:

Get 5 minutes of "kline" data for a trading pair.

Endpoint Request Details

POST /api/public/v1/market/kline

Request Parameters:
Parameter Mandatory Description
symbol Yes Trading Pair
num Yes Number of results to return (Up to 300)
range No Kline range(available values:
5min, 15min, 30min, 1hour,
6hour, 12hour, 1day), default
value:5min
Response Parameters:
Parameter Description
timestamp Timestamp
result Results
volume Volume Traded
high Highest Price
low Lowest Price
open Opening Price
close Closing Price

3. Public Real-Time Transaction Quotes

Request Sample:

{
    "data":{
        "symbol":"ETC/BTC",                  //  Trading Pair
        "num":"50"                           //  Number of Results
    }
}

Response Sample:

{
    "code":"1000",
    "msg":"success",
    "data":{
            "timestamp":"1500000000000",
            "result":[
                  {
                  "price": "0.00212320",
                  "tradeType": "SELL",
                  "volume": "0.3499",
                  "timestamp": "1500000000000"
                  },
                  ...
             ]
    }
}
Description:

Get latest transactions for a pair.

Endpoint Request Details

POST /api/public/v1/market/tickers

Request Parameters:
Parameter Mandatory Description
symbol Yes Trading Pair
num No Number of results to return (Up to 50, default 50)
Response Parameters:
Parameter Description
timestamp Timestamp
result Results
volume Volume Traded
timestamp Transaction Timestamp
price Transaction Price
tradeType Taker Trade Type (BUY - Buy, SELL - Sell)

Trade

1. Place a Buy Order

Request Sample:

{
    "common":{
        "accesskey" : "1900000109",            // Accesskey
        "timestamp": "1500000000000",            // Timestamp
        "sign":"sdfsdfa1231231sdfsdfsd"        // MD5 Signature
    },
    "data":{
        "orderType""LMT",
        "symbol":"ETC/BTC",
        "priceLimit":"12345.67", 
        "amount":"0",
        "quantity":"2.34"
    }
}

Response Sample:

{
    "code":"1000",
    "msg":"success",
    "data":{
            "timestamp":"1500000000000",
            "result":{
                        "orderNo":"2134123412" 
                     }
            }
}
Description:

Place a buy order.

You can place two types of orders: limit and market. Orders can only be placed if your account has sufficient funds.

Endpoint Request Details

POST /api/v1/order/buy

Request Parameters:
Parameter Mandatory Description
symbol Yes Transaction Pair Symbol
priceLimit Yes Price Limit(String type)
orderType Yes Order Type MKT- "Market Price",LMT- "Limit Price"
quantity Yes Buy Quantity(String type).
amount Yes Amount(String type)
clientOrderId No Client Order ID (any string, excluding special symbols, not repeating, length 10~50)
Response Parameters:
Parameter Description
timestamp Timestamp
result Results
orderNo Order Number ID (To avoid loss of order number accuracy upon receipt, please use a string to receive.)

2. Place a Sell Order

Request Sample:

{
    "common":{
        "accesskey" : "1900000109",            // Accesskey
        "timestamp": "1500000000000",            // Timestamp
        "sign":"sdfsdfa1231231sdfsdfsd"        // MD5 Signature
    },
    "data":{
        "orderType":"LMT",
        "symbol":"ETC/BTC",
        "priceLimit":"12345.67", 
        "amount":"0",
        "quantity":"2.34"
    }
}

Response Sample:

{
    "code":"1000",
    "msg":"success",
    "data":{
            "timestamp":"1500000000000",
            "result":{
                        "orderNo":"2134123412"
                     }
           }
}

Description:

Place a sell order.

Endpoint Request Details

POST /api/v1/order/sell

Request Parameters:
Parameter Mandatory Description
symbol Yes Transaction Pair Symbol
priceLimit Yes Price Limit(String type)
orderType Yes Order Type MKT- "Market Price",LMT- "Limit Price"
quantity Yes Buy Quantity(String type).
amount Yes Amount(String type. For sale, please use a fixed value of 0.)
clientOrderId No Client Order ID defined by you to identify your order(any string, excluding special symbols, not repeating, length 10~50)
Response Parameters:
Parameter Description
timestamp Timestamp
result Results
orderNo Order Number ID

3. Cancel an Order

Request Sample:

{
    "common":{
        "accesskey" : "1900000109",            // Accesskey
        "timestamp": "1500000000000",            // Timestamp
        "sign":"sdfsdfa1231231sdfsdfsd"        // MD5 Signature
    },
    "data":{
        "orderNo": "12341235123412"           //  Order Number
    }
}

Response Sample:

{
    "code":"1000",
    "msg":"success",
    "data":{
            "timestamp":"1500000000000",
            "result":{
                        "operate":"success"
                     }
            }
}

Description:

Cancel a previously placed order.

Endpoint Request Details

POST /api/v1/order/cancel

Request Parameters:
Parameter Mandatory Description
orderNo Yes Order Number ID. Please make sure the correctness of the order number and do not lose the accuracy of the last three numbers. There should be no space or other separators at both ends of the order number.
Response Parameters:
Parameter Description
timestamp Timestamp
result Results
operate Result Description : "success" or "failure"

4. Place orders in batch

Request Sample:

{
    "common":{
        "accesskey" : "1900000109",           
        "timestamp": "1500000000000",         
        "sign":"sdfsdfa1231231sdfsdfsd"       
    },
    "data":[
        {
            "action":"BUY",
            "amount":"0",
            "clientOrderId":"10000000001",
            "orderType":"LMT",
            "priceLimit":"12345.67", 
            "quantity":"2.34",
            "symbol":"ETC/BTC"
        },
        {
            "action":"BUY",
            "amount":"0.1",
            "clientOrderId":"10000000002",
            "orderType":"MKT",
            "priceLimit":"0", 
            "quantity":"0",
            "symbol":"ETC/BTC"
        },
        ...
        {
            "action":"BUY",
            "amount":"0",
            "clientOrderId":"10000000010",
            "orderType":"LMT",
            "priceLimit":"12345.69", 
            "quantity":"1.23",
            "symbol":"ETC/BTC"
        }
    ]
}

Response Sample:

{
    "code":"1000",
    "msg":"success",
    "data":{
            "timestamp":"1500000000000",
            "result":[
                    {
                        "orderNo":"1612930403329875969",
                        "clientOrderId":"10000000001"
                    },
                    {
                        "orderNo":"1612930403329876214",
                        "clientOrderId":"10000000010"
                    },
                    ...
                    {
                        "orderNo":"1612930403329886537",
                        "clientOrderId":"10000000002"
                    }
                ]
            }
}
Description:

Place orders in batch up to 100 orders at a time and limited to the same trading pair and the same transaction type)

Endpoint Request Details:

/api/v1/order/batchPlace

Request Parameters:
Parameter Mandatory Description
symbol Yes Transaction Pair Symbol
priceLimit Yes Price Limit(String type)
orderType Yes Order Type MKT- "Market Price",LMT- "Limit Price"
action Yes Order Type (BUY/SELL)
quantity Yes Buy Quantity(String type).
amount Yes Amount(String type)
clientOrderId Yes Client Order ID (excluding special symbols, not repeating, length 10~50)
Response Parameters:
Parameter Description
timestamp Timestamp(ms)
result Return Result
orderNo Order Number
clientOrderId Corresponding to the clientOrderId in the request

5. Batch Cancellation of Orders

Request Sample:

{
    "common":{
        "accesskey" : "1900000109",            // Accesskey
        "timestamp": "1500000000000",            // Timestamp
        "sign":"sdfsdfa1231231sdfsdfsd"        // MD5 Signature
    },
    "data":{
        "orderNoList":"1612930403329875969,1612930403329875970"        //  Order Number
    }
}

Response Sample:

{
    "code":"1000",
    "msg":"success",
    "data":{
            "timestamp":"1500000000000",
            "result":{
                        "failResultList": [
                            {
                                "errMsg": "orderNo is invalid",
                                "orderNo": "1612930403329875969"
                            }
                        ],
                        "successNoList": ["1612930403329875970"]
                     }
            }
}
Description:

Cancel open orders in batch

Endpoint Request Details

/api/v1/order/batchCancel

Request Parameters:
Parameter Mandatory Description
orderNoList No Order Number List to Cancel
clientOrderIdList No clientOrderIdList (separated by comma, orderNoList and clientOrderIdList need and only need the input of one parameter)
Response Parameters:
Parameter Description
timestamp Timestamp (ms)
result Return Result
successNoList Order numbers that succeeded to cancel(responded when the parameter is orderNoList)
successIdList Client order Ids that succeeded to cancel(responded when the parameter is clientOrderIdList)
failResultList List of orders that failed to be withdrawn
orderNo orderNo that failed to cancel(responded when the parameter is orderNoList)
clientOrderId clientOrderId that failed to cancel(responded when the parameter is clientOrderIdList)
errMsg Description on reason for failure

Query

1. Personal Asset Information

Request Sample:

{
    "common":{
        "accesskey" : "1900000109",            // Accesskey
        "timestamp": "1500000000000",            // Timestamp
        "sign":"sdfsdfa1231231sdfsdfsd"        // MD5 Signature
    },
    "data":{

    }
}

Response Sample:

{
    "code":"1000",
    "msg":"success",
    "data":{

            "timestamp":"1500000000000",
            "result":{
                        "userNo":"12345",
                        "email":"demouser@demo.domain",
                        "asset":{
                                "USD":
                                    {
                                        "total":"123",
                                        "available": "12"
                                    },
                                "BTC": 
                                    {
                                        "total":"1234",
                                        "available": "123"
                                    }
                                ...
                             }
                    }
            }
}
Description:

Get your own personal asset information.

Endpoint Request Details

POST /api/v1/asset/userAssetInfo

Request Parameters:

Only common parameters must be included.

Response Parameters:
Parameter Description
userNo User's Account Number
email User Email
timestamp System Timestamp
result Return Results
total Total Balance
available Available Balance

2. Get Detailed Open Orders

Request Sample:

{
    "common":{
        "accesskey" : "1900000109",            // Accesskey
        "timestamp": "1500000000000",            // Timestamp
        "sign":"sdfsdfa1231231sdfsdfsd"        // MD5 Signature
    },
    "data":{
        "orderNoList":"1234123412,1234223452"  //  Order Number List
    }
}

Response Sample:

{
    "code":"1000",
    "msg":"success",
    "data":{
            "timestamp": "1500000000123",
            "result":[ 
                        {
                            "orderNo":"123412313",                 //Order Number
                            "action":"SELL",                     //Order Type
                            "orderType":"MKT",                   //Order Subtype  
                            "priceLimit":"0.00000000",           //Price Limit
                            "symbol":"ETC/BTC",                  //Trading Pair
                            "quantity" :"0.00010000",            //Order Quantity
                            "quantityRemaining":"0.00010000",    //Remaining Quantity
                            "amount":"0.00000000",               //Order Amount
                            "amountRemaining":"0.00000000",      //Remaining Amount
                            "fee":"0.00000000",                  //Transaction Fee
                            "utcUpdate":"1500000000000",           //Timestamp of Last Transaction
                            "utcCreate":"1500000000000",           //Timestamp of Order Creation
                            "state":"CANCEL"                  //Order Status
                        },
                        ...

                    ]
            }
}
Description:

Get a list of order information (maximum 50 at one time).

Endpoint Request Details

POST /api/v1/order/list

Request Parameters:
Parameter Mandatory Description
orderNoList Yes Pass in comma separated order numbers.
Response Parameters:
Parameter Description
timestamp Timestamp
result Results
orderNo Order Number
action Order Type (BUY/SELL)
orderType Order Sub-type MKT-Market Price, LMT-Limit Price
priceLimit Price Limit
state Order Status. UNDEAL: Not Executed,
PARTDEAL:Partially Executed,
DEAL:Order Complete,
CANCEL: Canceled,
PROCESSING: Cancellation processing
quantity Order Quantity
quantityRemaining Remaining Quantity
amount Order Amount
amountRemaining Remaining Amount
fee Transaction Fee (Please ignore. The fee and feeCurrency in the transaction details shall prevail. )
symbol Trading Pair
utcUpdate Timestamp of the Last Transaction
utcCreate Timestamp on Order Creation

3. Get Historical Orders(by orderNoList)

Request Sample:

{
    "common":{
        "accesskey" : "1900000109",            // Accesskey
        "timestamp": "1500000000",            // Timestamp
        "sign":"sdfsdfa1231231sdfsdfsd"        // MD5 Signature
    },
    "data":{
        "orderNoList":"1234123412,1234223452"  //  Order Number List
    }
}

Response Sample:

{
    "code":1000,
    "msg":"success",
    "data":{
            "timestamp": "1500000000",
            "result":[
                        { 
                            "orderNo":"213412341",                       //Order Number
                            "priceLimit": "0.00000000",                //Price Limit
                            "quantity": "1.00000000",                  //Order Quantity
                            "symbol":"ETC/BTC",                        //Trading Pair
                            "action":"SELL",                           //Order Type
                            "orderType":"MKT",                         //Order subtype
                            "quantityRemaining": "0.00000000",         //Quantity Remaining
                            "amount": "0.00000000",                    //Amount
                            "amountRemaining": "0.00000000",           //Amount Remaining
                            "state":"DEAL",                            //Order Status
                            "detail":[
                                        {
                                "matchType":"MAKER",        //Transaction Type
                                 "price": "0.00213640",        //Transaction Price
                                 "volume": "0.42220000",       //Transaction Volume
                                 "utcDeal":"123123412",        //Transaction Timestamp
                                 "fee":"0.01",                //fee
                                 "feeCurrency":"BTC"          //fee currency
                                        },
                                        ...
                                    ]    
                        }

                        ...
                    ]
            }
}
Description:

Get a list of order information up to 50 within 24 hours.

Endpoint Request Details

/api/v1/order/details

Request Parameters:
Parameter Mandatory Description
orderNoList Yes Pass in comma separated order
numbers. Maximum 50 at one
time.
Response Parameters:
Parameter Description
timestamp Timestamp
result Results
orderNo Order Number
priceLimit Price Limit
price Transaction Price
quantity Order Quantity
quantityRemaining Remaining Quantity
amount Order Amount
amountRemaining Remaining Amount
volume Volume of Transaction
action Order Type (Buy/Sell)
orderType Order Sub-type MKT-Market Price, LMT-Limit Price
fee Transaction Fee (The fee and feeCurrency
in the detail shall prevail. )
feeCurrency Transaction Fee Currency
state Order Status. UNDEAL: Not Executed,
PARTDEAL:Partially Executed,
DEAL:Order Complete,
CANCEL: Canceled
matchType Transaction Type:MAKER-Passive Match,
TAKER-Active Match
symbol Trading Pair
detail Detailed Transaction Information
utcDeal Timestamp of Transaction

4. Get Historical Orders(by clientOrderIdList)

Request Sample:

{
    "common":{
        "accesskey" : "1900000109",            
        "timestamp": "1500000000000",          
        "sign":"sdfsdfa1231231sdfsdfsd"        
    },
    "data":{
        "clientOrderIdList":"8075ab7b-9888-11e9-a2a3-2a2ae2dbcca4,1561605101081" 
    }
}

Response Sample:

{
    "code":"1000",
    "msg":"success",
    "data":{
        "timestamp":1500000000123,
        "result":[ 
            {
                "orderNo":"123412313",                  //Order Number
                "clientOrderId":"8075ab7b-9888-11e9-a2a3-2a2ae2dbcca4", //clientOrderId
                "action":"SELL",                        //Order Action  
                "orderType":"MKT",                      //Order Type  
                "priceLimit":"0.00000000",              //Price Limit
                "symbol":"ETC/BTC",                     //Trading Pair
                "quantity" :"0.00010000",               //Order Quantity
                "quantityRemaining":"0.00010000",       //Remaining Quantity
                "amount":"0.00000000",                  //Order Amount
                "amountRemaining":"0.00000000",         //Remaining Amount
                "fee":"0.00000000",                     //Transaction Fee(Please ignore. The fee and feeCurrency in the transaction details shall prevail. )
                "utcUpdate":"1500000000000",            //Timestamp of Last Transaction
                "utcCreate":"1500000000000",            //Timestamp of Order Creation
                "state":"CANCEL"                        //Order Status
            },
            ...
        ]
  }
}
Description:

Get a list of order information up to 50 within 24 hours.

Endpoint Request Details:

POST /api/v1/order/clList

Request Parameters:
Parameter Mandatory Description
clientOrderIdList Yes Pass in comma separated order
numbers. Maximum 50 at one
time.
Response Parameters:
Parameter Description
timestamp Timestamp (ms)
result Return Result
orderNo Order No.
clientOrderId clientOrderId from request paremeter
action Order Type SELL-Sell/BUY-Buy
orderType Order Sub-type MKT-Market Price,
LMT-Limit Price
priceLimit Price Limit
state Order State. UNDEAL: Not Executed,
PARTDEAL: Partially Executed,
DEAL: Order Complete,
CANCEL: Cancelled
PROCESSING: Cancellation processing
quantity Order Quantity
quantityRemaining Remaining Quantity
amount Order Amount
amountRemaining Remaining Amount
fee Transaction Fee (The fee and feeCurrency
in the detail shall prevail. )
symbol Trading Pair
utcUpdate Timestamp of the Last Transaction (ms)
utcCreate Timestamp on Order Creation (ms)

5. List open Orders

Request Sample:

{
    "common":{
        "accesskey" : "1900000109", // Access Key
        "timestamp": "1500000000000", // Timestamp
        "sign":"sdfsdfa1231231sdfsdfsd" // MD5 Signature
    },
    "data":{
        "symbol":"ETC/BTC", // Trading Pair
        "num":"1000" // Number of Results
    }
}

Response Sample:

{
    "code":"1000",
    "msg":"success",
    "data":{
            "timestamp":"1500000000000",
            "result":[
                  "1603147161792831491",
                  "1603147093327106049",
                  "1603147072028430337",
                  ...
             ]
    }
}
Description:

List your current open orders (up to 1000).

Endpoint Request Details

POST /api/v1/order/openList

Request Parameters:
Parameter Mandatory Description
symbol No Trading Pair (Queries all Trading Pairs if unfilled)
num Yes Number of results to return (Max 1000)
Response Parameters:
Parameter Description
timestamp Timestamp
result Results, List of order IDs

6. Get Order History

Request Sample:

{
    "common":{
        "accesskey" : "1900000109",            // Accesskey
        "timestamp": "1500000000000",            // Timestamp
        "sign":"sdfsdfa1231231sdfsdfsd"        // MDS Signature
    },
    "data":{
        "symbol":"ETC/BTC",                    //  Trading Pair
        "utcStart":"1536818874583",            //  Query Start Time
        "utcEnd":"1536905274583",            //  Query End Time
        "withTrade":"true"  //  Return the Transaction Details of Corresponding Orders or Not?
    }
}

Response Sample:

{
    "code":"1000",
    "msg":"success",
    "data":{
            "timestamp":1500000000123,
            "result":[ 
                        {
                            "orderNo":"123412313",                 //Order Number
                            "action":"SELL",                     //Order Type  
                            "orderType":"MKT",                   //Order Sub-type
                            "priceAverage": "0.00000000",
                            "priceLimit":"0.00000000",           //Price Limit
                            "symbol":"ETC/BTC",                  //Trading Pair
                            "quantity" :"0.00010000",            //Order Quantity 
                            "quantityRemaining":"0.00010000",    //Remaining Quantity
                            "amount":"0.00000000",               //Order Amount
                            "amountRemaining":"0.00000000",      //Remaining Amount
                            "fee":"0.00000000",                  //Transaction Fee
                            "utcUpdate":"1500000000000",     //Time of Last Transaction 
                            "utcCreate":"1500000000000",      //Time of Order Creation
                            "state":"CANCEL",                  //Order State
                            "detail": [
                                  {
                                      "dealNo": "234234114241",
                                      "matchType": "ACTIVE",
                                      "price": "0.00001000",
                                      "utcDeal": "1500000000000",
                                      "volume": "1.4266",
                                      "fee":"0.01",
                                      "feeCurrency":"BTC"
                                  },
                                  {
                                      "dealNo": "24234212312",
                                      "matchType": "PASSIVE",
                                      "price": "0.00001000",
                                      "utcDeal": "1500000000000",
                                      "volume": "0.00001000",
                                      "fee":"0.01",
                                      "feeCurrency":"BTC"
                                  }
                              ],
                        },
                        ...

                    ]
            }
}
Description:

Request Personal Order History

Endpoint Request Details

POST /api/v1/order/history

Request Parameters:
Parameter Mandatory Description
symbol Yes Trading Pair
utcStart Yes Query Start Time (≤ order creation
time in the results, timestamps in
ms. utcStart and utcEnd span shall
not exceed one week. If you intend
to query the data one week before,
please subtract the corresponding
time from utcStart and utcEnd at
the same time.)
utcEnd Yes Query End Time ( ≥ order creation
time in the results, timestamps in
ms. utcStart and utcEnd span shall
not exceed one week. If you intend
to query the data one week before,
please subtract the corresponding
time from utcStart and utcEnd at
the same time.)
startOrderNo NO Start Order Number (Its data are
excluded from the query results.
If it is not passed, the first page
of data will be queried. )
withTrade NO Return the Transaction Details of
Corresponding Orders or Not (
true-Return, false-Not Return
(in lower case))
size NO Number of Results (limited to
1-100)
Response Parameters:
Parameter Description
timestamp Timestamp (ms)
result Return Result
orderNo Order No.
action Order Type SELL-Sell/BUY-Buy
orderType Order Sub-type MKT-Market Price,
LMT-Limit Price
priceLimit Price Limit
priceAverage Average Transaction Price
state Order State. UNDEAL: Not Executed,
PARTDEAL: Partially Executed,
DEAL: Order Complete,CANCEL: Cancelled
quantity Order Quantity
quantityRemaining Remaining Quantity
amount Order Amount
amountRemaining Remaining Amount
fee Transaction Fee (The fee and feeCurrency
in the detail shall prevail. )
feeCurrency Transaction Fee Currency
symbol Trading Pair
utcUpdate Timestamp of the Last Transaction (ms)
utcCreate Timestamp on Order Creation (ms)
detail Transaction Details
matchType Transaction Type: PASSIVE-Passive Match,
ACTIVE-Active Match
dealNo Transaction Number
volume Transaction Volume
price Transaction Price
utcDeal Transaction Timestamp (ms)

7. Get Match History

Request Sample:

{
    "common":{
        "accesskey" : "1900000109",            // Accesskey
        "timestamp": "1500000000000",            // Timestamp
        "sign":"sdfsdfa1231231sdfsdfsd"        // MDS Signature
    },
    "data":{
        "symbol":"BTC/USD",                    //  Trading Pair
        "utcStart":"1536818874583",            //  Query Start Time
        "utcEnd":"1536905274583",            //  Query End Time
        "withTrade":"true" //  Return the Transaction Details of Corresponding Orders or Not?
    }
}

Response Sample:

{
    "code":"1000",
    "msg":"success",
    "data":{
            "timestamp": "1500000000",
            "result":[ 
                        {
                          "dealNo":"12312312312312",    //Transaction Number
                          "symbol": "BTC/USD",          //Trading Pair
                          "matchType":"PASSIVE",        //Transaction Type
                          "orderNo":"32423412412",      //Order Number
                          "orderType":"MKT",            //Transaction Type
                          "action":"SELL",              //Order Type
                          "price": "0.00213640",        //Transaction Price
                          "volume": "0.42220000",       //Transaction Volume
                          "utcDeal": "123123412",       //Transaction Time
                          "fee":"0.01",                //fee
                          "feeCurrency":"USD"           //fee currency
                        },
                        ...

                    ]
            }
}
Description:

Get Personal Trading History

Endpoint Request Details

POST /api/v1/order/tradeHistory

Request Parameters:
FieldName Mandatory Description
symbol NO Trading Pair
utcStart Yes Query Start Time (≤ trade time in the
results, timestamps in ms. utcStart
and utcEnd span shall not exceed one
week. If you intend to query the data
one week before, please subtract the
corresponding time from utcStart and
utcEnd at the same time.)
utcEnd Yes Query End Time ( ≥ trade time in the
results, timestamps in ms. utcStart
and utcEnd span shall not exceed
one week. If you intend to query
the data one week before, please
subtract the corresponding time
from utcStart and utcEnd at the
same time.)
startDealNo NO Start Transaction Number (Its data
are excluded from the query results.
If it is not passed, the first page of
data will be queried.)
size NO Number of Results(limited to 1-100)
(When the last result has the same
order number as the size+1 result,
return the size+1 result and show
size+1 results)
Response Parameters:
Parameter Description
timestamp Timestamp (ms)
result Return Result
orderNo Order Number
action Order Type SELL-Sell/BUY-Buy
orderType Order Sub-type MKT-Market Price,
LMT-Limit Price
symbol Trading Pair
matchType Transaction Type: PASSIVE-Passive
Match, ACTIVE-Active Match
dealNo Transaction Number
volume Transaction Volume
price Transaction Price
fee Transaction Fee
feeCurrency Transaction Fee Currency
utcDeal Transaction Timestamp (ms)

8. Pairs List

Request Sample:

{
    "common":{
        "accesskey" : "1900000109",            // Access Key
        "timestamp": "1500000000000",            // Timestamp
        "sign":"sdfsdfa1231231sdfsdfsd"        // MD5 Signature
    },
  "data":{

  }
}

Response Sample:

{
    "code":"1000",
    "msg":"success",
    "data":{
            "timestamp":"1500000000000",
            "result":[
                {
                  "symbol": "BTC/USD",              //Trading Pair
                  "quantityMin": "0.00100000000",       //Minimum Transaction Quantity
                  "quantityMax": "5000.00000000000",        //Maximum Transaction Quantity
                  "priceMin": "0.00100000000",          //Minimum Transaction Amount
                  "priceMax": "9999.00000000000",       //Maximum Transaction Amount
                  "deviationRatio": "0.3",      //Maximum Deviation Ratio in Transaction Price
                  "quantityScale": "4",         //quantity precision of placing an order
                  "amountScale": "2",           //amount precision of placing an order
                  "priceScale": "2"             //price precision of placing an order
                },
                {
                  "symbol": "ETH/BTC",              //Trading Pair
                  "quantityMin": "0.00001000000",       //Minimum Transaction Quantity
                  "quantityMax": "8000.00000000000",        //Maximum Transaction Quantity
                  "priceMin": "0.00001000000",          //Minimum Transaction Amount
                  "priceMax": "8000.00000000000",       //Maximum Transaction Amount
                  "deviationRatio": "0.3",      //Maximum Deviation Ration in Transaction Price
                  "quantityScale": "4",         //quantity precision of placing an order
                  "amountScale": "8",           //amount precision of placing an order
                  "priceScale": "8"             //price precision of placing an order
                },
                  ...
             ]
    }
}
Description:

Get a list of available currency pairs for trading.

Endpoint Request Details

POST /api/v1/market/symbolList

Request Parameters:

Only uses common parameters.

Response Parameters:
Parameter Description
timestamp Timestamp
result Results
symbol Trading Pair
quantityMin Minimum Transaction Quantity(e.g.The
quantityMin of "BTC/USD" is the minimum
quantity of BTC)
quantityMax Maximum Transaction Quantity(e.g.The
quantityMax of "BTC/USD" is the maximum
quantity of BTC)
priceMin Minimum Transaction Amount(e.g.The
priceMin of "BTC/USD" is the minimum
amount of USD)
priceMax Maximum Transaction Amount(e.g.The
priceMax of "BTC/USD" is the maximum
amount of USD)
deviationRatio Maximum Deviation Ratio in Transaction
Price ((Calculation method of price range
is as follows: Maximum=(1+deviationRatio)x
latest transaction price; minimum=
(1-deviationRatio)xlatest transaction price.
Specifically, the latest transaction price
comes from the price of the first data
of /api/v1/market/tickers interface, and
deviationRatio comes from
/api/v1/market/symboList interface)
quantityScale Quantity precision of placing an order
(maximum number of decimal places)
amountScale Amount precision of placing an order
(maximum number of decimal places)
priceScale Price precision of placing an order
(maximum number of decimal places)

FIX API

1. General Information

API Access Address

Index API Access Address Description
1 apifix.coinsuper.info Active

API Specifications

POST Body Format

Parameter Details

  1. Parameter Descriptions:
      1.1 Request Parameters:
      Client-side fixed parameters:
      BeginString=FIX.4.4
      TargetCompID=COINSUPER
      HeartBtInt=30
      1.2 Response Parameters:
    For specific responses, please refer to the following API list. Please refer to the provided table to find out what exception has occurred.

  2. Quotation accuracy:
      Please see the scales response from symbolList endpoint.

  3. Signature:
      All requests must contain a valid signature. The signature generation method is detailed below.

  4. Other market data may be acquired through the REST API or WebSocket API.

  5. Logon messages shall be delivered before a request is sent.

Logon Signature Generation Method

Our API requires a signature to be generated, to verify that information has not been tampered with or falsified by bad actors. Therefore, the generation method of sign strings shall be defined.

a. During logon requests, sort the parameters, such as SendingTime, MsgType, MsgSeqNum, SenderCompID, TargetCompID, $secretKey, according to the parameter name (small to large), connect them with "," and then combine the MD5 encrypted signature to generate sign.

b. During logon requests, the required parameters include SendingTime, MsgType, MsgSeqNum, SenderCompID and TargetCompID.

c. During logon requests, please do not send $secretKey to secure the accounts.

d. During logon requests, "sign" shall be added as RawData to the Logon message, with words in lower case.

Get API Access

Signature Generation Sample

Let us suppose there is a request with these parameters, among which,
$accesskey : zhangsan,
$secretkey : zhangsan,
TargetCompID : SERVERTARGET

Logon Request Parameters:
"MsgSeqNum" -> "1"
"MsgType" -> "A"
"SenderCompID" -> "zhangsan"
"SendingTime" -> "20181228-13:08:08.091"
"TargetCompID" -> "SERVERTARGET"

i: The sorted pre-encryption signature string then is:
1,A,zhangsan,20181228-13:26:54.497,SERVERTARGET,zhangsan

ii: Finally, we encrypt the raw signature string and assign it to signValue. This will be the "sign" for the actual request body.
signValue = md5(string)

Complete Request Body:
8=FIX.4.49=11735=A34=149=zhangsan52=20181228-13:26:54.49756=SERVERTARGET95=3296=74c544ec967aae34fe84a30bae59520798=0108=3010=188

FIX is requesting a standard message header.

Hint: every request of the interface must convey the correspondent parameters of the message. The definitions of interfaces and exemples of requests are listed as follows that may help to understand specific operation methods.

Field Name Field code Mandatory Discription
BeginString 8 Yes The version of FIX
Protocol (Fixed
value: FIX. 4.4)
BodyLength 9 Yes As to the length of any
message, the number
of bytes should be
stably controlled at
the second field of
the whole message
(unencrypted).
MsgType 35 Yes The type of request
message.
MsgSeqNum 34 Yes The series number
of the integral
message (int
message).
SenderCompID 49 Yes $accesskey, acquired
via API activation.
SendingTime 52 Yes Request on sending
the time (UTC time).
TargetCompID 56 Yes The signal of server,
please read the
[login signature
discription] above
for references.

General Exceptions

Exception Description
user not exist! Wrong TargetCompID
has no authentication There is no corresponding API access
request too frequently Requests exceed the threshold
SendingTime accuracy problem Client UTC time does not match
server UTC time (Please compare
it to UTC)
system internal error system internal error

2. API Endpoint Details

1. Session Type

1.1 Logon

Request Sample:

8=FIX.4.49=11435=A34=249=zhangsan52=20190102-03:41:14.32956=COINSUPER95=3296=6cc719376923d980cbb5c882191d4e2898=0108=3010=058

Response Sample:

8=FIX.4.49=7235=A34=449=COINSUPER52=20190102-03:41:14.46156=zhangsan98=0108=3010=011

Description:

Logon Request (Keep-alive connection sessions are created upon successful logons, and other requests depend on successful logons)

Request MsgType:

Logon(A)

API Request Parameters:

Parameter Field Code Mandatory Description
SendingTime 52 Yes Request delivery time
(UTC time)
MsgType 35 Yes Message type
MsgSeqNum 34 Yes Message sequence
number
SenderCompID 49 Yes API user accessKey
TargetCompID 56 Yes For fixed parameters,
please refer to values
as described in the
above mentioned
[parameter details].
RawData 96 Yes Logon parameter
signature (for valid
signatures, please
refer to the above
mentioned [Logon
Signature Generation
Method]

Response MsgType:

Logon(A)

Response Parameters:

Parameter Field Code Description
ClOrdID 11 User's Account Number
OrderID 37 User's e-mail address
ExecType 150 System timestamp (Milliseconds)
OrdStatus 39 Return results
TransactTime 60 Total balance

1.2 Logout

Request Sample:

8=FIX.4.49=11435=534=249=zhangsan52=20190102-03:41:14.32956=COINSUPER95=3296=6cc719376923d980cbb5c882191d4e2898=0108=3010=058

Response Sample:

8=FIX.4.49=7235=534=449=COINSUPER52=20190102-03:41:14.46156=zhangsan98=0108=3010=011

Description:

Upon initiation of Logout request, the keep-alive connection session will be closed.

Request MsgType:

Logout(5)

API Request Parameters:

None

Response MsgType:

Logout(5)

Response Parameters:

None


1.3 Heartbeat

Request Sample:

8=FIX.4.49=6035=034=349=zhangsan52=20190102-07:31:01.57256=COINSUPER10=223

Response Sample:

8=FIX.4.49=6235=034=46349=COINSUPER52=20190102-07:31:01.69056=zhangsan10=076

Description:

Heartbeat requests are delivered for a fixed time, which aims to maintain keep-alive connection sessions.

Request MsgType:

Heartbeat(0)

API Request Parameters:

None

Response MsgType:

Heartbeat(0)

Response Parameters:

None


2. Transaction Type

2.1 Order Creation

Request Sample:

8=FIX.4.49=16735=D34=3249=zhangsan52=20190104-10:08:43.31456=COINSUPER11=ord000138=0.340=244=450054=255=BTC/USD60=20190104-18:08:43.308152=010=091

Response Sample:

8=FIX.4.49=22335=834=18349=COINSUPER52=20190104-10:08:42.34256=zhangsan6=014=017=a0cbfd23455e4b6faaacbe5fb36caf9920=037=162172399493790924939=054=255=BTC/USD60=20190104-18:08:42.341150=0151=0.310=036

Description:

Transaction Order Creation Request

Request MsgType:

NewOrderSingle(D)

API Request Parameters:

Parameter Field Code Mandatory Description
ClOrdID 11 Yes Customized order ID from
the client-side (cannot
repeat)
Symbol 55 Yes Trading pairs
Price 44 Yes Trading price limit (which is
exclusive for price limit
orders, and the market
price should be 0)
Side 54 Yes Purchase and sales type
(Buy (1)= place a buy
order, SELL (2)=place a
sell order)
OrdType 40 Yes Order type (MARKET (1)
=market price, and
LIMIT (2) = limit price)
OrderQty 38 Yes Quantity of target tokens
(used for purchases and
sales at limit prices or
salesat market prices.
Please input "0" for
purchases at market
prices)
CashOrderQty 152 Yes Quantity of valued tokens
(used for purchases at
market prices. Please
input "0" in case of
purchases and sales
at limit prices or sales
at market prices)
TransactTime 60 Yes Request time (UTC time)

Response MsgType:

ExecutionReport(8)

Response Parameters:

Parameter Field Code Description
ClOrdID 11 Customized order ID from
the client-side
OrderID 37 Order ID generated from
the server-side
ExecType 150 Execution results (fixed as
NEW)
OrdStatus 39 Order status (fixed as NEW)
TransactTime 60 Delivery time of response
messages (UTC time)
Exception Description
symbol not trading Trading pairs are not available for
trading
order amount or quantity less than min setting The trading quantity/amount is lower
than the minimum requirement
price out of range The price exceeds the range
action not support It does not support such transaction type
order type not support It does not support such order type
user account forbidden The account is forbidden from trading
balance not enough The balance is insufficient

2.2 Order Cancellation

Request Sample:

8=FIX.4.49=11235=F34=6549=zhangsan52=20190104-09:40:25.49556=COINSUPER37=162172076101837209710=112

Response Sample:

8=FIX.4.49=15435=834=12749=COINSUPER52=20190104-09:40:24.38956=zhangsan20=137=162172076101837209739=460=20190104-17:40:24.389150=410=041

Description:

Transaction Order Cancellation Requests

Request MsgType:

OrderCancelRequest(F)

API Request Parameters:

Parameter Field Code Mandatory Description
OrderID 37 Yes Order ID generated from the server-side
ClOrdID 11 Yes Customized order ID from the client-side

Response MsgType:

ExecutionReport(8)

Response Parameters:

Parameter Field Code Description
OrderID 37 Order ID generated from the server-side
ExecType 150 Execution results (order cancellation
in progress: PENDING_CANCEL)
OrdStatus 39 Order status (order cancellation in
progress: PENDING_CANCEL)
TransactTime 60 Delivery time of response messages
(UTC time)
Exception Description
order no not exist There exists no unfinished order
order has canceled The order has been canceled
order has execute The order has been completed

2.3 Transaction Message

Response Sample:

8=FIX.4.49=24735=834=40449=COINSUPER52=20190402-11:24:46.89056=pkucestestkey6=123.5711=925418490717412=0.00214=117=05bbb56b8c074ab1aa07e970404c95e432=137=162970131356271001739=244=123.5754=155=ETH/USD60=20190402-19:24:46.890150=F151=0479=ETH10=177

Description:

When an order has a transaction (partially filled and totally filled), a message will be sent to the client to return the transaction data. This is completely initiated by the system, and the client only needs to receive passively.

Response MsgType:

ExecutionReport(8)

Response Parameters:

Parameter Field Code Description
OrderID 37 Order ID generated by the server
ClOrdID 11 selected by client to identify the order
Side 54 Order type (1-Buy,2-Sell)
ExecType 150 Response type (F-transaction)
OrdStatus 39 Order Status (1-Partially filled,
2-totally filled)
AvgPx 6 Average price of the order
CumQty 14 Executed quantity of the order
LeavesQty 151 The remaining quantity (CumQty
+LeavesQty=Total quantity of the
order)
Symbol 55 Pair
Price 44 Executed price of this transaction
LastQty 32 Executed quantity of this transaction
Commission 12 Fees of this transaction
CommCurrency 479 Fees currency of this transaction
TransactTime 60 Response time (UTC)

3. Query Type

3.1 Queries into Unfinished Orders

Request Sample:

8=FIX.4.49=11235=H34=1849=zhangsan52=20190104-10:01:52.86256=COINSUPER37=162172183852353945710=111

Response Sample:

8=FIX.4.49=22335=834=16949=COINSUPER52=20190104-10:01:51.70456=dba8ef1f-6e3f-43ed-ae67-0668c3e933636=014=017=37e01f58367948fdaedf8dace2ea62ff20=337=162172183852353945739=A54=255=BTC/USD60=20190104-18:01:51.704150=I151=0.210=199

Description:

Queries are made into partially executed and in-progress orders

Request MsgType:

OrderStatusRequest(H)

API Request Parameters:

Parameter Field Code Mandatory Description
OrderID 37 Yes Order ID generated from the server-side (* indicates that queries are made into the latest 20 order entries)
ClOrdID 11 Yes Customized order ID from the client-side

Response MsgType:

ExecutionReport(8)

Response Parameters:

Parameter Field Code Description
OrderID 37 Order ID generated from the server-side
Side 54 Purchase and sales type (Buy (1)= place
a buy order, SELL (2)=place a sell order)
ExecType 150 Execution results (ORDER_STATUS)
OrdStatus 39 Order status (PENDING_NEW/
PARTIALLY_FILLED)
AvgPx 6 Average transaction price per order
CumQty 14 Quantity of completed transactions
LeavesQty 151 Quantity of remaining unfinished
transactions (CumQty+LeavesQty=
total order quantity)
Symbol 55 Trading pairs
TransactTime 60 Delivery time of response messages
(UTC time)
Exception Description
order no not exist There exists no unfinished order

WebSocket API

1. General Information

API Information

WebSocket Connection Instructions

1.Public Quote Topic Parameters

1. Base endpoint server name and port:

Index host port isSSL Description
1 apimqtt.coinsuper.info 1883 false mqtt server name
and port
2 apiwss.coinsuper.info 443 true javascript WebSocket
server name and port

2. Client Signature:
  Each message will have a unique signature. You must follow the rules below in order to obtain any data from this WebSocket feed.
  Signature generation method:clientId = md5(access_key) + md5(email) + md5(topic)
  That is to say, the signature is the spliced combination of the lowercase md5 hashes of the user's access key, user's email address and query topic without separator.
3. userName:
  api_subscriber
4. userCode:
  da65be18f44b33b69603c39fd03ddf49
5. Topic:
  topic=$env$subTopic
  Where the $env=exchange_ha_prod_hk,"$subTopic"s are described below.

2. Private Data Topic Parameters

1. Base endpoint server name and port:

Index host port isSSL Description
1 apimqtt.coinsuper.info 1883 false mqtt server name
and port
2 apiwss.coinsuper.info 443 true javascript WebSocket
server name and port

2. Client ID:
  clientId = $access_key

3. userName:   userName = api_private   ("api_private" is a fixed value) 4. userCode:   userCode=$email+","+$timeStamp+","+$sign
5. Topic:
  topic=$env$subTopic
  Where the $env=exchange_ha_prod_hk,"$subTopic"s are described below.


2. WebSocket API Details

API Function Definitions

1.Quotes

1.1 Latest Order Book Data

Topic Sample:

exchange_ha_prod_hk/api/ws/v1/market/orderBook/BTC_USD/0.01

Data Sample:

{"asks":[{"amount":"349.76","limitPrice":"6674.89","quantity":"0.0524"},{"amount":"1601.32","limitPrice":"6674.96","quantity":"0.2399"},{"amount":"1744.18","limitPrice":"6675.02","quantity":"0.2613"},{"amount":"3495.73","limitPrice":"6675.08","quantity":"0.5237"},{"amount":"1987.85","limitPrice":"6675.13","quantity":"0.2978"},{"amount":"1614.04","limitPrice":"6675.14","quantity":"0.2418"},{"amount":"556.03","limitPrice":"6675.15","quantity":"0.0833"},{"amount":"3542.57","limitPrice":"6675.29","quantity":"0.5307"},{"amount":"1948.53","limitPrice":"6675.34","quantity":"0.2919"},{"amount":"1073.40","limitPrice":"6675.39","quantity":"0.1608"},{"amount":"1230.94","limitPrice":"6675.40","quantity":"0.1844"},{"amount":"1293.70","limitPrice":"6675.47","quantity":"0.1938"},{"amount":"1696.24","limitPrice":"6675.50","quantity":"0.2541"},{"amount":"1169.55","limitPrice":"6675.52","quantity":"0.1752"},{"amount":"658.87","limitPrice":"6675.55","quantity":"0.0987"}],"bids":[{"amount":"5666.70","limitPrice":"6674.56","quantity":"0.8490"},{"amount":"817.97","limitPrice":"6617.89","quantity":"0.1236"},{"amount":"336.18","limitPrice":"6617.84","quantity":"0.0508"},{"amount":"1715.64","limitPrice":"6616.43","quantity":"0.2593"},{"amount":"1926.69","limitPrice":"6616.40","quantity":"0.2912"},{"amount":"1663.90","limitPrice":"6615.92","quantity":"0.2515"},{"amount":"1404.30","limitPrice":"6614.73","quantity":"0.2123"},{"amount":"448.47","limitPrice":"6614.69","quantity":"0.0678"},{"amount":"1738.04","limitPrice":"6613.57","quantity":"0.2628"},{"amount":"945.71","limitPrice":"6613.39","quantity":"0.1430"},{"amount":"1605.04","limitPrice":"6613.28","quantity":"0.2427"},{"amount":"942.30","limitPrice":"6612.69","quantity":"0.1425"},{"amount":"1768.89","limitPrice":"6612.68","quantity":"0.2675"},{"amount":"840.35","limitPrice":"6611.76","quantity":"0.1271"},{"amount":"1350.11","limitPrice":"6611.72","quantity":"0.2042"}],"limitSize":15,"step":"0.01","symbol":"BTC/USD","timestamp":1532686075803}

Description:

Connect to the order book data stream. (Shows last 15 orders)

Topic:

$env/api/ws/v1/market/orderBook/$topicSymbol/$step

Push frequency:

1 per 1-2 Seconds

Topic Parameters:

Name Mandatory Description
topicSymbol Yes Currency Pair
step Yes Aggregation Depth(For fiat,
this value should be: 1.0,
0.1,0.01;For crypto, this
value should be:0.0001,
0.000001,0.00000001)

Data Parameters:

Name Description
symbol Currency Pair
step Depth
timestamp Timestamp (Milliseconds)
limitSize Maximum Push Orders
asks Ask Data (JSON Array)
bids Bid Data (JSON Array)
limitPrice Price Limit. Note: Please refer to
symbolList interface for price
accuracy of trading pairs.
quantity Quantity. Note: Please refer to
symbolList interface for quantity
accuracy of trading pairs.
amount This field will be removed. Please ignore it.

1.2 Latest Kline Data

Topic Sample:

exchange_ha_prod_hk/api/ws/v1/market/kline/BTC_USD/60000

Data Sample:

{"symbol":"BTC/USD","first":"6616.40","last":"6616.45","max":"6616.48","min":"6616.40","quantity":"31.76239814","timestamp":1532686140000}

Description:

Contains between 1 minute to 1 month of Kline data, returned as a single data point per push.

Topic:

$env/api/ws/v1/market/kline/$topicSymbol/$range

Push frequency:

1 per 1-2 Seconds

Topic Parameters:

Name Mandatory Description
topicSymbol Yes Currency Pair
range Yes Kline Duration (1 Minute:60000,
5 Minutes:300000,15 Minutes:900000,
30 Minutes:1800000,1 Hour:3600000,
2 Hours:7200000,4 Hours:14400000,
6 Hours:21600000,12 Hours:43200000,
1 Day:86400000,1 Month:604800000)

Data Parameters:

Name Description
symbol Currency Pair
range Kline Duration
timestamp Timestamp (Milliseconds)
quantity Trade Volume
max Highest Price
min Lowest Price
first Opening Price
last Closing Price

1.3 Real Time Transaction Data

Topic Sample:

exchange_ha_prod_hk/api/ws/v1/market/tickers/BTC_USD

Data Sample:

[{"symbol":"BTC/USD","price":"6089.34","quantity":"0.4337","action":"BUY","timestamp":1532623321348},{"symbol":"BTC/USD","price":"6088.84","quantity":"0.0010","action":"BUY","timestamp":1532607467417},{"symbol":"BTC/USD","price":"6088.84","quantity":"0.2197","action":"SELL","timestamp":1532606712073},{"symbol":"BTC/USD","price":"6311.06","quantity":"0.1760","action":"BUY","timestamp":1532590562930},{"symbol":"BTC/USD","price":"6311.06","quantity":"0.0010","action":"SELL","timestamp":1532590547420},{"symbol":"BTC/USD","price":"6311.50","quantity":"0.8951","action":"SELL","timestamp":1532587958810},{"symbol":"BTC/USD","price":"6314.70","quantity":"0.0158","action":"SELL","timestamp":1532398791628},{"symbol":"BTC/USD","price":"6674.89","quantity":"0.0008","action":"SELL","timestamp":1532090050033},{"symbol":"BTC/USD","price":"6674.89","quantity":"0.0801","action":"SELL","timestamp":1531987659236},{"symbol":"BTC/USD","price":"6674.87","quantity":"0.2954","action":"SELL","timestamp":1531987655248},{"symbol":"BTC/USD","price":"6674.85","quantity":"0.1632","action":"SELL","timestamp":1531987653252},{"symbol":"BTC/USD","price":"6674.83","quantity":"0.1153","action":"SELL","timestamp":1531987651953},{"symbol":"BTC/USD","price":"6674.80","quantity":"0.2112","action":"SELL","timestamp":1531987651001},{"symbol":"BTC/USD","price":"6674.74","quantity":"0.2580","action":"SELL","timestamp":1531987646413},{"symbol":"BTC/USD","price":"6674.72","quantity":"0.1417","action":"SELL","timestamp":1531987643644},{"symbol":"BTC/USD","price":"6674.67","quantity":"0.2332","action":"SELL","timestamp":1531987642840},{"symbol":"BTC/USD","price":"6674.61","quantity":"0.1909","action":"BUY","timestamp":1531987599048},{"symbol":"BTC/USD","price":"6674.56","quantity":"0.1510","action":"BUY","timestamp":1531987571826},{"symbol":"BTC/USD","price":"6674.56","quantity":"0.0946","action":"BUY","timestamp":1531118165770},{"symbol":"BTC/USD","price":"6674.49","quantity":"0.1612","action":"BUY","timestamp":1531118165685}]

Description:

Request the latest transaction data (up to 50 entries)

Topic:

$env/api/ws/v1/market/tickers/$topicSymbol

Push frequency:

1 per 1-2 Seconds

Topic Parameters:

Name Mandatory Description
topicSymbol Yes Currency Pair

Data Parameters:

Name Description
symbol Currency Pair
timestamp Timestamp (Milliseconds)
quantity Quantity
price Price
action Transaction Direction BUY-Buy,SELL-Sell

2. Private Data

2.1 Change of Asset in User Account

Data Parameters:

exchange_ha_prod_hk/api/ws/personal/v1/asset/change/demouser@demo.domain

Data Sample:

{"asset":[{"available":0.738763122563248000000000000000,"currency":"BTC","total":1.306763122563248000000000000000,"utcUpdate":1542786801575},{"available":3226.058257880000000000000000000000,"currency":"USD","total":3226.058257880000000000000000000000,"utcUpdate":1542786801518}],"email":"demouser@demo.domain","timestamp":1542786802283,"userNo":"1600000000000000000"}

Description:

Connect to asset data after change of account info. In order to ensure the security of funds information, the asset change push interface needs to be approved after the official API technology group application is approved. (Please note: omission or duplication of "Push" data may occur under this topic)

Topic:

$env/api/ws/personal/v1/asset/change/$email

Topic Parameters:

Name Mandatory Description
email Yes User Account Email Address

Data Parameters:

Name Description
userNo User Number ID
email User Account Email Address
total Total Balance
available Available Balance
currency Asset Type
utcUpdate Time Of Update
timestamp Time Of Query

2.2 Change of Order Status

Topic Sample:

exchange_ha_prod_hk/ws/personal/v1/order/change/demouser@demo.domain

Data Sample:

{"action":"SELL","amount":"0.00000000","amountRemaining":"0.00000000","fee":"0.00000000","orderNo":"1616391691960328193","orderType":"MKT","priceAverage":"1234.56000000","priceLimit":"1234.56000000","quantity":"100.00000000","quantityRemaining":"99.97894000","state":"CANCEL","symbol":"ETC/BTC","utcCreate":"1541511242411","utcUpdate":"1541511806925"}

Description:

Connect to the data of order status changes (currently only connectable to pushes of order creation and order withdrawal. Please note: omission or duplication of "Push" data may occur under this topic)

Topic:

$env/api/ws/personal/v1/order/change/$email

Topic Parameters:

Name Mandatory Description
email Yes User Account Email Address

Data Parameters:

Name Description
symbol Transaction Pair
orderNo Transaction Pair
quantity Order Quantity
quantityRemaining Remaining Quantity
priceLimit Order Price
action Order Type SELL-Sell, BUY-Buy
priceAverage Average Transaction Price
amount Order Amount
amountRemaining Remaining Amount
fee Transaction Fee ( Please ignore. The fee
and feeCurrency in the transaction
details shall prevail.)
state Order Status NEW: CreatedCANCEL:
Cancelled
utcCreate Time Of Create
utcUpdate Time Of Update

2.3 Change of Order Transaction

Topic Sample:

exchange_ha_prod_hk/ws/personal/v1/trade/change/demouser@demo.domain

Data Sample:

{"action":"BUY","dealNo":"1616392748072460289","fee":"0.30000000","feeCurrency":"ETC","matchType":"TAKER","orderNo":"1616392747273428993","orderType":"MKT","price":"1234.56000000","quantity":"0.00081000","symbol":"ETC/BTC","utcDeal":"1541512249094"}

Description:

Connect to transaction data(Please note: omission or duplication of "Push" data may occur under this topic)

Topic:

$env/api/ws/personal/v1/trade/change/$email

Topic Parameters:

Name Mandatory Description
email Yes User Account Email Address

Data Parameters:

Name Description
dealNo Transaction Number ID
orderNo Order Number ID
orderType Order Sub-type MKT-Market Price,
LMT-Limit Price
symbol Transaction Pair
matchType Transaction Type: MAKER-Passive Match,
TAKER-Active Match
utcDeal Transaction Timestamp
quantity Transaction Volume
price Transaction Price
action Order Type SELL-Sell, BUY-Buy
fee Transaction Fee (The fee and feeCurrency
in the detail shall prevail.)
feeCurrency Transaction Fee Currency

Update Log

Version modify date comment Author
v1.0.0(R) 20180626 Create Document liyong
v1.0.1(α) 20180731 WebSocket Endpoints liyong
v1.0.1(β) 20181129 Rate Limit By Group liyong
v1.0.1(R) 20190117 FIX Endpoints liyong
v1.0.2(α) 20190715 clientOrderId is supported in Order Place and Order Status Query liyong
v1.0.3 20191009 Newly Added API Restful Interface: Place a Batch of Orders Interface liyong
v1.0.4 20191120 Public Market Data in REST API do not need API Key any more liyong

FAQ

Click here to check


Contact US

You can join the following API communication groups with comment of API + your Coinsuper account email:

Index Contact Information
1 QQ group 472488338
2 Telegram group https://t.me/joinchat/HEgiSxBKVx6nwQ33otJ3Zg

And we have a survey questionnaire about Coinsuper Exchange API, looking forward to receiving your feedback.

Click to fill in the questionnaire:https://jinshuju.net/f/1UjnY4