# Guides

## POST - Open platform access to domain names

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/`

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

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## Error Code

<table data-header-hidden><thead><tr><th width="150">code</th><th>Error Code Description</th></tr></thead><tbody><tr><td>0</td><td>Success</td></tr><tr><td>10020</td><td>Parameter error</td></tr><tr><td>10001</td><td>System exception, please contact the administrator</td></tr><tr><td>10003</td><td>Sliding verification error</td></tr><tr><td>10004</td><td>Text message delivery failure</td></tr><tr><td>10005</td><td>Send too often, try again later</td></tr><tr><td>10015</td><td>Operation failure</td></tr><tr><td>10009</td><td>SMS verification code or email verification code is incorrect</td></tr><tr><td>10010</td><td>Google captcha is incorrect</td></tr><tr><td>50000</td><td>http request method is not supported, the global interface is application/json call</td></tr><tr><td>50001</td><td>appKey is illegal</td></tr><tr><td>50002</td><td>The redirect url does not match the merchant configuration</td></tr><tr><td>50003</td><td>Permission group does not exist</td></tr><tr><td>50004</td><td>appKey does not exist</td></tr><tr><td>50005</td><td>Signature error</td></tr><tr><td>50006</td><td>The requested resource cannot be empty</td></tr><tr><td>50007</td><td>Invalid resource request</td></tr><tr><td>50008</td><td>Invalid item prefix</td></tr><tr><td>50009</td><td>Request timeout</td></tr><tr><td>50010</td><td>Illegal request time</td></tr><tr><td>50011</td><td>Network Error</td></tr><tr><td>50012</td><td>No permission to access resources</td></tr><tr><td>50013</td><td>This resource has reached its traffic limit today and is not accessible</td></tr><tr><td>50014</td><td>This merchant does not support such account payments</td></tr><tr><td>60001</td><td>The refreshed token is no longer valid</td></tr><tr><td>60002</td><td>token is no longer valid</td></tr><tr><td>60003</td><td>code has been used, can only be used once</td></tr><tr><td>60004</td><td>Invalid OPENID</td></tr><tr><td>70001</td><td>Order does not exist</td></tr><tr><td>70002</td><td>Order already exists, please do not repeat the order</td></tr><tr><td>70003</td><td>Order Status Exception</td></tr><tr><td>70004</td><td>Illegal payment users</td></tr><tr><td>70005</td><td>Merchant accounts are not available</td></tr><tr><td>70006</td><td>Insufficient account balance</td></tr><tr><td>70007</td><td>This currency is not supported</td></tr><tr><td>70008</td><td>Illegal payment amounts</td></tr><tr><td>70009</td><td>Types of illegal order scenarios</td></tr></tbody></table>

## Account Type

| assetType | Common Asset Types |
| --------- | ------------------ |
| 201       | Normal Balance     |

## Order Status

| orderStatus | Description        |
| ----------- | ------------------ |
| 1           | To be paid         |
| 2           | Payment failure    |
| 3           | Successful payment |
| 0           | Closed             |

## Order Scenario Type

| orderSceneType（即时生成） | Scenario description (merchant definition) |
| -------------------- | ------------------------------------------ |
| 1001                 | Sneak Peek                                 |
| ...                  | ...                                        |


# Development Notes

## Role of public and private keys

* Party A is the third-party business caller&#x20;
* Party B is the service provider of ChainUp&#x20;

The role of public-private key pair: Party A needs to generate a pair of public-private keys in advance when creating the application in the background, where the public key (rsa\_third\_pub) is provided to Party B, and the private key is kept by itself. When Party A requests the service provided by Party B, Party B encrypts the request parameters with Party B's public key and signs the original MD5 data with Party A's private key; when Party B receives the request, Party B decrypts the data with Party B's private key and checks the original MD5 data with Party A's public key.

## Account Preparation

Developers need to prepare the following information.&#x20;

1. Generate a pair of public and private keys, and submit the public key to the platform by creating an application in the background&#x20;
2. Third-party application server IP (optional)

&#x20;The information that the developer needs to save.&#x20;

1. The private key corresponding to the public key submitted to the platform: rsa\_third\_pri .&#x20;
2. The unique identifier of the created application: app\_id. The public key of the application corresponding to the platform: rsa\_saas\_pub.

### RSA public-private key production address

Production rules.&#x20;

Cipher length: 2048&#x20;

Key format: PKCS#8&#x20;

### Interface rules&#x20;

| Transmission method.:    | https                                                                                                       |
| ------------------------ | ----------------------------------------------------------------------------------------------------------- |
| Signature fields:        | All required fields except the sign field need to be involved in the signature                              |
| Response status code is: | 0 means successful processing, non-0 means request error or system exception                                |
| Request address:         | Domain name + interface address                                                                             |
| Encryption algorithm:    | Java encryption and decryption demo ： <https://github.com/exchange-platformApi/platformV2-java-example.git> |

## Interface documentation

&#x20;All the POST requests below need to convert the parameters in the Query object to json strings, encrypt them as data using rsa\_saas\_pub, and sign the data using the rsa\_third\_pri private key.

this is [demo](https://github.com/exchange-platformApi/platformV2-java-example/blob/b62e39e9bc1e4f9e562d82a54c1d0cb6be874fbe/exchange-platform-v2-example/src/main/java/com/chainup/open/exchangeplatformv2example/example/RequestDemo.java#L17)


# OAuth Authorization

## Step 1

## OAuth authorization login page (accessed in browser)

<mark style="color:blue;">`GET`</mark> `https://service.xxx.com/platform/login.html`

The final login page is stitched together as : <https://service.xxx.com/platform/login.html?appKey=xxx\\&redirectUrl=xxx\\&state=xxx> After successful login with code redirect to redirectUrl

#### Query Parameters

| Name                                          | Type   | Description                                       |
| --------------------------------------------- | ------ | ------------------------------------------------- |
| appKey<mark style="color:red;">\*</mark>      | String | Merchant AppKey                                   |
| redirectUrl<mark style="color:red;">\*</mark> | String | Jump to page after successful authorization login |
| state                                         | String | Merchant incoming status field                    |

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

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

#### parameters:

| name        | type   | required | example                                                                                                        | Description                                       |
| ----------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
| appKey      | string | YES      | xxx\_xxx                                                                                                       | Merchant AppKey                                   |
| redirectUrl | string | YES      | The page to redirect to after successful authorization login should be consistent with the merchant's backend. | Jump to page after successful authorization login |

## Step 2

## Get token and openId by code

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/auth/token`

It is necessary to package the data in the parameter table into JSON strings and use rsa for parameter encryption and signature as data and sign in the body

#### Request Body

| Name                                      | Type   | Description     |
| ----------------------------------------- | ------ | --------------- |
| app\_id<mark style="color:red;">\*</mark> | String | Merchant AppKey |
| time<mark style="color:red;">\*</mark>    | String | timestemp       |
| sign<mark style="color:red;">\*</mark>    | String |                 |
| data                                      | String |                 |

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

```javascript
{
    "code": "", //Return code	
    "msg": "", //Success or failure message	
    "data": "",
    "sign": ""
}


data:
{
     "openId":"xxxx",  //The unique openId of the merchant to which the authorized user belongs	
     "expireIn":"xxxx",  //token expiration time, seconds	
     "refreshToken":"xxxxx",  //The token required to refresh the token
     "token":"xxxx". //Authorized token	
}
```

{% endtab %}
{% endtabs %}

The following are the parameters involved in rsa encryption:

| name | type   | required | example                            | Description                                                                     |
| ---- | ------ | -------- | ---------------------------------- | ------------------------------------------------------------------------------- |
| code | string | YES      | 2ae04ed9165624419bad68e9e0f3f29fbd | The returned code when calling the first step of login for user authentication. |

## Refresh token

## Refresh token

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/auth/refreshToken`

It is necessary to package the data in the parameter table into JSON strings and use rsa for parameter encryption and signature as data and sign in the body

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                      | Type   | Description     |
| ----------------------------------------- | ------ | --------------- |
| app\_id<mark style="color:red;">\*</mark> | String | Merchant AppKey |
| time<mark style="color:red;">\*</mark>    | String | timestemp       |
| data<mark style="color:red;">\*</mark>    | String |                 |
| sign<mark style="color:red;">\*</mark>    | String |                 |

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

```javascript
{
    "code": "", //Return to cod	
    "msg": "", //Success or failure message	
    "data": "",
    "sign": ""
}

data:

{
    "openId":"xxxx",  //The unique openId of the merchant to which the authorized user belongs	
    "expireIn":"xxxx",  //token expiration time, seconds	
    "refreshToken":"xxxxx",  //The token required to refresh the token	
    "token":"xxxx". //Authorized token	
}
```

{% endtab %}
{% endtabs %}

The following are the parameters involved in rsa encryption:

| name         | type   | required | example                            | Description                                                         |
| ------------ | ------ | -------- | ---------------------------------- | ------------------------------------------------------------------- |
| refreshToken | string | YES      | 4dbca5afca8a46f48d863d18bsdd644731 | The "refresh\_token" received when obtaining the token.             |
| token        | string | YES      | 2ae04ed9165624419bad68e9e0f3f29fbd | The token previously authorized before.                             |
| openId       | string | YES      | 4dbca5afca8a46f48d863d18bsdd644731 | The unique openId of the authorized user belonging to the merchant. |


# Payments

## Step 1

## Create a payment order

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/opay/createThirdOrder`

It is necessary to package the data in the parameter table into JSON strings and use rsa for parameter encryption and signature as data and sign in the body

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Content-Type	<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                      | Type   | Description     |
| ----------------------------------------- | ------ | --------------- |
| app\_id<mark style="color:red;">\*</mark> | String | Merchant AppKey |
| sign<mark style="color:red;">\*</mark>    | String |                 |
| data<mark style="color:red;">\*</mark>    | String |                 |
| time<mark style="color:red;">\*</mark>    | String |                 |

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

```javascript
{
    "code": "", //Return code	
    "msg": "", //Success or failure message	
    "data": "",
    "sign": ""
}

data:
{
    "orderNum":"xxxx"  //Order Number		
}
```

{% endtab %}
{% endtabs %}

The following are the parameters involved in rsa encryption:

<table><thead><tr><th>name</th><th>type</th><th>required</th><th width="250">example</th><th>Description</th></tr></thead><tbody><tr><td>appOrderId</td><td>String</td><td>YES</td><td>11321</td><td>Merchant Order ID</td></tr><tr><td>openId</td><td>String</td><td>YES</td><td>2ae04ed9165624419bad68e9e0f3f29fbd</td><td>Paying user's unique ID: payerUserId</td></tr><tr><td>userId</td><td>String</td><td>YES</td><td>22033390</td><td>Paying user's UID (either UID or OpenID must exist, OpenID takes priority if both exist): payerUid</td></tr><tr><td>orderAmount</td><td>String</td><td>YES</td><td>10</td><td>amount</td></tr><tr><td>orderSceneType</td><td>String</td><td>NO</td><td>1000011</td><td>Scene type of the order, numerical enumeration</td></tr><tr><td>payCoinSymbol</td><td>String</td><td>YES</td><td>BTC</td><td>Payment currency, capitalized as BTCappKey</td></tr><tr><td>returnPage</td><td>String</td><td>YES</td><td>https://www.google.com</td><td>Front-end jump to merchant's page</td></tr><tr><td>notifyPage</td><td>String</td><td>YES</td><td>https://www.google.com</td><td>Address for back-office notification to merchants</td></tr><tr><td>token</td><td>String</td><td>NO</td><td>2ae04ed9165624419bad68e9e0f3f29fbd</td><td>Authorized token</td></tr><tr><td>goods</td><td>String</td><td>NO</td><td>Product description information, can not be passed, passed must be legal json format, otherwise the order creation failure; json in the subfield for name : product name desc: product description Example: [{"name": "Product 1", "desc": "Product information 123balabala"},{"name": "Product 2", "desc":" Product information 23balabala"},{"name": "Product 3", "desc": "Product information 33balabala"}]</td><td></td></tr></tbody></table>

## Step 2

## Payment Page

<mark style="color:blue;">`GET`</mark> `https://service.xxx.com/platform/pay.html`

After the final payment page is assembled as:\
[**https://service.xxx.com/**](https://platform.xxx.com/pay.html?appKey=xxx\&openId=xxx\&token=xxx\&orderNum=xxx)[**platform**](http://platform.apple.com/?appKey=apple_6746\&redirectUrl=https://www.chainup.com)**/**[**pay.html?appKey=xxx\&openId=xxx\&token=xxx\&orderNum=xxx**](https://platform.xxx.com/pay.html?appKey=xxx\&openId=xxx\&token=xxx\&orderNum=xxx)

#### Query Parameters

| Name     | Type   | Description                                             |
| -------- | ------ | ------------------------------------------------------- |
| appKey   | String | Merchant AppKey                                         |
| orderNum | String | Platform number payer openId, must be the order creator |
| openId   | String | payer openId, must be the order creator                 |
| userId   | String | Payment user uid (one must exist with openid)           |
| token    | String | Authorized token                                        |

parameters:

Either UID or OpenID is required.

<table><thead><tr><th>name</th><th>type</th><th>required</th><th width="250">example</th><th>Description</th></tr></thead><tbody><tr><td>orderNum</td><td>String</td><td>YES</td><td>1000000009</td><td>Platform number payer openId, must be the order creator</td></tr><tr><td>openId</td><td>String</td><td>NO</td><td>2ae04ed9165624419bad68e9e0f3f29fbd</td><td>payer openId, must be the order creator</td></tr><tr><td>userId</td><td>String</td><td>NO</td><td>2023203</td><td>Payment user uid (one must exist with openid)</td></tr><tr><td>token</td><td>String</td><td>NO</td><td>2ae04ed9165624419bad68e9e0f3f29fbd</td><td>Authorized token</td></tr></tbody></table>

## Step 3

## Payment result callback interface

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/notifyPage`

The interface URL is provided by the docking merchant, and the parameter passed in the first step of creating the order: notifyPage After the payment is completed, the payment result will be notified through the URL corresponding to the notifyPage

It is necessary to package the data in the parameter table into JSON strings and use rsa for parameter encryption and signature as data and sign in the body

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                      | Type   | Description     |
| ----------------------------------------- | ------ | --------------- |
| app\_id<mark style="color:red;">\*</mark> | String | Merchant AppKey |
| sign<mark style="color:red;">\*</mark>    | String | Signature       |
| data<mark style="color:red;">\*</mark>    | String |                 |
| time<mark style="color:red;">\*</mark>    | String |                 |

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

```javascript
{
    "code": "", //Return code	
    "msg": "", //Success or failure message	
    "data": "",//The client receives the request and returns success, which means the request has been received		
    "sign":""      
}
```

{% endtab %}
{% endtabs %}

The following are the parameters involved in rsa encryption:

<table><thead><tr><th>name</th><th width="124">type</th><th>required</th><th width="250">example</th><th>Description</th></tr></thead><tbody><tr><td>outOrderId</td><td>String</td><td>YES</td><td>1000000009</td><td>Merchant side order number</td></tr><tr><td>orderNum</td><td>String</td><td>YES</td><td>10000000002</td><td>Open Platform Order Number</td></tr><tr><td>orderStatus</td><td>String</td><td>YES</td><td>1</td><td>Order status (1 Pending payment; 2 Payment failed; 3 Payment successful; 0 Closed)</td></tr><tr><td>payAmount</td><td>String</td><td>YES</td><td>200</td><td>Order amount</td></tr><tr><td>returnUrl</td><td>String</td><td>YES</td><td>https://www.google.com</td><td>Synchronized notification page (order placement interface incoming)</td></tr></tbody></table>

## Query Payment Order

## Query Payment Order

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/opay/orderDetail`

It is necessary to package the data in the parameter table into JSON strings and use rsa for parameter encryption and signature as data and sign in the body

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Content-Type	<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                       | Type   | Description                |
| ------------------------------------------ | ------ | -------------------------- |
| appKey<mark style="color:red;">\*</mark>   | String | Merchant AppKey            |
| orderNum<mark style="color:red;">\*</mark> | String | Platform side order number |
| token                                      | String | Authorized token           |

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

<pre class="language-javascript"><code class="lang-javascript"><strong>{
</strong>        "totalAccount": [ // List of all accounts supported by the merchant
            {
                "accountName": "name", // Account name (displayed in the dropdown menu)
                "accountType": 202001, // Account type (equivalent to the ID to be passed back to the backend)
                "accountBalance": 1000.21 // Balance of the account for the payment user
            },
            {
                "accountName": "name",
                "accountType": 203001,
                "accountBalance": 1000.21
            }
        ],
        "googleStatus": 1, // Whether Google verification is enabled; 0 - Disabled, 1 - Enabled
        "appOrderId": "100000009", // Merchant order ID
        "sign": "2ae04ed9165624419bad68e9e0f3f29fbdqws2ae04ed9165624419bad68e9e0f3f29fbd", // Signature
        "orderNum": "12321", // Order number
        "orderStatus": "1", // Order status (1 - Pending payment; 2 - Payment failed; 3 - Payment successful; 0 - Closed)
        "userId": 230000, // User ID
        "isOpenMobileCheck": "1", // Whether mobile SMS verification is enabled; 0 - Disabled, 1 - Enabled
        "orderAmount": "20001.21", // Order amount
        "payCoinSymbol": "btc", // Payment currency
        "ctime": "20000000",
        "appKey": "xxx_xxx",
        "showPrecision": "8" // Display precision
}
</code></pre>

{% endtab %}
{% endtabs %}

parameters :

<table><thead><tr><th>name</th><th width="124">type</th><th>required</th><th width="250">example</th><th>Description</th></tr></thead><tbody><tr><td>appKey</td><td>String</td><td>YES</td><td>xxx_xxx</td><td>Merchant AppKey</td></tr><tr><td>orderNum</td><td>String</td><td>YES</td><td>10000000002</td><td>Platform side order number</td></tr><tr><td>token</td><td>String</td><td>NO</td><td>2ae04ed9165624419bad68e9e0f3f29fbd</td><td>Authorized token</td></tr></tbody></table>

## Merchant Daily Posting Statement

## Merchant Daily Posting Statement

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/opay/merchantBillingDay`

It is necessary to package the data in the parameter table into JSON strings and use rsa for parameter encryption and signature as data and sign in the body

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Content-Type	<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                      | Type   | Description     |
| ----------------------------------------- | ------ | --------------- |
| app\_id<mark style="color:red;">\*</mark> | String | Merchant AppKey |
| sign<mark style="color:red;">\*</mark>    | String | Signature       |
| data<mark style="color:red;">\*</mark>    | String |                 |
| time<mark style="color:red;">\*</mark>    | String |                 |

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

```javascript
{
  "code": "",
  "msg": "",
  "data": "",
  "sign: ""
}

data
{
        "count": 1000, // Total number of records for the day
        "list": [
            {
                "merchantUserId": 23000, // Merchant's receiving user ID
                "appOrderId": "100000019", // Merchant's order ID
                "payCoinSymbol": "btc", // Payment currency used
                "orderAmount": 10, // Order amount
                "orderType": 1, // Order type (1 - Payment order; 11 - Transfer (refund) order)
                "userId": 230000, // Payer's user ID
                "openId": "2ae04ed9165624419bad68e9e0f3f29fbd", // Payer's OpenID
                "createTime": "11200321123", // Order creation time in milliseconds
                "payTime": "320012321" // Actual payment completion time in milliseconds
            },
            {
                "merchantUserId": 23000, // Merchant's receiving user ID
                "appOrderId": "100000019", // Merchant's order ID
                "payCoinSymbol": "btc", // Payment currency used
                "orderAmount": 10, // Order amount
                "orderType": 1, // Order type (1 - Payment order; 11 - Transfer (refund) order)
                "userId": 230000, // Payer's user ID
                "openId": "2ae04ed9165624419bad68e9e0f3f29fbd", // Payer's OpenID
                "createTime": "11200321123", // Order creation time in milliseconds
                "payTime": "320012321" // Actual payment completion time in milliseconds
            }
        ]
    }
```

{% endtab %}
{% endtabs %}

The following are the parameters involved in rsa encryption:

<table><thead><tr><th width="136">name</th><th width="124">type</th><th>required</th><th width="214">example</th><th>Description</th></tr></thead><tbody><tr><td>orderType</td><td>String</td><td>YES</td><td>1</td><td>Order type (1=payment order; 11=transfer order), do not pass query all orders</td></tr><tr><td>day</td><td>String</td><td>YES</td><td>2099-01-01</td><td>Statistics of the date, the format: yyyy-MM-dd, does not match the format parameter exception; does not pass the query the order of the day</td></tr><tr><td>pageNum</td><td>String</td><td>YES</td><td>1</td><td>Query the first few pages, the same paging logic; do not pass to check all</td></tr><tr><td>pageSize</td><td>String</td><td>YES</td><td>200</td><td>The size of each page, the same paging logic; do not pass to check 2000 (the maximum is 2000, data more than 2000 please paging query)</td></tr></tbody></table>

## Cancel Pending Orders

## Cancel Pending Orders

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/opay/cancelOrder`

It is necessary to package the data in the parameter table into JSON strings and use rsa for parameter encryption and signature as data and sign in the body

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Content-Type	<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                      | Type   | Description     |
| ----------------------------------------- | ------ | --------------- |
| app\_id<mark style="color:red;">\*</mark> | String | Merchant AppKey |
| time<mark style="color:red;">\*</mark>    | String |                 |
| data<mark style="color:red;">\*</mark>    | String |                 |
| sign<mark style="color:red;">\*</mark>    | String |                 |

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

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

The following are the parameters involved in rsa encryption:

<table><thead><tr><th width="136">name</th><th width="124">type</th><th>required</th><th width="214">example</th><th>Description</th></tr></thead><tbody><tr><td>orderNum</td><td>String</td><td>YES</td><td>10000001</td><td>订单编号</td></tr></tbody></table>


# Coin Grants/Refund

## Coin Grants/Refund

## Coin Grants/Refund

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/opay/refundOrder`

It is necessary to package the data in the parameter table into JSON strings and use rsa for parameter encryption and signature as data and sign in the body

#### Request Body

| Name                                      | Type   | Description     |
| ----------------------------------------- | ------ | --------------- |
| app\_id<mark style="color:red;">\*</mark> | String | Merchant AppKey |
| sign<mark style="color:red;">\*</mark>    | String | Signature       |
| data<mark style="color:red;">\*</mark>    | String |                 |
| time<mark style="color:red;">\*</mark>    | String |                 |

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

```javascript
{
  "code": "",
  "msg": "o",
  "data": "",
  "sign":""
}

data:
{
    "orderNum": "xxxx"
}
```

{% endtab %}
{% endtabs %}

The following are the parameters involved in rsa encryption:

Either the UID or OpenID of the payee must exist, and if both are present, the OpenID takes precedence.

<table><thead><tr><th width="136">name</th><th width="124">type</th><th>required</th><th width="214">example</th><th>Description</th></tr></thead><tbody><tr><td>appOrderId</td><td>String</td><td>YES</td><td>10000001</td><td>Merchant-side order id, unique across the board</td></tr><tr><td>assetType</td><td>String</td><td>YES</td><td>202012</td><td>Payment account type: AB part of AB, default to available accounts</td></tr><tr><td>openId</td><td>String</td><td>NO</td><td></td><td>The unique id of the receiving user, the unique identification of the user authorized by the open platform to the application</td></tr><tr><td>userId</td><td>String</td><td>NO</td><td></td><td>Receiving user uid (and openid must exist a) || at the same time there is priority to take openid</td></tr><tr><td>orderAmount</td><td>String</td><td>YES</td><td>200</td><td>Amount</td></tr><tr><td>orderSceneType</td><td>String</td><td>NO</td><td>202</td><td>Scene type of the order, numerical enumeration.</td></tr><tr><td>payCoinSymbol</td><td>String</td><td>YES</td><td>btc</td><td>Payment currency, capitalized as BTC</td></tr></tbody></table>


# User Asset

## User asset search (single currency)

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/ouser/userAccounts`

It is necessary to package the data in the parameter table into JSON strings and use rsa for parameter encryption and signature as data and sign in the body

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Content-Type	<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                      | Type   | Description     |
| ----------------------------------------- | ------ | --------------- |
| app\_id<mark style="color:red;">\*</mark> | String | Merchant AppKey |
| time<mark style="color:red;">\*</mark>    | String |                 |
| sign<mark style="color:red;">\*</mark>    | String |                 |
| data<mark style="color:red;">\*</mark>    | String |                 |

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

<pre class="language-javascript"><code class="lang-javascript"><strong>{
</strong>  "code": "",
  "msg": "",
  "data": "",
  "sign": ""
}

data:
{
        "BTCPrecision": "btc8", // Currency parameter + precision: Precision of the currency in the exchange
        "accounts": [
            {
                "uid": "202113", // User ID
                "balance": "1000", // Account balance
                "tag": "xxxxx", // Description
                "type": "2021101" // Asset code
            },
            {
                "uid": "202113", // User ID
                "balance": "1000", // Account balance
                "tag": "xxxxx", // Description
                "type": "2021101" // Asset code
            }
        ],
        "USDTPrecision": "usdt8" // Currency parameter + precision: Precision of the currency in the exchange
    }
</code></pre>

{% endtab %}
{% endtabs %}

The following are the parameters involved in rsa encryption:

Either the UID or OpenID of the payee must exist, and if both are present, the OpenID takes precedence.

<table><thead><tr><th width="136">name</th><th width="124">type</th><th>required</th><th width="214">example</th><th>Description</th></tr></thead><tbody><tr><td>openId</td><td>String</td><td>NO</td><td></td><td>openId, userId must pass one, while passing, take openId</td></tr><tr><td>userId</td><td>String</td><td>NO</td><td></td><td>openId, userId must pass one, while passing, take openId</td></tr><tr><td>coinSymbols</td><td>String</td><td>YES</td><td>BTC</td><td>Currency type: e.g. BTC, USDT, BIKI, etc.; refer to the currency configuration in the exchange; multiple currencies are separated by commas: Example: "USDT,BTC,ETH"</td></tr><tr><td>assetType</td><td>String</td><td>NO</td><td>201</td><td>Common type: "201" : General account balance</td></tr></tbody></table>

## User account balance (full currency)

<mark style="color:green;">`POST`</mark> `https://service.xxx.om//platformapi/chainup/open/user/accountBalance`

It is necessary to package the data in the parameter table into JSON strings and use rsa for parameter encryption and signature as data and sign in the body

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Content-Type	<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                      | Type   | Description     |
| ----------------------------------------- | ------ | --------------- |
| app\_id<mark style="color:red;">\*</mark> | String | Merchant AppKey |
| time<mark style="color:red;">\*</mark>    | String |                 |
| data<mark style="color:red;">\*</mark>    | String |                 |
| sign<mark style="color:red;">\*</mark>    | String |                 |

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

```javascript
{
    "code": "", //Return code	
    "msg": "", //Success or failure message	
    "data": "",
    "sign": ""
}

data:

{
        "totalBalance": "100", // Total assets
        "totalBalanceSymbol": "BTC", // Total asset symbol
        "platformCoin": "xxx", // Platform coin for dividend configuration
        "allCoinMap": { // Mapping of all coins, where the key is the uppercase coin symbol and the value is the asset details for each coin
            "LTC": {
                "walletTransactionOpen": 1, // Whether the coin has wallet transaction enabled
                "isFiat": 0, // Whether it is a fiat currency, 0 for digital currency, 1 for fiat
                "normal_balance": "200", // User's normal spot balance
                "allBalance": "9000", // Total balance
                "exchange_symbol": "Trading pair", // Trading pair symbol
                "present_coin_balance": 9000, // Gift coin account
                "lock_position_balance": "2000", // Lock position account
                "btcValuatin": "10000", // BTC valuation
                "sort": 20, // Sorting order
                "depositOpen": 1, // Whether deposit is open
                "lock_grant_divided_balance": "999999", // User's token lock + mining lock balance
                "total_balance": "99999", // Total balance
                "nc_lock_balance": "98888", // User's subscription frozen balance
                "otcOpen": 1, // Whether OTC is open
                "depositMin": 20, // Minimum deposit amount
                "checked": "true", // Whether to hide zero assets, default to true
                "coinName": "name", // Name
                "lock_balance": "3000", // Frozen amount
                "allBtcValuatin": "9918923", // All BTC valuation
                "lock_position_v2_amount": "203213", // User's token lock account V2
                "withdrawOpen": 1, // Whether withdrawal is open
                "overcharge_balance": "9000"
            },
            "BCH": {
                "walletTransactionOpen": 1, // Whether the coin has wallet transaction enabled
                "isFiat": 0, // Whether it is a fiat currency, 0 for digital currency, 1 for fiat
                "normal_balance": "200", // User's normal spot balance
                "allBalance": "9000", // Total balance
                "exchange_symbol": "Trading pair", // Trading pair symbol
                "present_coin_balance": 9000, // Gift coin account
                "lock_position_balance": "2000", // Lock position account
                "btcValuatin": "10000", // BTC valuation
                "sort": 20, // Sorting order
                "depositOpen": 1, // Whether deposit is open
                "lock_grant_divided_balance": "999999", // User's token lock + mining lock balance
                "total_balance": "99999", // Total balance
                "nc_lock_balance": "98888", // User's subscription frozen balance
                "otcOpen": 1, // Whether OTC is open
                "depositMin": 20, // Minimum deposit amount
                "checked": "true", // Whether to hide zero assets, default to true
                "coinName": "name", // Name
                "lock_balance": "3000", // Frozen amount
                "allBtcValuatin": "9918923", // All BTC valuation
                "lock_position_v2_amount": "203213", // User's token lock account V2
                "withdrawOpen": 1, // Whether withdrawal is open
                "overcharge_balance": "9000"
            }
        }
    }
```

{% endtab %}
{% endtabs %}

The following are the parameters involved in rsa encryption:

(openId, userId, mobileNumber, email) One of these four must be provided.

<table><thead><tr><th width="136">name</th><th width="124">type</th><th>是否required</th><th width="214">例子</th><th>Description</th></tr></thead><tbody><tr><td>openId</td><td>String</td><td>NO</td><td></td><td>openId, userId must pass one, while passing, take openId</td></tr><tr><td>userId</td><td>String</td><td>NO</td><td></td><td>openId, userId must pass one, while passing, take openId</td></tr><tr><td>mobileNumber</td><td>String</td><td>NO</td><td>09011223</td><td>Cell phone number</td></tr><tr><td>email</td><td>String</td><td>NO</td><td>xxxxx@.com</td><td>Useremail(openId,userId,mobileNumber,email)Four choices are required</td></tr></tbody></table>

## Get user top-up records

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/user/depositRecord`

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Content-Type	<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                      | Type   | Description     |
| ----------------------------------------- | ------ | --------------- |
| app\_id<mark style="color:red;">\*</mark> | String | Merchant AppKey |
| time<mark style="color:red;">\*</mark>    | String |                 |
| sign<mark style="color:red;">\*</mark>    | String |                 |
| data<mark style="color:red;">\*</mark>    | String |                 |

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

```javascript
{
  "code": "",
  "msg": "",
  "data": "",
  "sign":""
}

data:
[
    {
        "symbol": "usdt", // Deposit coin symbol
        "id": 112331, // Deposit ID
        "uid": -230000, // Deposit user ID
        "createdAt": 1233200092, // Deposit creation time
        "addressTo": "xxxxxxxxx", // Deposit address
        "amount": "1", // Deposit amount
        "txid": "xxxxx", // TXID
        "status": 1, // Deposit status: 0 - Pending, 1 - Completed, 2 - Deposit exception
        "depositType": 0, // Deposit type: 0 - External deposit, 1 - Internal deposit
        "statusDesc": "xxxxx", // Deposit status description
        "mobileNumber": "08666666", // User's mobile number
        "email": "xxxxx", // User's email
        "riskLevel": 0 // Risk level: 0 - No risk detected, 1 - Low risk, 2 - Medium risk, 3 - High risk
    },
    {
        "symbol": "bnb", // Deposit coin symbol
        "id": 112331, // Deposit ID
        "uid": -230000, // Deposit user ID
        "createdAt": 1233200092, // Deposit creation time
        "addressTo": "xxxxxxxxx", // Deposit address
        "amount": "1", // Deposit amount
        "txid": "xxxxx", // TXID
        "status": 1, // Deposit status: 0 - Pending, 1 - Completed, 2 - Deposit exception
        "depositType": 0, // Deposit type: 0 - External deposit, 1 - Internal deposit
        "statusDesc": "xxxxx", // Deposit status description
        "mobileNumber": "08666666", // User's mobile number
        "email": "xxxxx", // User's email
        "riskLevel": 0 // Risk level: 0 - No risk detected, 1 - Low risk, 2 - Medium risk, 3 - High risk
    },
    {
        "symbol": "btc", // Deposit coin symbol
        "id": 112331, // Deposit ID
        "uid": -230000, // Deposit user ID
        "createdAt": 1233200092, // Deposit creation time
        "addressTo": "xxxxxxxxx", // Deposit address
        "amount": "1", // Deposit amount
        "txid": "xxxxx", // TXID
        "status": 1, // Deposit status: 0 - Pending, 1 - Completed, 2 - Deposit exception
        "depositType": 0, // Deposit type: 0 - External deposit, 1 - Internal deposit
        "statusDesc": "xxxxx", // Deposit status description
        "mobileNumber": "08666666", // User's mobile number
        "email": "xxxxx", // User's email
        "riskLevel": 0 // Risk level: 0 - No risk detected, 1 - Low risk, 2 - Medium risk, 3 - High risk
    },
    {
        "symbol": "eth", // Deposit coin symbol
        "id": 112331, // Deposit ID
        "uid": -230000, // Deposit user ID
        "createdAt": 1233200092, // Deposit creation time
        "addressTo": "xxxxxxxxx", // Deposit address
        "amount": "1", // Deposit amount
        "txid": "xxxxx", // TXID
        "status": 1, // Deposit status: 0 - Pending, 1 - Completed, 2 - Deposit exception
        "depositType": 0, // Deposit type: 0 - External deposit, 1 - Internal deposit
        "statusDesc": "xxxxx", // Deposit status description
        "mobileNumber": "08666666", // User's mobile number
        "email": "xxxxx", // User's email
        "riskLevel": 0 // Risk level: 0 - No risk detected, 1 - Low risk, 2 - Medium risk, 3 - High risk
    }
]
```

{% endtab %}
{% endtabs %}

The following are the parameters involved in rsa encryption:

<table><thead><tr><th width="136">名称</th><th width="124">类型</th><th>是否必需</th><th width="214">例子</th><th>描述</th></tr></thead><tbody><tr><td>openId</td><td>String</td><td>NO</td><td></td><td>openId, userId must pass one, while passing, take openId</td></tr><tr><td>userId</td><td>String</td><td>NO</td><td></td><td>openId, userId must pass one, while passing, take openId</td></tr><tr><td>mobileNumber</td><td>String</td><td>NO</td><td>09011223</td><td>Cell phone number</td></tr><tr><td>email</td><td>String</td><td>NO</td><td>xxxxx@.com</td><td>User email(openId,userId,mobileNumber,email)Four choices are required</td></tr><tr><td>pageSize</td><td>String</td><td>NO</td><td>20</td><td>Number of pages per page (default, 20, max 1000, can be equal to 1000)</td></tr><tr><td>pageNumber</td><td>String</td><td>NO</td><td>1</td><td>Number of pages (default 1, first page)</td></tr></tbody></table>

## User cash withdrawal records

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/user/withdrawRecord`

It is necessary to package the data in the parameter table into JSON strings and use rsa for parameter encryption and signature as data and sign in the body

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                      | Type   | Description     |
| ----------------------------------------- | ------ | --------------- |
| app\_id<mark style="color:red;">\*</mark> | String | Merchant AppKey |
| time<mark style="color:red;">\*</mark>    | String |                 |
| data<mark style="color:red;">\*</mark>    | String |                 |
| sign<mark style="color:red;">\*</mark>    | String |                 |

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

```javascript
{
  "code": "",
  "msg": "",
  "data": "",
  "sign": ""
}

data:

[
        {
            "symbol": "BTC", // Withdrawal coin symbol
            "id": 1112, // Withdrawal ID
            "uid": 2302221, // User ID
            "createdAt": 100892232313, // Withdrawal creation time
            "addressTo": "xxxxxxxxx", // Withdrawal address
            "amount": "20", // Withdrawal amount
            "txid": "xxxxxxxxxx", // TXID
            "status": 1, // Withdrawal status: 0 - Pending approval, 1 - Approved, 2 - Rejected, 3 - Payment in progress, 4 - Payment failed, 5 - Completed, 6 - Canceled
            "statusDesc": "test", // Withdrawal status description
            "fee": "20", // Fee
            "mobileNumber": "19982112", // Mobile number
            "email": "xxxx@.com", // Email
            "warningLevel": 1, // Risk warning level
            "warningLevelDesc": "test", // Warning level description
            "warningTip": "resr", // Warning content
            "warningTiplevel": 1 // Warning level displayed in merchant backend
        },
        {
            "symbol": "BTC", // Withdrawal coin symbol
            "id": 1112, // Withdrawal ID
            "uid": 2302221, // User ID
            "createdAt": 100892232313, // Withdrawal creation time
            "addressTo": "xxxxxxxxx", // Withdrawal address
            "amount": "20", // Withdrawal amount
            "txid": "xxxxxxxxxx", // TXID
            "status": 1, // Withdrawal status: 0 - Pending approval, 1 - Approved, 2 - Rejected, 3 - Payment in progress, 4 - Payment failed, 5 - Completed, 6 - Canceled
            "statusDesc": "test", // Withdrawal status description
            "fee": "20", // Fee
            "mobileNumber": "19982112", // Mobile number
            "email": "xxxx@.com", // Email
            "warningLevel": 1, // Risk warning level
            "warningLevelDesc": "test", // Warning level description
            "warningTip": "resr", // Warning content
            "warningTiplevel": 1 // Warning level displayed in merchant backend
        }
    ]
```

{% endtab %}
{% endtabs %}

The following are the parameters involved in rsa encryption:

<table><thead><tr><th width="136">名称</th><th width="124">类型</th><th>是否必需</th><th width="214">例子</th><th>描述</th></tr></thead><tbody><tr><td>openId</td><td>String</td><td>NO</td><td></td><td>openId, userId must pass one, while passing, take openId</td></tr><tr><td>userId</td><td>String</td><td>NO</td><td></td><td>openId, userId must pass one, while passing, take openId</td></tr><tr><td>mobileNumber</td><td>String</td><td>NO</td><td>09011223</td><td>Cell phone number</td></tr><tr><td>email</td><td>String</td><td>NO</td><td>xxxxx@.com</td><td>User email(openId,userId,mobileNumber,email)Four choices are required</td></tr><tr><td>pageSize</td><td>String</td><td>NO</td><td>20</td><td>Number of pages per page (default, 20, max 1000, can be equal to 1000)</td></tr><tr><td>pageNumber</td><td>String</td><td>NO</td><td>1</td><td>Number of pages (default 1, first page)</td></tr></tbody></table>

## Generate user's deposit address

## User's deposit address

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/user/depositAddress`

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                      | Type   | Description     |
| ----------------------------------------- | ------ | --------------- |
| app\_id<mark style="color:red;">\*</mark> | String | Merchant AppKey |
| data<mark style="color:red;">\*</mark>    | String |                 |
| sign<mark style="color:red;">\*</mark>    | String | Signature       |
| time<mark style="color:red;">\*</mark>    | String |                 |

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

```javascript
{
  "code": "",
  "msg": "",
  "data": "",
  "sign":""
}

data:
[
  {
    "code": "0",
    "msg": "Success",
    "data": {
      "address": "xxxxx",//deposit address
      "meta": "xxxxx"//Return for special tokens, and return null string as default
    }
  }
]
```

{% endtab %}
{% endtabs %}

<table><thead><tr><th width="136">name</th><th width="124">type</th><th>required</th><th width="214">example</th><th>Description</th></tr></thead><tbody><tr><td>appKey</td><td>String</td><td>YES</td><td>xxx_xxx</td><td>Merchant AppKey</td></tr><tr><td>openId</td><td>String</td><td>NO</td><td></td><td>openId, userId must pass one, while passing, take openId</td></tr><tr><td>userId</td><td>String</td><td>NO</td><td></td><td>openId, userId must pass one, while passing, take openId</td></tr><tr><td>symbol</td><td>String</td><td>YES</td><td>BTC</td><td>Symbol</td></tr><tr><td>sign</td><td>String</td><td>YES</td><td>2ae04ed9165624419bad68e9e0f3f2sa9fbd2ae04ed916511624419bad68e9e20f3f29fbd</td><td>Signature</td></tr></tbody></table>

##

## User asset search (multiple currency)

## User asset search (single currency)

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/ouser/userAccounts`

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Content-Type	<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                      | Type   | Description     |
| ----------------------------------------- | ------ | --------------- |
| app\_id<mark style="color:red;">\*</mark> | String | Merchant AppKey |
| data<mark style="color:red;">\*</mark>    | String |                 |
| sign<mark style="color:red;">\*</mark>    | String | Signature       |
| time<mark style="color:red;">\*</mark>    | String |                 |

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

<pre class="language-javascript"><code class="lang-javascript"><strong>{
</strong>  "code": "",
  "msg": "",
  "data": "",
  "sign":""
}


data:
[
    {
        "code": "0",
        "msg": "Success",
        "data": {
            "BTCPrecision": "btc8", // Currency parameter + precision: Precision of the currency in the exchange
            "accounts": [
                {
                    "uid": "202113", // User ID
                    "balance": "1000", // Account balance
                    "tag": "xxxxx", // Description
                    "type": "2021101" // Asset code
                },
                {
                    "uid": "202113", // User ID
                    "balance": "1000", // Account balance
                    "tag": "xxxxx", // Description
                    "type": "2021101" // Asset code
                }
            ],
            "USDTPrecision": "usdt8" // Currency parameter + precision: Precision of the currency in the exchange
        }
    }
]
</code></pre>

{% endtab %}
{% endtabs %}

#### Parameters:

Either the UID or OpenID of the payee must exist, and if both are present, the OpenID takes precedence.

<table><thead><tr><th width="136">name</th><th width="124">type</th><th>required</th><th width="214">example</th><th>Description</th></tr></thead><tbody><tr><td>appKey</td><td>String</td><td>YES</td><td>xxx_xxx</td><td>Merchant AppKey</td></tr><tr><td>openId</td><td>String</td><td>NO</td><td></td><td>openId, userId must pass one, while passing, take openId</td></tr><tr><td>userId</td><td>String</td><td>NO</td><td></td><td>openId, userId must pass one, while passing, take openId</td></tr><tr><td>coinSymbols</td><td>String</td><td>YES</td><td>BTC</td><td>Currency type: e.g. BTC, USDT, BIKI, etc.; refer to the currency configuration in the exchange; multiple currencies are separated by commas: Example: "USDT,BTC,ETH"</td></tr><tr><td>assetType</td><td>String</td><td>NO</td><td>201</td><td>Common type: "201" : General account balance</td></tr><tr><td>sign</td><td>String</td><td>YES</td><td>2ae04ed9165624419bad68e9e0f3f2sa9fbd2ae04ed916511624419bad68e9e20f3f29fbd</td><td>Signature</td></tr></tbody></table>

## User account balance (full currency)

<mark style="color:green;">`POST`</mark> `https://service.xxx.om//platformapi/chainup/open/user/accountBalance`

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Content-Type	<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                      | Type   | Description     |
| ----------------------------------------- | ------ | --------------- |
| app\_id<mark style="color:red;">\*</mark> | String | Merchant AppKey |
| data<mark style="color:red;">\*</mark>    | String |                 |
| sign<mark style="color:red;">\*</mark>    | String | Signature       |
| time<mark style="color:red;">\*</mark>    | String |                 |

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

<pre class="language-javascript"><code class="lang-javascript">{
  "code": "",
  "msg": "",
  "data": "",
  "sign":""
}


data:[
<strong>    {
</strong>        "code": "0",
        "msg": "Success",
        "message": null,
        "data": {
            "totalBalance": "100", // Total assets
            "totalBalanceSymbol": "BTC", // Total asset symbol
            "platformCoin": "xxx", // Platform coin for dividend configuration
            "allCoinMap": { // Mapping of all coins, where the key is the uppercase coin symbol and the value is the asset details for each coin
                "LTC": {
                    "walletTransactionOpen": 1, // Whether the coin has wallet transaction enabled
                    "isFiat": 0, // Whether it is a fiat currency, 0 for digital currency, 1 for fiat
                    "normal_balance": "200", // User's normal spot balance
                    "allBalance": "9000", // Total balance
                    "exchange_symbol": "Trading pair", // Trading pair symbol
                    "present_coin_balance": 9000, // Gift coin account
                    "lock_position_balance": "2000", // Lock position account
                    "btcValuatin": "10000", // BTC valuation
                    "sort": 20, // Sorting order
                    "depositOpen": 1, // Whether deposit is open
                    "lock_grant_divided_balance": "999999", // User's token lock + mining lock balance
                    "total_balance": "99999", // Total balance
                    "nc_lock_balance": "98888", // User's subscription frozen balance
                    "otcOpen": 1, // Whether OTC is open
                    "depositMin": 20, // Minimum deposit amount
                    "checked": "true", // Whether to hide zero assets, default to true
                    "coinName": "name", // Name
                    "lock_balance": "3000", // Frozen amount
                    "allBtcValuatin": "9918923", // All BTC valuation
                    "lock_position_v2_amount": "203213", // User's token lock account V2
                    "withdrawOpen": 1, // Whether withdrawal is open
                    "overcharge_balance": "9000"
                },
                "BCH": {
                    "walletTransactionOpen": 1, // Whether the coin has wallet transaction enabled
                    "isFiat": 0, // Whether it is a fiat currency, 0 for digital currency, 1 for fiat
                    "normal_balance": "200", // User's normal spot balance
                    "allBalance": "9000", // Total balance
                    "exchange_symbol": "Trading pair", // Trading pair symbol
                    "present_coin_balance": 9000, // Gift coin account
                    "lock_position_balance": "2000", // Lock position account
                    "btcValuatin": "10000", // BTC valuation
                    "sort": 20, // Sorting order
                    "depositOpen": 1, // Whether deposit is open
                    "lock_grant_divided_balance": "999999", // User's token lock + mining lock balance
                    "total_balance": "99999", // Total balance
                    "nc_lock_balance": "98888", // User's subscription frozen balance
                    "otcOpen": 1, // Whether OTC is open
                    "depositMin": 20, // Minimum deposit amount
                    "checked": "true", // Whether to hide zero assets, default to true
                    "coinName": "name", // Name
                    "lock_balance": "3000", // Frozen amount
                    "allBtcValuatin": "9918923", // All BTC valuation
                    "lock_position_v2_amount": "203213", // User's token lock account V2
                    "withdrawOpen": 1, // Whether withdrawal is open
                    "overcharge_balance": "9000"
                }
            }
        }
    }
]
</code></pre>

{% endtab %}
{% endtabs %}

#### Parameters:

(openId, userId, mobileNumber, email) One of these four must be provided.

<table><thead><tr><th width="136">name</th><th width="124">type</th><th>required</th><th width="214">example</th><th>Description</th></tr></thead><tbody><tr><td>appKey</td><td>String</td><td>YES</td><td>xxx_xxx</td><td>Merchant AppKey</td></tr><tr><td>openId</td><td>String</td><td>NO</td><td></td><td>openId, userId must pass one, while passing, take openId</td></tr><tr><td>userId</td><td>String</td><td>NO</td><td></td><td>openId, userId must pass one, while passing, take openId</td></tr><tr><td>mobileNumber</td><td>String</td><td>NO</td><td>09011223</td><td>Cell phone number</td></tr><tr><td>email</td><td>String</td><td>NO</td><td>xxxxx@.com</td><td>Useremail(openId,userId,mobileNumber,email)Four choices are required</td></tr><tr><td>sign</td><td>String</td><td>YES</td><td>2ae04ed9165624419bad68e9e0f3f2sa9fbd2ae04ed916511624419bad68e9e20f3f29fbd</td><td>Signature</td></tr></tbody></table>

## Batch User asset search (developing)

## Batch query of user assets (specified currency pairs)

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/ouser/batchQueryUserAccounts`

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Content-Type	<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body:

| Name                                      | Type   | Description     |
| ----------------------------------------- | ------ | --------------- |
| app\_id<mark style="color:red;">\*</mark> | String | Merchant AppKey |
| data<mark style="color:red;">\*</mark>    | String |                 |
| sign<mark style="color:red;">\*</mark>    | String | Signature       |
| time<mark style="color:red;">\*</mark>    | String |                 |

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

<pre class="language-javascript"><code class="lang-javascript">{
  "code": "",
  "msg": "",
  "data": "",
  "sign":""
}

<strong>data:[
</strong>    {
        "code": "0",
        "msg": "Success",
        "data": {
            "accounts": [
                {
                    "uid": "202113", // User ID
                    "balance": "1000", // Account balance
                    "type": "202" // Asset code
                    "coin": "USDT", // coin name
                    "showName": "USDT" // coin show name
                },
                {
                    "uid": "202113", // User ID
                    "balance": "1000", // Account balance
                    "type": "201" // Asset code
                    "coin": "USDT", // coin name
                    "showName": "USDT" // coin show nam
                }
            ],
        }
    }
]
//"Type" refers to the corresponding account type
type = 201(User: Normal Balance)
type = 202(User: Frozen)
type = 207(Lockup Account)
type = 210(OTC Merchant Margin Account)
type = 217(User: OTC Normal Balance)
type = 218(User: OTC Frozen)
type = 230(User: Lockup token account V2)
type = 221(User: Frozen token from Innovation trial zone subscription)

</code></pre>

{% endtab %}
{% endtabs %}

#### Parameters:

| Name                                          | Type   | Description                                                                                                                                                                                  |
| --------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| appKey<mark style="color:red;">\*</mark>      | String | Merchant AppKey                                                                                                                                                                              |
| sign<mark style="color:red;">\*</mark>        | String | Signature                                                                                                                                                                                    |
| coinSymbols<mark style="color:red;">\*</mark> | String | Currency type: e.g. BTC, USDT, BIKI, etc.; refer to the currency configuration in the exchange; multiple currencies are separated by commas: Example: "USDT,BTC,ETH"                         |
| updateTime                                    | String | Update the time, check for this timestamp and accounts that have changed in the future. If the time when the time changes is not specified, the system starts to pull all data from the site |
| page                                          | String | Page number, default 1                                                                                                                                                                       |
| pageSize                                      | String | Page size,default 20 ,Maximum support to1000                                                                                                                                                 |

#### Parameters:

updateTime is a required parameter, Taking two queries as an example, first time 2023-09-01 00:00:00 second time 2023-09-01 00:10:00

first query:&#x20;

account table record

| ID | uid | balance | type | changeTime          |
| -- | --- | ------- | ---- | ------------------- |
| 1  | 1   | 10      | 201  | 2023-09-01 00:00:00 |
| 2  | 2   | 2       | 201  | 2023-09-01 00:00:00 |
| 3  | 1   | 2       | 202  | 2023-09-01 00:00:00 |
| 4  | 2   | 5       | 202  | 2023-09-01 00:02:00 |
| 5  | 3   | 5       | 201  | 2023-09-01 00:02:00 |
| 6  | 4   | 5       | 201  | 2023-09-01 00:02:00 |
| 7  | 6   | 5       | 201  | 2023-09-01 00:02:00 |
| 8  | 7   | 5       | 201  | 2023-09-01 00:02:00 |
| 9  | 8   | 5       | 201  | 2023-09-01 00:02:00 |

2023-09-01 00:00:00 timestemp: 1693497600000

current params is {"updateTime":1693497600000, coinSymbols: "btc,eth","page":1, "pageSize": 5}

The records found are id (1,2,3,4,5)

If the number of results is less than pageSize, end the loop

Found 5 records for pagination query. The query criteria are {"updateTime":1693497600000, coinSymbols: "BTC,ETH","page":2, "pageSize": 5} The records found are id (6,7,8,9)

second query:&#x20;

account table record&#x20;

| ID | uid | balance | type | changeTime          |
| -- | --- | ------- | ---- | ------------------- |
| 1  | 1   | 12      | 201  | 2023-09-01 00:10:00 |
| 2  | 2   | 2       | 201  | 2023-09-01 00:00:00 |
| 3  | 1   | 0       | 202  | 2023-09-01 00:10:00 |
| 4  | 2   | 5       | 202  | 2023-09-01 00:02:00 |
| 5  | 3   | 5       | 201  | 2023-09-01 00:02:00 |
| 6  | 4   | 5       | 201  | 2023-09-01 00:02:00 |
| 7  | 6   | 5       | 201  | 2023-09-01 00:02:00 |
| 8  | 7   | 5       | 201  | 2023-09-01 00:02:00 |
| 9  | 8   | 5       | 201  | 2023-09-01 00:02:00 |

2023-09-01 00:10:00 timestemp: 1693498200000

current params is {"updateTime":1693498200000, coinSymbols: "BTC,ETH","page":1, "pageSize": 5} The records found are id (1,3)&#x20;


# User Trade Query

## Over-the-counter transaction record

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/user/otcTradeRecord`

It is necessary to package the data in the parameter table into JSON strings and use rsa for parameter encryption and signature as data and sign in the body

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                      | Type   | Description     |
| ----------------------------------------- | ------ | --------------- |
| app\_id<mark style="color:red;">\*</mark> | String | Merchant AppKey |
| time<mark style="color:red;">\*</mark>    | String |                 |
| data<mark style="color:red;">\*</mark>    | String |                 |
| sign<mark style="color:red;">\*</mark>    | String |                 |

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

```javascript
{
  "code": "",
  "msg": "",
  "data": "",
  "sign": ""
}

data:

  "minvolume": -85877589.87032616,
        "sell": 76456802.81250894,
        "beginTime": -84109769.0972242,
        "endTime": -91471204.57082653,
        "ctime": -83252352.01812582,
        "personalFeeDiscount": -52561186.38481931,
        "dealVolume": 29689231.7318981,
        "muid": -87491426.22952344,
        "mtime": -44834754.37780844,
        "autoReply": "veniam ut cu",
        "openType": "in labore",
        "numberCode": "esse sint dolor",
        "companyId": 57447087.82520917,
        "isBlockTrade": -53501910.55336584
      },
      "adsOwner": 9923810.697270945,
      "adsId": -7557138.298130855,
      "sellerComment": "Lorem tempor",
      "buyerCommentGrade": 95611794.75377128,
      "volume": "ad tempor nulla ut dolor",
      "bidCid": 81124164.91613445,
      "sequence": "ipsum dolore",
      "realName": "ad deserunt velit dolor",
      "feeAmount": "esse ut",
      "paySymbol": "cupidatat elit Excepteur",
      "createTime": 91195397.5040384,
      "status_text": "sit in culpa",
      "status": -45347712.68056339
    },
    {
      "totalPrice": "ad occaecat",
      "payTime": -97697744.91491856,
      "type": "minim sit fugiat ut dolore",
      "buyerId": -67400315.03292991,
      "buyerComment": "mollit aliqua",
      "payCoin": "proident",
      "sellerCommnetGrade": 29624576.293991074,
      "coinSymbol": "in",
      "sellerId": -81112890.94397196,
      "price": "deserunt cillum",
      "id": -77713242.61590835,
      "isBlockTrade": -53173517.20048298,
      "side": "non ad",
      "sidCid": 64917217.75421363,
      "nickName": "amet aute Excepteur commodo adipisicing",
      "advert": {
        "id": -82025960.19075097,
        "userId": 71893889.17026561,
        "status": 42502852.00024676,
        "side": "laboris cillum id Ut",
        "coin": "velit aute",
        "country": "dolore irure aliquip",
        "paycoin": "ex mollit aliquip dolor",
        "payment": "anim minim aliquip",
        "bankname": "ullamco",
        "priceRate": 79040943.9136841,
        "priceRateType": -70491397.7763741,
        "price": 58131019.11235669,
        "volume": -87245350.25403991,
        "feeRate": -52708904.255970076,
        "minTrade": -44253110.02508186,
        "maxTrade": -16720855.329489842,
        "beginDate": 9723332.17430523,
        "endDate": 16176193.82829751,
        "limitTime": -13816470.420947582,
        "terms": "nostrud id Ut eu in",
        "description": "occaecat",
        "authType": "minim adipisicing eu cupidatat",
        "minvolume": -91929088.03002208,
        "sell": -46475215.25835092,
        "beginTime": 24165976.991789952,
        "endTime": -63123299.885861695,
        "ctime": -11170229.167308807,
        "personalFeeDiscount": -40508687.216340624,
        "dealVolume": 66928105.85846299,
        "muid": 64368529.07996601,
        "mtime": 61880934.20807341,
        "autoReply": "sed ut",
        "openType": "reprehenderit occaecat sit in ut",
        "numberCode": "id reprehenderit nisi",
        "companyId": 9020599.115089566,
        "isBlockTrade": -68014672.57747972
      },
      "adsOwner": 370299.06812007725,
      "adsId": -35386946.45741396,
      "sellerComment": "aliquip consequat id irure",
      "buyerCommentGrade": 4069096.2173048854,
      "volume": "nisi amet ex elit",
      "bidCid": 9147210.283984378,
      "sequence": "ullamco mollit ad",
      "realName": "consectetur nostr",
      "feeAmount": "enim eu minim ipsu",
      "paySymbol": "dolore incididunt sit pariatur m",
      "createTime": 19711855.429372743,
      "status_text": "laboris consequat eu culpa",
      "status": -84096110.66384327
    }
  ]
```

{% endtab %}
{% endtabs %}

The following are the parameters involved in rsa encryption:

(openId, userId, mobileNumber, email) One of the four must be provided.

<table><thead><tr><th width="136">name</th><th width="124">type</th><th>required</th><th width="214">example</th><th>Description</th></tr></thead><tbody><tr><td>openId</td><td>String</td><td>NO</td><td></td><td>openId, userId must pass one, while passing, take openId</td></tr><tr><td>userId</td><td>String</td><td>NO</td><td></td><td>openId, userId must pass one, while passing, take openId</td></tr><tr><td>mobileNumber</td><td>String</td><td>NO</td><td>09011223</td><td>Cell phone number</td></tr><tr><td>email</td><td>String</td><td>NO</td><td>xxxxx@.com</td><td>User email(openId,userId,mobileNumber,email)Four choices are required</td></tr><tr><td>page</td><td>String</td><td>NO</td><td>1</td><td>The page number, defaulting to 1 for the first page.</td></tr><tr><td>pageNumber</td><td>String</td><td>NO</td><td>1000</td><td>Default 1000 entries.</td></tr></tbody></table>

## Coin trading records

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/trade/getAll`

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                      | Type   | Description                       |
| ----------------------------------------- | ------ | --------------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | Merchant unique identifier: appId |
| time<mark style="color:red;">\*</mark>    | String |                                   |
| sign<mark style="color:red;">\*</mark>    | String |                                   |
| data<mark style="color:red;">\*</mark>    | String |                                   |

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

```javascript
{
    "code": "", //Return code	
    "msg": "", //Success or failure message	
    "data": "",
    "sign": ""
}

data:
{
    "count": 1,//Total number of records.
    "resultList": [
      {
        "volume": "100",//Trade quantity.
        "side": "BUY",//The direction of the active order.
        "buyFeeCoin": "btc",//The currency in which the buyer pays the transaction fee.
        "price": "0.1",//The price at which the transaction was executed.
        "buyFee": "0.001",//The transaction fee incurred for the buy order.
        "ctime": 112334212321,//The timestamp indicating the creation time of the transaction.
        "sellFeeCoin": "usdt",//The currency in which the transaction fee is paid for the sell order.
        "id": 12321,
        "sellFee": "0.001",//The transaction fee for the sell order.
        "bid_id": 33000003300001,//The ID of the buy order.
        "ask_id": 33000013300001,//The ID of the sell order.
        "bid_user_id": -230000,//The ID of the buyer user.
        "ask_user_id": 230000//The ID of the seller user.
      },
      {
        "volume": "100",
        "side": "BUY",
        "buyFeeCoin": "btc",
        "price": "0.1",
        "buyFee": "0.001",
        "ctime": 112334212321,
        "sellFeeCoin": "usdt",
        "id": 12321,
        "sellFee": "0.001",
        "bid_id": 33000003300001,
        "ask_id": 33000013300001,
        "bid_user_id": -230000,
        "ask_user_id": 230000
      },
      {
        "volume": "100",
        "side": "BUY",
        "buyFeeCoin": "btc",
        "price": "0.1",
        "buyFee": "0.001",
        "ctime": 112334212321,
        "sellFeeCoin": "usdt",
        "id": 12321,
        "sellFee": "0.001",
        "bid_id": 33000003300001,
        "ask_id": 33000013300001,
        "bid_user_id": -230000,
        "ask_user_id": 230000
      },
      {
        "volume": "100",
        "side": "BUY",
        "buyFeeCoin": "btc",
        "price": "0.1",
        "buyFee": "0.001",
        "ctime": 112334212321,
        "sellFeeCoin": "usdt",
        "id": 12321,
        "sellFee": "0.001",
        "bid_id": 33000003300001,
        "ask_id": 33000013300001,
        "bid_user_id": -230000,
        "ask_user_id": 230000
      }
    ]
}

```

{% endtab %}
{% endtabs %}

The following are the parameters involved in rsa encryption:

<table><thead><tr><th width="136">name</th><th width="124">type</th><th>required</th><th width="214">example</th><th>Description</th></tr></thead><tbody><tr><td>symbol</td><td>String</td><td>YES</td><td>btcusdt</td><td>symbol</td></tr><tr><td>startDate</td><td>String</td><td>YES</td><td>2099-01-01 00:00:00</td><td>Start time, in seconds with the format "yyyy-MM-dd HH:mm:ss".</td></tr><tr><td>endDate</td><td>String</td><td>YES</td><td>2099-01-01 00:00:00</td><td>End time, in seconds with the format "yyyy-MM-dd HH:mm:ss".</td></tr><tr><td>pageSize</td><td>String</td><td>NO</td><td>20</td><td>Default 1000 entries.</td></tr><tr><td>page</td><td>String</td><td>NO</td><td>1</td><td>The page number, defaulting to 1 for the first page.</td></tr><tr><td>sort</td><td>String</td><td>NO</td><td></td><td>1 indicates descending order.</td></tr></tbody></table>

## Coin-to-Coin Order Record

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/record/orderList`

It is necessary to package the data in the parameter table into JSON strings and use rsa for parameter encryption and signature as data and sign in the body

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                      | Type   | Description |
| ----------------------------------------- | ------ | ----------- |
| app\_id<mark style="color:red;">\*</mark> | String |             |
| time                                      | String |             |
| sign                                      | String |             |
| data                                      | String |             |

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

```javascript
{
    "code": "", //Return code	
    "msg": "", //Success or failure message	
    "data": "",
    "sign": ""
}

code:
{
    "count": 1233,
    "list": [
      {
        "volume": 1123,//Order Quantity
        "symbol": "consectetur veni",//Trading Pair
        "dealVolume": 123412,//Filled Quantity
        "orderId": 123123,//Order ID
        "totalPrice": 0.201,//Limit order amount
        "price": 12341,//Limit order price
        "ctime": "ctime",//Order placement time
        "type": "limit",//limit = limit order, market = market order
        "orderSide": "buy",//SELL,BUY
        "dealMoney": 1,//filled amount
        "status": "0"//init = Initialized order, new = New order, filled = Fully filled order, part filled = Partially filled order, canceled = Canceled order, pending cancel = Pending cancel order, expired = Expired order
      },
      {
        "volume": 1123,//Order Quantity
        "symbol": "consectetur veni",//Trading Pair
        "dealVolume": 123412,//Filled Quantity
        "orderId": 123123,//Order ID
        "totalPrice": 0.201,//Limit order amount
        "price": 12341,//Limit order price
        "ctime": "ctime",//Order placement time
        "type": "limit",//limit = limit order, market = market order
        "orderSide": "buy",//SELL,BUY
        "dealMoney": 1,//filled amount
        "status": "0"//init = Initialized order, new = New order, filled = Fully filled order, part filled = Partially filled order, canceled = Canceled order, pending cancel = Pending cancel order, expired = Expired order
      {
        "volume": 1123,//Order Quantity
        "symbol": "consectetur veni",//Trading Pair
        "dealVolume": 123412,//Filled Quantity
        "orderId": 123123,//Order ID
        "totalPrice": 0.201,//Limit order amount
        "price": 12341,//Limit order price
        "ctime": "ctime",//Order placement time
        "type": "limit",//limit = limit order, market = market order
        "orderSide": "buy",//SELL,BUY
        "dealMoney": 1,//filled amount
        "status": "0"//init = Initialized order, new = New order, filled = Fully filled order, part filled = Partially filled order, canceled = Canceled order, pending cancel = Pending cancel order, expired = Expired order
      }
    ]
}
```

{% endtab %}
{% endtabs %}

The following are the parameters involved in rsa encryption:

<table><thead><tr><th width="136">name</th><th width="124">type</th><th>required</th><th width="214">example</th><th>Description</th></tr></thead><tbody><tr><td>symbol</td><td>String</td><td>YES</td><td>btcusdt</td><td>symbol</td></tr><tr><td>uid</td><td>String</td><td>YES</td><td>23000</td><td>User id</td></tr><tr><td>startDate</td><td>String</td><td>YES</td><td>2099-01-01 00:00:00</td><td>Start time, in seconds with the format "yyyy-MM-dd HH:mm:ss".</td></tr><tr><td>endDate</td><td>String</td><td>YES</td><td>2099-01-01 00:00:00</td><td>End time, in seconds with the format "yyyy-MM-dd HH:mm:ss".</td></tr><tr><td>pageSize</td><td>String</td><td>NO</td><td>20</td><td>Default 1000 entries.</td></tr><tr><td>pageNumber</td><td>String</td><td>NO</td><td>1</td><td>The page number, defaulting to 1 for the first page.</td></tr></tbody></table>


# User Information API

## User Registration

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/user/registration`

It is necessary to package the data in the parameter table into JSON strings and use rsa for parameter encryption and signature as data and sign in the body

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                      | Type   | Description                       |
| ----------------------------------------- | ------ | --------------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | Merchant unique identifier appKey |
| time                                      | String |                                   |
| data                                      | String |                                   |
| sign                                      | String |                                   |

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

```javascript

{
    "code": "0",
    "msg": "suc",
    "data": "",
    "sign": ""
}


data:
{
    "uid": 2000000,//user id
    "inviteCode": "AAAAAA"//Current user's invitation code
}
```

{% endtab %}
{% endtabs %}

The following are the parameters involved in rsa encryption:

The phone number and email fields are optional, but if you choose to fill in either one of them, you can only provide either the phone number or the email. You cannot fill in both fields simultaneously.

<table><thead><tr><th width="136">name</th><th width="124">type</th><th>required</th><th width="214">example</th><th>Description</th></tr></thead><tbody><tr><td>mobileNumber</td><td>String</td><td>NO</td><td>09011223</td><td>Phone number and email can only be filled in one of them</td></tr><tr><td>email</td><td>String</td><td>NO</td><td>xxxxx@.com</td><td>Phone number and email can only be filled in one of them</td></tr><tr><td>countryCode</td><td>String</td><td>NO</td><td>93</td><td>Country dialing code for the phone number</td></tr><tr><td>password</td><td>String</td><td>YES</td><td>TtEest19121</td><td>Password</td></tr><tr><td>invitedCode</td><td>String</td><td>YES</td><td>QSKNOQQQ</td><td>Invitation code</td></tr></tbody></table>

## User Registration Information

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/user/reg_info_list`

It is necessary to package the data in the parameter table into JSON strings and use rsa for parameter encryption and signature as data and sign in the body

#### Query Parameters

| Name                                           | Type   | Description                                                |
| ---------------------------------------------- | ------ | ---------------------------------------------------------- |
| page                                           | String | Page number for pagination, defaults to 1 if not specified |
| pageSize                                       | String | Number of items per page, defaults to 100 if not specified |
| regStartTime<mark style="color:red;">\*</mark> | String | Start registration time (13-digit timestamp)               |

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                      | Type   | Description                       |
| ----------------------------------------- | ------ | --------------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | Merchant unique identifier appKey |
| time                                      | String |                                   |
| sign                                      | String |                                   |
| data                                      | String |                                   |

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

```javascript
{
  "code": "fugiat in reprehenderit",
  "msg": "sint Excepteur non in",
  "data": "",
  "sign":""
}

data:
{
    "userInfoList": [
      {
        "uid": 23000, // User UID
        "mobileNumber": "9989921", // Mobile number
        "email": "www@.com", // Email
        "inviteCode": "SDONOQWE", // Invitation code
        "pid": "3999009" // Parent UID
      }
    ],
    "count": 62869161.58626932
  }
```

{% endtab %}
{% endtabs %}

The following are the parameters involved in rsa encryption:

<table><thead><tr><th width="136">name</th><th width="124">type</th><th>required</th><th width="214">example</th><th>Description</th></tr></thead><tbody><tr><td>page</td><td>String</td><td>NO</td><td>1</td><td>Page number for pagination, defaults to 1 if not specified</td></tr><tr><td>pageSize</td><td>String</td><td>NO</td><td>20</td><td>Number of items per page, defaults to 100 if not specified</td></tr><tr><td>regStartTime</td><td>String</td><td>YES</td><td>1232123421123</td><td>Start registration time (13-digit timestamp)</td></tr></tbody></table>

## Invitation Relationship Query - Superior

## Return all superior levels found in the current query, up to a maximum of five levels.

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/user/user_superior`

It is necessary to package the data in the parameter table into JSON strings and use rsa for parameter encryption and signature as data and sign in the body

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                      | Type   | Description                       |
| ----------------------------------------- | ------ | --------------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | Merchant unique identifier appKey |
| sign                                      | String | Signature                         |
| data                                      | String |                                   |
| time                                      | String |                                   |

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

```javascript
{
  "code": "fugiat",
  "msg": "sed occaecat nisi fugiat",
  "data": "",
  "sign":""
}

data:

{
        "user": {
            "uid": 230001, // User ID
            "inviteCode": "WEQSDA", // Invitation code
            "invitedCode": "OONSIAD", // Invited code
            "invitedUid": 2300002 // Inviter's UID
        },
        "level1": {
            "uid": 230003, // User ID
            "inviteCode": "SDKKCNASD", // Invitation code
            "invitedCode": "SDOMMQWE", // Invited code
            "invitedUid": 2399901 // Inviter's UID
        },
        "level2": {
            "uid": 230003, // User ID
            "inviteCode": "SDKKCNASD", // Invitation code
            "invitedCode": "SDOMMQWE", // Invited code
            "invitedUid": 2399901 // Inviter's UID
        }
    }
```

{% endtab %}
{% endtabs %}

The following are the parameters involved in rsa encryption:

<table><thead><tr><th width="136">name</th><th width="124">type</th><th>required</th><th width="214">example</th><th>Description</th></tr></thead><tbody><tr><td>openId</td><td>String</td><td>NO</td><td></td><td>Choose either openid, emailOrPhone, with uid taking priority</td></tr><tr><td>uid</td><td>String</td><td>NO</td><td></td><td>user ID</td></tr><tr><td>emailOrPhone</td><td>String</td><td>NO</td><td></td><td>Mobile phone number</td></tr></tbody></table>

## Invitation Relationship Query - Subordinate

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/user/user_invite`

It is necessary to package the data in the parameter table into JSON strings and use rsa for parameter encryption and signature as data and sign in the body

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                      | Type   | Description                       |
| ----------------------------------------- | ------ | --------------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | Merchant unique identifier appKey |
| sign                                      | String | Signature                         |
| data                                      | String |                                   |
| time                                      | String |                                   |

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

```javascript
{
  "code": "0",
  "msg": "suc",
  "data": "",
  "sign":""
}

data:
{
    "levelOneCount": 4, // Level 1 count
    "levelTwoCount": 9, // Level 2 count
    "cuerrentUser": {
      "uid": 10002053, // Current user UID
      "nickname": "xuyang", // Current user nickname
      "inviteCode": "EAAAQATW", // Current user invite code
      "invitedUid": -1, // UID of the inviting user, returns -1 if not exist
      "invitedCode": "\"'", // Invited code of the current user, returns an empty string if not exist
      "ctime": "2019-09-02 12:24:36" // Registration time
    },
    "userExtInviteVoList": [ // List of invited users
      {
        "uid": 10002183, // UID
        "nickname": "小明", // Nickname
        "inviteCode": "XXXXXXXX", // Invite code
        "level": 1, // Level 1
        "invitedUid": 10002181, // Inviting user UID
        "invitedNickname": "小花", // Inviting user nickname
        "invitedCode": "XXXXXXXX", // Inviting user invite code
        "phone": "18310479052", // Phone number
        "email": "111@163.com", // Email
        "ctime": "2020-08-22 19:40:18", // Registration time
        "childLevel": [
          {
            "uid": 10002065,
            "nickname": "小明",
            "inviteCode": "XXXXXXXX",
            "level": 2, // Level 2
            "invitedUid": 10002183,
            "invitedNickname": "小花",
            "invitedCode": "XXXXXXXX",
            "phone": "18210479051",
            "email": "111@163.com",
            "ctime": "2020-04-09 20:52:26"
          },
          {
            "uid": 10002065,
            "nickname": "小明",
            "inviteCode": "XXXXXXXX",
            "level": 2,
            "invitedUid": 10002183,
            "invitedNickname": "小花",
            "invitedCode": "XXXXXXXX",
            "phone": "18210479051",
            "email": "111@163.com",
            "ctime": "2020-04-09 20:52:26"
          },
          {
            "uid": 10002065,
            "nickname": "小明",
            "inviteCode": "XXXXXXXX",
            "level": 2,
            "invitedUid": 10002183,
            "invitedNickname": "小花",
            "invitedCode": "XXXXXXXX",
            "phone": "18210479051",
            "email": "111@163.com",
            "ctime": "2020-04-09 20:52:26"
          },
          {
            "uid": 10002065,
            "nickname": "小明",
            "inviteCode": "XXXXXXXX",
            "level": 2,
            "invitedUid": 10002183,
            "invitedNickname": "小花",
            "invitedCode": "XXXXXXXX",
            "phone": "18210479051",
            "email": "111@163.com",
            "ctime": "2020-04-09 20:52
            }]
  ]
}
```

{% endtab %}
{% endtabs %}

The following are the parameters involved in rsa encryption:

<table><thead><tr><th width="136">name</th><th width="124">type</th><th>required</th><th width="214">example</th><th>Description</th></tr></thead><tbody><tr><td>openId</td><td>String</td><td>NO</td><td></td><td>Choose either openid, emailOrPhone, with uid taking priority</td></tr><tr><td>uid</td><td>String</td><td>NO</td><td></td><td>user ID</td></tr><tr><td>emailOrPhone</td><td>String</td><td>NO</td><td></td><td>Mobile phone number</td></tr><tr><td>page</td><td>String</td><td>YES</td><td>1</td><td>Page number for pagination, defaults to 1 if not specified</td></tr><tr><td>pageSize</td><td>String</td><td>YES</td><td>20</td><td>Number of items per page, defaults to 100 if not specified</td></tr></tbody></table>

## User Identity Verification

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/user/verifyUserIdentity`

It is necessary to package the data in the parameter table into JSON strings and use rsa for parameter encryption and signature as data and sign in the body

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                      | Type   | Description                         |
| ----------------------------------------- | ------ | ----------------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | Merchant Unique Identifier (appKey) |
| time                                      | String |                                     |
| sign                                      | String |                                     |
| data                                      | String |                                     |

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

```javascript

{
    "code": "0",
    "msg": "suc"
}
```

{% endtab %}
{% endtabs %}

The following are the parameters involved in rsa encryption:

<table><thead><tr><th width="136">name</th><th width="124">type</th><th>required</th><th width="214">example</th><th>Description</th></tr></thead><tbody><tr><td>uid</td><td>String</td><td>YES</td><td>230000</td><td>User ID</td></tr><tr><td>countryCode</td><td>String</td><td>YES</td><td>93</td><td>Country code. You need to enter the correct "code", which can be obtained from the left-hand side country code list.</td></tr><tr><td>certificateNumber</td><td>String</td><td>YES</td><td>211111111111</td><td>ID number</td></tr><tr><td>familyName</td><td>String</td><td>YES</td><td>test</td><td>Last name</td></tr><tr><td>name</td><td>String</td><td>YES</td><td>test</td><td>First name</td></tr><tr><td>firstPhoto</td><td>String</td><td>YES</td><td></td><td>ID photo, only supports online image URLs, maximum of three inputs, separated by commas. Example:"https://oss.com.https://oss.com,https://oss.com"</td></tr></tbody></table>

## get user history login

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/user/getUserHistoryLogin`

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                     | Type   | Description                         |
| ---------------------------------------- | ------ | ----------------------------------- |
| appKey<mark style="color:red;">\*</mark> | String | Merchant Unique Identifier (appKey) |
| sign<mark style="color:red;">\*</mark>   | String |                                     |
| uid<mark style="color:red;">\*</mark>    | String | User ID                             |
| endDate                                  | String | end time 2024-00-00 00:00:00        |
| startDate                                | String | start time 2024-00-00 00:00:00      |

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

```javascript
{
    "code": "0",
    "msg": "suc",
    "data": {
        "count": 10,
        "HistoryLogin": [
           {
                "id": 2323332,
                "uid": 2324288,//UID
                "lgType": 1,// Login type，1：phone number，2：email，3：WeChat，4：QQ，5：APP QR code 
                "lgPlatform": 3,//Login platform，1：WEB，2：H5，3：APP ,4 : OAUTH
                "lgSystem": "web",//Login system，e.g.‘android’，‘ios
                "lgIp": "111.203.241.52",// Login IP address
                "lgStatus": 1,// Login status，1：success，2：failure
                "lgInTime": 1598352251000//User login time
            },
            {                
                "id": 2323332,
                "uid": 2324288,//UID
                "lgType": 1,// Login type，1：phone number，2：email，3：WeChat，4：QQ，5：APP QR code 
                "lgPlatform": 3,//Login platform，1：WEB，2：H5，3：APP ,4 : OAUTH
                "lgSystem": "web",//Login system，e.g.‘android’，‘ios
                "lgIp": "111.203.241.52",// Login IP address
                "lgStatus": 1,// Login status，1：success，2：failure
                "lgInTime": 1598352251000//User login time
            }
        ]
    }
}

```

{% endtab %}
{% endtabs %}


# Contract transaction

## Contract fee inquiry

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/futures/feeList`

It is necessary to package the data in the parameter table into JSON strings and use rsa for parameter encryption and signature as data and sign in the body

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                      | Type   | Description                       |
| ----------------------------------------- | ------ | --------------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | Merchant unique identifier appKey |
| sign<mark style="color:red;">\*</mark>    | String | <p>Signature</p><p><br></p>       |
| data<mark style="color:red;">\*</mark>    | String |                                   |
| time<mark style="color:red;">\*</mark>    | String |                                   |

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

```javascript
{
  "code":"",
  "msg":"",
  "sign":"",
  "data":""
}

data:
{
    "count": "20",
    "list": [
        {
            "itemDate": 10008902123, // Date, in timestamp format accurate to seconds
            "uid": "20300021", // User ID
            "coin": "btc", // Coin symbol
            "tradeAmount": "2000", // Trade amount
            "feeAmount": "1" // Fee amount
        }
    ]
}
```

{% endtab %}
{% endtabs %}

The following are the parameters involved in rsa encryption:

<table><thead><tr><th width="136">name</th><th width="124">type</th><th>required</th><th width="214">example</th><th>Description</th></tr></thead><tbody><tr><td>startDate</td><td>String</td><td>YES</td><td>200001</td><td>Start date, accurate to the day, timestamp accurate to the second</td></tr><tr><td>endDate</td><td>String</td><td>YES</td><td>xxxxx@.com</td><td>End date, accurate to the day, timestamp accurate to the second</td></tr><tr><td>page</td><td>String</td><td>NO</td><td>1</td><td>Page number, default 1</td></tr><tr><td>pageSize</td><td>String</td><td>NO</td><td>10</td><td>Items per page, default 100</td></tr></tbody></table>

## Contract broker role inquiry

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/futures/agentUser`

It is necessary to package the data in the parameter table into JSON strings and use rsa for parameter encryption and signature as data and sign in the body

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                      | Type   | Description                       |
| ----------------------------------------- | ------ | --------------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | Merchant unique identifier appKey |
| time<mark style="color:red;">\*</mark>    | String |                                   |
| data<mark style="color:red;">\*</mark>    | String |                                   |
| sign<mark style="color:red;">\*</mark>    | String |                                   |

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

```javascript
{
  "code":"",
  "msg":"",
  "data":"",
  "sign":""
}

data:
{
  "count": "sed in ipsum",
  "list": [
    {
      "itemDate": 42617625.97714323,//Date, in timestamp format accurate to seconds
      "uid": "voluptate minim Duis",// User ID
      "coin": "amet sunt est dolore aute",//Coin type
      "tradeAmount": "commodo Excepteur nisi",//Trade amount
      "feeAmount": "amet commodo in Duis nostrud"//手续费
    }
  ]
}
```

{% endtab %}
{% endtabs %}

The following are the parameters involved in rsa encryption:

<table><thead><tr><th width="136">name</th><th width="124">type</th><th>required</th><th width="214">example</th><th>Description</th></tr></thead><tbody><tr><td>startDate</td><td>String</td><td>YES</td><td>200001</td><td>Start date, accurate to the day, timestamp accurate to the second</td></tr><tr><td>endDate</td><td>String</td><td>YES</td><td>xxxxx@.com</td><td>End date, accurate to the day, timestamp accurate to the second</td></tr><tr><td>page</td><td>String</td><td>NO</td><td>1</td><td>Page number, default 1</td></tr><tr><td>pageSize</td><td>String</td><td>NO</td><td>10</td><td>Items per page, default 100</td></tr></tbody></table>


# Wallet

#### Wallet address mapping

## Wallet address mapping

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/wallet/addressMapping`

#### Query Parameters

| Name                                         | Type   | Description                                              |
| -------------------------------------------- | ------ | -------------------------------------------------------- |
| walletType<mark style="color:red;">\*</mark> | number | wallet type（1 custody 2 wapi 3 fireblocks 4 custody mpc） |
| symbol<mark style="color:red;">\*</mark>     | String | chainup symbol name                                      |
| uid                                          | number | uid (not required)                                       |
| page<mark style="color:red;">\*</mark>       | number | Paging parameters (page number)                          |
| pageSize<mark style="color:red;">\*</mark>   | number | Paging parameters (page size)                            |

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-type | String | application/json |

#### Request Body

| Name                                      | Type   | Description          |
| ----------------------------------------- | ------ | -------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | app\_id              |
| time<mark style="color:red;">\*</mark>    | String | timestamp            |
| sign<mark style="color:red;">\*</mark>    | String | sign                 |
| data<mark style="color:red;">\*</mark>    | String | Cryptographic string |

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

```json
{
    "code": "", //code	
    "msg": "", //message	
    "data": "",
    "sign": ""
}

The decrypted structure in data:

{
    "count":50, // total record number
    "page":1, // Paging parameters (page number)
    "pageSize":2, // Paging parameters (page size)
    "symbol":"BTCTEST1760", // chainup symbol
    "walletSymbol":"BTC_TEST", //wallet symbol 
    "list":[
      {
        "address":"1K1zD7ypt6oiXH4z54NoohddEV7JwQKCEo", // user deposit address
        "tag":"4567", // tag
        "uid":1234, // chainup uid
        "walletUid":2 // wallet uid or fireblocks vault id
      },
      {
        "address":"1K1zD7ypt6oiXH4z54Noo", // user deposit address
        "tag":"4567", // tag
        "uid":4567, // chainup uid
        "walletUid":3 // wallet uid or fireblocks vault id
      }
    ]
}
```

{% endtab %}
{% endtabs %}

#### Wallet symbol mapping

## Wallet symbol mapping

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/wallet/symbolMapping`

#### Query Parameters

| Name                                          | Type   | Description                                              |
| --------------------------------------------- | ------ | -------------------------------------------------------- |
| walletType	<mark style="color:red;">\*</mark> | number | wallet type（1 custody 2 wapi 3 fireblocks 4 custody mpc） |
| symbol                                        | String | chainup symbol name(not required)                        |
| walletSymbol                                  | String | wallet symbol name(not required)                         |
| page<mark style="color:red;">\*</mark>        | number | Paging parameters (page number)                          |
| pageSize<mark style="color:red;">\*</mark>    | number | Paging parameters (page size)                            |

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-type | String | application/json |

#### Request Body

| Name                                      | Type   | Description          |
| ----------------------------------------- | ------ | -------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | app\_id              |
| time<mark style="color:red;">\*</mark>    | String | timestamp            |
| sign<mark style="color:red;">\*</mark>    | String | sign                 |
| data<mark style="color:red;">\*</mark>    | String | Cryptographic string |

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

```json
{
    "code": "", //code	
    "msg": "", //message
    "data": "",
    "sign": ""
}

The decrypted structure in data:

{
    "count":50, // total record number
    "page":1, // Paging parameters (page number)
    "pageSize":2, // Paging parameters (page size)
    "walletType":3 //1 custody 2 wapi 3 fireblocks 4 custody mpc
    "list":[
      {
        "symbol":"BTCTEST1760", // chainup symbol name
        "walletSymbol":"BTC_TEST" // wallet symbol name
      },
      {
        "symbol":"ETHTEST1760", // chainup symbol name
        "walletSymbol":"ETH_TEST5" // wallet symbol name
      }
    ]
}
```

{% endtab %}
{% endtabs %}

#### Company account asset

## Company account asset

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/wallet/companyAsset`

#### Query Parameters

| Name                                     | Type   | Description         |
| ---------------------------------------- | ------ | ------------------- |
| symbol<mark style="color:red;">\*</mark> | String | chainup symbol name |

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                      | Type   | Description          |
| ----------------------------------------- | ------ | -------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | app\_id              |
| time<mark style="color:red;">\*</mark>    | String | timestamp            |
| sign<mark style="color:red;">\*</mark>    | String | sign                 |
| data<mark style="color:red;">\*</mark>    | String | Cryptographic string |

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

```json
{
    "code": "", //code	
    "msg": "", //message	
    "data": "",
    "sign": ""
}

The decrypted structure in data:

{
    "accounts":[
      {
        "companyId": 1760, // company id
        "balance": "1000", // account balance
        "type": "113"  // account type,see the table below for a detailed description
      },
      {
        "companyId": 1760, // company id
        "balance": "1000", // account balance
        "type": "112" // account type,see the table below for a detailed description
      }
    ]
}
```

{% endtab %}
{% endtabs %}

#### Company account type description

| type | description                                                       |
| ---- | ----------------------------------------------------------------- |
| 113  | Company: recharging account of the administrator                  |
| 112  | Company: gift coin account                                        |
| 105  | Company: Withdrawal Fee Income & Miner Fee Expense Account        |
| 114  | Company: dividend return account                                  |
| 116  | Company: lockup account                                           |
| 130  | Company:Lock-up Token Distribution (Released to user's lock-up)V2 |
| 121  | Company:IEO Income Account (Raising Income)                       |
| 122  | Company:IEO Spending Account (Released to user's available)       |
| 181  | Company: (Spot & Margin) Transaction Fee Income Account           |
| 187  | Company: C2CTransaction Fee Income Account                        |
| 118  | Company: (Spot & Futures) Agent Rewards Account                   |
| 115  | Company: dividend account                                         |
| 149  | Company: contract bonus expense / recovery account                |
| 150  | Company: Financial account                                        |
| 152  | Rewards account of invitation to register                         |
| 153  | Mortgage loan interest sharing account                            |

Currency and contract transfer records

## Currency and contract transfer records

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/wallet/futuresTransferRecord`

#### Query Parameters

| Name                                       | Type   | Description                       |
| ------------------------------------------ | ------ | --------------------------------- |
| symbol                                     | String | chainup symbol name(not required) |
| uid                                        | number | uid(not required)                 |
| page<mark style="color:red;">\*</mark>     | number | Paging parameters (page number)   |
| pageSize<mark style="color:red;">\*</mark> | number | Paging parameters (page size)     |

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                      | Type   | Description          |
| ----------------------------------------- | ------ | -------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | app\_id              |
| time<mark style="color:red;">\*</mark>    | String | timestamp            |
| sign<mark style="color:red;">\*</mark>    | String | sign                 |
| data<mark style="color:red;">\*</mark>    | String | Cryptographic string |

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

```json
{
    "code": "", //code	
    "msg": "", //message	
    "data": "",
    "sign": ""
}

The decrypted structure in data:

{
    "count":50, // total record number
    "page":1, // Paging parameters (page number)
    "pageSize":2, // Paging parameters (page size)
    "list":[
      {
        "uid":12345,
        "symbol":"USDT1760", // chainup symbol name
        "transferType":"contract_to_wallet", // Fixed value: contract_to_wallet(Transfer the Futures to Spot)、wallet_to_contract（Spot transfer to the Futures）
        "transferTime":1691388963422, // transfer time
        "amount":"1000"
      },
      {
        "uid":12345,
        "symbol":"USDT1760", // chainup symbol name
        "transferType":"wallet_to_contract", // Fixed value: contract_to_wallet(Transfer the Futures to Spot)、wallet_to_contract（Spot transfer to the Futures）
        "transferTime":1691388963966, // transfer time
        "amount":"500"
      }
    ]
}
```

{% endtab %}
{% endtabs %}


# Sample request

## Overall access steps

Step 1: Resolve the domain name first

Step 2: Create application to submit public key and get app\_id/rsa\_saas\_pub, configure callback address.

Step 3: The user is authorized to register, and obtains the three-party merchant code

Step 4: Get the open platform counter-question token by code

Step 5: Access to open resources:

## Preparation - Get appKey and set redirectUrl( callback address )

Open Platform is an OAuth2.0 authorization login system built based on OAuth2.0 protocol standard. Before accessing the open platform, you need to prepare the following access materials through the management background:

1. appKey: Used to bind one-to-one with the UID of the merchant who opened the open platform, which is necessary to obtain the login permission of the open platform;
2. redirectUrl: The address to be used to jump to after the successful opening of an authorized account on the open platform; this address is filled in according to the actual business needs, if you do not know the business needs, you can fill in the exchange home page by default.;

Login to the administration background: Public Administration--> Open Platform Management--> Application Management

![](https://3422565439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJ12JnMKxsBgT55xBjIjw%2Fuploads%2Fo6S4VIh9UNKbwp7rV0c7%2Fimage.png?alt=media\&token=c4d9f291-32a7-493f-84cc-caed440c81b7)

Submit the public key according to the content in the red box

<figure><img src="https://3422565439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJ12JnMKxsBgT55xBjIjw%2Fuploads%2F6libJ5p5vD4HxLG3YQnT%2Fimage.png?alt=media&amp;token=0e485188-b1d4-4fd0-855b-77a20d102410" alt=""><figcaption></figcaption></figure>

User Registration Authorization - OAuth Authorization Login Page

Click Register with the correct appkey and redirectUrl

Browser access address: [http://service.xxx.com/platform/login.html?appKey=xxx\&redirectUrl=https:xxxx](http://platform.apple.com/?appKey=apple_6746\&redirectUrl=https://www.chainup.com)

![](https://3422565439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJ12JnMKxsBgT55xBjIjw%2Fuploads%2FKp8Aer0xtAIGWnGT6bfE%2Fimage.png?alt=media\&token=caa58015-ef36-4251-bbcf-a0a8bce083dc)

If you are not registered, register first; if you are already a registered user, just click the "Confirm Authorization" button in the previous image

![](https://3422565439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJ12JnMKxsBgT55xBjIjw%2Fuploads%2F5ULDFd95ussFwIPPiIW6%2Fimage.png?alt=media\&token=421ed495-ee4b-49c5-89df-be2464b18070)

The system will send a verification code for authorization

![](https://3422565439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJ12JnMKxsBgT55xBjIjw%2Fuploads%2FZnyqtGuAjoleEVm6eyez%2Fimage.png?alt=media\&token=4131e401-b1c3-4b4a-b036-4477befc26b9)

Register (or login) to get the code successfully

If you fill in the first step of the registration callback address is the home page of the exchange; then you can see the following image, the arrow is the current Code obtained

![](https://3422565439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJ12JnMKxsBgT55xBjIjw%2Fuploads%2FIJBggKlTSxOO6fG1Bv76%2Fimage.png?alt=media\&token=6dbfc8d6-6c4f-4d5b-89c0-1afbe4ded5fa)

## Get token - Get token and openId by code

#### Call the interface for a token or openId

Interface Address: <http://servoce.xfnh.com/platformapi/chainup/open/auth/token>

## Access to open platform resources via Token - create order/pay/inquire order

#### Create a payment order

Interface Address: <http://service.xfnh.fnhcom/platformapi/chainup/open/opay/createThirdOrder>

<mark style="color:red;">**Note!!! openId and userId can only exist one, if both exist at the same time, openId is preferred.**</mark>

Payment Page

Interface Address: <http://service.xfnh.com/pay.html>

#### Get the request parameters::

Login to the administration background: Public Administration--> Open Platform Management--> Application Management

Get the userId of the request parameter as shown in the image

![](https://3422565439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJ12JnMKxsBgT55xBjIjw%2Fuploads%2FXLGweY923yrsewmd0oR0%2Fimage.png?alt=media\&token=86159676-477d-43ba-ac26-25d6ad959efa)

Use POSTMAN tool to get the interface call address

The address of the interface call after assembling the parameters: [https://service.xxx.com/pay.html?appKey=xxx\&openId=xxx\&token=xxx\&orderNum=xxx](https://platform.xxx.com/pay.html?appKey=xxx\&openId=xxx\&token=xxx\&orderNum=xxx)

Engineers who are familiar with GET requests can directly follow the parameters to assemble the address to access

![](https://3422565439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJ12JnMKxsBgT55xBjIjw%2Fuploads%2FSsVpgNviAoalHYH7ggjj%2Fimage.png?alt=media\&token=58c3415d-fb6b-4e70-b6b8-7d7e5a853b63)

#### Calling the request payment page:

![](https://3422565439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJ12JnMKxsBgT55xBjIjw%2Fuploads%2Fm6RUYiyFnfyPYE9nJTOr%2Fimage.png?alt=media\&token=46daf9c8-eef4-4ed4-86b2-fe25736d3656)

Insufficient balance in the management platform to recharge the coins ( if the balance is sufficient, you can ignore this step )

Asset Management -- > Financial Management -- > Coin Grant Tool

![](https://3422565439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJ12JnMKxsBgT55xBjIjw%2Fuploads%2FH94dBtN6fc0epctl2w0R%2Fimage.png?alt=media\&token=90fa9f02-f266-46d5-89e9-a29a82454309)

The page that will be redirected after successful payment ( the page is the redirectUrl configured in the first step )

![](https://3422565439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJ12JnMKxsBgT55xBjIjw%2Fuploads%2FYAJcUHYTo8nHMaMQWO3H%2Fimage.png?alt=media\&token=a59727be-e2fc-4002-bcfa-2995ea9e43e9)

Check Payment Order

Interface Address：<http://service.xfnh.com/platformapi/chainup/open/opay/orderDetail>

Use POSTMAN tool to get the interface call address;

![返回结果即为查询成功后订单信息](https://3422565439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJ12JnMKxsBgT55xBjIjw%2Fuploads%2FJtrKCRy3EcJhL0djvSmB%2Fimage.png?alt=media\&token=036b996f-a3cd-442f-a2e3-fb150d9b1f52)


# Country code

<table><thead><tr><th width="252">cnName</th><th width="315">enName</th><th width="153">code</th></tr></thead><tbody><tr><td>阿富汗</td><td>AFGHANISTAN</td><td>97</td></tr><tr><td>阿尔巴尼亚</td><td>ALBANIA</td><td>+355+8</td></tr><tr><td>阿尔及利亚</td><td>ALGERIA</td><td>+213+12</td></tr><tr><td>美属萨摩亚</td><td>AMERICAN SAMOA</td><td>+684+16</td></tr><tr><td>安道尔</td><td>ANDORRA</td><td>396</td></tr><tr><td>安哥拉</td><td>ANGOLA</td><td>244+24</td></tr><tr><td>安圭拉岛</td><td>ANGUILLA</td><td>+1264+660</td></tr><tr><td>安提瓜和巴布达</td><td>ANTIGUA AND BARBUDA</td><td>+1268+28</td></tr><tr><td>阿根廷</td><td>ARGENTINA</td><td>+54+32</td></tr><tr><td>亚美尼亚</td><td>ARMENIA</td><td>+374+51</td></tr><tr><td>澳大利亚</td><td>AUSTRALIA</td><td>+61+36</td></tr><tr><td>奥地利</td><td>AUSTRIA</td><td>+43+40</td></tr><tr><td>阿塞拜疆</td><td>AZERBAIJAN</td><td>+994+31</td></tr><tr><td>巴哈马</td><td>BAHAMAS</td><td>+1242+44</td></tr><tr><td>巴林</td><td>BAHRAIN</td><td>+973+48</td></tr><tr><td>孟加拉国</td><td>BANGLADESH</td><td>+880+50</td></tr><tr><td>巴巴多斯</td><td>BARBADOS</td><td>+1246+52</td></tr><tr><td>白俄罗斯</td><td>BELARUS</td><td>+375+112</td></tr><tr><td>比利时</td><td>BELGIUM</td><td>+32+56</td></tr><tr><td>伯利兹</td><td>BELIZE</td><td>+501+84</td></tr><tr><td>贝宁</td><td>BENIN</td><td>+229+204</td></tr><tr><td>百慕大群岛</td><td>BERMUDA</td><td>+1441+60</td></tr><tr><td>玻利维亚</td><td>BOLIVIA, PLURINATION</td><td>+591+68</td></tr><tr><td>博茨瓦纳</td><td>BOTSWANA</td><td>+267+72</td></tr><tr><td>巴西</td><td>BRAZIL</td><td>+55+76</td></tr><tr><td>文莱</td><td>BRUNEI DARUSSALAM</td><td>+673+96</td></tr><tr><td>保加利亚</td><td>BULGARIA</td><td>+359+100</td></tr><tr><td>布基纳法索</td><td>BURKINA FASO</td><td>+226+854</td></tr><tr><td>布隆迪</td><td>BURUNDI</td><td>+257+108</td></tr><tr><td>柬埔寨</td><td>CAMBODIA</td><td>+855+116</td></tr><tr><td>喀麦隆</td><td>CAMEROON</td><td>+237+120</td></tr><tr><td>加拿大</td><td>CANADA</td><td>+1+124</td></tr><tr><td>开曼群岛</td><td>CAYMAN ISLANDS</td><td>+1345+136</td></tr><tr><td>中非共和国</td><td>CENTRAL AFRICAN REPU</td><td>+236+140</td></tr><tr><td>乍得</td><td>CHAD</td><td>+235+148</td></tr><tr><td>智利</td><td>CHILE</td><td>+56+152</td></tr><tr><td>中国</td><td>CHINA</td><td>+86+156</td></tr><tr><td>哥伦比亚</td><td>COLOMBIA</td><td>+57+170</td></tr><tr><td>刚果</td><td>CONGO</td><td>+242+178</td></tr><tr><td>库克群岛</td><td>COOK ISLANDS</td><td>+682+184</td></tr><tr><td>哥斯达黎加</td><td>COSTA RICA</td><td>+506+188</td></tr><tr><td>科特迪瓦</td><td>CÔTE D'IVOIRE</td><td>+225+384</td></tr><tr><td>克罗地亚</td><td>CROATIA</td><td>+385+191</td></tr><tr><td>古巴</td><td>CUBA</td><td>+53+192</td></tr><tr><td>塞浦路斯</td><td>CYPRUS</td><td>+357+196</td></tr><tr><td>捷克共和国</td><td>CZECH REPUBLIC</td><td>+420+203</td></tr><tr><td>丹麦</td><td>DENMARK</td><td>+45+208</td></tr><tr><td>吉布提</td><td>DJIBOUTI</td><td>+253+262</td></tr><tr><td>多米尼加共和国</td><td>DOMINICAN REPUBLIC</td><td>+1890+214</td></tr><tr><td>厄瓜多尔</td><td>ECUADOR</td><td>+593+218</td></tr><tr><td>埃及</td><td>EGYPT</td><td>+20+818</td></tr><tr><td>萨尔瓦多</td><td>EL SALVADOR</td><td>+503+222</td></tr><tr><td>爱沙尼亚</td><td>ESTONIA</td><td>+372+233</td></tr><tr><td>埃塞俄比亚</td><td>ETHIOPIA</td><td>+251+231</td></tr><tr><td>斐济群岛</td><td>FIJI</td><td>+679+242</td></tr><tr><td>芬兰</td><td>FINLAND</td><td>+358+246</td></tr><tr><td>法国</td><td>FRANCE</td><td>+33+250</td></tr><tr><td>法属圭亚那</td><td>FRENCH GUIANA</td><td>+594+254</td></tr><tr><td>法属波利尼西亚</td><td>FRENCH POLYNESIA</td><td>+689+258</td></tr><tr><td>加蓬</td><td>GABON</td><td>+241+266</td></tr><tr><td>冈比亚</td><td>GAMBIA</td><td>+220+270</td></tr><tr><td>乔治亚</td><td>GEORGIA</td><td>+995+268</td></tr><tr><td>德国</td><td>GERMANY</td><td>+49+276</td></tr><tr><td>加纳</td><td>GHANA</td><td>+233+288</td></tr><tr><td>直布罗陀</td><td>GIBRALTAR</td><td>+350+292</td></tr><tr><td>希腊</td><td>GREECE</td><td>+30+300</td></tr><tr><td>格林纳达</td><td>GRENADA</td><td>+1809+308</td></tr><tr><td>关岛</td><td>GUAM</td><td>+1671+316</td></tr><tr><td>危地马拉</td><td>GUATEMALA</td><td>+502+320</td></tr><tr><td>几内亚</td><td>GUINEA</td><td>+224+324</td></tr><tr><td>圭亚那</td><td>GUYANA</td><td>+592+328</td></tr><tr><td>海地</td><td>HAITI</td><td>+509+332</td></tr><tr><td>洪都拉斯</td><td>HONDURAS</td><td>+504+340</td></tr><tr><td>中国香港</td><td>HONG KONG</td><td>+852+344</td></tr><tr><td>匈牙利</td><td>HUNGARY</td><td>+36+348</td></tr><tr><td>冰岛</td><td>ICELAND</td><td>+354+352</td></tr><tr><td>印度</td><td>INDIA</td><td>+91+356</td></tr><tr><td>印度尼西亚</td><td>INDONESIA</td><td>+62+360</td></tr><tr><td>伊朗</td><td>IRAN, ISLAMIC REPUBL</td><td>+98+364</td></tr><tr><td>伊拉克</td><td>IRAQ</td><td>+964+368</td></tr><tr><td>爱尔兰</td><td>IRELAND</td><td>+353+372</td></tr><tr><td>以色列</td><td>ISRAEL</td><td>+972+376</td></tr><tr><td>意大利</td><td>ITALY</td><td>+39+380</td></tr><tr><td>牙买加</td><td>JAMAICA</td><td>+1876+388</td></tr><tr><td>日本</td><td>JAPAN</td><td>+81+392</td></tr><tr><td>约旦</td><td>JORDAN</td><td>+962+400</td></tr><tr><td>哈萨克斯坦</td><td>KAZAKHSTAN</td><td>+327+398</td></tr><tr><td>肯尼亚</td><td>KENYA</td><td>+254+404</td></tr><tr><td>朝鲜</td><td>KOREA, DEMOCRATIC PE</td><td>+850+408</td></tr><tr><td>韩国</td><td>KOREA, REPUBLIC OF</td><td>+82+410</td></tr><tr><td>科威特</td><td>KUWAIT</td><td>+965+414</td></tr><tr><td>吉尔吉斯斯坦</td><td>KYRGYZSTAN</td><td>+331+417</td></tr><tr><td>老挝</td><td>LAO PEOPLE'S DEMOCRA</td><td>+856+418</td></tr><tr><td>拉脱维亚</td><td>LATVIA</td><td>+371+428</td></tr><tr><td>黎巴嫩</td><td>LEBANON</td><td>+961+422</td></tr><tr><td>莱索托</td><td>LESOTHO</td><td>+266+426</td></tr><tr><td>利比里亚</td><td>LIBERIA</td><td>+231+430</td></tr><tr><td>利比亚</td><td>LIBYAN ARAB JAMAHIRI</td><td>+218+434</td></tr><tr><td>列支敦士登</td><td>LIECHTENSTEIN</td><td>+423+438</td></tr><tr><td>立陶宛</td><td>LITHUANIA</td><td>+370+440</td></tr><tr><td>卢森堡</td><td>LUXEMBOURG</td><td>+352+442</td></tr><tr><td>中国澳门</td><td>MACAO</td><td>+853+446</td></tr><tr><td>马达加斯加</td><td>MADAGASCAR</td><td>+261+450</td></tr><tr><td>马拉维</td><td>MALAWI</td><td>+265+454</td></tr><tr><td>马来西亚</td><td>MALAYSIA</td><td>+60+458</td></tr><tr><td>马尔代夫</td><td>MALDIVES</td><td>+960+462</td></tr><tr><td>马里</td><td>MALI</td><td>+223+466</td></tr><tr><td>马耳他</td><td>MALTA</td><td>+356+470</td></tr><tr><td>马提尼克岛</td><td>MARTINIQUE</td><td>+596+474</td></tr><tr><td>毛里求斯</td><td>MAURITIUS</td><td>+230+480</td></tr><tr><td>墨西哥</td><td>MEXICO</td><td>+52+484</td></tr><tr><td>摩尔多瓦</td><td>MOLDOVA, REPUBLIC OF</td><td>+373+498</td></tr><tr><td>摩纳哥</td><td>MONACO</td><td>+377+492</td></tr><tr><td>蒙古</td><td>MONGOLIA</td><td>+976+496</td></tr><tr><td>蒙特塞拉特</td><td>MONTSERRAT</td><td>+1664+500</td></tr><tr><td>摩洛哥</td><td>MOROCCO</td><td>+212+504</td></tr><tr><td>莫桑比克</td><td>MOZAMBIQUE</td><td>+258+508</td></tr><tr><td>缅甸</td><td>MYANMAR</td><td>+95+104</td></tr><tr><td>纳米比亚</td><td>NAMIBIA</td><td>+264+516</td></tr><tr><td>瑙鲁</td><td>NAURU</td><td>+674+520</td></tr><tr><td>尼泊尔</td><td>NEPAL</td><td>+977+524</td></tr><tr><td>荷兰</td><td>NETHERLANDS</td><td>+31+528</td></tr><tr><td>荷属安的列斯群岛</td><td>NETHERLANDS ANTILLES</td><td>+599+530</td></tr><tr><td>新西兰</td><td>NEW ZEALAND</td><td>+64+554</td></tr><tr><td>尼加拉瓜</td><td>NICARAGUA</td><td>+505+558</td></tr><tr><td>尼日尔</td><td>NIGER</td><td>+227+562</td></tr><tr><td>尼日利亚</td><td>NIGERIA</td><td>+234+566</td></tr><tr><td>挪威</td><td>NORWAY</td><td>+47+578</td></tr><tr><td>阿曼</td><td>OMAN</td><td>+968+512</td></tr><tr><td>巴基斯坦</td><td>PAKISTAN</td><td>+92+586</td></tr><tr><td>巴拿马</td><td>PANAMA</td><td>+507+591</td></tr><tr><td>巴布亚新几内亚</td><td>PAPUA NEW GUINEA</td><td>+675+598</td></tr><tr><td>巴拉圭</td><td>PARAGUAY</td><td>+595+600</td></tr><tr><td>秘鲁</td><td>PERU</td><td>+51+604</td></tr><tr><td>菲律宾</td><td>PHILIPPINES</td><td>+63+608</td></tr><tr><td>波兰</td><td>POLAND</td><td>+48+616</td></tr><tr><td>葡萄牙</td><td>PORTUGAL</td><td>+351+620</td></tr><tr><td>波多黎各</td><td>PUERTO RICO</td><td>+1787+630</td></tr><tr><td>卡塔尔</td><td>QATAR</td><td>+974+634</td></tr><tr><td>留尼汪岛</td><td>REUNION</td><td>+262+638</td></tr><tr><td>罗马尼亚</td><td>ROMANIA</td><td>+40+642</td></tr><tr><td>俄罗斯</td><td>RUSSIAN FEDERATION</td><td>+7+643</td></tr><tr><td>圣卢西亚</td><td>SAINT LUCIA</td><td>+1758+662</td></tr><tr><td>圣文森特和格林纳丁斯</td><td>SAINT VINCENT AND TH</td><td>+1784+670</td></tr><tr><td>萨摩亚</td><td>SAMOA</td><td>+685+882</td></tr><tr><td>圣马力诺</td><td>SAN MARINO</td><td>+378+674</td></tr><tr><td>圣多美和普林西比</td><td>SAO TOME AND PRINCIP</td><td>+239+678</td></tr><tr><td>沙特阿拉伯</td><td>SAUDI ARABIA</td><td>+966+682</td></tr><tr><td>塞内加尔</td><td>SENEGAL</td><td>+221+686</td></tr><tr><td>塞舌尔</td><td>SEYCHELLES</td><td>+248+690</td></tr><tr><td>塞拉利昂</td><td>SIERRA LEONE</td><td>+232+694</td></tr><tr><td>新加坡</td><td>SINGAPORE</td><td>+65+702</td></tr><tr><td>斯洛伐克</td><td>SLOVAKIA</td><td>+421+703</td></tr><tr><td>斯洛文尼亚</td><td>SLOVENIA</td><td>+386+705</td></tr><tr><td>所罗门群岛</td><td>SOLOMON ISLANDS</td><td>+677+90</td></tr><tr><td>索马里</td><td>SOMALIA</td><td>+252+706</td></tr><tr><td>南非</td><td>SOUTH AFRICA</td><td>+27+710</td></tr><tr><td>西班牙</td><td>SPAIN</td><td>+34+724</td></tr><tr><td>斯里兰卡</td><td>SRI LANKA</td><td>+94+144</td></tr><tr><td>苏丹</td><td>SUDAN</td><td>+249+736</td></tr><tr><td>苏里南</td><td>SURINAME</td><td>+597+740</td></tr><tr><td>斯威士兰</td><td>SWAZILAND</td><td>+268+748</td></tr><tr><td>瑞典</td><td>SWEDEN</td><td>+46+752</td></tr><tr><td>瑞士</td><td>SWITZERLAND</td><td>+41+756</td></tr><tr><td>叙利亚</td><td>SYRIAN ARAB REPUBLIC</td><td>+963+760</td></tr><tr><td>中国台湾</td><td>TAIWAN, PROVINCE OF </td><td>+886+158</td></tr><tr><td>塔吉克斯坦</td><td>TAJIKISTAN</td><td>+992+762</td></tr><tr><td>坦桑尼亚</td><td>TANZANIA, UNITED REP</td><td>+255+834</td></tr><tr><td>泰国</td><td>THAILAND</td><td>+66+764</td></tr><tr><td>多哥</td><td>TOGO</td><td>+228+768</td></tr><tr><td>汤加</td><td>TONGA</td><td>+676+776</td></tr><tr><td>特立尼达和多巴哥</td><td>TRINIDAD AND TOBAGO</td><td>+1809+780</td></tr><tr><td>突尼斯</td><td>TUNISIA</td><td>+216+788</td></tr><tr><td>土耳其</td><td>TURKEY</td><td>+90+792</td></tr><tr><td>土库曼斯坦</td><td>TURKMENISTAN</td><td>+993+795</td></tr><tr><td>乌干达</td><td>UGANDA</td><td>+256+800</td></tr><tr><td>乌克兰</td><td>UKRAINE</td><td>+380+804</td></tr><tr><td>阿拉伯联合酋长国</td><td>UNITED ARAB EMIRATES</td><td>+971+784</td></tr><tr><td>英国</td><td>UNITED KINGDOM</td><td>+44+826</td></tr><tr><td>美国</td><td>UNITED STATES</td><td>+1+840</td></tr><tr><td>乌拉圭</td><td>URUGUAY</td><td>+598+858</td></tr><tr><td>乌兹别克斯坦</td><td>UZBEKISTAN</td><td>+233+860</td></tr><tr><td>委内瑞拉</td><td>VENEZUELA, BOLIVARIA</td><td>+58+862</td></tr><tr><td>越南</td><td>VIET NAM</td><td>+84+704</td></tr><tr><td>也门</td><td>YEMEN</td><td>+967+887</td></tr><tr><td>赞比亚</td><td>ZAMBIA</td><td>+260+894</td></tr><tr><td>津巴布韦</td><td>ZIMBABWE</td><td>+263+716</td></tr></tbody></table>


# Staking

## Finance & Mining Pool - Participation record - Pledge currency query

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/staking/findBaseCoinByGroup`

Query participation record

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                     | Type    | Description                                                                               |
| ---------------------------------------- | ------- | ----------------------------------------------------------------------------------------- |
| appKey<mark style="color:red;">\*</mark> | String  | appKey                                                                                    |
| sign<mark style="color:red;">\*</mark>   | String  |                                                                                           |
| userId                                   | integer | User ID                                                                                   |
| baseCoin                                 | String  | baseCoin(/platformapi/chainup/open/staking/findBaseCoinByGroup  Get a list of currencies) |
| minAmount                                | String  | min pledge Amount                                                                         |
| maxAmount                                | String  | max pledge Amount                                                                         |
| projectId                                | String  | projectId                                                                                 |
| startTime                                | number  | Participation start time                                                                  |
| endTime                                  | number  | Participation end time                                                                    |
| page                                     | integer | page                                                                                      |
| pageSize                                 | integer | pageSize                                                                                  |
| status                                   | String  | status                                                                                    |
| itemDate                                 | Long    | Lock up time                                                                              |

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

```javascript
{
	"code": "",
	"msg": "",
	"data": [
		"BTC",
		"USDT"
	]
}
```

{% endtab %}
{% endtabs %}

#### Return value declaration

<table><thead><tr><th>Name</th><th>Type</th><th>Necessary</th><th>Example</th><th>Description</th></tr></thead><tbody><tr><td>data</td><td>List</td><td>YES</td><td><p></p><pre class="language-json"><code class="lang-json">[
    "BTC",
    "EUSDT"
]
</code></pre></td><td>Collection of pledged currencies</td></tr></tbody></table>

## Finance & Mining Pools - Participation records - Participation records inquiry

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/staking/getApplyRecord`

Query participation record

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                     | Type    | Description                                                                               |
| ---------------------------------------- | ------- | ----------------------------------------------------------------------------------------- |
| appKey<mark style="color:red;">\*</mark> | String  | appKey                                                                                    |
| sign<mark style="color:red;">\*</mark>   | String  |                                                                                           |
| userId                                   | integer | User ID                                                                                   |
| baseCoin                                 | String  | baseCoin(/platformapi/chainup/open/staking/findBaseCoinByGroup  Get a list of currencies) |
| minAmount                                | String  | min pledge Amount                                                                         |
| maxAmount                                | String  | max pledge Amount                                                                         |
| projectId                                | String  | projectId                                                                                 |
| startTime                                | number  | Participation start time                                                                  |
| endTime                                  | number  | Participation end time                                                                    |
| page                                     | integer | page                                                                                      |
| pageSize                                 | integer | pageSize                                                                                  |
| status                                   | String  | status                                                                                    |
| itemDate                                 | Long    | Lock up time                                                                              |

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

```javascript
{
	"code": "",
	"msg": "",
	"data": {
		"current": 1,
		"size": 10,
		"total": 6,
		"pages": 1,
		"records": [
			{
				"uid": 10002186,
				"amount": "10",
				"isAuth": 1,
				"pawnCoin": "BTC",
				"etime": "1608719975000",
				"ctime": "1616342400000",
				"earlyQuitRate": "0",
				"id": 284,
				"projectName": "余币宝-测试B2",
				"projectId": 144,
				"applyStatus": 2,
				"lockDay": 7
			}
		]
	}
}
```

{% endtab %}
{% endtabs %}

#### 状态说明

```
1 -> In income
2 -> Normal unlock
3 -> Unlock in advance
5 -> Apply to Quit
```

#### 返回值说明

<table><thead><tr><th>Name</th><th>Type</th><th>Necessary</th><th>Example</th><th>Description</th></tr></thead><tbody><tr><td><p></p><pre class="language-json"><code class="lang-json">records
</code></pre></td><td>List</td><td>YES</td><td><pre class="language-json"><code class="lang-json">{
	"uid": 10002186,
	"amount": "10",
	"isAuth": 1,
	"pawnCoin": "BTC",
	"etime": "1608719975000",
	"ctime": "1616342400000",
	"earlyQuitRate": "0",
	"id": 284,
	"projectName": "余币宝-测试B2",
	"projectId": 144,
	"applyStatus": 2,
	"lockDay": 7
}
</code></pre></td><td>Tabular data</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">current
</code></pre></td><td>int</td><td>YES</td><td>1</td><td>Current page</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">size
</code></pre></td><td>int</td><td>YES</td><td>10</td><td> Page size</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">total
</code></pre></td><td>int</td><td>YES</td><td>6</td><td>Total data</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">pages
</code></pre></td><td>int</td><td>YES</td><td>1</td><td>Total pages</td></tr></tbody></table>

<table><thead><tr><th width="236">Name</th><th>Type</th><th>Necessary</th><th>Example</th><th>Description</th></tr></thead><tbody><tr><td><p></p><pre class="language-json"><code class="lang-json">uid
</code></pre></td><td>int</td><td>YES</td><td>10012312</td><td>User id</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">amount
</code></pre></td><td>String</td><td>YES</td><td>19</td><td>Pledge deposit amount</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">isAuth
</code></pre></td><td>int</td><td>YES</td><td>1</td><td>Is the real name (0/1)</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">pawnCoin
</code></pre></td><td>String</td><td>YES</td><td>BTC</td><td>CoinSymbol</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">etime
</code></pre></td><td>int</td><td>YES</td><td>1616342400000</td><td>Unlock time</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">ctime
</code></pre></td><td>int</td><td>YES</td><td>1616342400000</td><td>Participation time</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">earlyQuitRate
</code></pre></td><td>int</td><td>YES</td><td>0</td><td>Proportion of liquidated damages</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">id
</code></pre></td><td>int</td><td>YES</td><td>286</td><td>Record id</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">projectName
</code></pre></td><td>String</td><td>YES</td><td>xxx</td><td>Project name</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">projectId
</code></pre></td><td>int</td><td>YES</td><td>144</td><td>Item id</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">applyStatus
</code></pre></td><td>int</td><td>YES</td><td>2</td><td>Status (reference enumeration)</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">lockDay
</code></pre></td><td>int</td><td>YES</td><td>7</td><td>Pledge cycle</td></tr></tbody></table>


# 开放平台指引

## 访问域名

## POST - 开放平台访问域名

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/`

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

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## 错误码

<table data-header-hidden><thead><tr><th width="150">code</th><th>错误码描述</th></tr></thead><tbody><tr><td>0</td><td>成功</td></tr><tr><td>10020</td><td>参数错误</td></tr><tr><td>10001</td><td>系统异常，请联系管理员</td></tr><tr><td>10003</td><td>滑动验证错误</td></tr><tr><td>10004</td><td>短信发送失败</td></tr><tr><td>10005</td><td>送过于频繁，稍后再试</td></tr><tr><td>10015</td><td>操作失败</td></tr><tr><td>10009</td><td>短信验证码或邮箱验证码不正确</td></tr><tr><td>10010</td><td>谷歌验证码不正确</td></tr><tr><td>50000</td><td>http请求的method不支持，全局接口都是application/json调用</td></tr><tr><td>50001</td><td>appKey非法</td></tr><tr><td>50002</td><td>重定向url与商户配置不匹配</td></tr><tr><td>50003</td><td>权限组不存在</td></tr><tr><td>50004</td><td>appKey不存在</td></tr><tr><td>50005</td><td>签名错误</td></tr><tr><td>50006</td><td>请求资源不能为空</td></tr><tr><td>50007</td><td>请求资源无效</td></tr><tr><td>50008</td><td>项目前缀无效</td></tr><tr><td>50009</td><td>请求时间超时</td></tr><tr><td>50010</td><td>非法的请求时间</td></tr><tr><td>50011</td><td>网络错误</td></tr><tr><td>50012</td><td>无权限访问资源</td></tr><tr><td>50013</td><td>今日该资源流量已达上限，不可访问</td></tr><tr><td>50014</td><td>该商户不支持此类账户支付</td></tr><tr><td>60001</td><td>刷新的token已失效</td></tr><tr><td>60002</td><td>token已失效</td></tr><tr><td>60003</td><td>code已被使用,只可使用一次</td></tr><tr><td>60004</td><td>无效的OPENID</td></tr><tr><td>70001</td><td>订单不存在</td></tr><tr><td>70002</td><td>订单已存在,请勿重复下单</td></tr><tr><td>70003</td><td>订单状态异常</td></tr><tr><td>70004</td><td>非法的支付用户</td></tr><tr><td>70005</td><td>商家账户不可用</td></tr><tr><td>70006</td><td>账户余额不足</td></tr><tr><td>70007</td><td>不支持该币种</td></tr><tr><td>70008</td><td>非法的支付金额</td></tr><tr><td>70009</td><td>非法的订单场景类型</td></tr></tbody></table>

## 账户类型

| assetType | 常用资产类型 |
| --------- | ------ |
| 201       | 正常余额   |

## 订单状态

| orderStatus | 描述   |
| ----------- | ---- |
| 1           | 待支付  |
| 2           | 支付失败 |
| 3           | 支付成功 |
| 0           | 已关闭  |

## 订单场景类型

| orderSceneType（即时生成） | 场景说明（商家定义） |
| -------------------- | ---------- |
| 1001                 | 抢购活动       |
| ...                  | ...        |


# 开发须知

### **公私钥作用**

**甲方**为 第三方业务调用方

**乙方**为 ChainUp服务提供方

**公私钥对作用**： 甲方在后台创建应用时，需提前生成一对公私钥，其中公钥（rsa\_third\_pub）提供给乙方，私钥自己保管，私钥请勿透露给任何人。甲方在请求乙方提供的服务时，通过乙方的公钥来加密请求参数，并用甲方的私钥对MD5后的数据原文进行签名，乙方接受到请求时，通过乙方的私钥解密数据，并用甲方的公钥对MD5后的数据原文进行验签.

### 账号准备

开发者需要准备如下信息:

1. 生成一对公私钥,将公钥通过后台创建应用提交到平台
2. 第三方应用服务器IP (可选)

开发者需要保存的信息:

1. 提交到平台公钥对应的私钥: rsa\_third\_pri ;
2. 创建应用的唯一标识: app\_id;
3. 应用对应平台公钥: rsa\_saas\_pub;

RSA公私钥生产地址

{% embed url="<http://www.metools.info/code/c80.html>" %}

生产规则:

* 密码长度: 2048
* 密钥格式: PKCS#8

### 接口规则

| 传输方式:   | https                                                                                |
| ------- | ------------------------------------------------------------------------------------ |
| 签名字段:   | 除了`sign`字段，其他所有必填项都需要参与签名                                                            |
| 响应状态码为: | `0`表示处理成功，非 0 表示请求错误或系统异常                                                            |
| 请求地址:   | 域名+接口地址                                                                              |
| 加密算法:   | Java 加解密Demo ： <https://github.com/exchange-platformApi/platformV2-java-example.git> |

### 接口文档说明

下文中所有POST请求 都需要将Query对象中的参数转为json字符串, 使用rsa\_saas\_pub 进行加密后为data, 使用rsa\_third\_pri 私钥对数据进行签名 详见[调用示例](https://github.com/exchange-platformApi/platformV2-java-example/blob/b62e39e9bc1e4f9e562d82a54c1d0cb6be874fbe/exchange-platform-v2-example/src/main/java/com/chainup/open/exchangeplatformv2example/example/RequestDemo.java#L17).&#x20;


# OAuth授权

## 第一步 <a href="#u7b2cu4e00u6b65uff0coauthu6388u6743u767bu5f55u98750a3ca20id3du7b2cu4e00u6b65uff0coauthu6388u6743u767" id="u7b2cu4e00u6b65uff0coauthu6388u6743u767bu5f55u98750a3ca20id3du7b2cu4e00u6b65uff0coauthu6388u6743u767"></a>

## OAuth授权登录页(在浏览器访问)

<mark style="color:blue;">`GET`</mark> `https://service.xxx.com/platform/login.html`

最后登录页拼接完成后为:\
[https://service.xxx.com/](https://platform.xxx.com/login.html?appKey=xxx\&redirectUrl=xxx\&state=xxx)platform/[login.html?appKey=xxx\&redirectUrl=xxx\&state=xxx](https://platform.xxx.com/login.html?appKey=xxx\&redirectUrl=xxx\&state=xxx)\
授权登录成功后携带code重定向到redirectUrl

#### Query Parameters

| Name                                          | Type   | Description |
| --------------------------------------------- | ------ | ----------- |
| appKey<mark style="color:red;">\*</mark>      | String | 商家appKey    |
| redirectUrl<mark style="color:red;">\*</mark> | String | 授权登录成功后跳转页面 |
| state                                         | String | 商家传入状态字段    |

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

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## 第二步 <a href="#di-er-bu-shi-yong-code-huan-qu-tokenopenid-jie-kou" id="di-er-bu-shi-yong-code-huan-qu-tokenopenid-jie-kou"></a>

## 使用code换取token、openId接口

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/auth/token`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Request Body

| Name                                      | Type   | Description                  |
| ----------------------------------------- | ------ | ---------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一app\_id                  |
| time<mark style="color:red;">\*</mark>    | String | 请求时间                         |
| sign<mark style="color:red;">\*</mark>    | String | 用rsa\_third\_pri对query中的数据签名 |
| data<mark style="color:red;">\*</mark>    | String | rsa\_saas\_pub加密query中数据     |

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

```javascript
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 解密后的结构
{
      "openId":"4dbca5afca8a46f48d863d18bsdd644731",  //该授权用户所属该商户下的唯一openId	
      "expireIn":"1720492073",  //token过期时间，秒	
      "refreshToken":"4dbca5afca8a46f48d863d18bsdd644731",  //刷新token所需的token	
      "token":"4dbca5afca8a46f48d863d18bsdd644731". //授权的token	
}
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数

| 名称   | 类型     | 是否必需 | 例子                                 | 描述                     |
| ---- | ------ | ---- | ---------------------------------- | ---------------------- |
| code | string | YES  | 2ae04ed9165624419bad68e9e0f3f29fbd | 调用第一步login用户登陆时返回的code |

## 刷新token

## 刷新token

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/auth/refreshToken`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                      | Type   | Description                  |
| ----------------------------------------- | ------ | ---------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一appId                    |
| time<mark style="color:red;">\*</mark>    | String | 请求时间                         |
| data<mark style="color:red;">\*</mark>    | String | 用rsa\_third\_pri对query中的数据签名 |
| sign<mark style="color:red;">\*</mark>    | String | rsa\_saas\_pub加密query中数据     |

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

```javascript
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 解密后的结构体
{
  "openId":"4dbca5afca8a46f48d863d18bsdd644731",  //该授权用户所属该商户下的唯一openId	
  "expireIn":"1720492073",  //token过期时间，秒	
  "refreshToken":"4dbca5afca8a46f48d863d18bsdd644731",  //刷新token所需的token	
  "token":"4dbca5afca8a46f48d863d18bsdd644731". //授权的token	
}
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数

| 名称           | 类型     | 是否必需 | 例子                                 | 描述                         |
| ------------ | ------ | ---- | ---------------------------------- | -------------------------- |
| refreshToken | string | YES  | 4dbca5afca8a46f48d863d18bsdd644731 | 获取token时收到的 refresh\_token |
| token        | string | YES  | 2ae04ed9165624419bad68e9e0f3f29fbd | <p>token之前授权的token<br></p> |
| openId       | string | YES  | 4dbca5afca8a46f48d863d18bsdd644731 | 该授权用户所属该商户下的唯一openId       |


# 支付

## 第一步

## 创建支付订单

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/opay/createThirdOrder`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Content-Type	<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                      | Type   | Description                  |
| ----------------------------------------- | ------ | ---------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一app\_id                  |
| time                                      | String | 请求时间                         |
| sign                                      | String | 用rsa\_third\_pri对query中的数据签名 |
| data                                      | String | rsa\_saas\_pub加密query中数据     |

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

```javascript
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体
{
  "orderNum":"xxxx",  //订单编号		
}
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

<table><thead><tr><th>名称</th><th>类型</th><th>是否必需</th><th width="250">例子</th><th>描述</th></tr></thead><tbody><tr><td>appOrderId</td><td>String</td><td>YES</td><td>11321</td><td>商家端订单id</td></tr><tr><td>openId</td><td>String</td><td>YES</td><td>2ae04ed9165624419bad68e9e0f3f29fbd</td><td>付款用户的唯一id</td></tr><tr><td>userId</td><td>String</td><td>YES</td><td>22033390</td><td>付款用户uid(与openid必须存在一个) ||同时存在优先取openid</td></tr><tr><td>orderAmount</td><td>String</td><td>YES</td><td>10</td><td>金额</td></tr><tr><td>orderSceneType</td><td>String</td><td>NO</td><td>1000011</td><td>订单的场景类型，数字枚举</td></tr><tr><td>payCoinSymbol</td><td>String</td><td>YES</td><td>BTC</td><td>支付币种，大写如BTCappKey</td></tr><tr><td>returnPage</td><td>String</td><td>YES</td><td>https://www.google.com</td><td>前台跳转商家的页面</td></tr><tr><td>notifyPage</td><td>String</td><td>YES</td><td>https://www.google.com</td><td>后台通知商家的地址</td></tr><tr><td>token</td><td>String</td><td>NO</td><td>2ae04ed9165624419bad68e9e0f3f29fbd</td><td>授权的token</td></tr><tr><td>goods</td><td>String</td><td>NO</td><td>商品描述信息，可不传，传入必须为合法的json格式，否则订单创建失败 ；json中的子字段为 name : 商品名称 desc:商品描述 例：[{"name":"商品1","desc":"商品信息123balabala"},{"name":"商品2","desc":"商品信息23balabala"},{"name":"商品3","desc":"商品信息33balabala"}]</td><td></td></tr></tbody></table>

## 第二步

## 支付页面

<mark style="color:blue;">`GET`</mark> `https://service.xxx.com/platform/pay.html`

最后支付页瓶装完成后为:\
[**https://service.xxx.com/**](https://platform.xxx.com/pay.html?appKey=xxx\&openId=xxx\&token=xxx\&orderNum=xxx)[**platform**](http://platform.apple.com/?appKey=apple_6746\&redirectUrl=https://www.chainup.com)**/**[**pay.html?appKey=xxx\&openId=xxx\&token=xxx\&orderNum=xxx**](https://platform.xxx.com/pay.html?appKey=xxx\&openId=xxx\&token=xxx\&orderNum=xxx)

#### Query Parameters

| Name                                    | Type   | Description               |
| --------------------------------------- | ------ | ------------------------- |
| appKey                                  | String |                           |
| orderNum                                | String | 平台编号支付人 openId，必须是订单创建人   |
| openId                                  | String | 支付人 openId，必须是订单创建人       |
| userId                                  | String | 付款用户 uid(与 openid 必须存在一个) |
| token<mark style="color:red;">\*</mark> | String | 授权的 token                 |

参数:

uid 与 openid 二选一必填

<table><thead><tr><th>名称</th><th>类型</th><th>是否必需</th><th width="250">例子</th><th>描述</th></tr></thead><tbody><tr><td>appKey</td><td>String</td><td>YES</td><td>xxx_xxx</td><td>商家唯一appKey</td></tr><tr><td>orderNum</td><td>String</td><td>YES</td><td>1000000009</td><td>平台编号支付人 openId，必须是订单创建人</td></tr><tr><td>openId</td><td>String</td><td>NO</td><td>2ae04ed9165624419bad68e9e0f3f29fbd</td><td>付款用户的唯一id</td></tr><tr><td>userId</td><td>String</td><td>NO</td><td>2023203</td><td>付款用户 uid</td></tr><tr><td>token</td><td>String</td><td>NO</td><td>2ae04ed9165624419bad68e9e0f3f29fbd</td><td>授权的token</td></tr></tbody></table>

## 第三步

## 支付结果回调接口

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/notifyPage`

该接口URL由对接商户提供，第一步创建订单时传出的参数：notifyPage\
支付完成后，支付结果会通过notifyPage对应的URL进行通知

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                      | Type   | Description                  |
| ----------------------------------------- | ------ | ---------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一app\_id                  |
| time                                      | String | 请求时间                         |
| sign                                      | String | 用rsa\_third\_pri对query中的数据签名 |
| data                                      | String | rsa\_saas\_pub加密query中数据     |

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

```javascript
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息 客户端收到请求后返回success，代表已收到请求	
    "data": "",
    "sign": ""
}
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

<table><thead><tr><th>名称</th><th width="124">类型</th><th>是否必需</th><th width="250">例子</th><th>描述</th></tr></thead><tbody><tr><td>outOrderId</td><td>String</td><td>YES</td><td>1000000009</td><td>商家端订单号</td></tr><tr><td>orderNum</td><td>String</td><td>YES</td><td>10000000002</td><td>开放平台订单编号</td></tr><tr><td>orderStatus</td><td>String</td><td>YES</td><td>1</td><td>订单状态(1 待支付； 2 支付失败；3 支付成功； 0 已关闭)</td></tr><tr><td>payAmount</td><td>String</td><td>YES</td><td>200</td><td>订单金额</td></tr><tr><td>returnUrl</td><td>String</td><td>YES</td><td>https://www.google.com</td><td>同步通知页面(下单接口传入)</td></tr></tbody></table>

## 查询支付订单

## 查询支付订单

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/opay/orderDetail`

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Content-Type	<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| appKey<mark style="color:red;">\*</mark>   | String | 商家唯一app\_id |
| orderNum<mark style="color:red;">\*</mark> | String | 平台方订单编号     |
| token                                      | String | 授权的token    |

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

```javascript

{
    "totalAccount": [ //商户支持的所有账户list	
      {
        "accountName": "nostrud qui", //账户名称(下拉菜单中显示)	
        "accountType": -88610101, //账户类型(id)需要回传给后端的相当于id字段	
        "accountBalance": 24283812.991745576 //支付用户该账户的余额
      },
      {
        "accountName": "consequat tempor nulla ullamco",
        "accountType": 57824482,
        "accountBalance": -38228228.129181474
      }
    ],
    "googleStatus": -93156512.86876366, //是否开启google验证；0-未开启,1-开启
    "appOrderId": "non aute ut", //商家订单id
    "sign": "est aliqua non eu", //签名
    "orderNum": "magna laborum dolore proident", //订单编号
    "orderStatus": "voluptate do eu Lorem", //订单状态(1 待支付； 2 支付失败；3 支付成功； 0 已关闭)
    "userId": 8957369, //用户id	
    "isOpenMobileCheck": "do consequat", //是否开启手机短信效验；0-未开启,1-开启
    "orderAmount": "aute enim ut", //订单金额
    "payCoinSymbol": "nulla", //支付币种	
    "ctime": "id ad conse",
    "appKey": "in aute",
    "showPrecision": "voluptate occaecat reprehenderit" //显示的精度
}
```

{% endtab %}
{% endtabs %}

参数:

<table><thead><tr><th>名称</th><th width="124">类型</th><th>是否必需</th><th width="250">例子</th><th>描述</th></tr></thead><tbody><tr><td>app_id</td><td>String</td><td>YES</td><td>xxx_xxx</td><td>商家唯一appKey</td></tr><tr><td>orderNum</td><td>String</td><td>YES</td><td>10000000002</td><td>开放平台订单编号</td></tr><tr><td>token</td><td>String</td><td>NO</td><td>2ae04ed9165624419bad68e9e0f3f29fbd</td><td>授权的token</td></tr></tbody></table>

## 商家日贴对账单

## 商家日贴对账单

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/opay/merchantBillingDay`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Content-Type	<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                      | Type   | Description                  |
| ----------------------------------------- | ------ | ---------------------------- |
| sign<mark style="color:red;">\*</mark>    | String | 用rsa\_third\_pri对query中的数据签名 |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一app\_id                  |
| time<mark style="color:red;">\*</mark>    | String | 请求时间                         |
| data<mark style="color:red;">\*</mark>    | String | rsa\_saas\_pub加密query中数据     |

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

```javascript
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体
{
    "count": 1000, //当日记录总数；  
    "list": [
      {
        "merchantUserId": 23000, //商家收款用户id；
        "appOrderId": "100000019", //商家端订单id；
        "payCoinSymbol": "btc", //支付使用币种； 
        "orderAmount": 10, //订单操作数量；
        "orderType": 1, //订单类型(1、支付订单;11、划转(退款)订单)  
        "userId": 230000, //付款用户id；付款用户id；  
        "openId": "2ae04ed9165624419bad68e9e0f3f29fbd", //付款用户openid；  
        "createTime": "11200321123", //下单时间，到毫秒； 
        "payTime": "320012321" //实际支付完成时间，到毫秒；  
      },
      {
        "merchantUserId": 23000, //商家收款用户id；
        "appOrderId": "100000019", //商家端订单id；
        "payCoinSymbol": "btc", //支付使用币种； 
        "orderAmount": 10, //订单操作数量；
        "orderType": 1, //订单类型(1、支付订单;11、划转(退款)订单)  
        "userId": 230000, //付款用户id；付款用户id；  
        "openId": "2ae04ed9165624419bad68e9e0f3f29fbd", //付款用户openid；  
        "createTime": "11200321123", //下单时间，到毫秒； 
        "payTime": "320012321" //实际支付完成时间，到毫秒； 
      }
    ]
}
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

<table><thead><tr><th width="136">名称</th><th width="124">类型</th><th>是否必需</th><th width="214">例子</th><th>描述</th></tr></thead><tbody><tr><td>orderType</td><td>String</td><td>YES</td><td>1</td><td>订单类型（1=支付订单；11=划转订单），不传查询所有订单</td></tr><tr><td>day</td><td>String</td><td>YES</td><td>2099-01-01</td><td>统计的日期，格式：yyyy-MM-dd，不符合格式参数异常；不传查询当日订单</td></tr><tr><td>pageNum</td><td>String</td><td>YES</td><td>1</td><td>查询第几页，同分页逻辑；不传查所有</td></tr><tr><td>pageSize</td><td>String</td><td>YES</td><td>200</td><td>每页大小，同分页逻辑；不传查2000（最大为2000，数据超过2000请分页查询）</td></tr></tbody></table>

## 取消待支付订单

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/opay/cancelOrder`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Content-Type	<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                      | Type   | Description                  |
| ----------------------------------------- | ------ | ---------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一app\_id                  |
| time<mark style="color:red;">\*</mark>    | String | 请求时间                         |
| sign<mark style="color:red;">\*</mark>    | String | 用rsa\_third\_pri对query中的数据签名 |
| data<mark style="color:red;">\*</mark>    | String | rsa\_saas\_pub加密query中数据     |

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

```javascript
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

<table><thead><tr><th width="136">名称</th><th width="124">类型</th><th>是否必需</th><th width="214">例子</th><th>描述</th></tr></thead><tbody><tr><td>orderNum</td><td>String</td><td>YES</td><td>10000001</td><td>订单编号</td></tr></tbody></table>


# 赠币

## 赠币接口 <a href="#zeng-bi-jie-kou" id="zeng-bi-jie-kou"></a>

## 赠币接口

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/opay/refundOrder`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Request Body

| Name                                      | Type   | Description                  |
| ----------------------------------------- | ------ | ---------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一app\_id                  |
| time<mark style="color:red;">\*</mark>    | String | 请求时间                         |
| sign                                      | String | 用rsa\_third\_pri对query中的数据签名 |
| data                                      | String | rsa\_saas\_pub加密query中数据     |

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

```javascript
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体

{
    "orderNum": "订单编号"
}
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

收款用户uid与openid必须存在一个,同时存在优先取openid

<table><thead><tr><th width="136">名称</th><th width="124">类型</th><th>是否必需</th><th width="214">例子</th><th>描述</th></tr></thead><tbody><tr><td>appOrderId</td><td>String</td><td>YES</td><td>10000001</td><td>商家端订单id，全局唯一</td></tr><tr><td>assetType</td><td>String</td><td>YES</td><td>202012</td><td>支付账户类型：AB的AB部分，默认到可用账户</td></tr><tr><td>openId</td><td>String</td><td>NO</td><td></td><td>收款用户的唯一id，开放平台授权给应用的用户唯一标识</td></tr><tr><td>userId</td><td>String</td><td>NO</td><td></td><td>收款用户uid(与openid必须存在一个) ||同时存在优先取openid</td></tr><tr><td>orderAmount</td><td>String</td><td>YES</td><td>200</td><td>金额</td></tr><tr><td>orderSceneType</td><td>String</td><td>NO</td><td>202</td><td>订单的场景类型，数字枚举；</td></tr><tr><td>payCoinSymbol</td><td>String</td><td>YES</td><td>btc</td><td>支付币种，大写如BTC</td></tr></tbody></table>


# 用户资产接口

## 用户资产查询（单币种） <a href="#yong-hu-zi-chan-cha-xun-dan-bi-zhong" id="yong-hu-zi-chan-cha-xun-dan-bi-zhong"></a>

## 用户资产查询（单币种）

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/ouser/userAccounts`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Content-Type	<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                      | Type   | Description                  |
| ----------------------------------------- | ------ | ---------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一编号                       |
| sign<mark style="color:red;">\*</mark>    | String | 用rsa\_third\_pri对query中的数据签名 |
| time<mark style="color:red;">\*</mark>    | String | 请求时间                         |
| data<mark style="color:red;">\*</mark>    | String | rsa\_saas\_pub加密query中数据     |

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

```javascript
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体

{
    "BTCPrecision": "btc8", //币种参数 + precision ： 该币种交易所精度 
    "accounts": [
      {
        "uid": "202113",//用户id
        "balance": "1000", //账号余额 
        "tag": "xxxxx", //描述  
        "type": "2021101" //资产编号 
      },
      {
        "uid": "202113",//用户id
        "balance": "1000", //账号余额 
        "tag": "xxxxx", //描述  
        "type": "2021101" //资产编号 
      }
    ],
    "USDTPrecision": "usdt8" //币种参数 + precision ： 该币种交易所精度 
}
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

收款用户uid与openid必须存在一个,同时存在优先取openid

<table><thead><tr><th width="136">名称</th><th width="124">类型</th><th>是否必需</th><th width="214">例子</th><th>描述</th></tr></thead><tbody><tr><td>openId</td><td>String</td><td>NO</td><td></td><td>收款用户的唯一id，开放平台授权给应用的用户唯一标识</td></tr><tr><td>userId</td><td>String</td><td>NO</td><td></td><td>收款用户uid(与openid必须存在一个) ||同时存在优先取openid</td></tr><tr><td>coinSymbols</td><td>String</td><td>YES</td><td>BTC</td><td>货币类型：如 ：BTC、USDT、BIKI、等；参考交易所内币种配置；多个币种用逗号分隔：例："USDT,BTC,ETH"</td></tr><tr><td>assetType</td><td>String</td><td>NO</td><td>201</td><td>常用类型："201" ：普通账户余额</td></tr></tbody></table>

## 用户账户余额（全币种） <a href="#u7528u6237u8d26u6237u4f59u989duff08u5168u5e01u79cduff090a3ca20id3du7528u6237u8d26u6237u4f59u989duff0" id="u7528u6237u8d26u6237u4f59u989duff08u5168u5e01u79cduff090a3ca20id3du7528u6237u8d26u6237u4f59u989duff0"></a>

<mark style="color:green;">`POST`</mark> `https://service.xxx.om//platformapi/chainup/open/user/accountBalance`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Content-Type	<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                      | Type   | Description                  |
| ----------------------------------------- | ------ | ---------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一编号                       |
| time<mark style="color:red;">\*</mark>    | String | 请求时间                         |
| sign<mark style="color:red;">\*</mark>    | String | 用rsa\_third\_pri对query中的数据签名 |
| data<mark style="color:red;">\*</mark>    | String | rsa\_saas\_pub加密query中数据     |

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

```javascript
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体
java
{
    "totalBalance": "100",//总资产
    "totalBalanceSymbol": "BTC",//总资产币种
    "platformCoin": "xxx",//分红配置的平台币
    "allCoinMap": { // 所有币种的映射，key是币种名字大写，value是每个币种对应的资产详情，
      "LTC": {
        "walletTransactionOpen": 1,//币种是否开启钱包划转
        "isFiat": 0 // 是否为法币，0:数字货币，1法币
        "normal_balance": "200", //用户现货正常余额
        "allBalance": "9000",//所有余额
        "exchange_symbol": "交易币对",//交易币对
        "present_coin_balance": 9000,//赠币账户
        "lock_position_balance": "2000",//锁仓账户
        "btcValuatin": "10000",//BTC折合
        "sort": 20,//排序
        "depositOpen": 1,//是否打开充值
        "lock_grant_divided_balance": "999999",//用户代币锁仓+挖矿锁仓账户余额
        "total_balance": "99999",//总余额
        "nc_lock_balance": "98888",//用户申购冻结余额
        "otcOpen": 1,//是否开启场外
        "depositMin": 20,//最小充值金额
        "checked": "true",//是否隐藏零资产，默认给true
        "coinName": "name", // 名字
        "lock_balance": "3000", //冻结金额
        "allBtcValuatin": "9918923",//所有折合btc
        "lock_position_v2_amount": "203213",//用户代币锁仓账户V2
        "withdrawOpen": 1, //是否开启提现
        "overcharge_balance": "9000"
      },
      "BCH": {
        "walletTransactionOpen": 1,//币种是否开启钱包划转
        "isFiat": 0 // 是否为法币，0:数字货币，1法币
        "normal_balance": "200", //用户现货正常余额
        "allBalance": "9000",//所有余额
        "exchange_symbol": "交易币对",//交易币对
        "present_coin_balance": 9000,//赠币账户
        "lock_position_balance": "2000",//锁仓账户
        "btcValuatin": "10000",//BTC折合
        "sort": 20,//排序
        "depositOpen": 1,//是否打开充值
        "lock_grant_divided_balance": "999999",//用户代币锁仓+挖矿锁仓账户余额
        "total_balance": "99999",//总余额
        "nc_lock_balance": "98888",//用户申购冻结余额
        "otcOpen": 1,//是否开启场外
        "depositMin": 20,//最小充值金额
        "checked": "true",//是否隐藏零资产，默认给true
        "coinName": "name", // 名字
        "lock_balance": "3000", //冻结金额
        "allBtcValuatin": "9918923",//所有折合btc
        "lock_position_v2_amount": "203213",//用户代币锁仓账户V2
        "withdrawOpen": 1, //是否开启提现
        "overcharge_balance": "9000"
      }
    }
  }
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

(openId,userId,mobileNumber,email)四选一必填

<table><thead><tr><th width="136">名称</th><th width="124">类型</th><th>是否必需</th><th width="214">例子</th><th>描述</th></tr></thead><tbody><tr><td>openId</td><td>String</td><td>NO</td><td></td><td>收款用户的唯一id，开放平台授权给应用的用户唯一标识</td></tr><tr><td>userId</td><td>String</td><td>NO</td><td></td><td>收款用户uid(与openid必须存在一个) ||同时存在优先取openid</td></tr><tr><td>mobileNumber</td><td>String</td><td>NO</td><td>09011223</td><td>手机号码</td></tr><tr><td>email</td><td>String</td><td>NO</td><td>xxxxx@.com</td><td>用户邮箱</td></tr></tbody></table>

## 获取用户充值记录

## 获取用户充值记录

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/user/depositRecord`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Content-Type	<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                      | Type   | Description                  |
| ----------------------------------------- | ------ | ---------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一编号                       |
| time<mark style="color:red;">\*</mark>    | String | 请求时间                         |
| sign<mark style="color:red;">\*</mark>    | String | 用rsa\_third\_pri对query中的数据签名 |
| data<mark style="color:red;">\*</mark>    | String | rsa\_saas\_pub加密query中数据     |

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

```javascript
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体
[
    {
      "symbol": "usdt", //充值币种  
      "id": 112331, //充值id  
      "uid": -230000, //充值用户id  
      "createdAt": 1233200092, //充值创建时间 
      "addressTo": "xxxxxxxxx", //充值地址  
      "amount": "1", //充值金额 
      "txid": "xxxxx", //txid 
      "status": 1, //充值状态 0 待确认，1 已完成 2 充值状态异常  
      "depositType": 0, //充值类型，0 外部充值 1 内部充值  
      "statusDesc": "xxxxx", //充值状态描述 
      "mobileNumber": "08666666", //用户手机号 
      "email": "xxxxx", //邮箱  
      "riskLevel": 0 //0:未检测到风险, 1:低风险, 2:中风险, 3:高风险
    },
    {
      "symbol": "bnb", //充值币种  
      "id": 112331, //充值id  
      "uid": -230000, //充值用户id  
      "createdAt": 1233200092, //充值创建时间 
      "addressTo": "xxxxxxxxx", //充值地址  
      "amount": "1", //充值金额 
      "txid": "xxxxx", //txid 
      "status": 1, //充值状态 0 待确认，1 已完成 2 充值状态异常  
      "depositType": 0, //充值类型，0 外部充值 1 内部充值  
      "statusDesc": "xxxxx", //充值状态描述 
      "mobileNumber": "08666666", //用户手机号 
      "email": "xxxxx", //邮箱  
      "riskLevel": 0 //0:未检测到风险, 1:低风险, 2:中风险, 3:高风险
    },
    {
      "symbol": "btc", //充值币种  
      "id": 112331, //充值id  
      "uid": -230000, //充值用户id  
      "createdAt": 1233200092, //充值创建时间 
      "addressTo": "xxxxxxxxx", //充值地址  
      "amount": "1", //充值金额 
      "txid": "xxxxx", //txid 
      "status": 1, //充值状态 0 待确认，1 已完成 2 充值状态异常  
      "depositType": 0, //充值类型，0 外部充值 1 内部充值  
      "statusDesc": "xxxxx", //充值状态描述 
      "mobileNumber": "08666666", //用户手机号 
      "email": "xxxxx", //邮箱  
      "riskLevel": 0 //0:未检测到风险, 1:低风险, 2:中风险, 3:高风险
    },
    {
      "symbol": "eth", //充值币种  
      "id": 112331, //充值id  
      "uid": -230000, //充值用户id  
      "createdAt": 1233200092, //充值创建时间 
      "addressTo": "xxxxxxxxx", //充值地址  
      "amount": "1", //充值金额 
      "txid": "xxxxx", //txid 
      "status": 1, //充值状态 0 待确认，1 已完成 2 充值状态异常  
      "depositType": 0, //充值类型，0 外部充值 1 内部充值  
      "statusDesc": "xxxxx", //充值状态描述 
      "mobileNumber": "08666666", //用户手机号 
      "email": "xxxxx", //邮箱  
      "riskLevel": 0 //0:未检测到风险, 1:低风险, 2:中风险, 3:高风险
    }
  ]
 
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

(openId,userId,mobileNumber,email)四选一必填

<table><thead><tr><th width="136">名称</th><th width="124">类型</th><th>是否必需</th><th width="214">例子</th><th>描述</th></tr></thead><tbody><tr><td>openId</td><td>String</td><td>NO</td><td></td><td>收款用户的唯一id，开放平台授权给应用的用户唯一标识</td></tr><tr><td>userId</td><td>String</td><td>NO</td><td></td><td>收款用户uid(与openid必须存在一个) ||同时存在优先取openid</td></tr><tr><td>mobileNumber</td><td>String</td><td>NO</td><td>09011223</td><td>手机号码</td></tr><tr><td>email</td><td>String</td><td>NO</td><td>xxxxx@.com</td><td>用户邮箱</td></tr><tr><td>pageSize</td><td>String</td><td>NO</td><td>20</td><td>每页数量(默认，20，最大1000，可以等于1000)</td></tr><tr><td>pageNumber</td><td>String</td><td>NO</td><td>1</td><td>页数（默认1，第一页）</td></tr></tbody></table>

## 用户提现记录 <a href="#yong-hu-ti-xian-ji-lu" id="yong-hu-ti-xian-ji-lu"></a>

## 用户提现记录

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/user/withdrawRecord`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                      | Type   | Description                  |
| ----------------------------------------- | ------ | ---------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一编号                       |
| time<mark style="color:red;">\*</mark>    | String | 请求时间                         |
| sign<mark style="color:red;">\*</mark>    | String | 用rsa\_third\_pri对query中的数据签名 |
| data<mark style="color:red;">\*</mark>    | String | rsa\_saas\_pub加密query中数据     |

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

```javascript
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体

[
    {
      "symbol": "BTC", //提现币种  
      "id": 1112, //提现id  
      "uid": 2302221, //用户id  
      "createdAt": 100892232313, //提现创建时间  
      "addressTo": "xxxxxxxxx", //提现地址 
      "amount": "20", //提现金额  
      "txid": "xxxxxxxxxx", //txid
      "status": 1, //提现状态   0未审核 1 审核通过 2审核拒绝 3支付中，已打币 4支付失败  5已完成  6已撤销 
      "statusDesc": "test", //提现状态描述  
      "fee": "20", //手续费  
      "mobileNumber": "19982112", //手机号  
      "email": "xxxx@.com", //邮箱
      "warningLevel": 1, //风控警告等级  
      "warningLevelDesc": "test", //警告等级提示  
      "warningTip": "resr", //报警内容 
      "warningTiplevel": 1 //商户后台报警等级展示 
    },
    {
      "symbol": "BTC", //提现币种  
      "id": 1112, //提现id  
      "uid": 2302221, //用户id  
      "createdAt": 100892232313, //提现创建时间  
      "addressTo": "xxxxxxxxx", //提现地址 
      "amount": "20", //提现金额  
      "txid": "xxxxxxxxxx", //txid
      "status": 1, //提现状态   0未审核 1 审核通过 2审核拒绝 3支付中，已打币 4支付失败  5已完成  6已撤销 
      "statusDesc": "test", //提现状态描述  
      "fee": "20", //手续费  
      "mobileNumber": "19982112", //手机号  
      "email": "xxxx@.com", //邮箱
      "warningLevel": 1, //风控警告等级  
      "warningLevelDesc": "test", //警告等级提示  
      "warningTip": "resr", //报警内容 
      "warningTiplevel": 1 //商户后台报警等级展示 
    }
  ]
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

(openId,userId,mobileNumber,email)四选一必填

<table><thead><tr><th width="136">名称</th><th width="124">类型</th><th>是否必需</th><th width="214">例子</th><th>描述</th></tr></thead><tbody><tr><td>openId</td><td>String</td><td>NO</td><td></td><td>收款用户的唯一id，开放平台授权给应用的用户唯一标识</td></tr><tr><td>userId</td><td>String</td><td>NO</td><td></td><td>收款用户uid(与openid必须存在一个) ||同时存在优先取openid</td></tr><tr><td>mobileNumber</td><td>String</td><td>NO</td><td>09011223</td><td>手机号码</td></tr><tr><td>email</td><td>String</td><td>NO</td><td>xxxxx@.com</td><td>用户邮箱</td></tr><tr><td>pageSize</td><td>String</td><td>NO</td><td>20</td><td>每页数量(默认，20，最大1000，可以等于1000)</td></tr><tr><td>pageNumber</td><td>String</td><td>NO</td><td>1</td><td>页数（默认1，第一页）</td></tr></tbody></table>


# 用户交易查询接口

## 场外交易记录查询接口 <a href="#chang-wai-jiao-yi-ji-lu-cha-xun-jie-kou" id="chang-wai-jiao-yi-ji-lu-cha-xun-jie-kou"></a>

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/user/otcTradeRecord`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Content-Type	<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                      | Type   | Description                  |
| ----------------------------------------- | ------ | ---------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一编号                       |
| time<mark style="color:red;">\*</mark>    | String | 请求时间                         |
| sign<mark style="color:red;">\*</mark>    | String | 用rsa\_third\_pri对query中的数据签名 |
| data<mark style="color:red;">\*</mark>    | String | rsa\_saas\_pub加密query中数据     |

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

```javascript
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体
[
    {
      "totalPrice": "2000",//广告总价
      "payTime": 2990990123,//支付时间
      "type": "BUY",//广告类型  
      "buyerId": 86973424.98351815,
      "buyerComment": "test",//给买方的评论
      "payCoin": "btc",//支付币种
      "sellerCommnetGrade": 1,//给卖家的评论等级 0好评 1差评
      "coinSymbol": "btc",//交易币种
      "sellerId": 23002,//卖方uid
      "price": "20",//广告单价
      "id": 21993123, // 广告id
      "isBlockTrade": 0, //是否大宗交易，0：普通交易，1：大宗交易
      "side": "Buy", //买卖方向 BUY 买入 SELL 卖出
      "sidCid": 1000, //卖方商户id
      "nickName": "bame",//昵称
      "advert": {
        "id": 2893123123,//广告id
        "userId": 230000,//用户id
        "status": 1,//广告状态 1发布中  2交易中 3过期 4关闭
        "side": "BUY",//交易类型
        "coin": "BTC",//交易货币(虚拟货币)'
        "country": "159",//国家
        "paycoin": "usdt",//支付货币（法币）
        "payment": "test",//付款方式
        "bankname": "test",//银行名称
        "priceRate": 230123,//交易价格与市场价的比率
        "priceRateType": 1,//交易价格与市场价的比率类型 1为与市场价相同 2高于 3为低于
        "price": 20,//价格
        "volume": 2999,//数量
        "feeRate": 10,//费率
        "minTrade": 10,//单笔最小交易额(金额)
        "maxTrade": 20,//单笔最大交易额(金额)
        "beginDate": 19989021313,//开始日期
        "endDate": 19989021313,//结束日期
        "limitTime": 19989021313,//交易期限
        "terms": "test",//交易条款
        "description": "test",//付款信息
        "authType": "2",//认证方式
        "minvolume": 20,//累计最小交易量
        "sell": 30,//当前广告实际出售数量
        "beginTime": 100089923123,//广告每天显示的开始时间
        "endTime": 298213123,//广告每天显示的截止时间
        "ctime": 12389894123,//创建日期
        "personalFeeDiscount": 1,//个人手续费折扣，1表示不打折
        "dealVolume": 30,
        "muid": 20300,//最后更新人
        "mtime": 123994123,//修改时间
        "autoReply": "test",//自动回复消息
        "openType": "12323",//广告开放方式 DEFAULT:系统默认时间30天随时可见,CUSTOM:用户指定时间段内可见
        "numberCode": "19",//国家数字编码
        "companyId": 129,//商户id，0表示SAAS总平台
        "isBlockTrade": 1//是否大宗交易
      },
      "adsOwner": 230000,//广告拥有者id
      "adsId": 52952411404654145,//广告id
      "sellerComment": "test",//给卖方的评论
      "buyerCommentGrade": 1,//给买家的评论等级 0好评 1差评  默认好评
      "volume": "300",//广告数量
      "bidCid": 1999,//买方商户id
      "sequence": "21398783123",//场外订单号码
      "realName": "name",//真实姓名
      "feeAmount": "20",//手续费额度
      "paySymbol": "usd",//支付币种，和payCoin一样，
      "createTime": 8806999099162734,//创建时间
      "status_text": "status_finished",//广告交易状态描述  status_unfinished  未完成   status_finished  已完成  otc.status1.buy.pending  待付款  otc.status1.sell.pending  待买家付款 otc.status2.buy.paid  待卖家放币  otc.status2.sell.paid  待放币
      "status": 1 //广告交易状态  订单状态 待支付1 已支付2 交易成功3 取消4 申诉5  打币中6  异常订单7
    }
  ]
}

```

{% endtab %}
{% endtabs %}

#### 以下为参与rsa加密的参数:

(openId,userId,mobileNumber,email)四选一必填

<table><thead><tr><th width="136">名称</th><th width="124">类型</th><th>是否必需</th><th width="214">例子</th><th>描述</th></tr></thead><tbody><tr><td>openId</td><td>String</td><td>NO</td><td></td><td>收款用户的唯一id，开放平台授权给应用的用户唯一标识</td></tr><tr><td>userId</td><td>String</td><td>NO</td><td></td><td>收款用户uid(与openid必须存在一个) ||同时存在优先取openid</td></tr><tr><td>mobileNumber</td><td>String</td><td>NO</td><td>09011223</td><td>手机号码</td></tr><tr><td>email</td><td>String</td><td>NO</td><td>xxxxx@.com</td><td>用户邮箱</td></tr><tr><td>pageSize</td><td>String</td><td>NO</td><td>20</td><td>每页数量(默认，20，最大1000，可以等于1000)</td></tr><tr><td>pageNumber</td><td>String</td><td>NO</td><td>1</td><td>页数（默认1，第一页）</td></tr></tbody></table>

## 币币成交记录查询

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/trade/getAll`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                      | Type   | Description                  |
| ----------------------------------------- | ------ | ---------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家app\_id                    |
| sign<mark style="color:red;">\*</mark>    | String | 用rsa\_third\_pri对query中的数据签名 |
| data<mark style="color:red;">\*</mark>    | String | rsa\_saas\_pub加密query中数据     |
| time<mark style="color:red;">\*</mark>    | String | 请求时间                         |

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

<pre class="language-javascript"><code class="lang-javascript">{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体

<strong>{
</strong>    "count": 1,//数据总条数
    "resultList": [
      {
        "volume": "100",//成交数量
        "side": "BUY",//主动单方向
        "buyFeeCoin": "btc",//买单支付手续费的币种
        "price": "0.1",//成交价格
        "buyFee": "0.001",//买单手续费
        "ctime": 112334212321,//创建时间
        "sellFeeCoin": "usdt",//卖单支付手续费的币种
        "id": 12321,
        "sellFee": "0.001",//卖单手续费
        "bid_id": 33000003300001,//买单id
        "ask_id": 33000013300001,//卖单id
        "bid_user_id": -230000,//买方用户id
        "ask_user_id": 230000//卖方用户id
      },
      {
        "volume": "100",
        "side": "BUY",
        "buyFeeCoin": "btc",
        "price": "0.1",
        "buyFee": "0.001",
        "ctime": 112334212321,
        "sellFeeCoin": "usdt",
        "id": 12321,
        "sellFee": "0.001",
        "bid_id": 33000003300001,
        "ask_id": 33000013300001,
        "bid_user_id": -230000,
        "ask_user_id": 230000
      },
      {
        "volume": "100",
        "side": "BUY",
        "buyFeeCoin": "btc",
        "price": "0.1",
        "buyFee": "0.001",
        "ctime": 112334212321,
        "sellFeeCoin": "usdt",
        "id": 12321,
        "sellFee": "0.001",
        "bid_id": 33000003300001,
        "ask_id": 33000013300001,
        "bid_user_id": -230000,
        "ask_user_id": 230000
      },
      {
        "volume": "100",
        "side": "BUY",
        "buyFeeCoin": "btc",
        "price": "0.1",
        "buyFee": "0.001",
        "ctime": 112334212321,
        "sellFeeCoin": "usdt",
        "id": 12321,
        "sellFee": "0.001",
        "bid_id": 33000003300001,
        "ask_id": 33000013300001,
        "bid_user_id": -230000,
        "ask_user_id": 230000
      }
    ]
}
</code></pre>

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

<table><thead><tr><th width="136">名称</th><th width="124">类型</th><th width="85">是否必需</th><th width="214">例子</th><th>描述</th></tr></thead><tbody><tr><td>symbol</td><td>String</td><td>YES</td><td>btcusdt</td><td>币对</td></tr><tr><td>startDate</td><td>String</td><td>YES</td><td>2099-01-01 00:00:00</td><td>开始时间，精确到秒“yyyy-MM-dd HH:mm:ss”</td></tr><tr><td>endDate</td><td>String</td><td>YES</td><td>2099-01-01 00:00:00</td><td>结束时间，精确到秒“yyyy-MM-dd HH:mm:ss”</td></tr><tr><td>pageSize</td><td>String</td><td>NO</td><td>20</td><td>每页数量(默认，20，最大1000，可以等于1000)</td></tr><tr><td>pageNumber</td><td>String</td><td>NO</td><td>1</td><td>页数（默认1，第一页）</td></tr></tbody></table>

## 币币订单记录查询接口

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/record/orderList`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                      | Type   | Description                  |
| ----------------------------------------- | ------ | ---------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一编号app\_id                |
| sign<mark style="color:red;">\*</mark>    | String | 用rsa\_third\_pri对query中的数据签名 |
| time<mark style="color:red;">\*</mark>    | String | 请求时间                         |
| data<mark style="color:red;">\*</mark>    | String | rsa\_saas\_pub加密query中数据     |

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

```javascript
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体


{
    "count": 1233,
    "list": [
      {
        "volume": 1123,//下单数量
        "symbol": "btcusdt",//币对
        "dealVolume": 123412,//已成交数量
        "orderId": 123123,//订单ID
        "totalPrice": 0.201,//限价单委托金额
        "price": 12341,//限价单委托价格
        "ctime": "ctime",//挂单时间
        "type": "limit",//limit=限价单；market市价单
        "orderSide": "buy",//SELL=卖出；BUY=买入
        "dealMoney": 1,//已成交金额
        "status": "0"//init=未初始订单；new=新订单；filled=完全成交订单；part filled=部分成交订单；canceled=已撤单；pending cancel=带撤单；expired=异常单
      },
      {
       "volume": 1123,//下单数量
        "symbol": btcusdt",//币对
        "dealVolume": 123412,//已成交数量
        "orderId": 123123,//订单ID
        "totalPrice": 0.201,//限价单委托金额
        "price": 12341,//限价单委托价格
        "ctime": "ctime",//挂单时间
        "type": "limit",//limit=限价单；market市价单
        "orderSide": "buy",//SELL=卖出；BUY=买入
        "dealMoney": 1,//已成交金额
        "status": "0"//init=未初始订单；new=新订单；filled=完全成交订单；part filled=部分成交订单；canceled=已撤单；pending cancel=带撤单；expired=异常单
      },
      {
        "volume": 1123,//下单数量
        "symbol": "btcusdt",//币对
        "dealVolume": 123412,//已成交数量
        "orderId": 123123,//订单ID
        "totalPrice": 0.201,//限价单委托金额
        "price": 12341,//限价单委托价格
        "ctime": "ctime",//挂单时间
        "type": "limit",//limit=限价单；market市价单
        "orderSide": "buy",//SELL=卖出；BUY=买入
        "dealMoney": 1,//已成交金额
        "status": "0"//init=未初始订单；new=新订单；filled=完全成交订单；part filled=部分成交订单；canceled=已撤单；pending cancel=带撤单；expired=异常单
      }
    ]
}
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

<table><thead><tr><th width="136">名称</th><th width="124">类型</th><th>是否必需</th><th width="214">例子</th><th>描述</th></tr></thead><tbody><tr><td>symbol</td><td>String</td><td>YES</td><td>btcusdt</td><td>币对</td></tr><tr><td>uid</td><td>String</td><td>YES</td><td>203000</td><td>用户id</td></tr><tr><td>startDate</td><td>String</td><td>YES</td><td>2099-01-01 00:00:00</td><td>开始时间，精确到秒“yyyy-MM-dd HH:mm:ss”</td></tr><tr><td>endDate</td><td>String</td><td>YES</td><td>2099-01-01 00:00:00</td><td>结束时间，精确到秒“yyyy-MM-dd HH:mm:ss”</td></tr><tr><td>pageSize</td><td>String</td><td>NO</td><td>20</td><td>每页数量(默认，20，最大1000，可以等于1000)</td></tr><tr><td>pageNumber</td><td>String</td><td>NO</td><td>1</td><td>页数（默认1，第一页）</td></tr></tbody></table>


# 用户信息接口

## 用户注册接口

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/user/registration`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                      | Type   | Description                  |
| ----------------------------------------- | ------ | ---------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一编号                       |
| time<mark style="color:red;">\*</mark>    | String | 请求时间                         |
| sign<mark style="color:red;">\*</mark>    | String | 用rsa\_third\_pri对query中的数据签名 |
| data<mark style="color:red;">\*</mark>    | String | rsa\_saas\_pub加密query中数据     |

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

```javascript
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体
{
    "uid": 2000000,//用户id
    "inviteCode": "AAAAAA"//邀请码   
}
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

手机号和邮箱填写,只能填写其中一个

<table><thead><tr><th width="136">名称</th><th width="124">类型</th><th>是否必需</th><th width="214">例子</th><th>描述</th></tr></thead><tbody><tr><td>mobileNumber</td><td>String</td><td>NO</td><td>09011223</td><td>手机号码</td></tr><tr><td>email</td><td>String</td><td>NO</td><td>xxxxx@.com</td><td>用户邮箱</td></tr><tr><td>countryCode</td><td>String</td><td>NO</td><td>93</td><td>手机号的国家拨号码<br></td></tr><tr><td>password</td><td>String</td><td>YES</td><td>TtEest19121</td><td>密码</td></tr><tr><td>invitedCode</td><td>String</td><td>YES</td><td>QSKNOQQQ</td><td>邀请码</td></tr></tbody></table>

## 用户注册信息

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/user/reg_info_list`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                      | Type   | Description                  |
| ----------------------------------------- | ------ | ---------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一编号                       |
| sign<mark style="color:red;">\*</mark>    | String | 用rsa\_third\_pri对query中的数据签名 |
| data<mark style="color:red;">\*</mark>    | String | rsa\_saas\_pub加密query中数据     |
| time<mark style="color:red;">\*</mark>    | String | 请求时间                         |

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

```javascript
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体


{
    "userInfoList": [
      {
        "uid": 23000,//用户uid
        "mobileNumber": "9989921",
        "email": "www@.com",
        "inviteCode": "SDONOQWE",//邀请码
        "pid": "3999009"//父级uid
      }
    ],
    "count": 20
  }
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

<table><thead><tr><th width="136">名称</th><th width="124">类型</th><th>是否必需</th><th width="214">例子</th><th>描述</th></tr></thead><tbody><tr><td>page</td><td>String</td><td>NO</td><td>1</td><td>翻页页数,不填默认为1</td></tr><tr><td>pageSize</td><td>String</td><td>NO</td><td>20</td><td>每页数量,不填默认为100</td></tr><tr><td>regStartTime</td><td>String</td><td>YES</td><td>1232123421123</td><td>开始注册时间(13位时间戳)</td></tr></tbody></table>

## 邀请关系查询-上级

## 返回当前查询到的所有上级,最高五级

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/user/user_superior`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                     | Type   | Description                  |
| ---------------------------------------- | ------ | ---------------------------- |
| appKey<mark style="color:red;">\*</mark> | String | 商家唯一app\_id                  |
| sign<mark style="color:red;">\*</mark>   | String | 用rsa\_third\_pri对query中的数据签名 |
| time<mark style="color:red;">\*</mark>   | String | 请求时间                         |
| data<mark style="color:red;">\*</mark>   | String | rsa\_saas\_pub加密query中数据     |

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

```javascript
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体
{
    "user": {
      "uid": 230001,//用户id  
      "inviteCode": "WEQSDA",//邀请码  
      "invitedCode": "OONSIAD",//被邀请码  
      "invitedUid": 2300002 //邀请人Uid  
    },
    "level1": {
      "uid": 230003,//用户id 
      "inviteCode": "SDKKCNASD",//邀请码  
      "invitedCode": "SDOMMQWE",//被邀请码  
      "invitedUid": 2399901//邀请人Uid 
    },
    "level2": {
      "uid": 230003,//用户id 
      "inviteCode": "SDKKCNASD",//邀请码  
      "invitedCode": "SDOMMQWE",//被邀请码  
      "invitedUid": 2399901//邀请人Uid 
    }
  }

```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

openid,用户uid,与openId和emailOrPhone三选一,优先uid

<table><thead><tr><th width="136">名称</th><th width="124">类型</th><th>是否必需</th><th width="214">例子</th><th>描述</th></tr></thead><tbody><tr><td>openId</td><td>String</td><td>NO</td><td></td><td>该授权用户所属该商户下的唯一openId</td></tr><tr><td>uid</td><td>String</td><td>NO</td><td></td><td>用户id</td></tr><tr><td>emailOrPhone</td><td>String</td><td>NO</td><td></td><td>手机号或者邮箱号</td></tr></tbody></table>

## 邀请关系查询-下级

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/user/user_invite`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                      | Type   | Description                  |
| ----------------------------------------- | ------ | ---------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一编号                       |
| sign<mark style="color:red;">\*</mark>    | String | 用rsa\_third\_pri对query中的数据签名 |
| data<mark style="color:red;">\*</mark>    | String | rsa\_saas\_pub加密query中数据     |
| time<mark style="color:red;">\*</mark>    | String | 请求时间                         |

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

```javascript
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体


{
    "levelOneCount": 4,//第一层子级
    "levelTwoCount": 9,//第二层子级
    "cuerrentUser": {
      "uid": 10002053,//当前用户uid
      "nickname": "xuyang",//当前用户nickname
      "inviteCode": "EAAAQATW",//当前用户邀请码
      "invitedUid": -1,//当前用户邀请人,不存在时返回-1
      "invitedCode": "",//当前用户被邀请码,不存在返回空串
      "ctime": "2019-09-02 12:24:36"
    },
    "userExtInviteVoList": [//被邀请人列表
      {
        "uid": 10002183,//uid
        "nickname": "小明",//nickname
        "inviteCode": "XXXXXXXX",//邀请码
        "level": 1,//第一层子级
        "invitedUid": 10002181,//邀请人uid
        "invitedNickname": "小花",//邀请人nickname
        "invitedCode": "XXXXXXXX",//邀请人邀请码
        "phone": "18310479052",//手机号码
        "email": "111@163.com",//email
        "ctime": "2020-08-22 19:40:18",//注册时间
        "childLevel": [
          {
            "uid": 10002065,
            "nickname": "小明",
            "inviteCode": "XXXXXXXX",
            "level": 2,//第二层子级
            "invitedUid": 10002183,
            "invitedNickname": "小花",
            "invitedCode": "XXXXXXXX",
            "phone": "18210479051",
            "email": "111@163.com",
            "ctime": "2020-04-09 20:52:26"
          },
          {
            "uid": 10002065,
            "nickname": "小明",
            "inviteCode": "XXXXXXXX",
            "level": 2,
            "invitedUid": 10002183,
            "invitedNickname": "小花",
            "invitedCode": "XXXXXXXX",
            "phone": "18210479051",
            "email": "111@163.com",
            "ctime": "2020-04-09 20:52:26"
          },
          {
            "uid": 10002065,
            "nickname": "小明",
            "inviteCode": "XXXXXXXX",
            "level": 2,
            "invitedUid": 10002183,
            "invitedNickname": "小花",
            "invitedCode": "XXXXXXXX",
            "phone": "18210479051",
            "email": "111@163.com",
            "ctime": "2020-04-09 20:52:26"
          },
          {
            "uid": 10002065,
            "nickname": "小明",
            "inviteCode": "XXXXXXXX",
            "level": 2,
            "invitedUid": 10002183,
            "invitedNickname": "小花",
            "invitedCode": "XXXXXXXX",
            "phone": "18210479051",
            "email": "111@163.com",
            "ctime": "2020-04-09 20:52:26"
          },
          {
            "uid": 10002065,
            "nickname": "小明",
            "inviteCode": "XXXXXXXX",
            "level": 2,
            "invitedUid": 10002183,
            "invitedNickname": "小花",
            "invitedCode": "XXXXXXXX",
            "phone": "18210479051",
            "email": "111@163.com",
            "ctime": "2020-04-09 20:52:26"
          }
        ]
      }
    ]
  }
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

<table><thead><tr><th width="136">名称</th><th width="124">类型</th><th>是否必需</th><th width="214">例子</th><th>描述</th></tr></thead><tbody><tr><td>openId</td><td>String</td><td>NO</td><td></td><td>该授权用户所属该商户下的唯一openId</td></tr><tr><td>uid</td><td>String</td><td>NO</td><td></td><td>用户uid</td></tr><tr><td>emailOrPhone</td><td>String</td><td>NO</td><td></td><td>手机号或者邮箱号</td></tr><tr><td>page</td><td>String</td><td>YES</td><td>1</td><td>翻页页数,不填默认为1</td></tr><tr><td>pageSize</td><td>String</td><td>YES</td><td>20</td><td>每页数量,不填默认为100</td></tr></tbody></table>

## 用户实名接口

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/user/verifyUserIdentity`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                      | Type   | Description                  |
| ----------------------------------------- | ------ | ---------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一编号                       |
| sign<mark style="color:red;">\*</mark>    | String | 用rsa\_third\_pri对query中的数据签名 |
| data<mark style="color:red;">\*</mark>    | String | rsa\_saas\_pub加密query中数据     |
| time<mark style="color:red;">\*</mark>    | String | 请求时间                         |

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

```javascript

{
    "code": "0",
    "msg": "suc",
    "sign": "",
    "data": ""
}
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

<table><thead><tr><th width="136">名称</th><th width="124">类型</th><th>是否必需</th><th width="214">例子</th><th>描述</th></tr></thead><tbody><tr><td>uid</td><td>String</td><td>YES</td><td>230000</td><td>用户id</td></tr><tr><td>countryCode</td><td>String</td><td>YES</td><td>93</td><td>国家编码,需要输入正确的code,code在左侧国家编码中获取</td></tr><tr><td>certificateNumber</td><td>String</td><td>YES</td><td>211111111111</td><td>证件号码</td></tr><tr><td>familyName</td><td>String</td><td>YES</td><td>test</td><td>姓</td></tr><tr><td>name</td><td>String</td><td>YES</td><td>test</td><td>名</td></tr><tr><td>firstPhoto</td><td>String</td><td>NO</td><td></td><td>证件照片,只支持在线图片地址,最多输入三个,逗号分隔,例: "https://oss.com.https://oss.com,https://oss.com"</td></tr></tbody></table>

## 用户登录历史

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/user/getUserHistoryLogin`

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                     | Type   | Description              |
| ---------------------------------------- | ------ | ------------------------ |
| appKey<mark style="color:red;">\*</mark> | String | 商家唯一编号appKey             |
| sign<mark style="color:red;">\*</mark>   | String |                          |
| uid<mark style="color:red;">\*</mark>    | String | 用户id                     |
| endDate                                  | String | 结束时间 2024-00-00 00:00:00 |
| startDate                                | String | 开始时间 2024-00-00 00:00:00 |

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

```javascript
{
    "code": "0",
    "msg": "suc",
    "data": {
        "count": 10,
        "HistoryLogin": [
            {
                "id": 2323332,
                "uid": 2324288,//用户id
                "lgType": 1,//登录方式，1：手机号，2：邮件，3：微信，4：QQ，5：APP扫码登录
                "lgPlatform": 3,//登录平台，1：WEB，2：H5，3：APP ,4 : OAUTH
                "lgSystem": "web",//登录系统，例如：‘android’，‘ios
                "lgIp": "111.203.241.52",//登录IP
                "lgStatus": 1,// 登录状态，1：成功，2：失败
                "lgInTime": 1598352251000//用户登录时间
            },
            {
                "id": 2323332,
                "uid": 2324288,//用户id
                "lgType": 1,//登录方式，1：手机号，2：邮件，3：微信，4：QQ，5：APP扫码登录
                "lgPlatform": 3,//登录平台，1：WEB，2：H5，3：APP ,4 : OAUTH
                "lgSystem": "web",//登录系统，例如：‘android’，‘ios
                "lgIp": "111.203.241.52",//登录IP
                "lgStatus": 1,// 登录状态，1：成功，2：失败
                "lgInTime": 1598352251000//用户登录时间
            }
        ]
    }
}

```

{% endtab %}
{% endtabs %}


# 合约交易

## 合约手续费查询

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/futures/feeList`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                      | Type   | Description                  |
| ----------------------------------------- | ------ | ---------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一编号                       |
| sign<mark style="color:red;">\*</mark>    | String | 用rsa\_third\_pri对query中的数据签名 |
| data<mark style="color:red;">\*</mark>    | String | rsa\_saas\_pub加密query中数据     |
| time<mark style="color:red;">\*</mark>    | String | 请求时间                         |

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

```javascript
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体

{
  "count": "20",
  "list": [
    {
      "itemDate": 10008902123,//日期，时间戳格式，精确到秒
      "uid": "20300021",//用户id
      "coin": "btc",//币种
      "tradeAmount": "2000",//交易额
      "feeAmount": "1"//手续费
    }
  ]
}
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

<table><thead><tr><th width="136">名称</th><th width="124">类型</th><th>是否必需</th><th width="214">例子</th><th>描述</th></tr></thead><tbody><tr><td>startDate</td><td>String</td><td>YES</td><td>200001</td><td>开始日期，精确到天，时间戳精确到秒</td></tr><tr><td>endDate</td><td>String</td><td>YES</td><td>xxxxx@.com</td><td>结束日期，精确到天，时间戳精确到秒</td></tr><tr><td>page</td><td>String</td><td>NO</td><td>1</td><td>页码 默认1</td></tr><tr><td>pageSize</td><td>String</td><td>NO</td><td>10</td><td>每页条数,默认100</td></tr></tbody></table>

## 合约经纪人角色查询

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/futures/agentUser`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                      | Type   | Description                  |
| ----------------------------------------- | ------ | ---------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一编号                       |
| sign<mark style="color:red;">\*</mark>    | String | 用rsa\_third\_pri对query中的数据签名 |
| data<mark style="color:red;">\*</mark>    | String | rsa\_saas\_pub加密query中数据     |
| time<mark style="color:red;">\*</mark>    | String | 请求时间                         |

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

```javascript
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体

{
  "count": "sed in ipsum",
  "list": [
    {
      "itemDate": 10008902123,//日期，时间戳格式，精确到秒
      "uid": "20300021",//用户id
      "coin": "btc",//币种
      "tradeAmount": "2000",//交易额
      "feeAmount": "1"//手续费
    }
  ]
}
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

<table><thead><tr><th width="136">名称</th><th width="124">类型</th><th>是否必需</th><th width="214">例子</th><th>描述</th></tr></thead><tbody><tr><td>startDate</td><td>String</td><td>YES</td><td>200001</td><td>开始日期，精确到天，时间戳精确到秒</td></tr><tr><td>endDate</td><td>String</td><td>YES</td><td>xxxxx@.com</td><td>结束日期，精确到天，时间戳精确到秒</td></tr><tr><td>page</td><td>String</td><td>NO</td><td>1</td><td>页码 默认1</td></tr><tr><td>pageSize</td><td>String</td><td>NO</td><td>10</td><td>每页条数,默认100</td></tr></tbody></table>


# 第三方免登录

## 创建/获取用户openApiKey及密钥信息

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/user/registerOrLoginToGetOpenApi`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Request Body

| Name                                      | Type   | Description                  |
| ----------------------------------------- | ------ | ---------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一app\_id                  |
| sign<mark style="color:red;">\*</mark>    | String | 用rsa\_third\_pri对query中的数据签名 |
| data<mark style="color:red;">\*</mark>    | String | rsa\_saas\_pub加密query中数据     |
| time<mark style="color:red;">\*</mark>    | String | 请求时间                         |

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

```javascript
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体
{
    "uid": 23998752,//用户id
    "apiKey": "47e2468b6dc5277fe19417d44daa834a",
    "secret": "f1abbd4ef74ec2d046dea8a85a659076"
}
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

邮箱号和手机号二选一必填, 注册用户手机号(传手机号必传国家编码)

<table><thead><tr><th width="136">名称</th><th width="124">类型</th><th>是否必需</th><th width="214">例子</th><th>描述</th></tr></thead><tbody><tr><td>countryCode</td><td>String</td><td>YES</td><td>93</td><td>注册用户国家编码</td></tr><tr><td>mobileNumber</td><td>String</td><td>YES</td><td>1990099121</td><td>注册用户手机号(传手机号必传国家编码)</td></tr><tr><td>email</td><td>String</td><td>YES</td><td>xxx@.com</td><td>邮箱 (邮箱 手机 任选其一)</td></tr><tr><td>password</td><td>String</td><td>YES</td><td>xxxxx</td><td>创建用户密码</td></tr><tr><td>invitedCode</td><td>String</td><td>YES</td><td>SDOOMXA</td><td>邀请码</td></tr></tbody></table>

## 获取用户交易所登录Token

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/user/getExchangeToken`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Request Body

| Name                                      | Type   | Description                  |
| ----------------------------------------- | ------ | ---------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一app\_id                  |
| sign<mark style="color:red;">\*</mark>    | String | 用rsa\_third\_pri对query中的数据签名 |
| time<mark style="color:red;">\*</mark>    | String | 请求时间                         |
| data<mark style="color:red;">\*</mark>    | String | rsa\_saas\_pub加密query中数据     |

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

```javascript
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体

{
    "uid": 23998752,//用户id
    "inviteCode": "QWGGHLTQ",//邀请码
    "token": "891324eb68128c031b98a1d8417ae12ed79be7a172704c02a52186f95b78e7ef" 
}
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

<table><thead><tr><th width="136">名称</th><th width="124">类型</th><th>是否必需</th><th width="214">例子</th><th>描述</th></tr></thead><tbody><tr><td>apiKey</td><td>String</td><td>YES</td><td>2ae04ed9165624419bad68e9e0f3</td><td>openApiKey</td></tr><tr><td>secret</td><td>String</td><td>YES</td><td>SSe04ed9165624419bad68eDWQ0f3</td><td>openApi的密钥</td></tr><tr><td>uid</td><td>String</td><td>YES</td><td>202300123</td><td>用户id</td></tr></tbody></table>

## 退出登录

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/user/exchangeLogOut`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Request Body

| Name                                      | Type   | Description                  |
| ----------------------------------------- | ------ | ---------------------------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一app\_id                  |
| sign<mark style="color:red;">\*</mark>    | String | 用rsa\_third\_pri对query中的数据签名 |
| time<mark style="color:red;">\*</mark>    | String | 请求时间                         |
| data<mark style="color:red;">\*</mark>    | String | rsa\_saas\_pub加密query中数据     |

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

```javascript
{
    "code": "0",
    "msg": "suc"
}
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

<table><thead><tr><th width="136">名称</th><th width="124">类型</th><th>是否必需</th><th width="214">例子</th><th>描述</th></tr></thead><tbody><tr><td>apiKey</td><td>String</td><td>YES</td><td>2ae04ed9165624419bad68e9e0f3</td><td>openApiKey</td></tr><tr><td>secret</td><td>String</td><td>YES</td><td>SSe04ed9165624419bad68eDWQ0f3</td><td>openApi的密钥</td></tr><tr><td>uid</td><td>String</td><td>YES</td><td>202300123</td><td>用户id</td></tr><tr><td>exchangeToken</td><td>String</td><td>YES</td><td></td><td>登录人登录token，如果有保存直接传，没有也可以再生成一个传过来</td></tr></tbody></table>


# 钱包

#### 钱包地址映射关系

## 钱包地址映射关系

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/wallet/addressMapping`

#### Query Parameters

| Name                                         | Type   | Description                                       |
| -------------------------------------------- | ------ | ------------------------------------------------- |
| walletType<mark style="color:red;">\*</mark> | number | 钱包类型（1 custody 2 wapi 3 fireblocks 4 custody mpc） |
| symbol<mark style="color:red;">\*</mark>     | String | chainup币种名称                                       |
| uid                                          | number | uid (非必填)                                         |
| page<mark style="color:red;">\*</mark>       | number | 分页参数（页码）                                          |
| pageSize<mark style="color:red;">\*</mark>   | number | 分页参数（每页大小）                                        |

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-type | String | application/json |

#### Request Body

| Name                                      | Type   | Description |
| ----------------------------------------- | ------ | ----------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一app\_id |
| time<mark style="color:red;">\*</mark>    | String | 请求时间        |
| sign<mark style="color:red;">\*</mark>    | String | 签名          |
| data<mark style="color:red;">\*</mark>    | String | 加密字符串       |

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

```json
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体

{
    "count":50, // total record number
    "page":1, // Paging parameters (page number)
    "pageSize":2, // Paging parameters (page size)
    "symbol":"BTCTEST1760", // chainup symbol
    "walletSymbol":"BTC_TEST", //wallet symbol 
    "list":[
      {
        "address":"1K1zD7ypt6oiXH4z54NoohddEV7JwQKCEo", // user deposit address
        "tag":"4567", // tag
        "uid":1234, // chainup uid
        "walletUid":2 // wallet uid or fireblocks vault id
      },
      {
        "address":"1K1zD7ypt6oiXH4z54Noo", // user deposit address
        "tag":"4567", // tag
        "uid":4567, // chainup uid
        "walletUid":3 // wallet uid or fireblocks vault id
      }
    ]
}
```

{% endtab %}
{% endtabs %}

#### 钱包币种映射

## 钱包币种映射

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/wallet/symbolMapping`

#### Query Parameters

| Name                                          | Type   | Description                                       |
| --------------------------------------------- | ------ | ------------------------------------------------- |
| walletType	<mark style="color:red;">\*</mark> | number | 钱包类型（1 custody 2 wapi 3 fireblocks 4 custody mpc） |
| symbol                                        | String | chainup币种名称(非必填)                                  |
| walletSymbol                                  | String | 钱包币种名称(非必填)                                       |
| page<mark style="color:red;">\*</mark>        | number | 分页参数（页码）                                          |
| pageSize<mark style="color:red;">\*</mark>    | number | 分页参数（每页大小）                                        |

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-type | String | application/json |

#### Request Body

| Name                                      | Type   | Description |
| ----------------------------------------- | ------ | ----------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一app\_id |
| time<mark style="color:red;">\*</mark>    | String | 请求时间        |
| sign<mark style="color:red;">\*</mark>    | String | 签名          |
| data<mark style="color:red;">\*</mark>    | String | 加密字符串       |

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

```json
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体

{
    "count":50, // total record number
    "page":1, // Paging parameters (page number)
    "pageSize":2, // Paging parameters (page size)
    "walletType":3 //1 custody 2 wapi 3 fireblocks 4 custody mpc
    "list":[
      {
        "symbol":"BTCTEST1760", // chainup symbol name
        "walletSymbol":"BTC_TEST" // wallet symbol name
      },
      {
        "symbol":"ETHTEST1760", // chainup symbol name
        "walletSymbol":"ETH_TEST5" // wallet symbol name
      }
    ]
}
```

{% endtab %}
{% endtabs %}

#### 公司资产

## 公司资产

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/wallet/companyAsset`

#### Query Parameters

| Name                                     | Type   | Description |
| ---------------------------------------- | ------ | ----------- |
| symbol<mark style="color:red;">\*</mark> | String | chainup币种名称 |

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                      | Type   | Description |
| ----------------------------------------- | ------ | ----------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一app\_id |
| time<mark style="color:red;">\*</mark>    | String | 请求时间        |
| sign<mark style="color:red;">\*</mark>    | String | 签名          |
| data<mark style="color:red;">\*</mark>    | String | 加密字符串       |

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

```json
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体

{
    "accounts":[
      {
        "companyId": 1760, // company id
        "balance": "1000", // account balance
        "type": "113"  // account type,see the table below for a detailed description
      },
      {
        "companyId": 1760, // company id
        "balance": "1000", // account balance
        "type": "112" // account type,see the table below for a detailed description
      }
    ]
}
```

{% endtab %}
{% endtabs %}

#### 公司资产type描述

| type | description                |
| ---- | -------------------------- |
| 113  | 公司:管理员充值账户                 |
| 112  | 公司:赠币账户                    |
| 105  | 公司:提币手续费收入&矿工费支出账户         |
| 114  | 公司:分红币返还账户                 |
| 116  | 公司:锁仓账户                    |
| 130  | 公司:锁仓代币发放（释放到用户锁仓账户）V2     |
| 121  | 公司:IEO收入账户（募集收入）           |
| 122  | 公司:IEO支出账户（释放到用户可用账户）      |
| 181  | 公司:（Spot\&Margin）交易手续费收入账户 |
| 187  | 公司:C2C交易手续费收入账户            |
| 118  | 公司:（现货 & 合约）经纪人奖励账户        |
| 115  | 公司:分红币分红账户                 |
| 149  | 公司:合约赠金支出/回收账户             |
| 150  | 公司:理财发币账户                  |
| 152  | 邀请注册奖励账户                   |
| 153  | 公司：抵押借贷利息分成账户              |

#### 币币与合约划转记录

## 币币与合约划转记录

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/wallet/futuresTransferRecord`

#### Query Parameters

| Name                                       | Type   | Description      |
| ------------------------------------------ | ------ | ---------------- |
| symbol                                     | String | chainup币种名称(非必填) |
| uid                                        | number | uid(非必填)         |
| page<mark style="color:red;">\*</mark>     | number | 分页参数（页码）         |
| pageSize<mark style="color:red;">\*</mark> | number | 分页参数（每页大小）       |

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                      | Type   | Description |
| ----------------------------------------- | ------ | ----------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一app\_id |
| time<mark style="color:red;">\*</mark>    | String | 请求时间        |
| sign<mark style="color:red;">\*</mark>    | String | 签名          |
| data<mark style="color:red;">\*</mark>    | String | 加密字符串       |

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

```json
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体

{
    "count":50, // total record number
    "page":1, // Paging parameters (page number)
    "pageSize":2, // Paging parameters (page size)
    "list":[
      {
        "uid":12345,
        "symbol":"USDT1760", // chainup symbol name
        "transferType":"contract_to_wallet", // Fixed value: contract_to_wallet(Transfer the contract to currency)、wallet_to_contract（Currency transfer to the contract）
        "transferTime":1691388963422, // transfer time
        "amount":"1000"
      },
      {
        "uid":12345,
        "symbol":"USDT1760", // chainup symbol name
        "transferType":"wallet_to_contract", // Fixed value: contract_to_wallet(Transfer the contract to currency)、wallet_to_contract（Currency transfer to the contract）
        "transferTime":1691388963966, // transfer time
        "amount":"500"
      }
    ]
}
```

{% endtab %}
{% endtabs %}


# RWA

## 用户登录token鉴权

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/rwa/token/verify`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-type | String | application/json |

#### Request Body

| Name                                      | Type   | Description |
| ----------------------------------------- | ------ | ----------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一app\_id |
| time<mark style="color:red;">\*</mark>    | String | 请求时间        |
| sign<mark style="color:red;">\*</mark>    | String | 签名          |
| data<mark style="color:red;">\*</mark>    | String | 加密字符串       |

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

```json
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体

{
    "uid":12345 // saas user id
}
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

| 名称    | 类型     | 是否必填 | 例子                                                               | 描述        |
| ----- | ------ | ---- | ---------------------------------------------------------------- | --------- |
| token | String | 是    | 63fe725e1fac6f6b279a125b5cc0acbecccf63728c884bf4ac9432ec3f87f88a | 用户登录token |

## 用户余额查询接口

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/rwa/user/balance`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-type | String | application/json |

#### Request Body

| Name                                      | Type   | Description |
| ----------------------------------------- | ------ | ----------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一app\_id |
| time<mark style="color:red;">\*</mark>    | String | 请求时间        |
| sign<mark style="color:red;">\*</mark>    | String | 签名          |
| data<mark style="color:red;">\*</mark>    | String | 加密字符串       |

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

```json
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体
[
    {
        "symbol":"TUSDT5248", //币种名称
        "showName":"TUSDT",//币种前台展示名称
        "totalBalance":"10000",//币币总余额
        "normalBalance":"5000",//币币可用余额
        "lockBalance":"5000"//币币冻结余额
    },
    {
        "symbol":"RWA5248",
        "showName":"RWA",
        "totalBalance":"10000",
        "normalBalance":"7000",
        "lockBalance":"3000"
    }
]
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

| 名称      | 类型      | 是否必填 | 例子                | 描述                       |
| ------- | ------- | ---- | ----------------- | ------------------------ |
| uid     | Integer | 是    | 12345             | saas交易所用户id              |
| symbols | String  | 是    | TUSDT5248,RWA5248 | saas币种名称，如果传多个以英文逗号","分隔 |

## 上RWA通证代币

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/rwa/rwaSymbol/add`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-type | String | application/json |

#### Request Body

| Name                                      | Type   | Description |
| ----------------------------------------- | ------ | ----------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一app\_id |
| time<mark style="color:red;">\*</mark>    | String | 请求时间        |
| sign<mark style="color:red;">\*</mark>    | String | 签名          |
| data<mark style="color:red;">\*</mark>    | String | 加密字符串       |

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

```json
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体
{
        "coinSymbol":"RWA5248", //币种名称
        "showName":"RWA",//币种前台展示名称
        "type":3,//rwa通证代币
        "tokenBase":"ETH5248",//主链币
        "contractAddress":"sdcdacad",//合约地址
        "contractPrecision":8,//合约精度
        "depositOpen":1,//充值开关 0关闭 1开启
        "withdrawOpen":1//提现开关 0关闭 1开启
    }
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

| 名称                | 类型      | 是否必填 | 例子      | 描述                         |
| ----------------- | ------- | ---- | ------- | -------------------------- |
| symbolName        | String  | 是    | RWATEST | rwa通证代币前台显示名称              |
| contractAddress   | String  | 是    | scdaca  | 合约地址                       |
| contractPrecision | Integer | 是    | 8       | 合约精度                       |
| tokenBase         | String  | 是    | ETH     | 主链币，固定值：ETH，此接口目前只能上ETH的代币 |

## 查询币种列表

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/rwa/symbol/list`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-type | String | application/json |

#### Request Body

| Name                                      | Type   | Description |
| ----------------------------------------- | ------ | ----------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一app\_id |
| time<mark style="color:red;">\*</mark>    | String | 请求时间        |
| sign<mark style="color:red;">\*</mark>    | String | 签名          |
| data<mark style="color:red;">\*</mark>    | String | 加密字符串       |

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

```json
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体
[
   {
        "coinSymbol":"RWA5248", //币种名称
        "showName":"RWA",//币种前台展示名称
        "type":3,//币种类型 1 数字货币 2 法币 3 RWA通证代币
        "tokenBase":"ETH5248",//主链币
        "contractAddress":"sdcdacad",//合约地址
        "showPrecision":8,//显示精度
        "depositOpen":1,//充值开关 0关闭 1开启
        "withdrawOpen":1//提现开关 0关闭 1开启
    }
]
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

| 名称     | 类型      | 是否必填 | 例子      | 描述                                            |
| ------ | ------- | ---- | ------- | --------------------------------------------- |
| type   | Integer | 否    | 3       | 币种类型，非必填，1 数字货币  2 法币  3 RWA通证代币 ， 不传则默认查所有类型 |
| symbol | String  | 否    | RWA1563 | 币种名称，非必填，传则查指定币种                              |

## rwa下单冻结/撤单解冻

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/rwa/order`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-type | String | application/json |

#### Request Body

| Name                                      | Type   | Description |
| ----------------------------------------- | ------ | ----------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一app\_id |
| time<mark style="color:red;">\*</mark>    | String | 请求时间        |
| sign<mark style="color:red;">\*</mark>    | String | 签名          |
| data<mark style="color:red;">\*</mark>    | String | 加密字符串       |

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

```json
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体
{
    "orderId":"12345"//交易所冻结解冻订单id
}
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

| 名称         | 类型      | 是否必填 | 例子            | 描述                                    |
| ---------- | ------- | ---- | ------------- | ------------------------------------- |
| uid        | Integer | 是    | 552233        | 下单用户uid                               |
| side       | String  | 是    | BUY           | 买卖方向，固定值：BUY、SELL                     |
| type       | Integer | 是    | 0             | 转账类型：0 下单冻结 ； 1 撤单解冻                  |
| coinSymbol | String  | 是    | RWA1711       | 币种名称                                  |
| amount     | Integer | 是    | 100           | 金额                                    |
| fee        | Integer | 否    | 5             | 手续费，没有可不传或者传0                         |
| orderType  | Integer | 是    | 1             | 订单类型：1 认购订单  2 otc市场订单                |
| rwaOrderId | String  | 是    | 123456        | rwa外部系统订单id                           |
| remark     | String  | 否    | remark        | 订单备注，非必填                              |
| token      | String  | 否    | sncjdankcnkda | 用户登录token，除开【认购订单】&【SELL】之外，其余订单均需要校验 |

## rwa 成交

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/rwa/trade`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-type | String | application/json |

#### Request Body

| Name                                      | Type   | Description |
| ----------------------------------------- | ------ | ----------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一app\_id |
| time<mark style="color:red;">\*</mark>    | String | 请求时间        |
| sign<mark style="color:red;">\*</mark>    | String | 签名          |
| data<mark style="color:red;">\*</mark>    | String | 加密字符串       |

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

```json
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体
{
    "tradeId":"12345"//交易所成交单id
}
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

| 名称          | 类型          | 是否必填 | 例子      | 描述                            |
| ----------- | ----------- | ---- | ------- | ----------------------------- |
| rwaBuyId    | String      | 是    | 12345   | rwa外部系统买单id                   |
| rwaSellId   | String      | 是    | 54321   | rwa外部系统卖单id                   |
| trendSide   | String      | 是    | BUY     | 主动单方向，固定值：BUY、SELL            |
| bidUserId   | Integer     | 是    | 223344  | 买方用户id                        |
| askUserId   | Integer     | 是    | 445566  | 卖方用户id                        |
| buyCoin     | String      | 是    | USD1711 | 买单需要支付的币种                     |
| sellCoin    | String      | 是    | RWA1711 | 卖单需要支付的币种                     |
| buyAmount   | BigDeceimal | 是    | 100     | 买单需要成交的金额                     |
| sellAmount  | BigDeceimal | 是    | 500     | 卖单需要成交的金额                     |
| buyFeeCoin  | String      | 是    | USD1711 | 买单支付手续费的币种                    |
| sellFeeCoin | String      | 是    | USD1711 | 卖单支付手续费的币种                    |
| buyFee      | BigDeceimal | 否    | 5       | 买单手续费，没有就不传或者传0               |
| sellFee     | BigDeceimal | 否    | 10      | 卖单手续费，没有就不传或者传0               |
| tradeType   | Integer     | 是    | 1       | 成交类型：1 认购订单成交 2 otc市场订单成交     |
| remark      | String      | 否    | remark  | 成交备注，非必填                      |
| feeUserId   | Integer     | 是    | 12345   | 手续费接收uid，买卖双方交的手续费，会交到此用户的账户中 |

## 币种持仓列表

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/rwa/symbol/balance`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-type | String | application/json |

#### Request Body

| Name                                      | Type   | Description |
| ----------------------------------------- | ------ | ----------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一app\_id |
| time<mark style="color:red;">\*</mark>    | String | 请求时间        |
| sign<mark style="color:red;">\*</mark>    | String | 签名          |
| data<mark style="color:red;">\*</mark>    | String | 加密字符串       |

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

```json
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体
{
    "count": 15,  //总记录数
    "pageSize": 10,  //分页参数：每页大小
    "page": 1,  //分页参数：页码
    "list": [  //结果集
        {
            "uid": 24003810,  //uid
            "balance": 9999999.0000000000000000  //总余额（可用+冻结）
            "lockBalance": 0   //冻结余额
            "normalBalance": 9999999.0000000000000000   //可用余额
        }
    ]
}
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

| 名称       | 类型     | 是否必填 | 例子       | 描述            |
| -------- | ------ | ---- | -------- | ------------- |
| symbol   | String | 是    | USDT1563 | 币种名称          |
| page     | number | 是    | 1        | 分页参数：页码，最小值 1 |
| pageSize | number | 是    | 20       | 分页参数：每页大小     |

## 用户充值地址

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/rwa/user/depositAddress`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-type | String | application/json |

#### Request Body

| Name                                      | Type   | Description |
| ----------------------------------------- | ------ | ----------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一app\_id |
| time<mark style="color:red;">\*</mark>    | String | 请求时间        |
| sign<mark style="color:red;">\*</mark>    | String | 签名          |
| data<mark style="color:red;">\*</mark>    | String | 加密字符串       |

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

```json
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体
{
    "address": "ascsabjcbaksdbckasabcab",  //充值地址
    "memo": "5237687"  //memo
}
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

| 名称     | 类型     | 是否必填 | 例子       | 描述     |
| ------ | ------ | ---- | -------- | ------ |
| symbol | String | 是    | USDT1563 | 币种名称   |
| uid    | number | 是    | 3728238  | 交易所uid |

## 用户谷歌验证

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/rwa/user/googleVerify`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-type | String | application/json |

#### Request Body

| Name                                      | Type   | Description |
| ----------------------------------------- | ------ | ----------- |
| app\_id<mark style="color:red;">\*</mark> | String | 商家唯一app\_id |
| time<mark style="color:red;">\*</mark>    | String | 请求时间        |
| sign<mark style="color:red;">\*</mark>    | String | 签名          |
| data<mark style="color:red;">\*</mark>    | String | 加密字符串       |

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

```json
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

| 名称         | 类型     | 是否必填 | 例子      | 描述     |
| ---------- | ------ | ---- | ------- | ------ |
| googleCode | String | 是    | 123456  | 谷歌验证码  |
| uid        | number | 是    | 3728238 | 交易所uid |

## 通证资产投资交易开关

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/rwa/symbol/investTransaction`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-type | String | application/json |

#### Request Body

<table><thead><tr><th width="166">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>app_id<mark style="color:red;">*</mark></td><td>String</td><td>商家唯一app_id</td></tr><tr><td>time<mark style="color:red;">*</mark></td><td>String</td><td>请求时间</td></tr><tr><td>sign<mark style="color:red;">*</mark></td><td>String</td><td>签名</td></tr><tr><td>data<mark style="color:red;">*</mark></td><td>String</td><td>加密字符串</td></tr></tbody></table>

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

```json
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

<table><thead><tr><th>名称</th><th width="125">类型</th><th>是否必填</th><th>例子</th><th>描述</th></tr></thead><tbody><tr><td>symbol</td><td>String</td><td>是</td><td>RWA1711</td><td>通证资产币种名称</td></tr><tr><td>investOpen</td><td>number</td><td>是</td><td>1</td><td>投资开关： 0 关闭    1 开启</td></tr><tr><td>transactionOpen</td><td>number</td><td>是</td><td>1</td><td>交易开关： 0 关闭    1 开启</td></tr></tbody></table>

## rwa otc市场订单批量成交

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/rwa/otc/batchTrade`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-type | String | application/json |

#### Request Body

<table><thead><tr><th width="354">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>app_id<mark style="color:red;">*</mark></td><td>String</td><td>商家唯一app_id</td></tr><tr><td>time<mark style="color:red;">*</mark></td><td>String</td><td>请求时间</td></tr><tr><td>sign<mark style="color:red;">*</mark></td><td>String</td><td>签名</td></tr><tr><td>data<mark style="color:red;">*</mark></td><td>String</td><td>加密字符串</td></tr></tbody></table>

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

```json
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体
{
   "tradeList":[
                  {
                    "rwaOrderId":"123",       //rwa外部系统主动单id
                    "passivityOrderId":"2",   //rwa外部系统被动单id
                    "tradeId":"222"           //交易所成交单id
                  }
               ]
}
```

{% endtab %}
{% endtabs %}

以下为参与rsa加密的参数:

```
{
    "trendSide":"BUY",              //主动单方向，固定值：BUY、SELL
    "rwaOrderId":"123",             //rwa外部系统主动单id
    "uid":123,                      //主动单用户id
    "coin":"USD1711",               //主动单需要支付的币种
    "feeCoin":"USD1711",            //主动单需要支付手续费的币种
    "remark":"成交备注",             //成交备注，非必填
    "feeUserId":11,                 //手续费接收uid，买卖双方交的手续费，会交到此用户的账户中
    "passivityCoin":"RAW1711",      //被动单需要支付的币种
    "passivityFeeCoin":"USD1711",   //被动单需要支付手续费的币种
    "passivityOrderList":[          //被动单信息列表
        {
            "amount":100,            //主动单需要支付的金额
            "fee":5,                 //主动单需要支付的手续费，没有就不传或者传0
            "passivityOrderId":"2",  //rwa外部系统被动单id
            "passivityUid":456,      //被动单用户id
            "passivityAmount":500,   //被动单需要支付的金额
            "passivityFee":10        //被动单需要支付的手续费，没有就不传或者传0
        }
    ]
}
```

## rwa 订单查询

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/rwa/select/order`

需要将参数表格中的数据包装成json字符串 利用rsa 进行参数加密和签名 作为body中的data和sign

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-type | String | application/json |

#### Request Body

<table><thead><tr><th width="166">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>app_id<mark style="color:red;">*</mark></td><td>String</td><td>商家唯一app_id</td></tr><tr><td>time<mark style="color:red;">*</mark></td><td>String</td><td>请求时间</td></tr><tr><td>sign<mark style="color:red;">*</mark></td><td>String</td><td>签名</td></tr><tr><td>data<mark style="color:red;">*</mark></td><td>String</td><td>加密字符串</td></tr></tbody></table>

```json
{
    "code": "", //返回code	
    "msg": "", //成功或失败提示信息	
    "data": "",
    "sign": ""
}

data 中解密后的结构体
{
    "orderId":"12345"//交易所冻结解冻订单id
}
```

以下为参与rsa加密的参数:

<table><thead><tr><th>名称</th><th width="125">类型</th><th>是否必填</th><th>例子</th><th>描述</th></tr></thead><tbody><tr><td>rwaOrderId</td><td>String</td><td>是</td><td>112233</td><td>rwa外部系统订单id</td></tr><tr><td>orderType</td><td>number</td><td>是</td><td>1</td><td>订单类型：1 认购订单  2 otc市场订单</td></tr></tbody></table>


# 调用示例

## 整体接入步骤

第一步:先找运维解析域名

第二步:创建应用提交公钥并获取 app\_id/rsa\_saas\_pub, 配置回调地址;

第三步:用户授权注册, 获取三方商户code;

第四步:通过code获取开放平台访问token;

第五步:访问开放的资源:

## 准备工作 - 获取 appKey 和设置redirectUrl( 回调地址 )

开放平台是基于OAuth2.0协议标准构建的OAuth2.0授权登录系统。 在进行开放平台授权登录接入之前，需要通过管理后台准备以下接入材料:

1. appKey: 用于和开通开放平台的商户UID进行一对一绑定, 获取开放平台登陆权限的必要条件;
2. redirectUrl: 用于完成开放平台开通授权帐号成功后的跳转地址; 该地址根据实际业务需求填写, 如不清楚业务需求, 可默认填写交易所主页;

#### 登陆管理后台: 公共管理-- > 开放平台管理-- > 应用管理

![](https://1243490506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYi2EFgp9ZcuBqz2x3G6F%2Fuploads%2FvMmLXldD34SozyW6vq2z%2Fimage.png?alt=media\&token=c4d9f291-32a7-493f-84cc-caed440c81b7)

根据红框中内容, 提交公钥

<figure><img src="https://1243490506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYi2EFgp9ZcuBqz2x3G6F%2Fuploads%2F4CTRVCCVk22l6Uuz7qMd%2Fimage.png?alt=media&amp;token=c30753e7-7810-4b16-bd04-56a3a7b5130f" alt=""><figcaption></figcaption></figure>

#### 用户注册授权 - OAuth授权登录页

带上正确的appkey和redirectUrl点击注册

浏览器访问地址: [http://service.xxx.com/platform/login.html?appKey=xxx\&redirectUrl=https:xxxx](http://platform.apple.com/?appKey=apple_6746\&redirectUrl=https://www.chainup.com)

![](https://1243490506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYi2EFgp9ZcuBqz2x3G6F%2Fuploads%2FA3JlgmJm9Hem7SrqSz6n%2Fimage.png?alt=media\&token=caa58015-ef36-4251-bbcf-a0a8bce083dc)

如果没有注册, 先进行注册; 如果已经是注册用户, 则直接点击上一张图片中的"确认授权" 按钮即可;

![](https://1243490506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYi2EFgp9ZcuBqz2x3G6F%2Fuploads%2FqYiX0zNPaaFFuwHilKDG%2Fimage.png?alt=media\&token=421ed495-ee4b-49c5-89df-be2464b18070)

系统会发送验证码进行授权;

![](https://1243490506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYi2EFgp9ZcuBqz2x3G6F%2Fuploads%2FksCwK3kRnmgBIilRPWyz%2Fimage.png?alt=media\&token=4131e401-b1c3-4b4a-b036-4477befc26b9)

#### 注册( 或登陆 )成功获取code

且在第一步中填写的注册回调地址为交易所首页; 则可以看到下述图片, 箭头处则为当前获取的Code

![](https://1243490506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYi2EFgp9ZcuBqz2x3G6F%2Fuploads%2FG2yfGgaVXbAiwxddN7W9%2Fimage.png?alt=media\&token=6dbfc8d6-6c4f-4d5b-89c0-1afbe4ded5fa)

## 获取token - 使用code换取token、openId

#### 调用接口换取token或openId

接口地址: <http://servoce.xfnh.com/platformapi/chainup/open/auth/token>

接口调用成功后, 返回信息会携带token和openId

## 通过Token访问开放平台资源 - 创建订单/支付/查询订单

#### 创建支付订单

接口地址: <http://service.xfnh.fnhcom/platformapi/chainup/open/opay/createThirdOrder>

<mark style="color:red;">**注意!!!**</mark> <mark style="color:red;">**openId 和userId 只能存在一个,如果都同时存在 优先选择openId**</mark>

支付页面

接口地址: <http://service.xfnh.com/pay.html>

#### 获取请求参数:

登陆管理后台: 公共管理-- > 开放平台管理-- > 应用管理

根据图片所示获取请求参数中的userId

![](https://1243490506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYi2EFgp9ZcuBqz2x3G6F%2Fuploads%2FyXLf7wmNN3pVchrZnuT0%2Fimage.png?alt=media\&token=86159676-477d-43ba-ac26-25d6ad959efa)

使用POSTMAN工具获取接口调用地址

拼装完参数后的接口调用地址: [https://service.xxx.com/pay.html?appKey=xxx\&openId=xxx\&token=xxx\&orderNum=xxx](https://platform.xxx.com/pay.html?appKey=xxx\&openId=xxx\&token=xxx\&orderNum=xxx)

如果熟悉GET请求的工程师可以直接按照参数拼装地址访问

![](https://1243490506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYi2EFgp9ZcuBqz2x3G6F%2Fuploads%2Fhoa4oN2cC0cQyZBi6Sbn%2Fimage.png?alt=media\&token=58c3415d-fb6b-4e70-b6b8-7d7e5a853b63)

#### 调用请求支付页面:

![](https://1243490506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYi2EFgp9ZcuBqz2x3G6F%2Fuploads%2F3PmUe0kJA27vFZxsN7xa%2Fimage.png?alt=media\&token=46daf9c8-eef4-4ed4-86b2-fe25736d3656)

#### 余额不足在管理平台充值增币 ( 如果余额充足可忽略该步 )

资产管理-- > 财务管理 -- > 赠币工具

![](https://1243490506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYi2EFgp9ZcuBqz2x3G6F%2Fuploads%2FQRFzCpifEfjfikZwd33T%2Fimage.png?alt=media\&token=90fa9f02-f266-46d5-89e9-a29a82454309)

#### 支付成功后跳转的页面( 该页面为第一步配置的 redirectUrl )

![](https://1243490506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYi2EFgp9ZcuBqz2x3G6F%2Fuploads%2Ft7cB4j3b9XsqlUCvc27w%2Fimage.png?alt=media\&token=a59727be-e2fc-4002-bcfa-2995ea9e43e9)

#### 查询支付订单

接口地址：<http://service.xfnh.com/platformapi/chainup/open/opay/orderDetail>

使用POSTMAN工具获取接口调用地址;

![返回结果即为查询成功后订单信息](https://1243490506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYi2EFgp9ZcuBqz2x3G6F%2Fuploads%2FZJK6xbDKM8IBatu0GCRq%2Fimage.png?alt=media\&token=036b996f-a3cd-442f-a2e3-fb150d9b1f52)


# 国家编码

<table><thead><tr><th width="252">cnName</th><th width="315">enName</th><th width="153">code</th></tr></thead><tbody><tr><td>阿富汗</td><td>AFGHANISTAN</td><td>97</td></tr><tr><td>阿尔巴尼亚</td><td>ALBANIA</td><td>+355+8</td></tr><tr><td>阿尔及利亚</td><td>ALGERIA</td><td>+213+12</td></tr><tr><td>美属萨摩亚</td><td>AMERICAN SAMOA</td><td>+684+16</td></tr><tr><td>安道尔</td><td>ANDORRA</td><td>396</td></tr><tr><td>安哥拉</td><td>ANGOLA</td><td>244+24</td></tr><tr><td>安圭拉岛</td><td>ANGUILLA</td><td>+1264+660</td></tr><tr><td>安提瓜和巴布达</td><td>ANTIGUA AND BARBUDA</td><td>+1268+28</td></tr><tr><td>阿根廷</td><td>ARGENTINA</td><td>+54+32</td></tr><tr><td>亚美尼亚</td><td>ARMENIA</td><td>+374+51</td></tr><tr><td>澳大利亚</td><td>AUSTRALIA</td><td>+61+36</td></tr><tr><td>奥地利</td><td>AUSTRIA</td><td>+43+40</td></tr><tr><td>阿塞拜疆</td><td>AZERBAIJAN</td><td>+994+31</td></tr><tr><td>巴哈马</td><td>BAHAMAS</td><td>+1242+44</td></tr><tr><td>巴林</td><td>BAHRAIN</td><td>+973+48</td></tr><tr><td>孟加拉国</td><td>BANGLADESH</td><td>+880+50</td></tr><tr><td>巴巴多斯</td><td>BARBADOS</td><td>+1246+52</td></tr><tr><td>白俄罗斯</td><td>BELARUS</td><td>+375+112</td></tr><tr><td>比利时</td><td>BELGIUM</td><td>+32+56</td></tr><tr><td>伯利兹</td><td>BELIZE</td><td>+501+84</td></tr><tr><td>贝宁</td><td>BENIN</td><td>+229+204</td></tr><tr><td>百慕大群岛</td><td>BERMUDA</td><td>+1441+60</td></tr><tr><td>玻利维亚</td><td>BOLIVIA, PLURINATION</td><td>+591+68</td></tr><tr><td>博茨瓦纳</td><td>BOTSWANA</td><td>+267+72</td></tr><tr><td>巴西</td><td>BRAZIL</td><td>+55+76</td></tr><tr><td>文莱</td><td>BRUNEI DARUSSALAM</td><td>+673+96</td></tr><tr><td>保加利亚</td><td>BULGARIA</td><td>+359+100</td></tr><tr><td>布基纳法索</td><td>BURKINA FASO</td><td>+226+854</td></tr><tr><td>布隆迪</td><td>BURUNDI</td><td>+257+108</td></tr><tr><td>柬埔寨</td><td>CAMBODIA</td><td>+855+116</td></tr><tr><td>喀麦隆</td><td>CAMEROON</td><td>+237+120</td></tr><tr><td>加拿大</td><td>CANADA</td><td>+1+124</td></tr><tr><td>开曼群岛</td><td>CAYMAN ISLANDS</td><td>+1345+136</td></tr><tr><td>中非共和国</td><td>CENTRAL AFRICAN REPU</td><td>+236+140</td></tr><tr><td>乍得</td><td>CHAD</td><td>+235+148</td></tr><tr><td>智利</td><td>CHILE</td><td>+56+152</td></tr><tr><td>中国</td><td>CHINA</td><td>+86+156</td></tr><tr><td>哥伦比亚</td><td>COLOMBIA</td><td>+57+170</td></tr><tr><td>刚果</td><td>CONGO</td><td>+242+178</td></tr><tr><td>库克群岛</td><td>COOK ISLANDS</td><td>+682+184</td></tr><tr><td>哥斯达黎加</td><td>COSTA RICA</td><td>+506+188</td></tr><tr><td>科特迪瓦</td><td>CÔTE D'IVOIRE</td><td>+225+384</td></tr><tr><td>克罗地亚</td><td>CROATIA</td><td>+385+191</td></tr><tr><td>古巴</td><td>CUBA</td><td>+53+192</td></tr><tr><td>塞浦路斯</td><td>CYPRUS</td><td>+357+196</td></tr><tr><td>捷克共和国</td><td>CZECH REPUBLIC</td><td>+420+203</td></tr><tr><td>丹麦</td><td>DENMARK</td><td>+45+208</td></tr><tr><td>吉布提</td><td>DJIBOUTI</td><td>+253+262</td></tr><tr><td>多米尼加共和国</td><td>DOMINICAN REPUBLIC</td><td>+1890+214</td></tr><tr><td>厄瓜多尔</td><td>ECUADOR</td><td>+593+218</td></tr><tr><td>埃及</td><td>EGYPT</td><td>+20+818</td></tr><tr><td>萨尔瓦多</td><td>EL SALVADOR</td><td>+503+222</td></tr><tr><td>爱沙尼亚</td><td>ESTONIA</td><td>+372+233</td></tr><tr><td>埃塞俄比亚</td><td>ETHIOPIA</td><td>+251+231</td></tr><tr><td>斐济群岛</td><td>FIJI</td><td>+679+242</td></tr><tr><td>芬兰</td><td>FINLAND</td><td>+358+246</td></tr><tr><td>法国</td><td>FRANCE</td><td>+33+250</td></tr><tr><td>法属圭亚那</td><td>FRENCH GUIANA</td><td>+594+254</td></tr><tr><td>法属波利尼西亚</td><td>FRENCH POLYNESIA</td><td>+689+258</td></tr><tr><td>加蓬</td><td>GABON</td><td>+241+266</td></tr><tr><td>冈比亚</td><td>GAMBIA</td><td>+220+270</td></tr><tr><td>乔治亚</td><td>GEORGIA</td><td>+995+268</td></tr><tr><td>德国</td><td>GERMANY</td><td>+49+276</td></tr><tr><td>加纳</td><td>GHANA</td><td>+233+288</td></tr><tr><td>直布罗陀</td><td>GIBRALTAR</td><td>+350+292</td></tr><tr><td>希腊</td><td>GREECE</td><td>+30+300</td></tr><tr><td>格林纳达</td><td>GRENADA</td><td>+1809+308</td></tr><tr><td>关岛</td><td>GUAM</td><td>+1671+316</td></tr><tr><td>危地马拉</td><td>GUATEMALA</td><td>+502+320</td></tr><tr><td>几内亚</td><td>GUINEA</td><td>+224+324</td></tr><tr><td>圭亚那</td><td>GUYANA</td><td>+592+328</td></tr><tr><td>海地</td><td>HAITI</td><td>+509+332</td></tr><tr><td>洪都拉斯</td><td>HONDURAS</td><td>+504+340</td></tr><tr><td>中国香港</td><td>HONG KONG</td><td>+852+344</td></tr><tr><td>匈牙利</td><td>HUNGARY</td><td>+36+348</td></tr><tr><td>冰岛</td><td>ICELAND</td><td>+354+352</td></tr><tr><td>印度</td><td>INDIA</td><td>+91+356</td></tr><tr><td>印度尼西亚</td><td>INDONESIA</td><td>+62+360</td></tr><tr><td>伊朗</td><td>IRAN, ISLAMIC REPUBL</td><td>+98+364</td></tr><tr><td>伊拉克</td><td>IRAQ</td><td>+964+368</td></tr><tr><td>爱尔兰</td><td>IRELAND</td><td>+353+372</td></tr><tr><td>以色列</td><td>ISRAEL</td><td>+972+376</td></tr><tr><td>意大利</td><td>ITALY</td><td>+39+380</td></tr><tr><td>牙买加</td><td>JAMAICA</td><td>+1876+388</td></tr><tr><td>日本</td><td>JAPAN</td><td>+81+392</td></tr><tr><td>约旦</td><td>JORDAN</td><td>+962+400</td></tr><tr><td>哈萨克斯坦</td><td>KAZAKHSTAN</td><td>+327+398</td></tr><tr><td>肯尼亚</td><td>KENYA</td><td>+254+404</td></tr><tr><td>朝鲜</td><td>KOREA, DEMOCRATIC PE</td><td>+850+408</td></tr><tr><td>韩国</td><td>KOREA, REPUBLIC OF</td><td>+82+410</td></tr><tr><td>科威特</td><td>KUWAIT</td><td>+965+414</td></tr><tr><td>吉尔吉斯斯坦</td><td>KYRGYZSTAN</td><td>+331+417</td></tr><tr><td>老挝</td><td>LAO PEOPLE'S DEMOCRA</td><td>+856+418</td></tr><tr><td>拉脱维亚</td><td>LATVIA</td><td>+371+428</td></tr><tr><td>黎巴嫩</td><td>LEBANON</td><td>+961+422</td></tr><tr><td>莱索托</td><td>LESOTHO</td><td>+266+426</td></tr><tr><td>利比里亚</td><td>LIBERIA</td><td>+231+430</td></tr><tr><td>利比亚</td><td>LIBYAN ARAB JAMAHIRI</td><td>+218+434</td></tr><tr><td>列支敦士登</td><td>LIECHTENSTEIN</td><td>+423+438</td></tr><tr><td>立陶宛</td><td>LITHUANIA</td><td>+370+440</td></tr><tr><td>卢森堡</td><td>LUXEMBOURG</td><td>+352+442</td></tr><tr><td>中国澳门</td><td>MACAO</td><td>+853+446</td></tr><tr><td>马达加斯加</td><td>MADAGASCAR</td><td>+261+450</td></tr><tr><td>马拉维</td><td>MALAWI</td><td>+265+454</td></tr><tr><td>马来西亚</td><td>MALAYSIA</td><td>+60+458</td></tr><tr><td>马尔代夫</td><td>MALDIVES</td><td>+960+462</td></tr><tr><td>马里</td><td>MALI</td><td>+223+466</td></tr><tr><td>马耳他</td><td>MALTA</td><td>+356+470</td></tr><tr><td>马提尼克岛</td><td>MARTINIQUE</td><td>+596+474</td></tr><tr><td>毛里求斯</td><td>MAURITIUS</td><td>+230+480</td></tr><tr><td>墨西哥</td><td>MEXICO</td><td>+52+484</td></tr><tr><td>摩尔多瓦</td><td>MOLDOVA, REPUBLIC OF</td><td>+373+498</td></tr><tr><td>摩纳哥</td><td>MONACO</td><td>+377+492</td></tr><tr><td>蒙古</td><td>MONGOLIA</td><td>+976+496</td></tr><tr><td>蒙特塞拉特</td><td>MONTSERRAT</td><td>+1664+500</td></tr><tr><td>摩洛哥</td><td>MOROCCO</td><td>+212+504</td></tr><tr><td>莫桑比克</td><td>MOZAMBIQUE</td><td>+258+508</td></tr><tr><td>缅甸</td><td>MYANMAR</td><td>+95+104</td></tr><tr><td>纳米比亚</td><td>NAMIBIA</td><td>+264+516</td></tr><tr><td>瑙鲁</td><td>NAURU</td><td>+674+520</td></tr><tr><td>尼泊尔</td><td>NEPAL</td><td>+977+524</td></tr><tr><td>荷兰</td><td>NETHERLANDS</td><td>+31+528</td></tr><tr><td>荷属安的列斯群岛</td><td>NETHERLANDS ANTILLES</td><td>+599+530</td></tr><tr><td>新西兰</td><td>NEW ZEALAND</td><td>+64+554</td></tr><tr><td>尼加拉瓜</td><td>NICARAGUA</td><td>+505+558</td></tr><tr><td>尼日尔</td><td>NIGER</td><td>+227+562</td></tr><tr><td>尼日利亚</td><td>NIGERIA</td><td>+234+566</td></tr><tr><td>挪威</td><td>NORWAY</td><td>+47+578</td></tr><tr><td>阿曼</td><td>OMAN</td><td>+968+512</td></tr><tr><td>巴基斯坦</td><td>PAKISTAN</td><td>+92+586</td></tr><tr><td>巴拿马</td><td>PANAMA</td><td>+507+591</td></tr><tr><td>巴布亚新几内亚</td><td>PAPUA NEW GUINEA</td><td>+675+598</td></tr><tr><td>巴拉圭</td><td>PARAGUAY</td><td>+595+600</td></tr><tr><td>秘鲁</td><td>PERU</td><td>+51+604</td></tr><tr><td>菲律宾</td><td>PHILIPPINES</td><td>+63+608</td></tr><tr><td>波兰</td><td>POLAND</td><td>+48+616</td></tr><tr><td>葡萄牙</td><td>PORTUGAL</td><td>+351+620</td></tr><tr><td>波多黎各</td><td>PUERTO RICO</td><td>+1787+630</td></tr><tr><td>卡塔尔</td><td>QATAR</td><td>+974+634</td></tr><tr><td>留尼汪岛</td><td>REUNION</td><td>+262+638</td></tr><tr><td>罗马尼亚</td><td>ROMANIA</td><td>+40+642</td></tr><tr><td>俄罗斯</td><td>RUSSIAN FEDERATION</td><td>+7+643</td></tr><tr><td>圣卢西亚</td><td>SAINT LUCIA</td><td>+1758+662</td></tr><tr><td>圣文森特和格林纳丁斯</td><td>SAINT VINCENT AND TH</td><td>+1784+670</td></tr><tr><td>萨摩亚</td><td>SAMOA</td><td>+685+882</td></tr><tr><td>圣马力诺</td><td>SAN MARINO</td><td>+378+674</td></tr><tr><td>圣多美和普林西比</td><td>SAO TOME AND PRINCIP</td><td>+239+678</td></tr><tr><td>沙特阿拉伯</td><td>SAUDI ARABIA</td><td>+966+682</td></tr><tr><td>塞内加尔</td><td>SENEGAL</td><td>+221+686</td></tr><tr><td>塞舌尔</td><td>SEYCHELLES</td><td>+248+690</td></tr><tr><td>塞拉利昂</td><td>SIERRA LEONE</td><td>+232+694</td></tr><tr><td>新加坡</td><td>SINGAPORE</td><td>+65+702</td></tr><tr><td>斯洛伐克</td><td>SLOVAKIA</td><td>+421+703</td></tr><tr><td>斯洛文尼亚</td><td>SLOVENIA</td><td>+386+705</td></tr><tr><td>所罗门群岛</td><td>SOLOMON ISLANDS</td><td>+677+90</td></tr><tr><td>索马里</td><td>SOMALIA</td><td>+252+706</td></tr><tr><td>南非</td><td>SOUTH AFRICA</td><td>+27+710</td></tr><tr><td>西班牙</td><td>SPAIN</td><td>+34+724</td></tr><tr><td>斯里兰卡</td><td>SRI LANKA</td><td>+94+144</td></tr><tr><td>苏丹</td><td>SUDAN</td><td>+249+736</td></tr><tr><td>苏里南</td><td>SURINAME</td><td>+597+740</td></tr><tr><td>斯威士兰</td><td>SWAZILAND</td><td>+268+748</td></tr><tr><td>瑞典</td><td>SWEDEN</td><td>+46+752</td></tr><tr><td>瑞士</td><td>SWITZERLAND</td><td>+41+756</td></tr><tr><td>叙利亚</td><td>SYRIAN ARAB REPUBLIC</td><td>+963+760</td></tr><tr><td>中国台湾</td><td>TAIWAN, PROVINCE OF </td><td>+886+158</td></tr><tr><td>塔吉克斯坦</td><td>TAJIKISTAN</td><td>+992+762</td></tr><tr><td>坦桑尼亚</td><td>TANZANIA, UNITED REP</td><td>+255+834</td></tr><tr><td>泰国</td><td>THAILAND</td><td>+66+764</td></tr><tr><td>多哥</td><td>TOGO</td><td>+228+768</td></tr><tr><td>汤加</td><td>TONGA</td><td>+676+776</td></tr><tr><td>特立尼达和多巴哥</td><td>TRINIDAD AND TOBAGO</td><td>+1809+780</td></tr><tr><td>突尼斯</td><td>TUNISIA</td><td>+216+788</td></tr><tr><td>土耳其</td><td>TURKEY</td><td>+90+792</td></tr><tr><td>土库曼斯坦</td><td>TURKMENISTAN</td><td>+993+795</td></tr><tr><td>乌干达</td><td>UGANDA</td><td>+256+800</td></tr><tr><td>乌克兰</td><td>UKRAINE</td><td>+380+804</td></tr><tr><td>阿拉伯联合酋长国</td><td>UNITED ARAB EMIRATES</td><td>+971+784</td></tr><tr><td>英国</td><td>UNITED KINGDOM</td><td>+44+826</td></tr><tr><td>美国</td><td>UNITED STATES</td><td>+1+840</td></tr><tr><td>乌拉圭</td><td>URUGUAY</td><td>+598+858</td></tr><tr><td>乌兹别克斯坦</td><td>UZBEKISTAN</td><td>+233+860</td></tr><tr><td>委内瑞拉</td><td>VENEZUELA, BOLIVARIA</td><td>+58+862</td></tr><tr><td>越南</td><td>VIET NAM</td><td>+84+704</td></tr><tr><td>也门</td><td>YEMEN</td><td>+967+887</td></tr><tr><td>赞比亚</td><td>ZAMBIA</td><td>+260+894</td></tr><tr><td>津巴布韦</td><td>ZIMBABWE</td><td>+263+716</td></tr></tbody></table>


# 理财

## 理财&矿池-参与记录-质押币种查询

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/staking/findBaseCoinByGroup`

查询参与记录

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                     | Type    | Description                                                         |
| ---------------------------------------- | ------- | ------------------------------------------------------------------- |
| appKey<mark style="color:red;">\*</mark> | String  | 商家唯一编号appKey                                                        |
| sign<mark style="color:red;">\*</mark>   | String  |                                                                     |
| userId                                   | integer | 用户ID                                                                |
| baseCoin                                 | String  | 质押币种(/platformapi/chainup/open/staking/findBaseCoinByGroup接口获取币种列表) |
| minAmount                                | String  | 最小质押金额                                                              |
| maxAmount                                | String  | 最大质押金额                                                              |
| projectId                                | String  | 项目ID                                                                |
| startTime                                | number  | 参与起始时间(时间戳)                                                         |
| endTime                                  | number  | 参与结束时间(时间戳)                                                         |
| page                                     | integer | 当前页码                                                                |
| pageSize                                 | integer | 分页大小                                                                |
| status                                   | String  | 状态(参考枚举)                                                            |
| itemDate                                 | Long    | 锁仓时间                                                                |

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

```javascript
{
	"code": "",
	"msg": "",
	"data": [
		"BTC",
		"USDT"
	]
}
```

{% endtab %}
{% endtabs %}

#### 返回值说明

<table><thead><tr><th>名称</th><th>类型</th><th>是否必需</th><th>例子</th><th>描述</th></tr></thead><tbody><tr><td>data</td><td>List</td><td>YES</td><td><p></p><pre class="language-json"><code class="lang-json">[
    "BTC",
    "EUSDT"
]
</code></pre></td><td>质押币种集合</td></tr></tbody></table>

## 理财&矿池-参与记录-参与记录查询

<mark style="color:green;">`POST`</mark> `https://service.xxx.com/platformapi/chainup/open/staking/getApplyRecord`

查询参与记录

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                     | Type    | Description                                                         |
| ---------------------------------------- | ------- | ------------------------------------------------------------------- |
| appKey<mark style="color:red;">\*</mark> | String  | 商家唯一编号appKey                                                        |
| sign<mark style="color:red;">\*</mark>   | String  |                                                                     |
| userId                                   | integer | 用户ID                                                                |
| baseCoin                                 | String  | 质押币种(/platformapi/chainup/open/staking/findBaseCoinByGroup接口获取币种列表) |
| minAmount                                | String  | 最小质押金额                                                              |
| maxAmount                                | String  | 最大质押金额                                                              |
| projectId                                | String  | 项目ID                                                                |
| startTime                                | number  | 参与起始时间(时间戳)                                                         |
| endTime                                  | number  | 参与结束时间(时间戳)                                                         |
| page                                     | integer | 当前页码                                                                |
| pageSize                                 | integer | 分页大小                                                                |
| status                                   | String  | 状态(参考枚举)                                                            |
| itemDate                                 | Long    | 锁仓时间                                                                |

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

```javascript
{
	"code": "",
	"msg": "",
	"data": {
		"current": 1,
		"size": 10,
		"total": 6,
		"pages": 1,
		"records": [
			{
				"uid": 10002186,
				"amount": "10",
				"isAuth": 1,
				"pawnCoin": "BTC",
				"etime": "1608719975000",
				"ctime": "1616342400000",
				"earlyQuitRate": "0",
				"id": 284,
				"projectName": "余币宝-测试B2",
				"projectId": 144,
				"applyStatus": 2,
				"lockDay": 7
			}
		]
	}
}
```

{% endtab %}
{% endtabs %}

#### 状态说明

```
1 -> 收益中
2 -> 正常解锁
3 -> 提前解锁
5 -> 申请退出
```

#### 返回值说明

<table><thead><tr><th>名称</th><th>类型</th><th>是否必需</th><th>例子</th><th>描述</th></tr></thead><tbody><tr><td><p></p><pre class="language-json"><code class="lang-json">records
</code></pre></td><td>List</td><td>YES</td><td><pre class="language-json"><code class="lang-json"><strong>{
</strong>	"uid": 10002186,
	"amount": "10",
	"isAuth": 1,
	"pawnCoin": "BTC",
	"etime": "1608719975000",
	"ctime": "1616342400000",
	"earlyQuitRate": "0",
	"id": 284,
	"projectName": "余币宝-测试B2",
	"projectId": 144,
	"applyStatus": 2,
	"lockDay": 7
}
</code></pre></td><td>列表数据</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">current
</code></pre></td><td>int</td><td>YES</td><td>1</td><td>当前页</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">size
</code></pre></td><td>int</td><td>YES</td><td>10</td><td>当前分页数量</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">total
</code></pre></td><td>int</td><td>YES</td><td>6</td><td>总数据量</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">pages
</code></pre></td><td>int</td><td>YES</td><td>1</td><td>总页数</td></tr></tbody></table>

<table><thead><tr><th width="236">名称</th><th>类型</th><th>是否必需</th><th>例子</th><th>描述</th></tr></thead><tbody><tr><td><p></p><pre class="language-json"><code class="lang-json">uid
</code></pre></td><td>int</td><td>YES</td><td>10012312</td><td>用户id</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">amount
</code></pre></td><td>String</td><td>YES</td><td>19</td><td>质押金额</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">isAuth
</code></pre></td><td>int</td><td>YES</td><td>1</td><td>是否实名 0/1</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">pawnCoin
</code></pre></td><td>String</td><td>YES</td><td>BTC</td><td>币种</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">etime
</code></pre></td><td>int</td><td>YES</td><td>1616342400000</td><td>解锁时间</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">ctime
</code></pre></td><td>int</td><td>YES</td><td>1616342400000</td><td>参与时间</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">earlyQuitRate
</code></pre></td><td>int</td><td>YES</td><td>0</td><td>违约金比例</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">id
</code></pre></td><td>int</td><td>YES</td><td>286</td><td>记录id</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">projectName
</code></pre></td><td>String</td><td>YES</td><td>xxx</td><td>项目名称</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">projectId
</code></pre></td><td>int</td><td>YES</td><td>144</td><td>项目id</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">applyStatus
</code></pre></td><td>int</td><td>YES</td><td>2</td><td>状态(参考枚举)</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">lockDay
</code></pre></td><td>int</td><td>YES</td><td>7</td><td>质押周期</td></tr></tbody></table>


