# 用户交易查询接口

## 场外交易记录查询接口 <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>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://platformv2docs.chainup.com/yong-hu-jiao-yi-cha-xun-jie-kou.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
