# Description

## Welcome to API&#x20;

Here you can find the documents you need.

**API HOST**

**`https://www.swftc.info`**

### DAPP

{% embed url="<https://www.allchainbridge.com/>" %}

## Want to know more about us?&#x20;

Providing the following API for use

## PAY API

{% content-ref url="/pages/6Ln0o60Mva32RrWsI2f9" %}
[PAY API](/pay-api)
{% endcontent-ref %}

## TRADE API

{% content-ref url="/pages/FYN66MPHG9OGNQFQRhBU" %}
[TRADE API](/trade-api)
{% endcontent-ref %}

## NFT API

{% content-ref url="/pages/Tp1UuD0ksi3OezfDbhJh" %}
[NFT API](/nft-api)
{% endcontent-ref %}


# PAY API

## Payment instructions

{% content-ref url="/pages/-LbWF9xBHm1S7DJ4rYRf" %}
[Pay Interface](/pay-api/swft-pay-interface)
{% endcontent-ref %}


# Pay Interface

### Request for explanation

* This document is for partners who have applied for the channel number channelId and private key at us.
* Partner requirements: Provide channel name, register account.

### Process Chart

![](https://content.gitbook.com/content/QuCPmGNiuDhXkBysKU4Z/blobs/v1fqyqqtzJ1nXooCBK4d/swftpay.png)

![](file://D:/work/swftcoin/swft-h5/swft-api/images/swftpay.png?lastModify=1554262336)

#### Access process：

&#x20;① The developer calls us to create a payment order procotol and creates a payment order;

&#x20;② Our link that returns to the payment page, and the user makes a payment;

&#x20;③ to obtain payment results, the following two ways are doable: a. The developer provides a payment completion notification protocal, and after the user completes the payment, we call the protocal to notify; b. The developer can take the protocol of order status to get the status of the order payment result.

### Protocol list

| Request type          | Request method            | Description               |
| --------------------- | ------------------------- | ------------------------- |
| POST application/json | api/pay/createPayOrder    | Create a payment order    |
| POST application/json | api/pay/queryPayOrder     | Check order status        |
| POST application/json | Provided by the developer | Payment completion notice |

#### Create a payment order

#### api/pay/createPayOrder

#### Explanation

The partner calls the protocol to create a payment order.

#### Request parameter

| Parameter name | Is it necessary | Type of data | description             | Defaults | Ranges                               |
| -------------- | --------------- | ------------ | ----------------------- | -------- | ------------------------------------ |
| channelId      | Y               | String       | Channel number          |          | Provided by us，eg：payaaa201903212028 |
| channelName    | Y               | String       | Channel short name      |          | eg：xxMall                            |
| sign           | Y               | String       | Signature               |          | See "Signature Generation"           |
| timestamp      | Y               | Long         | Timestamp               |          | Millisecond timestamp                |
| channelOrderId | N               | String       | Channel order number    |          | Developer customization              |
| channelUserNo  | N               | String       | Channel username        |          | Developer customization              |
| coinCode       | Y               | String       | Payment currency name   |          | eg：ETH                               |
| amount         | Y               | String       | Payment currency amount |          | eg：1                                 |
| remark         | N               | String       | Remark                  |          | Remark of order                      |

#### Response parameter

```
 {
     "data": {
         "amount": "2",
         "channelOrderId": "channelorder001",
         "channelUserNo": "xxMall_zhangsan",
         "coinCode": "ETH",
         "payId": "jpedyB3T",
         "payUrl": "https://test.swftcoin.com/swft-v3/PayAPI.html?payID=jpedyB3T",
         "remark": "zhangsan pay to xxMall"
     },
     "resCode": "800",
     "resMsg": "success"
 }
```

#### data explanation

```
 {
     "amount": "Payment currency amount",
     "channelOrderId": "Channel order number",
     "channelUserNo": "Channel username",
     "coinCode": "Payment currency name",
     "payId": "Payment order number",
     "payUrl": "Payment page link",
     "remark": "Remark"
 }
```

#### Payment order status

#### api/pay/queryPayOrder

#### Explanation

Payment order status protocol

#### Request parameter

| Parameter name | Is it necessary | Type of data | description          | Defaults | Ranges                     |
| -------------- | --------------- | ------------ | -------------------- | -------- | -------------------------- |
| payId          | Y               | String       | Payment order number |          | eg : Nlt0OnQP              |
| channelId      | Y               | String       | Channel number       |          | eg：payaaa201903212028      |
| sign           | Y               | String       | Signature            |          | See "Signature Generation" |
| timestamp      | N               | String       | Timestamp            |          | Millisecond timestamp      |

#### Response parameter

```
 {
     "data": {
         "amount": "2",
         "channelId": "payaaa201903212028",
         "channelName": "xxMall",
         "coinCode": "ETH",
         "createTime": "2019-03-22 17:11:38",
         "payId": "XMdqbM8Q",
         "remark": "zhangsan pay to xxMall",
         "sign": "DB99639E8B9EC419F88C94355DF1C483ACD420B7366C27CAB8E86A6D7B84CB52",
         "status": "complete",
         "timestamp": 1553838107450,
         "transType": "PAY_IN",
         "userNo": "5****@qq.com"
     },
     "resCode": "800",
     "resMsg": "success"
 }
```

#### data explanation

```
   {
     "amount": "Payment currency amount",
     "channelOrderId": "Channel order number",
     "channelUserNo": "Channel username",
     "coinCode": "Payment currency name",
     "payId": "Payment order number",
     "remark": "Remark",
     "sign": "Signature",
     "status": "Payment order status",
     "timestamp": "Millisecond timestamp",
     "transType": "Order type",
     "userNo": "Third-party channel number has not been set up yet"
   }
```

#### Order payment completion notification

#### Explanation

Order payment completion notification protocol

#### Request parameter

| Parameter name | Is it necessary | Type of data | description          | Defaults | Ranges                 |
| -------------- | --------------- | ------------ | -------------------- | -------- | ---------------------- |
| payId          | Y               | String       | Payment order number |          | eg: Nlt0OnQP           |
| status         | Y               | String       | Payment order status |          | valid，complete，invalid |
| sign           | Y               | String       | Signature            |          |                        |
| timestamp      | Y               | String       | Timestamp            |          | Millisecond timestamp  |

#### Response parameter

```
 {
     "data": “Response completed”,
     "resCode": "800",
     "resMsg": "success"
 }
```

#### data explanation

```
 {
     "data": “response info”,
     "resCode": "Return status code",//800: indicates success, others indicate failure
     "resMsg": "Return result information"
 }
```

### Error code description

#### Return data resCode code

| Error code | Explanation                                                       |
| ---------- | ----------------------------------------------------------------- |
| 800        | Success                                                           |
| 900        | Servers busy, please try later                                    |
| 213        | Illegal Request                                                   |
| 214        | Currency does not exist                                           |
| 216        | Amount illegal                                                    |
| 907        | Required field is empty                                           |
| 1002       | Order doesn’t exist                                               |
| 1017       | Third-party channels or account does not exist                    |
| 1018       | Third-party channels have not been set up on the account.         |
| 1019       | Third-party channel number has not been set up yet.               |
| 1031       | The note is longer than 50 characters                             |
| 1032       | Third-party channel payment page address has not been set up yet. |

### Generate signature

The parameter names are sorted according to the order of the ASCII code, converted into a json string, signed with a private key, and HMAC-SHA256 encryption should be used.

#### Signature generation step description

**First step：**

Let's assume all the data sent or received to be the set M, and sort the parameters of the non-empty parameter values in the set M according to the parameter name ASCII code from small to large (dictionary order), using the format of the URL key-value pair (ie key1=value1\&key2=value2) ...) stitched into a string stringA.

**Pay special attention to the following important rules：**

1. The parameter name ASCII code is sorted from small to large (dictionary order);
2. app\_id, timestamp is a required parameter; timestamp is the last five minutes timestamp, which is invalid for more than 5 minutes;
3. If the value of the parameter is null, it does not participate in the signature;
4. Parameter names are case sensitive;
5. The transmitted sign parameter does not participate in the signature, and the generated signature will be checked based on the sign value.

**The Second step：**

The string is finally stitched to get the stringSignTemp string, and the stringSignTemp is programmed according to HMAC-SHA256, and then all the characters of the obtained string are converted to uppercase, then the signvalue is set.

**Pseudo code example**

Assume that the parameters transmitted are as follows： channelId: mttest timestamp : 1516320000 body : test

```
 First step: The parameters are sorted according to the key=value format and sorted according to the parameter name ASCII dictionary order as follows：
 stringA="app_id=mttest&body=test&timestamp=1516320000";
 The second step: splicing the API key:
 stringSignTemp=stringA+"&secret=my_test_secret" 
 sign=hash_hmac("sha256",stringSignTemp,key).toUpperCase()="6A9AE1657590FD6257D693A078E1C3E4BB6BA4DC30B23E0EE2496E54170DACD6" //Note: HMAC-SHA256 signature method"    
```

**Code example**

```
     @Test
     public void deductBalance() throws IOException {
         JTextField field ;
         String url = "http://localhost:8088/channel/deductBalance";
         TreeMap<String,Object> params = Maps.newTreeMap();
         params.put("orderId","my_order_id");
         params.put("channelId","test91021071617412");
         long timestamp = System.currentTimeMillis();
         params.put("timestamp",timestamp);
         String channelSign = getChannelSign(params, secret);
         params.put("sign",channelSign);
         System.out.println(url);
         System.out.println(JSON.toJSONString(params));
         String result = HttpUtils.sendRequestBody(url, params);
         System.out.println(result);
     }
 ​
     public static String getChannelSign(Map<String, Object> params,String secret) {
         StringBuilder result = new StringBuilder();
         if (params != null) {
             for (Object key : params.keySet()) {
                 Object value = params.get(key);
                 result.append(key).append("=").append(value).append("&");
             }
             String tempString = result + "secret=" + secret;
             try {
                 System.out.println(tempString);
                 String sign = EncryptUtils.sha256_HMAC(tempString, secret).toUpperCase();
                 System.out.println(sign);
                 return sign;
             } catch (Exception e) {
                 e.printStackTrace();
             }
         }
         return null;
     }
```

> The parameters and order in which the code participates in encryption are：`channelId=test91021071617412&orderId=my_test_id&timestamp=1547987604644&secret=my_secret`


# TRADE API

## Welcome to TRADE API

In this section you can learn about and use the TRADE API

## Related instructions

{% content-ref url="/pages/-LlGUbMe3ajbvQsny2h7" %}
[TRADE Interface](/trade-api/swft-trade-interface)
{% endcontent-ref %}

{% content-ref url="/pages/-LlGVXzWylHOmEtP-Zoc" %}
[Generate signature](/trade-api/generate-signature)
{% endcontent-ref %}

## Other Interfac

{% content-ref url="/pages/-LlGValtFIsdLytUeX6s" %}
[Get Account Balance](/trade-api/get-account-balance)
{% endcontent-ref %}

{% content-ref url="/pages/-LlGVz2-tiVcQgOAhJmM" %}
[Single currency Account Balance](/trade-api/single-currency-account-balance)
{% endcontent-ref %}

{% content-ref url="/pages/-LlGWV24i-QclSX9kZQB" %}
[Get the Order Detail of Account](/trade-api/get-the-order-detail-of-account)
{% endcontent-ref %}

{% content-ref url="/pages/-LlGWYMGnUlNicZ9z4c7" %}
[Get the Support Trade Pair](/trade-api/get-the-support-trade-pair)
{% endcontent-ref %}

{% content-ref url="/pages/-LlGWhactReJoszVNDM1" %}
[Get Market Depth](/trade-api/get-market-depth)
{% endcontent-ref %}

{% content-ref url="/pages/-LlGWpHt7lR9nQIgpnJx" %}
[Place a New Order](/trade-api/place-a-new-order)
{% endcontent-ref %}

{% content-ref url="/pages/-LlGWvEqWmDgi9KXFaEy" %}
[Submit Cancel for an Order](/trade-api/submit-cancel-for-an-order)
{% endcontent-ref %}

{% content-ref url="/pages/-LlGXBv-Nuq7SHYZ3cCC" %}
[Get All Open Orders](/trade-api/get-all-open-orders)
{% endcontent-ref %}

{% content-ref url="/pages/-LlGXHwzJzZzpWAYTaoA" %}
[Search Historical Orders](/trade-api/search-historical-orders)
{% endcontent-ref %}

{% content-ref url="/pages/-LlGXMPEk5xWio9jFIpR" %}
[Get the Order Detail of an Order](/trade-api/get-the-order-detail-of-an-order)
{% endcontent-ref %}

{% content-ref url="/pages/k6HW4S0MDTUVYFSTfmqA" %}
[Latest transaction information](/trade-api/latest-transaction-information)
{% endcontent-ref %}

{% content-ref url="/pages/t0by9DayXjEjxJWyhxT1" %}
[Historical transaction record](/trade-api/historical-transaction-record)
{% endcontent-ref %}

{% content-ref url="/pages/T0YEnrtsH7fHcnsGm2Oh" %}
[K-line data](/trade-api/k-line-data)
{% endcontent-ref %}


# TRADE Interface

### Request for explanation

* This document is for partners who have applied for the channel number channelId and private key at us.
* Partner requirements: Provide channel name, register account.
* Request type: POST  application/json.
* Error code description:

  | Error code | Explanation                                              |
  | ---------- | -------------------------------------------------------- |
  | 800        | SUCCESS                                                  |
  | 900        | The system is busy, please try again later               |
  | 1100       | The trading pair is invalid                              |
  | 1101       | The trading pair does not exist                          |
  | 1102       | The depth does not exist                                 |
  | 1103       | The trading type is invalid                              |
  | 1104       | The trading price is invalid                             |
  | 1105       | The trading price accuracy is too long                   |
  | 1106       | The trading amount is invalid                            |
  | 1107       | The trading amount accuracy is too long                  |
  | 1108       | The minimum trading amount cannot be lower than 0.01 ETH |
  | 1109       | The minimum trading sum cannot be lower than 0.01 ETH    |
  | 1110       | Cancellation successful                                  |
  | 1111       | Cancellation fail                                        |


# Generate signature

### Generate signature

The parameter names are sorted according to the order of the ASCII code, converted into a json string, signed with a private key, and HMAC-SHA256 encryption should be used.

#### Signature generation step description

**First step：**

Let's assume all the data sent or received to be the set M, and sort the parameters of the non-empty parameter values in the set M according to the parameter name ASCII code from small to large (dictionary order), using the format of the URL key-value pair (ie key1=value1\&key2=value2) ...) stitched into a string stringA.

**Pay special attention to the following important rules：**

1. The parameter name ASCII code is sorted from small to large (dictionary order);
2. app\_id, timestamp is a required parameter; timestamp is the last five minutes timestamp, which is invalid for more than 5 minutes;
3. If the value of the parameter is null, it does not participate in the signature;
4. Parameter names are case sensitive;
5. The transmitted sign parameter does not participate in the signature, and the generated signature will be checked based on the sign value.

**The Second step：**

The string is finally stitched to get the stringSignTemp string, and the stringSignTemp is programmed according to HMAC-SHA256, and then all the characters of the obtained string are converted to uppercase, then the signvalue is set.

**Pseudo code example**

Assume that the parameters transmitted are as follows： channelId: mttest timestamp : 1516320000 body : test

```
 First step: The parameters are sorted according to the key=value format and sorted according to the parameter name ASCII dictionary order as follows：
 stringA="app_id=mttest&body=test&timestamp=1516320000";
 The second step: splicing the API key:
 stringSignTemp=stringA+"&secret=my_test_secret" 
 sign=hash_hmac("sha256",stringSignTemp,key).toUpperCase()="6A9AE1657590FD6257D693A078E1C3E4BB6BA4DC30B23E0EE2496E54170DACD6" //Note: HMAC-SHA256 signature method"    
```

**Code example**

```
     @Test
     public void deductBalance() throws IOException {
         JTextField field ;
         String url = "http://localhost:8088/channel/deductBalance";
         TreeMap<String,Object> params = Maps.newTreeMap();
         params.put("orderId","my_order_id");
         params.put("channelId","test91021071617412");
         long timestamp = System.currentTimeMillis();
         params.put("timestamp",timestamp);
         String channelSign = getChannelSign(params, secret);
         params.put("sign",channelSign);
         System.out.println(url);
         System.out.println(JSON.toJSONString(params));
         String result = HttpUtils.sendRequestBody(url, params);
         System.out.println(result);
     }
 ​
     public static String getChannelSign(Map<String, Object> params,String secret) {
         StringBuilder result = new StringBuilder();
         if (params != null) {
             for (Object key : params.keySet()) {
                 Object value = params.get(key);
                 result.append(key).append("=").append(value).append("&");
             }
             String tempString = result + "secret=" + secret;
             try {
                 System.out.println(tempString);
                 String sign = EncryptUtils.sha256_HMAC(tempString, secret).toUpperCase();
                 System.out.println(sign);
                 return sign;
             } catch (Exception e) {
                 e.printStackTrace();
             }
         }
         return null;
     }
```

> The parameters and order in which the code participates in encryption are：`channelId=test91021071617412&orderId=my_test_id&timestamp=1547987604644&secret=my_secret`


# Get Account Balance

**1. Request Url**

&#x20;`https://{host}/marketApi/accounts`

**2. Request Param**

| Parameter name | Is it necessary | description                                                                    |
| -------------- | --------------- | ------------------------------------------------------------------------------ |
| channelId      | Y               | Channel number                                                                 |
| timestamp      | Y               | Millisecond timestamp（UTC+8）                                                   |
| sign           | Y               | See "[Signature Generation](/trade-api/generate-signature#generate-signature)" |

**3.Request Example**

```
 {
     "channelId":"swft-channel",
     "sign":"102027D292DD0707E0D899459D91C759858D7367D223CB239A8EC3A90C30B122",
     "timestamp":"1557653925555"
 }
```

**4.Response Data**

```
 {
     "data":[
        {
            "coinCode":"SWFTC",
            "availableAmount":"1022375.469017",
            "freezeAmount":"0"
        },
        {
            "coinCode":"BTC",
            "availableAmount":"1.469017",
            "freezeAmount":"0"
        },
        {
            "coinCode":"ETH",
            "availableAmount":"10.153343",
            "freezeAmount":"0"
        }
    ],
     "resCode": "800",
     "resMsg": "Success"
 }
```

**5.Response Data Explanation**

| Parameter name  | Is it necessary | Type of data | description       | remark   |
| --------------- | --------------- | ------------ | ----------------- | -------- |
| coinCode        | Y               | String       | Currency Code     | eg: BTC  |
| availableAmount | Y               | String       | Available Balance | eg: 1.46 |
| freezeAmount    | Y               | String       | Freeze Balance    | eg: 0.01 |


# Single currency Account Balance

**1. Request Url**

&#x20;`https://{host}/marketApi/accountsByCode/{coinCode}`

**2. Request Param**

| Parameter name | Is it necessary | description                                                                    |
| -------------- | --------------- | ------------------------------------------------------------------------------ |
| channelId      | Y               | Channel number                                                                 |
| timestamp      | Y               | Millisecond timestamp（UTC+8）                                                   |
| sign           | Y               | See "[Signature Generation](/trade-api/generate-signature#generate-signature)" |

**3. Request Example**

```
 {
     "channelId":"swft-channel",
     "sign":"102027D292DD0707E0D899459D91C759858D7367D223CB239A8EC3A90C30B122",
     "timestamp":"1557653925555"
 }
```

**4. Response Data**

```
 {
     "data":{
         "coinCode":"BTC",
         "availableAmount":"1.46",
         "freezeAmount":"0"
     },
     "resCode": "800",
     "resMsg": "SUCCESS"
 }
```

**5.Response Data Explanation**

| Parameter name  | Is it necessary | Type of data | description       | remark   |
| --------------- | --------------- | ------------ | ----------------- | -------- |
| coinCode        | Y               | String       | Currency Code     | eg: BTC  |
| availableAmount | Y               | String       | Available Balance | eg: 1.46 |
| freezeAmount    | Y               | String       | Freeze Balance    | eg: 0.01 |


# Get the Order Detail of Account

**1. Request Url**

&#x20;`https://{host}/marketApi/billRecord`

**2. Request Param**

| Parameter name | Is it necessary | description                                                                    |
| -------------- | --------------- | ------------------------------------------------------------------------------ |
| channelId      | Y               | Channel number                                                                 |
| timestamp      | Y               | Millisecond timestamp（UTC+8）                                                   |
| sign           | Y               | See "[Signature Generation](/trade-api/generate-signature#generate-signature)" |
| pageNo         | N               | The current number of pages（default: 1）                                        |
| pageSize       | N               | Number each page（default: 10）                                                  |
| coinCode       | Y               | Currency Type                                                                  |

**3.Request Example**

```
 {
     "channelId":"swft-channel",
     "sign":"102027D292DD0707E0D899459D91C759858D7367D223CB239A8EC3A90C30B122",
     "timestamp":"1557653925555",
     "pageNo":"2",
     "pageSize":"10",
     "coinCode":"BTC",
 }
```

**4.Response Data**

```
 {
     "data":{
         "pageContent":[
            {
                "amount":"4.344231",
                "changeAmt":"1",
                "coinCode":"BTC",
                "createTime":"2019-08-02 12:14:12",
                "recordId":"adsjvLP4",
                "type":"trade_deduct"
            },
            {
                "amount":"5.344231",
                "changeAmt":"0.0013",
                "coinCode":"BTC",
                "createTime":"2019-08-03 11:14:00",
                "recordId":"mffeoHl",
                "type":"trade_receive"
            }
        ],
        "pageNo":1,
        "pageSize":10,
        "totalCount":2,
        "totalPage":1
     },
     "resCode": "800",
     "resMsg": "SUCCESS"
 }
```

**5.Response Data Explanation**

| description                 | Is Array | Parameter name | Data type | Length | Is it necessary | Remark                         |
| --------------------------- | -------- | -------------- | --------- | ------ | --------------- | ------------------------------ |
| The current number of pages | N        | pageNo         | Number    | 20     | Y               | eg: 1                          |
| Number each page            | N        | pageSize       | Number    | 20     | Y               | eg: 10                         |
| The total number of records | N        | totalCount     | Number    | 20     | Y               | eg: 2                          |
| Total number of pages       | N        | totalPage      | Number    | 20     | Y               | eg: 1                          |
| The balance                 | Y        | amount         | String    | 20     | Y               | eg: 4.32                       |
| Change the number           | Y        | changeAmt      | String    | 20     | Y               | eg: 1                          |
| Currency Type               | Y        | coinCode       | String    | 20     | Y               | eg: BTC                        |
| Record Id                   | Y        | recordId       | String    | 20     | Y               | eg: adsjvLP4                   |
| Record Type                 | Y        | type           | String    | 20     | Y               | eg: trade\_deduct              |
| Timestamp                   | Y        | createTime     | String    | 20     | Y               | eg: 2019-08-03 11:14:00（UTC+8） |


# Get the Support Trade Pair

**1. Request Url**

&#x20;`https://{host}/marketApi/loadPair`

**2. Request Param**

| Parameter name | Is it necessary | description                                                                    |
| -------------- | --------------- | ------------------------------------------------------------------------------ |
| channelId      | Y               | Channel number                                                                 |
| timestamp      | Y               | Millisecond timestamp（UTC+8）                                                   |
| sign           | Y               | See "[Signature Generation](/trade-api/generate-signature#generate-signature)" |

**3.Request Example**

```
 {
     "channelId":"swft-channel",
     "sign":"102027D292DD0707E0D899459D91C759858D7367D223CB239A8EC3A90C30B122",
     "timestamp":"1557653925555"
 }
```

**4.Response Data**

```
 {
    "data":[
        {
            "allowCoinLow":"0.001",
            "allowTradeLow":"0.000001",
            "tradeCode":"USDT",
            "tradeNumAccuracy":6,
            "tradePair":"BTC/USDT",
            "tradePriceAccuracy":2
        },
        {
            "allowCoinLow":"0.001",
            "allowTradeLow":"0.000001",
            "tradeCode":"USDT",
            "tradeNumAccuracy":6,
            "tradePair":"ETH/USDT",
            "tradePriceAccuracy":2
        }
    ],
    "resCode":"800",
    "resMsg":"成功"
}
```

**5.Response Data Explanation**

| Description               | Is Array | Parameter name     | Data type | Length | Is it necessary | Remark       |
| ------------------------- | -------- | ------------------ | --------- | ------ | --------------- | ------------ |
| Minimum trading volume    | Y        | allowCoinLow       | String    | 20     | Y               | eg: 0.001    |
| Minimum turnover          | Y        | allowTradeLow      | String    | 20     | Y               | eg: 0.000001 |
| Currency type             | Y        | tradeCode          | String    | 20     | Y               | eg: USDT     |
| Trade pair                | Y        | tradePair          | String    | 20     | Y               | eg: ETH/USDT |
| Trading quantity accuracy | Y        | tradeNumAccuracy   | Number    | 2      | Y               | eg: 2        |
| Trading accuracy          | Y        | tradePriceAccuracy | Number    | 2      | Y               | eg: 6        |


# Get Market Depth

**1. Request Url**

&#x20;`https://{host}/marketApi/depth`

**2. Request Param**

| Parameter name | Is it necessary | description                                                                    |
| -------------- | --------------- | ------------------------------------------------------------------------------ |
| channelId      | Y               | Channel number                                                                 |
| timestamp      | Y               | Millisecond timestamp（UTC+8）                                                   |
| sign           | Y               | See "[Signature Generation](/trade-api/generate-signature#generate-signature)" |
| tradePair      | Y               | Trade pair                                                                     |
| depth          | Y               | Deep polymerization, 1,2,3,4,5,6                                               |

**3.Request Example**

```
 {
     "channelId":"swft-channel",
     "sign":"102027D292DD0707E0D899459D91C759858D7367D223CB239A8EC3A90C30B122",
     "timestamp":"1557653925555",
     "tradePair":"BTC/USDT",
     "depth":"1"
 }
```

**4.Response Data**

```
 {
    "data":{
        "buyOrders":[
            [
                "10395.67",
                "0.006137"
            ],
            [
                "10393.50",
                "4.741722"
            ]
        ],
        "sellOrders":[
            [
                "10392.33",
                "0.097679"
            ],
            [
                "10392.39",
                "1.593146"
            ]
        ],
        "latestPrice":"10392.33",
        "latestType":"buy"
    },
    "resCode":"800",
    "resMsg":"SUCCESS"
}
```

**5.Response Data Explanation**

| Description  | Is Array | Parameter name | Data type | Length | Is it necessary | Remark       |
| ------------ | -------- | -------------- | --------- | ------ | --------------- | ------------ |
| Buy orders   | Y        | buyOrders      | Array     | -      | Y               | eg: array    |
| Sell orders  | Y        | sellOrders     | Array     | -      | Y               | eg: array    |
| Latest price | N        | latestPrice    | String    | 20     | Y               | eg: 10392.33 |
| Latest type  | N        | latestType     | String    | 20     | Y               | eg: sell/buy |


# Place a New Order

**1. Request Url**

&#x20;`https://{host}/marketApi/trade`

**2. Request Param**

| Parameter name | Is it necessary | description                                                                    |
| -------------- | --------------- | ------------------------------------------------------------------------------ |
| channelId      | Y               | Channel number                                                                 |
| timestamp      | Y               | Millisecond timestamp（UTC+8）                                                   |
| sign           | Y               | See "[Signature Generation](/trade-api/generate-signature#generate-signature)" |
| tradePair      | Y               | Trade pair                                                                     |
| type           | Y               | buy/sell                                                                       |
| price          | Y               | price                                                                          |
| amount         | Y               | amount                                                                         |

**3.Request Example**

```
 {
     "channelId":"swft-channel",
     "sign":"102027D292DD0707E0D899459D91C759858D7367D223CB239A8EC3A90C30B122",
     "timestamp":"1557653925555",
     "tradePair":"BTC/USDT",
     "type":"buy",
     "price":"1",
     "amount":"1",
 }
```

**4.Response Data**

```
 {
    "data":"",
    "resCode":"800",
    "resMsg":"SUCCESS"
}
```


# Submit Cancel for an Order

**1. Request Url**

&#x20;`https://{host}/marketApi/cancel`

**2. Request Param**

| Parameter name | Is it necessary | description                                                                    |
| -------------- | --------------- | ------------------------------------------------------------------------------ |
| channelId      | Y               | Channel number                                                                 |
| timestamp      | Y               | Millisecond timestamp（UTC+8）                                                   |
| sign           | Y               | See "[Signature Generation](/trade-api/generate-signature#generate-signature)" |
| orderId        | Y               | OrderId                                                                        |

**3.Request Example**

```
 {
     "channelId":"swft-channel",
     "sign":"102027D292DD0707E0D899459D91C759858D7367D223CB239A8EC3A90C30B122",
     "timestamp":"1557653925555",
     "orderId":"fmju82Feozm"
 }
```

**4.Response Data**

```
 {
    "data":"",
    "resCode":"800",
    "resMsg":"SUCCESS"
}
```


# Get All Open Orders

**1. Request Url**

&#x20;`https://{host}/marketApi/openOrders`

**2. Request Param**

| Parameter name | Is it necessary | description                                                                    |
| -------------- | --------------- | ------------------------------------------------------------------------------ |
| channelId      | Y               | Channel number                                                                 |
| timestamp      | Y               | Millisecond timestamp（UTC+8）                                                   |
| sign           | Y               | See "[Signature Generation](/trade-api/generate-signature#generate-signature)" |
| pageNo         | N               | The current number of pages（default: 1）                                        |
| pageSize       | N               | Number each page（default: 10）                                                  |
| tradePair      | Y               | Trade pair                                                                     |

**3.Request Example**

```
 {
     "channelId":"swft-channel",
     "sign":"102027D292DD0707E0D899459D91C759858D7367D223CB239A8EC3A90C30B122",
     "timestamp":"1557653925555",
     "tradePair":"BTC/USDT",
     "pageNo":"1",
     "pageSize":"10"
 }
```

**4.Response Data**

```
 {
    "data":{
        "pageContent":[
            {
                "availCoinCode":"BTC",
                "availTradeCode":"USDT",
                "createTime":"2019-08-02 11:14:00",
                "orderId":"HRwiB8EgFcx5",
                "price":"1",
                "successAmt":"0",
                "totalAmt":"1",
                "tradePair":"BTC/USDT",
                "type":"buy",
                "updateTime":"2019-08-02 11:14:00"
            }
        ],
        "pageNo":1,
        "pageSize":10,
        "totalCount":1,
        "totalPage":1
    },
    "resCode":"800",
    "resMsg":"SUCCESS"
}
```

**5.Response Data Explanation**

| Description                 | Is Array | Parameter name | Data type | Length | Is it necessary | Remark                         |
| --------------------------- | -------- | -------------- | --------- | ------ | --------------- | ------------------------------ |
| The current number of pages | N        | pageNo         | Number    | 20     | Y               | eg: 1                          |
| Number each page            | N        | pageSize       | Number    | 20     | Y               | eg: 10                         |
| The total number of records | N        | totalCount     | Number    | 20     | Y               | eg: 2                          |
| Total number of pages       | N        | totalPage      | Number    | 20     | Y               | eg: 1                          |
| OrderId                     | Y        | orderId        | String    | 30     | Y               | eg: Hushjrw8723                |
| Trading code                | Y        | availCoinCode  | String    | 20     | Y               | eg: BTC                        |
| Trade zone code             | Y        | availTradeCode | String    | 20     | Y               | eg: USDT                       |
| Trade pair                  | Y        | tradePair      | String    | 20     | Y               | BTC/USDT                       |
| Price                       | Y        | price          | String    | 30     | Y               | eg: 0.21312                    |
| Order quantity              | Y        | totalAmt       | String    | 30     | Y               | eg: 1                          |
| Deal quantity               | Y        | successAmt     | String    | 30     | Y               | eg: 0                          |
| Type                        | Y        | type           | String    | 20     | Y               | eg: buy                        |
| Create time                 | Y        | createTime     | String    | 30     | Y               | eg: 2019-08-02 11:14:00（UTC+8） |
| Update time                 | Y        | updateTime     | String    | 30     | Y               | eg: 2019-08-02 11:14:00（UTC+8） |


# Search Historical Orders

**1. Request Url**

&#x20;`https://{host}/marketApi/historyOrders`

**2. Request Param**

| Parameter name | Is it necessary | description                                                                    |
| -------------- | --------------- | ------------------------------------------------------------------------------ |
| channelId      | Y               | Channel number                                                                 |
| timestamp      | Y               | Millisecond timestamp（UTC+8）                                                   |
| sign           | Y               | See "[Signature Generation](/trade-api/generate-signature#generate-signature)" |
| pageNo         | N               | The current number of pages（default: 1）                                        |
| pageSize       | N               | Number each page（default: 10）                                                  |
| tradePair      | Y               | Trade pair                                                                     |

**3.Request Example**

```
 {
     "channelId":"swft-channel",
     "sign":"102027D292DD0707E0D899459D91C759858D7367D223CB239A8EC3A90C30B122",
     "timestamp":"1557653925555",
     "tradePair":"BTC/USDT",
     "pageNo":"1",
     "pageSize":"10"
 }
```

**4.Response Data**

```
 {
    "data":{
        "pageContent":[
            {
                "availCoinCode":"BTC",
                "availTradeCode":"USDT",
                "averagePrice":"",
                "createTime":"2019-07-31 11:12:06",
                "orderId":"gxrn9R0N4weI",
                "price":"1",
                "status":"canceled",
                "successAmt":"0",
                "successTradeAmt":"0",
                "totalAmt":"1",
                "totalTradeAmt":"1",
                "tradeFee":"0",
                "tradePair":"BTC/USDT",
                "type":"buy",
                "updateTime":"2019-07-31 11:12:06"
            }
        ],
        "pageNo":1,
        "pageSize":10,
        "totalCount":60,
        "totalPage":6
    },
    "resCode":"800",
    "resMsg":"SUCCESS"
}
```

**5.Response Data Explanation**

| Description                 | Is Array | Parameter name  | Data type | Length | Is it necessary | Remark                         |
| --------------------------- | -------- | --------------- | --------- | ------ | --------------- | ------------------------------ |
| The current number of pages | N        | pageNo          | Number    | 20     | Y               | eg: 1                          |
| Number each page            | N        | pageSize        | Number    | 20     | Y               | eg: 10                         |
| The total number of records | N        | totalCount      | Number    | 20     | Y               | eg: 2                          |
| Total number of pages       | N        | totalPage       | Number    | 20     | Y               | eg: 1                          |
| OrderId                     | Y        | orderId         | String    | 30     | Y               | eg: Hushjrw8723                |
| Trading code                | Y        | availCoinCode   | String    | 20     | Y               | eg: BTC                        |
| Trade zone code             | Y        | availTradeCode  | String    | 20     | Y               | eg: USDT                       |
| Trade pair                  | Y        | tradePair       | String    | 20     | Y               | BTC/USDT                       |
| Price                       | Y        | price           | String    | 30     | Y               | eg: 0.21312                    |
| Order quantity              | Y        | totalAmt        | String    | 30     | Y               | eg: 1                          |
| Deal quantity               | Y        | successAmt      | String    | 30     | Y               | eg: 1                          |
| The total volume            | Y        | totalTradeAmt   | String    | 30     | Y               | eg: 0.21312                    |
| Deal volume                 | Y        | successTradeAmt | String    | 30     | Y               | eg: 0.21312                    |
| Type                        | Y        | type            | String    | 20     | Y               | eg: buy                        |
| Fee                         | Y        | tradeFee        | String    | 20     | Y               | eg: 0.000426                   |
| Average price               | Y        | averagePrice    | String    | 20     | Y               | eg: 0.21312                    |
| Status                      | Y        | status          | String    | 30     | Y               | eg: canceled                   |
| Create time                 | Y        | createTime      | String    | 30     | Y               | eg: 2019-08-02 11:14:00（UTC+8） |
| Update time                 | Y        | updateTime      | String    | 30     | Y               | eg: 2019-08-02 11:14:00（UTC+8） |


# Get the Order Detail of an Order

**1. Request Url**

&#x20;`https://{host}/marketApi/orders`

**2. Request Param**

| Parameter name | Is it necessary | description                                                                    |
| -------------- | --------------- | ------------------------------------------------------------------------------ |
| channelId      | Y               | Channel number                                                                 |
| timestamp      | Y               | Millisecond timestamp（UTC+8）                                                   |
| sign           | Y               | See "[Signature Generation](/trade-api/generate-signature#generate-signature)" |
| orderId        | Y               | Order id                                                                       |

**3.Request Example**

```
 {
     "channelId":"swft-channel",
     "sign":"102027D292DD0707E0D899459D91C759858D7367D223CB239A8EC3A90C30B122",
     "timestamp":"1557653925555",
     "orderId":"Huwldef823Fw"
 }
```

**4.Response Data**

```
 {
    "data":{
        "availCoinCode":"BTC",
        "availTradeCode":"USDT",
        "averagePrice":"",
        "createTime":"2019-07-31 11:12:06",
        "orderId":"gxrn9R0N4weI",
        "price":"1",
        "status":"canceled",
        "successAmt":"0",
        "successTradeAmt":"0",
        "totalAmt":"1",
        "totalTradeAmt":"1",
        "tradeFee":"0",
        "tradePair":"BTC/USDT",
        "type":"buy",
        "updateTime":"2019-07-31 11:12:06"
    },
    "resCode":"800",
    "resMsg":"SUCCESS"
}
```

**5.Response Data Explanation**

| Description                 | Is Array | Parameter name  | Data type | Length | Is it necessary | Remark                         |
| --------------------------- | -------- | --------------- | --------- | ------ | --------------- | ------------------------------ |
| The current number of pages | N        | pageNo          | Number    | 20     | Y               | eg: 1                          |
| Number each page            | N        | pageSize        | Number    | 20     | Y               | eg: 10                         |
| The total number of records | N        | totalCount      | Number    | 20     | Y               | eg: 2                          |
| Total number of pages       | N        | totalPage       | Number    | 20     | Y               | eg: 1                          |
| OrderId                     | Y        | orderId         | String    | 30     | Y               | eg: Hushjrw8723                |
| Trading code                | Y        | availCoinCode   | String    | 20     | Y               | eg: BTC                        |
| Trade zone code             | Y        | availTradeCode  | String    | 20     | Y               | eg: USDT                       |
| Trade pair                  | Y        | tradePair       | String    | 20     | Y               | BTC/USDT                       |
| Price                       | Y        | price           | String    | 30     | Y               | eg: 0.21312                    |
| Order quantity              | Y        | totalAmt        | String    | 30     | Y               | eg: 1                          |
| Deal quantity               | Y        | successAmt      | String    | 30     | Y               | eg: 1                          |
| The total volume            | Y        | totalTradeAmt   | String    | 30     | Y               | eg: 0.21312                    |
| Deal volume                 | Y        | successTradeAmt | String    | 30     | Y               | eg: 0.21312                    |
| Type                        | Y        | type            | String    | 20     | Y               | eg: buy                        |
| Fee                         | Y        | tradeFee        | String    | 20     | Y               | eg: 0.000426                   |
| Average price               | Y        | averagePrice    | String    | 20     | Y               | eg: 0.21312                    |
| Status                      | Y        | status          | String    | 30     | Y               | eg: canceled                   |
| Create time                 | Y        | createTime      | String    | 30     | Y               | eg: 2019-08-02 11:14:00（UTC+8） |
| Update time                 | Y        | updateTime      | String    | 30     | Y               | eg: 2019-08-02 11:14:00（UTC+8） |


# Latest transaction information

**1. Request Url**

`https://{host}/marketApi/history/detail`

**2. Request Param**

| Parameter name | Is it necessary | description                                                                    |
| -------------- | --------------- | ------------------------------------------------------------------------------ |
| channelId      | yes             | Channel number                                                                 |
| timestamp      | yes             | Millisecond timestamp（UTC+8）                                                   |
| sign           | yes             | See "[Signature Generation](/trade-api/generate-signature#generate-signature)" |
| symbol         | yes             | symbol                                                                         |

**3.Request Example**

```
 {
     "channelId":"swft-channel",
     "sign":"102027D292DD0707E0D899459D91C759858D7367D223CB239A8EC3A90C30B122",
     "timestamp":"1557653925555",
     "symbol":"BTC/USDT"
 }
```

**4.Response Data**

```
{
    "data":{
        "amount":"19607",
        "close":"64816.58",
        "direction":"sell",
        "high":"66961.43",
        "latestAmount":"0.001731",
        "latestPrice":"64812.59",
        "latestPriceRMB":"414800.57",
        "latestPriceUSDT":"64812.59",
        "low":"63679.00",
        "open":"63780.05",
        "percentage":"+1.59%",
        "ts":1634796068,
        "type":"up",
        "vol":"1281488695"
    },
    "resCode":"800",
    "resMsg":"success",
    "resMsgEn":""
}
```

**5.Response Data Explanation**

<table><thead><tr><th width="276">Description</th><th>Is Array</th><th>Parameter name</th><th>Data type</th></tr></thead><tbody><tr><td>amount</td><td>Y</td><td>amount</td><td>String</td></tr><tr><td>close</td><td>Y</td><td>close</td><td>String</td></tr><tr><td>direction</td><td>Y</td><td>direction</td><td>String</td></tr><tr><td>high</td><td>Y</td><td>high</td><td>String</td></tr><tr><td>latestAmount</td><td>Y</td><td>latestAmount</td><td>String</td></tr><tr><td>latestPrice</td><td>Y</td><td>latestPrice</td><td>String</td></tr><tr><td>latestPriceRMB</td><td>Y</td><td>latestPriceRMB</td><td>String</td></tr><tr><td>latestPriceUSDT</td><td>Y</td><td>latestPriceUSDT</td><td>String</td></tr><tr><td>low</td><td>Y</td><td>low</td><td>String</td></tr><tr><td>open</td><td>Y</td><td>open</td><td>String</td></tr><tr><td>percentage</td><td>Y</td><td>percentage</td><td>String</td></tr><tr><td>ts</td><td>Y</td><td>ts</td><td>String</td></tr><tr><td>type</td><td>Y</td><td>type</td><td>String</td></tr><tr><td>vol</td><td>Y</td><td>vol</td><td>String</td></tr></tbody></table>


# Historical transaction record

**1. Request Url**

`https://{host}/marketApi/history/trade`

**2. Request Param**

| Parameter name | Is it necessary | description                                                                    |
| -------------- | --------------- | ------------------------------------------------------------------------------ |
| channelId      | yes             | Channel number                                                                 |
| timestamp      | yes             | Millisecond timestamp（UTC+8）                                                   |
| sign           | yes             | See "[Signature Generation](/trade-api/generate-signature#generate-signature)" |
| symbol         | yes             | symbol                                                                         |

**3.Request Example**

```
 {
     "channelId":"swft-channel",
     "sign":"102027D292DD0707E0D899459D91C759858D7367D223CB239A8EC3A90C30B122",
     "timestamp":"1557653925555",
     "symbol":"BTC/USDT"
 }
```

**4.Response Data**

```
{
    "data":[
        {
            "amount":"0.016019",
            "direction":"buy",
            "price":"64486.20",
            "trade-id":102547488829,
            "ts":1634798182
        },
        {
            "amount":"0.000004",
            "direction":"sell",
            "price":"64479.12",
            "trade-id":102547488828,
            "ts":1634798182
        },
        {
            "amount":"0.098946",
            "direction":"buy",
            "price":"64505.74",
            "trade-id":102547488447,
            "ts":1634798098
        }
    ],
    "resCode":"800",
    "resMsg":"success",
    "resMsgEn":""
}
```

**5.Response Data Explanation**

| Description | Is Array | Parameter name | Data type |
| ----------- | -------- | -------------- | --------- |
| amount      | yes      | amount         | String    |
| direction   | yes      | direction      | String    |
| price       | yes      | price          | String    |
| trade-id    | yes      | trade-id       | String    |
| ts          | yes      | ts             | String    |


# K-line data

**1. Request Url**

`https://{host}/market/history/kline`&#x20;

**2. Request Param**

| Parameter name | Is it necessary | description                                                                                                                         |
| -------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| channelId      | yes             | Channel number                                                                                                                      |
| timestamp      | yes             | Millisecond timestamp（UTC+8）                                                                                                        |
| sign           | yes             | See "[Signature Generation](/trade-api/generate-signature#generate-signature)"                                                      |
| symbol         | yes             | symbol                                                                                                                              |
| period         | yes             | Return data time granularity, that is, the time interval of each candle (1min, 5min, 15min, 30min, 60min, 1day, 1mon, 1week, 1year) |

**3.Request Example**

```
{
     "channelId":"swft-channel",
     "sign":"102027D292DD0707E0D899459D91C759858D7367D223CB239A8EC3A90C30B122",
     "timestamp":"1557653925555",
     "symbol":"BTC/USDT",
     "period":"5min"
 }
```

**4.Response Data**

```
{
  "data":[
    {
      "amount":"9",
      "close":"64584.05",
      "count":728,
      "high":"64678.86",
      "low":"64542.78",
      "open":"64640.77",
      "ts":"1634799300",
      "vol":"598187"
    },
    {
      "amount":"27",
      "close":"64644.22",
      "count":1605,
      "high":"64673.56",
      "low":"64403.50",
      "open":"64503.61",
      "ts":"1634799000",
      "vol":"1784771"
    },
    {
      "amount":"43",
      "close":"64503.61",
      "count":2806,
      "high":"64537.95",
      "low":"64165.55",
      "open":"64267.67",
      "ts":"1634798700",
      "vol":"2785947"
    },
    {
      "amount":"10",
      "close":"63798.99",
      "count":793,
      "high":"63821.82",
      "low":"63732.67",
      "open":"63770.11",
      "ts":"1634709600",
      "vol":"694601"
    }
  ],
  "resCode":"800",
  "resMsg":"success",
  "resMsgEn":""
}
```

**5.Response Data Explanation**

| Description | Is Array | Parameter name | Data type |
| ----------- | -------- | -------------- | --------- |
| amount      | Y        | amount         | String    |
| close       | Y        | close          | String    |
| count       | Y        | count          | String    |
| high        | Y        | high           | String    |
| low         | Y        | low            | String    |
| open        | Y        | open           | String    |
| ts          | Y        | ts             | String    |
| vol         | Y        | vol            | String    |


# NFT API

## Welcome to NFT API

In this section you can learn about and use the NFT API

## Related instructions

{% content-ref url="/pages/4VpuE5J4MWexLKluMHCe" %}
[NFT Interface](/nft-api/nft-interface)
{% endcontent-ref %}

## Other Interfac

{% content-ref url="/pages/PqdftCuaoWhBxj0MRMtK" %}
[Get NFT Category List](/nft-api/get-nft-category-list)
{% endcontent-ref %}

{% content-ref url="/pages/hgEN7AEwnnCC7dv1Evql" %}
[Get NFT Detail List](/nft-api/get-nft-detail-list)
{% endcontent-ref %}

{% content-ref url="/pages/ysINZf3KzauBuAvv4nuf" %}
[Query nft by account](/nft-api/query-nft-by-account)
{% endcontent-ref %}

{% content-ref url="/pages/1a17H3dxje0KXI9lYBML" %}
[Query price](/nft-api/query-price)
{% endcontent-ref %}

{% content-ref url="/pages/jL4X9ggoRWIPBNc5R4yj" %}
[Place an order](/nft-api/place-an-order)
{% endcontent-ref %}

{% content-ref url="/pages/DbXnA7Naa3Kogvk59bMW" %}
[Add the hash of the order](/nft-api/add-the-hash-of-the-order)
{% endcontent-ref %}

{% content-ref url="/pages/iqWRWZE5aimjyekwfE2j" %}
[Query transaction records](/nft-api/query-transaction-records)
{% endcontent-ref %}

{% content-ref url="/pages/OWpNqKL016HlJfHJs8PF" %}
[Check order details](/nft-api/check-order-details)
{% endcontent-ref %}


# NFT Interface

### Request for explanation

* The request method is POST application/json
* Error code description:

  <table data-header-hidden><thead><tr><th width="209">Error code</th><th>Explanation</th></tr></thead><tbody><tr><td>Error code</td><td>Explanation</td></tr><tr><td>800</td><td>SUCCESS</td></tr><tr><td>900</td><td>The system is busy, please try again later</td></tr><tr><td>50003</td><td>NFT does not support swap, please select again</td></tr><tr><td>50004</td><td>Currently does not support the sale of NFT</td></tr><tr><td>50005</td><td>Currently does not support the purchase of NFT</td></tr><tr><td>50006</td><td>The current NFT cannot be purchased as the price does not cover the transaction fee</td></tr><tr><td>999</td><td>This NFT cannot be purchased or sold twice</td></tr></tbody></table>


# Get NFT Category List

**1. Request Url**

`https://{host}/gt/swap/path/v1/getBaseInfo`

**2. Request Param**

| Parameter name | Is it necessary | description                                                                                              |
| -------------- | --------------- | -------------------------------------------------------------------------------------------------------- |
| keywords       | Y               | search for the keyword                                                                                   |
| type           | Y               | Type: collection/platfrom                                                                                |
| page           | Y               | The current number of pages（default: 1）                                                                  |
| pageSize       | Y               | Number each page（default: 50）                                                                            |
| equipmentNo    | N               | device ID                                                                                                |
| sessionUuid    | N               | User's unique login ID sessionId                                                                         |
| sourceFlag     | N               | The order source is used to identify which platform created the order and needs to be negotiated with us |
| sourceType     | N               | Request source device (IOS, Android, h5)                                                                 |
| userNo         | N               | userNo                                                                                                   |

**3.Request Example**

```
{
	"equipmentNo": "",
	"keywords": "",
	"page": 0,
	"pageSize": 0,
	"sessionUuid": "",
	"sourceFlag": "",
	"sourceType": "",
	"type": "",
	"userNo": ""
}
```

**4.Response Data**

```
{
	"data": {
		"lists": [
			{
				"contractAddress": "",
				"currentPrice": "",
				"id": "",
				"imageUrl": "",
				"isSupportAny": 0,
				"itemNum": "",
				"mainnet": "",
				"name": "",
				"ownerAddress": "",
				"paymentContract": "",
				"paymentDecimals": "",
				"paymentTokenName": "",
				"paymentUrl": "",
				"platformId": "",
				"platformUrl": "",
				"tokenId": "",
				"type": ""
			}
		],
		"total": 0
	},
	"resCode": "800",
	"resMsg": "success"
}
```


# Get NFT Detail List

**1. Request Url**

`https://{host}/gt/swap/path/v1/getLists`

**2. Request Param**

| Parameter name | Is it necessary | description                                                                                              |
| -------------- | --------------- | -------------------------------------------------------------------------------------------------------- |
| buyNow         | Y               | default：1                                                                                                |
| chain          | Y               | collection: ''                             platfrom: Contains BSC, ETH, POLYGON three or one of them     |
| page           | Y               | The current number of pages（default: 1）                                                                  |
| pageSize       | Y               | Number each page（default: 50）                                                                            |
| priceOrder     | Y               | Sort by price（default: asc）                                                                              |
| type           | Y               | Type: collection/platfrom                                                                                |
| equipmentNo    | N               | device ID                                                                                                |
| sessionUuid    | N               | User's unique login ID sessionId                                                                         |
| sourceFlag     | N               | The order source is used to identify which platform created the order and needs to be negotiated with us |
| sourceType     | N               | Request source device (IOS, Android, h5)                                                                 |
| userNo         | N               | userNo                                                                                                   |


# Query nft by account

&#x20;**1. Request Url**

`https://{host}/gt/swap/path/v1/getOwnedAssets`

**2. Request Param**

| Parameter name | Is it necessary | description                                                                                              |
| -------------- | --------------- | -------------------------------------------------------------------------------------------------------- |
| owner          | Y               | User wallet address                                                                                      |
| page           | Y               | The current number of pages（default: 1）                                                                  |
| pageSize       | Y               | Number each page（default: 50）                                                                            |
| equipmentNo    | N               | device ID                                                                                                |
| sessionUuid    | N               | User's unique login ID sessionId                                                                         |
| sourceFlag     | N               | The order source is used to identify which platform created the order and needs to be negotiated with us |
| sourceType     | N               | Request source device (IOS, Android, h5)                                                                 |
| userNo         | N               | userNo                                                                                                   |

**3.Request Example**

```
{
	"equipmentNo": "",
	"owner": "",
	"pageSize": 0,
	"sessionUuid": "",
	"sourceFlag": "",
	"sourceType": "",
	"userNo": ""
}
```

**4.Response Data**

```
{
	"data": {
		"assets": [
			{
				"canSell": "",
				"contractAddr": "",
				"imageUrl": "",
				"mainnet": "",
				"name": "",
				"paymentInfo": {},
				"platformId": "",
				"tokenId": ""
			}
		]
	},
	"resCode": "800",
	"resMsg": "success"
}
```


# Query price

&#x20;**1. Request Url**

`https://{host}/gt/swap/path/v1/quote`

**2. Request Param**

| Parameter name   | Is it necessary | description                                                                                              |
| ---------------- | --------------- | -------------------------------------------------------------------------------------------------------- |
| coinCode         | Y               | buy：Deposit coinCode      sell： Receive coinCode                                                         |
| fromAddress      | Y               | User wallet address                                                                                      |
| fromTokenAddress | Y               | buy：not required           sell：nft contract address                                                     |
| fromTokenChain   | Y               | nft mainnet                                                                                              |
| nftId            | Y               | buy：NFT ID                                   sell：not required                                           |
| orderSide        |                 | buy---1   sell---0                                                                                       |
| paymentContract  | Y               | buy：not required                sell：The contract address to receive coins                               |
| platformId       | Y               | Platfrom ID                                                                                              |
| tokenId          | Y               | buy：not required                   sell： NFT tokenId                                                     |
| equipmentNo      | N               | device ID                                                                                                |
| sessionUuid      | N               | User's unique login ID sessionId                                                                         |
| sourceFlag       | N               | The order source is used to identify which platform created the order and needs to be negotiated with us |
| sourceType       | N               | Request source device (IOS, Android, h5)                                                                 |
| userNo           | N               | userNo                                                                                                   |

**3.Request Example**

```
{
	"coinCode": "",
	"equipmentNo": "",
	"fromAddress": "",
	"fromTokenAddress": "",
	"fromTokenChain": "",
	"nftId": "",
	"orderSide": "",
	"paymentContract": "",
	"platformId": "",
	"sessionUuid": "",
	"sourceFlag": "",
	"sourceType": "",
	"tokenId": "",
	"userNo": ""
}
```

**4.Response Data**

```
{
	"data": {
		"baseCoinCode": "",
		"buyWithOrigin": true,
		"dex": "",
		"fee": "",
		"feeToken": "",
		"fromTokenAmount": "",
		"fromTokenDecimal": "",
		"logoUrl": "",
		"path": [],
		"paymentInfo": {},
		"platformId": "",
		"toTokenAmount": "",
		"toTokenDecimal": "",
		"txInfo": {},
		"userCoinAmt": "",
		"userCoinCode": ""
	},
	"resCode": "800",
	"resMsg": "success"
}
```


# Place an order

&#x20;**1. Request Url**

`https://{host}/gt/swap/path/v1/placeOrder`

**2. Request Param**

| Parameter name  | Is it necessary | description                                                                                              |
| --------------- | --------------- | -------------------------------------------------------------------------------------------------------- |
| depositCoinCode | Y               | buy：Deposit coinCode      sell： nft contract address                                                     |
| fromTokenChain  | Y               | buy：not required         sell： nft main network                                                          |
| nftLogoUrl      | Y               | buy：not required           sell：nft Image                                                                |
| nftName         | Y               | buy：not required           sell：nft Name                                                                 |
| paymentContract | Y               | buy:  not required                                  sell：Base currency contract address                  |
| orderSide       |                 | buy---1   sell---0                                                                                       |
| platformId      | Y               | Platfrom Id                                                                                              |
| receiveCoinCode | Y               | buy：NFT Id                   sell： receive coinCode                                                      |
| refundAddr      | Y               | Refund address                                                                                           |
| tokenId         | Y               | buy：not required           sell：nft tokenId                                                              |
| userAddr        | Y               | User address                                                                                             |
| equipmentNo     | N               | device ID                                                                                                |
| sessionUuid     | N               | User's unique login ID sessionId                                                                         |
| sourceFlag      | N               | The order source is used to identify which platform created the order and needs to be negotiated with us |
| sourceType      | N               | Request source device (IOS, Android, h5)                                                                 |
| userNo          | N               | userNo                                                                                                   |

**3.Request Example**

```
{
	"depositCoinCode": "",
	"equipmentNo": "",
	"fromTokenChain": "",
	"nftLogoUrl": "",
	"nftName": "",
	"orderSide": "",
	"paymentContract": "",
	"platformId": "",
	"receiveCoinCode": "",
	"refundAddr": "",
	"sessionUuid": "",
	"sourceFlag": "",
	"sourceType": "",
	"tokenId": "",
	"userAddr": "",
	"userNo": ""
}
```

**4.Response Data**

```
{
	"data": {
		"depositCoinAmt": "",
		"depositCoinCode": "",
		"destinationAddr": "",
		"equipmentNo": "",
		"isNft": "",
		"nftId": "",
		"nftLogoUrl": "",
		"nftName": "",
		"orderId": "",
		"orderSide": "",
		"orderStatus": "",
		"platformAddr": "",
		"receiveCoinAmt": "",
		"receiveCoinCode": "",
		"refundAddr": "",
		"router": "",
		"txInfo": {},
		"userAddr": ""
	},
	"resCode": "800",
	"resMsg": "success"
}
```


# Add the hash of the order

&#x20;**1. Request Url**

`https://{host}/gt/swap/path/v1/modifyDepositTxId`

**2. Request Param**

| Parameter name  | Is it necessary | description                                                                                              |
| --------------- | --------------- | -------------------------------------------------------------------------------------------------------- |
| depositTxid     | Y               | transaction hash                                                                                         |
| orderId         | Y               | order Id                                                                                                 |
| platformAddress | Y               | platform address                                                                                         |
| userAddress     | Y               | user address                                                                                             |
| equipmentNo     | N               | device ID                                                                                                |
| sessionUuid     | N               | User's unique login ID sessionId                                                                         |
| sourceFlag      | N               | The order source is used to identify which platform created the order and needs to be negotiated with us |
| sourceType      | N               | Request source device (IOS, Android, h5)                                                                 |
| userNo          | N               | userNo                                                                                                   |

**3.Request Example**

```
{
	"depositTxid": "",
	"equipmentNo": "",
	"orderId": "",
	"platformAddress": "",
	"sessionUuid": "",
	"sourceFlag": "",
	"sourceType": "",
	"userAddress": "",
	"userNo": ""
}
```

**4.Response Data**

```
{
	"data": "",
	"resCode": "800",
	"resMsg": "success"
}
```


# Query transaction records

**1. Request Url**

`https://{host}/gt/swap/path/v1/queryAllNftTrade`

**2. Request Param**

| Parameter name | Is it necessary | description                                                                                                                       |
| -------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| orderSide      | Y               | 0---Sell                                  1--- Buy                                     if not passed, the default is to check all |
| page           | Y               | The current number of pages（default: 1）                                                                                           |
| pageSize       | Y               | Number each page（default: 50）                                                                                                     |
| equipmentNo    | N               | device ID                                                                                                                         |
| sessionUuid    | N               | User's unique login ID sessionId                                                                                                  |
| sourceFlag     | N               | The order source is used to identify which platform created the order and needs to be negotiated with us                          |
| sourceType     | N               | Request source device (IOS, Android, h5)                                                                                          |
| userNo         | N               | userNo                                                                                                                            |

**3.Request Example**

```
{
	"equipmentNo": "",
	"orderSide": "",
	"pageNo": 0,
	"pageSize": 0,
	"sessionUuid": "",
	"sourceFlag": "",
	"sourceType": "",
	"userNo": ""
}
```

**4.Response Data**

```
{
	"data": {
		"pageContent": [
			{
				"createTime": "",
				"depositCoinAmt": "",
				"depositCoinCode": "",
				"equipmentNo": "",
				"isNft": "",
				"nftLogoUrl": "",
				"nftName": "",
				"orderId": "",
				"orderSide": "",
				"orderStatus": "",
				"platformAddr": "",
				"receiveCoinAmt": "",
				"receiveCoinCode": "",
				"refundAddr": "",
				"refundCoinAmt": "",
				"router": "",
				"transactionHash": "",
				"userAddr": ""
			}
		],
		"pageNo": 0,
		"pageSize": 0,
		"totalCount": 0,
		"totalPage": 0
	},
	"resCode": "800",
	"resMsg": "success"
}
```


# Check order details

**1. Request Url**

`https://{host}/gt/swap/path/v1/queryOrderState`

**2. Request Param**

| Parameter name | Is it necessary | description                                                                                               |
| -------------- | --------------- | --------------------------------------------------------------------------------------------------------- |
| orderId        | Y               | orderId                                                                                                   |
| equipmentNo    | N               | device ID                                                                                                 |
| sessionUuid    | N               | User's unique login ID sessionId                                                                          |
| sourceFlag     | N               | The order source is used to identify which platform created the order and needs to be negotiated with us. |
| sourceType     | N               | Request source device (IOS, Android, h5)                                                                  |
| userNo         | N               | userNo                                                                                                    |

**3.Request Example**

```
{
	"equipmentNo": "",
	"orderId": "",
	"sessionUuid": "",
	"sourceFlag": "",
	"sourceType": "",
	"userNo": ""
}
```

**4.Response Data**

```
{
	"data": {
		"createTime": "",
		"depositCoinAmt": "",
		"depositCoinCode": "",
		"depositHashExplore": "",
		"depositTxid": "",
		"destinationAddr": "",
		"equipmentNo": "",
		"isNft": "",
		"nftId": "",
		"nftLogoUrl": "",
		"nftName": "",
		"orderId": "",
		"orderSide": "",
		"orderStatus": "",
		"platformAddr": "",
		"receiveCoinAmt": "",
		"receiveCoinCode": "",
		"receiveHashExplore": "",
		"refundAddr": "",
		"refundCoinAmt": "",
		"refundDepositTxid": "",
		"refundHashExplore": "",
		"router": "",
		"transactionHash": "",
		"transactionId": "",
		"userAddr": ""
	},
	"resCode": "800",
	"resMsg": "success"
}
```


