# CoinSend

## Dispatch/Transfer <a href="#dispatch-withdrawal" id="dispatch-withdrawal"></a>

To initiate a transfer via API.

{% hint style="info" %}

### Before you proceed

Server sub-account is required to setup API integration and be given access rights to "Data submission permission" (as shown images below).\
You may also refer to the guide below on how to create a sub-account:\
[https://app.gitbook.com/o/IH18q5jVHaB5yVgZO7Xv/s/bq6zziU9PCtrTYtaegKj/\~/changes/124/coinsend/setup/setup-sub-account-and-coinsign](https://coinsdo.gitbook.io/docs/coinsend/setup/setup-sub-account-and-coinsign)<br>

![](https://3529283920-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbq6zziU9PCtrTYtaegKj%2Fuploads%2FLbgYx6U4bKQO8dOKYCH1%2Fimage.png?alt=media\&token=977d6876-c8d2-4b3f-ae3e-e8d431e50b26)\ <img src="https://3529283920-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbq6zziU9PCtrTYtaegKj%2Fuploads%2FbpSGYSSZsM3gcIsofDXR%2FScreenshot%202026-03-31%20at%208.57.25%E2%80%AFAM.png?alt=media&#x26;token=7daa8e07-20a5-429b-8cd5-91a739d9d268" alt="" data-size="original">\ <br>
{% endhint %}

### Sub Account Roles

* Submitter – Responsible for creating dispatch records.
* Reviewer – Reviews and approves dispatch records submitted by the Submitter.
* Executor – Determines which CoinSend client and address the the funds will be sent from.

### Making a Transfer

Below is the graphical illustration of how transfer works in CoinsDo.

<figure><img src="https://3529283920-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbq6zziU9PCtrTYtaegKj%2Fuploads%2FgjjoeLwchtjAWTQMjOPV%2Fimage.png?alt=media&#x26;token=31bde3a7-c07a-4a06-b5a1-ebcba073fcae" alt=""><figcaption></figcaption></figure>

1. End user submits a withdrawal request on the corporate platform.
2. Corporate platform initiates a transfer request via the API.
3. CoinsDo server forwards the request to the Reviewer.
4. The Reviewer approves (signs) and forwards Signature A to the Executor.
5. The Executor approves, selects the CoinSend client and wallet address to use, and forwards both Signatures A and B back to the CoinsDo server.
6. The data and both signatures are forwarded to the selected CoinSend client.
7. The CoinSend client verifies the data and signatures, then executes the transaction.
8. CoinSend client sync transaction status with CoinsDo server.
9. CoinsDo server notify platform via API callback.

### Automatic transfer

Corporate can skip 1 of all of the approval process by including either reviewSign (skip 1st-level approval) , or both reviewSign and approveSign (skip both level approval) in the API request parameter to achieve semi or fully automated transfer, as such.

**Semi-automated**

<figure><img src="https://3529283920-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbq6zziU9PCtrTYtaegKj%2Fuploads%2Fba4UiMotzxgG4rXDXPKL%2Fimage.png?alt=media&#x26;token=a47b4eed-c153-4146-ad87-25d5e2d9feea" alt=""><figcaption></figcaption></figure>

**Fully automated**

<figure><img src="https://3529283920-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbq6zziU9PCtrTYtaegKj%2Fuploads%2FLu1EIPBm9WdFZ521dftH%2Fimage.png?alt=media&#x26;token=853f098c-60e8-4e24-95f7-14be25d32e2b" alt=""><figcaption></figcaption></figure>

### **Request**

<mark style="color:green;">`POST`</mark> `/v1/withdraw`

<table data-full-width="false"><thead><tr><th width="100.07421875">Parameter</th><th width="89.91015625">Required</th><th width="67.64453125">Type</th><th>Description</th></tr></thead><tbody><tr><td>data</td><td>Yes</td><td>string</td><td>Content（JSON, refer below）</td></tr></tbody></table>

* Data content

{% code fullWidth="false" %}

```json
{
    "apiKey": "cd384rt80f5575dc",
    "submitAccount": "coinsdoTest",
    "address": "TKU69qcQPoR5jDEE7ertPpdaxoLGCTX4xR",
    "amount": "616.616",
    "coinsDoId": "3",
    "businessId": "TRX_999",
    "businessScene": "1",
    "timestamp": "1622775712229",
    "txMemo": "COINSDO TEST TRX",
    "reviewUuid": "A65F7B1C-8FF8-4E0D-ADF2-AE0BCB0F378B",
    "reviewSign": "DXoICpzZN7/yoHCLbb32czn0Goq9XLTdW9Dcn281qNNgcejzXPToGOJReA/wYMI0e3ikjAVxzXSDXImAFqslbjBbiR8PVnXImV6VBMYL5J3Lssfu4nZMPEPNgIFtAWlLk9drWoElGe/Ch6NaozD9VJx5xPNIPq7ErVwfeB+g2LM=",
    "reviewRemark": "trx test",
    "targetDeviceUuid": "2DEA1BEB-CFE9-4E1D-9D88-F983D84D2E4D",
    "approveUuid": "BD9D4D2C-6689-4FE1-88BB-C9DA5A251A30",
    "approveSign": "vPuFWmtV/KbemdN/5IqRhyfY63kp55HSZEErFa0rtJco861WkUsesaJ1U5kV0oX3bn5U8iVEKGeAzA37s/jMBy8hq62r1fstvhZ6vcgX5FuqtvvL8fTOeRuK9v85e7FR/89U2Jm/KbVt0US2Xe1oQz2D7lDvFW15ZtSQdp8JoVA=",
    "approveRemark": "trx test",
    "approveExpireTime": "1622775712"
}
```

{% endcode %}

<table data-full-width="false"><thead><tr><th width="158.98046875">Parameter</th><th width="90.18359375">Required</th><th width="68.78515625">Type</th><th>Description</th></tr></thead><tbody><tr><td>apiKey</td><td>Yes</td><td>String</td><td>API KEY</td></tr><tr><td>submitAccount</td><td>Yes</td><td>String</td><td>Submit account(Client side approval account)</td></tr><tr><td>address</td><td>Yes</td><td>String</td><td>Receive address</td></tr><tr><td>amount</td><td>Yes</td><td>String</td><td>Receive amount</td></tr><tr><td>coinsDoId</td><td>Yes</td><td>String</td><td>CoinsDoID (refer to currency control)</td></tr><tr><td>businessId</td><td>Yes</td><td>String</td><td>Business ID (cannot be repeated)</td></tr><tr><td>businessScene</td><td>No</td><td>String</td><td>Business scenario</td></tr><tr><td>timestamp</td><td>Yes</td><td>String</td><td>Unix epoch timestamp format (up to second or millisecond)</td></tr><tr><td>txMemo</td><td>No</td><td>String</td><td>On-chain remarks (XRP and EOS tag can insert here)</td></tr><tr><td>reviewUuid</td><td>No</td><td>String</td><td>UUID of the executor's device<strong>. This is mandatory if you want to automate 1st-level approval.</strong></td></tr><tr><td>reviewSign</td><td>No</td><td>String</td><td>Reviewer signature, generate using RSA-SHA256 algorithm with the following data. <strong>This is mandatory if you want to automate 1st-level approval.</strong><br><br>businessId=&#x3C;Business ID>&#x26;address=&#x3C;Receive address>&#x26;amount=&#x3C;Receive amount>&#x26;coinsDoId=&#x3C;CoinsDo ID>，<br><br>❗ Important：<br>Remove trailing zeros from the decimal places of the receive amount. <br>For eg: 1.010 to 1.01, 1.000 to 1.</td></tr><tr><td>reviewRemark</td><td>No</td><td>String</td><td>Reviewer approval remarks</td></tr><tr><td>targetDeviceUuid</td><td>No</td><td>String</td><td>UUID of the target CoinSend client from which the funds will be sent. <strong>This is mandatory if you want to automate 2nd-level approval.</strong><br><br><img src="https://3529283920-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbq6zziU9PCtrTYtaegKj%2Fuploads%2FlsZDrVjBKHJFUlXAGNZw%2Fimage.png?alt=media&#x26;token=b67674b7-3567-4e4b-beb8-b4a9f5e0099c" alt=""></td></tr><tr><td>approveUuid</td><td>No</td><td>String</td><td><p>UUID of the executor's device. <strong>This is mandatory if you want to automate 2nd-level approval.</strong></p><p></p><p><img src="https://3529283920-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbq6zziU9PCtrTYtaegKj%2Fuploads%2ForFfLxwxWWtbvOxAgH4J%2Fimage.png?alt=media&#x26;token=e4b0678b-eec0-44d3-9620-11fdd111fa75" alt=""></p></td></tr><tr><td>approveSign</td><td>No</td><td>String</td><td><p>Executor signature, generate using RSA-SHA256 algorithm with the following parameters (the signature must be generated strictly following the parameters sequence shown).<br><strong>This is mandatory if you want to automate 2nd-level approval.</strong><br></p><p>businessId=&#x3C;Business ID>&#x26;deviceUuid=&#x3C;CoinSend UUID>&#x26;approveExpireTime=&#x3C;Execution signature expiration time></p></td></tr><tr><td>approveRemark</td><td>No</td><td>String</td><td>Executor approval remarks</td></tr><tr><td>approveExpireTime</td><td>Yes</td><td>String</td><td>Unix epoch timestamp format, up to second. For eg.<br>Friday, 2 January 2026 09:52:43 = 1767347563<br><br>approveSign signature expiry date. Up to 72 hours from timestamp parameter.<br><br><a href="https://coinsdo.gitbook.io/docs/coinsend/how-to/execution-approval-expiry-time">Reference</a></td></tr><tr><td>targetAddrIndex</td><td>No</td><td>String</td><td>Designated send address index, default to 0 if not present. If this parameter is present, approveSign will have to include the following parameters to produce signature (the signature must be generated strictly following the parameters sequence shown):<br><br>businessId=&#x3C;Business ID>&#x26;deviceUuid=&#x3C;CoinSend UUID>&#x26;targetAddrIndex=&#x3C;Send address index>&#x26;approveExpireTime=&#x3C;Execution signature expiration time><br><br><img src="https://3529283920-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbq6zziU9PCtrTYtaegKj%2Fuploads%2FsUoD1wOCC6UnINVi7FCS%2Fimage.png?alt=media&#x26;token=de90fdbc-a112-497b-b701-6f6b739804e0" alt=""></td></tr><tr><td>keepApproveSign</td><td>No</td><td>Boolean</td><td>When keepApproveSign is set to True, if the data approval (first-level approval) is intercepted, the qualified execution approval (second-level approval) signature can still be retained, meaning manual second-level approval will not be required. If retaining the second-level approval signature is not needed, please do not pass the keepApproveSign parameter, or set keepApproveSign to False.</td></tr></tbody></table>

**Request Example**

{% code fullWidth="false" %}

```json
{
    "data": "{\"apiKey\":\"cd384rt80f5575dc\",\"submitAccount\":\"coinsdoTest\",\"address\":\"TKU69qcQPoR5jDEE7ertPpdaxoLGCTX4xR\",\"amount\":\"616.616\",\"coinsDoId\":\"3\",\"businessId\":\"TRX_999\",\"businessScene\":\"1\",\"timestamp\":\"1767261163000\",\"txMemo\":\"COINSDOTESTTRX\",\"reviewUuid\":\"A65F7B1C-8FF8-4E0D-ADF2-AE0BCB0F378B\",\"reviewSign\":\"3pIsqtrXPG/I4o/YGLOvtIvBUUrBrRyFehlt0wkezWU4u0dj5xXEoZ9E4EXSes9WawqfpxrRfOIHgXV1BnPNM2tt0DLloCnJkzR7smC26+z6kuZb87s3hitZWgM3UaWWghB8/qNMQImvCZ6MREqChoNmEVyaqCnTbjorKsrU/V0=\",\"reviewRemark\":\"trxreview\",\"targetDeviceUuid\":\"2DEA1BEB-CFE9-4E1D-9D88-F983D84D2E4D\",\"approveUuid\":\"BD9D4D2C-6689-4FE1-88BB-C9DA5A251A30\",\"approveExpireTime\":\"1767433963\",\"approveSign\":\"vPuFWmtV/KbemdN/5IqRhyfY63kp55HSZEErFa0rtJco861WkUsesaJ1U5kV0oX3bn5U8iVEKGeAzA37s/jMBy8hq62r1fstvhZ6vcgX5FuqtvvL8fTOeRuK9v85e7FR/89U2Jm/KbVt0US2Xe1oQz2D7lDvFW15ZtSQdp8JoVA=\",\"approveRemark\":\"trxapprove\",\"approveExpireTime\":\"1622775712\",\"keepApproveSign\":True}",
    "sign": "d32bfb9905f0b6713be45fea2bce001449146a43b3319479076a6d8c2bf22055"
}
```

{% endcode %}

### **Response**

{% code fullWidth="false" %}

```
{
  "code": 200, // State code
  "msg": "Success", // Response message
  "data": null // Response data
}
```

{% endcode %}

**Response status**

<table data-full-width="false"><thead><tr><th width="113.5078125">Status code</th><th>Description</th></tr></thead><tbody><tr><td>4006</td><td>Currently do not support the tokens dispatched</td></tr><tr><td>4008</td><td>Business ID already exists</td></tr><tr><td>4009</td><td>Failed to add new dispatch record</td></tr><tr><td>4011</td><td>Failed to verify device for approval</td></tr><tr><td>4012</td><td>Data approver's (first approver) device does not exists</td></tr><tr><td>4013</td><td>Approval device not bound to approval account</td></tr><tr><td>4014</td><td>Data approver's (first approver) signature verification failed</td></tr><tr><td>4015</td><td>Authorization code verification failed</td></tr><tr><td>4016</td><td>Authorization code expired or does not exists</td></tr><tr><td>4017</td><td>Device verification failed</td></tr><tr><td>4018</td><td>Ading new approval device failed</td></tr><tr><td>4019</td><td>Signature verification through SHA256 with RSA failed</td></tr><tr><td>4020</td><td>Corporate sub-account could not be found</td></tr><tr><td>4021</td><td>Does not have data submission rights</td></tr><tr><td>4022</td><td>Does not have data approver (first approver) rights</td></tr><tr><td>4023</td><td>Exceeded token’s largest decimal</td></tr><tr><td>4024</td><td>Incomplete parameters found for execution approver (first approver)</td></tr><tr><td>4025</td><td>Wrong format for dispatch address</td></tr><tr><td>4026</td><td>Incomplete parameters found for execution approver (second approver)</td></tr><tr><td>4027</td><td>Device does not exists for execution approver (second approver)</td></tr><tr><td>4028</td><td>Failed to verify execution approver (second approver)’s signature</td></tr><tr><td>4029</td><td>Does not have the rights to do execution approval (second approval)</td></tr><tr><td>4030</td><td>Dispatch amount exceeded the limit designated for your role as the data approver (first approver)</td></tr><tr><td>4031</td><td>Dispatch amount exceeded the limit designated for your role as the execution approver (second approver)</td></tr><tr><td>4032</td><td>Failed to verify wallet</td></tr><tr><td>4033</td><td>Wallet does not exists</td></tr><tr><td>4038</td><td>Failed to verify dispatch address</td></tr><tr><td>4039</td><td>Withdrawal account has been deactivated</td></tr><tr><td>4040</td><td>Data approver (first approver)’s bound device has been deactivated</td></tr><tr><td>4041</td><td>Execution approver (second approver)’s bound device has been deactivated</td></tr><tr><td>4046</td><td>Failed to verify whitelisted dispatch address</td></tr><tr><td>4047</td><td>Dispatch address not found amongst the whitelist</td></tr><tr><td>4048</td><td>Dispatch amount is less than the minimum required amount</td></tr><tr><td>4049</td><td>Data submitter account does not belong to an API account</td></tr><tr><td>4056</td><td>The approval device associate with the data approval account does have the required permission. Contact your merchant account holder to assign permission for this account</td></tr><tr><td>4057</td><td>The approval device associated with the execution approval account does have the required permission. Contact your merchant account holder to assign permission for this account</td></tr><tr><td>4065</td><td>Failed to verify business ID</td></tr><tr><td>4066</td><td>Failed to verify supported tokens</td></tr><tr><td>4067</td><td>CoinsDoId must be a whole number</td></tr><tr><td>4069</td><td>Sub account does not exists</td></tr><tr><td>4070</td><td>Select a coin</td></tr><tr><td>4160</td><td>Execution approver (second approver)’s signature expiration time cannot be blank</td></tr><tr><td>4161</td><td>Execution approver (second approver)’s signature expiration time is invalid</td></tr><tr><td>4162</td><td>The current client version does not support submitting an execution approver (second approver)’s signature expiration time.</td></tr></tbody></table>

{% hint style="info" %}

### **For webhook request of transfer record upon completion, please refer to** [**Webhook notification**](https://coinsdo.gitbook.io/docs/general/coinsdo-open-api/webhook-notification) **section.**

{% endhint %}

***

## Get device info <a href="#dispatch-wallet" id="dispatch-wallet"></a>

To retrieve CoinSend client device information.

### **Request**

<mark style="color:green;">`POST`</mark> `/v1/deviceDetail`

<table data-full-width="false"><thead><tr><th width="100.2734375">Parameter</th><th width="68.39453125">Type</th><th>Description</th></tr></thead><tbody><tr><td>data</td><td>string</td><td>Content（JSON string，refer below）</td></tr></tbody></table>

* **Data content**

<table data-full-width="false"><thead><tr><th width="111.453125">Parameter</th><th width="100.41796875">Required</th><th width="69.41015625">Type</th><th>Description</th></tr></thead><tbody><tr><td>apiKey</td><td>Yes</td><td>string</td><td>API KEY</td></tr><tr><td>deviceUuid</td><td>Yes</td><td>string</td><td>CoinSend client UUID</td></tr></tbody></table>

{% code fullWidth="false" %}

```
{
  "apiKey": "cd384rt80f5575dc",
  "deviceUuid": "2DEA1BEB-CFE9-4E1D-9D88-F983D84D2E4D"
}
```

{% endcode %}

**Request example**

{% code fullWidth="false" %}

```json
{
  "data": "{\"apiKey\":\"cd384rt80f5575dc\",\"deviceUuid\":\"2DEA1BEB-CFE9-4E1D-9D88-F983D84D2E4D\"}",
  "sign": "d32bfb9905f0b6713be45fea2bce001449146a43b3319479076a6d8c2bf22055"
}
```

{% endcode %}

### **Response**

<table data-full-width="false"><thead><tr><th width="170.48046875">Parameter</th><th width="89.8046875">Required</th><th width="67.15625">Type</th><th>Description</th></tr></thead><tbody><tr><td>onlineStatus</td><td>Yes</td><td>string</td><td>Online status (0: offline 1: online)</td></tr><tr><td>useStatus</td><td>Yes</td><td>string</td><td>Use status (0: stopped 1: In Use)</td></tr><tr><td>devicePublicKey</td><td>Yes</td><td>string</td><td>Wallet's public key</td></tr><tr><td>deviceRegisterTime</td><td>Yes</td><td>string</td><td>Timestamp when you register wallet (seconds)</td></tr><tr><td>deviceExpiryTime</td><td>Yes</td><td>string</td><td>Timestamp of wallet’s expiry (seconds)</td></tr><tr><td>addressList</td><td>No</td><td>array</td><td>List of sending addresses, refer to content below.</td></tr></tbody></table>

* addressList content

<table data-full-width="false"><thead><tr><th width="100.1796875">Parameter</th><th width="89.84375">Required</th><th width="67.5859375">Type</th><th>Description</th></tr></thead><tbody><tr><td>currency</td><td>Yes</td><td>string</td><td>Token/currency</td></tr><tr><td>flag</td><td>Yes</td><td>string</td><td>Contract address/Token ID</td></tr><tr><td>address</td><td>Yes</td><td>string</td><td>Wallet's sending address</td></tr><tr><td>balance</td><td>No</td><td>string</td><td>Balance in address</td></tr></tbody></table>

**Response Example**

{% code fullWidth="false" %}

```json
{
  "code": 200, // State code
  "msg": "成功", // Remarks
  "data": {
    "onlineStatus": 1,
    "useStatus": 1,
    "addressList": [{
      "flag": "TRX",
      "address": "TEN51U1W5hW5bJ833J6CLojvJdFGEQtz39",
      "balance": "222.1",
      "currency": "TRX"
    }, {
      "flag": "0xe7b0d9104aec8ea4ec6a02dfc5ae5180f9f78f95",
      "address": "TKU69qcQPoR5jDEE7ertPpdaxoLGCTX4xR",
      "balance": "6161.999",
      "currency": "TRC20"
    }],
    "devicePublicKey":"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD311wvweaxTv9bJBz3dxxd8e1nhInyoS/my8zarbeyqwAcTjWkMsWQt5cquU5G463nd5nSAOUGDgdytOZu78ZT4OQPFyeKRM/TWC7ghibhi/FDxJvE7txj7QRjdY0vTDTM/6CYxi2F8PIgjzX9TKBP7DK6pZq/sN1VciBuRWz2kQIDAQAB"
    "deviceExpiryTime": "1628380800",
    "deviceRegisterTime": "1625802606"
  }
}
```

{% endcode %}

**Response status**

<table data-full-width="false"><thead><tr><th width="99.90234375">Status code</th><th>Description</th></tr></thead><tbody><tr><td>4032</td><td>Failed to verify wallet</td></tr><tr><td>4033</td><td>Wallet does not exists</td></tr><tr><td>4034</td><td>Failed to verify address</td></tr><tr><td>4035</td><td>Failed to verify token</td></tr><tr><td>4036</td><td>Failed to verify the balance</td></tr><tr><td>4037</td><td>Failed to verify the wallet’s network status</td></tr></tbody></table>

***

## Adding a new approval device <a href="#adding-a-new-approval-device" id="adding-a-new-approval-device"></a>

To add new approval device

### **Request**

<mark style="color:green;">`POST`</mark> `/v1/reviewAdd`

<table data-full-width="false"><thead><tr><th width="121.59375">Parameter</th><th width="118.66796875">Required</th><th width="86.55859375">Type</th><th>Description</th></tr></thead><tbody><tr><td>data</td><td>Yes</td><td>string</td><td>Content（JSON string，refer below）</td></tr></tbody></table>

* Data content

<table data-full-width="false"><thead><tr><th width="171.24609375">Parameter</th><th width="99.65625">Required</th><th width="79.625">Type</th><th>Description</th></tr></thead><tbody><tr><td>apiKey</td><td>Yes</td><td>string</td><td>API Key</td></tr><tr><td>reviewPubkey</td><td>Yes</td><td>string</td><td>Verify device’s public key</td></tr><tr><td>plainText</td><td>Yes</td><td>string</td><td>String to be verified</td></tr><tr><td>signature</td><td>Yes</td><td>string</td><td>Signature (Signs plainText using SHA256 with RSA)</td></tr><tr><td>authorizationCode</td><td>Yes</td><td>string</td><td>Device’s authorization code</td></tr></tbody></table>

{% code fullWidth="false" %}

```json
{
  "apiKey": "cd384rt80f5575dc",
  "reviewPubkey":"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDi7RszjTelyGLJmpyXUPKo7xSUGQSv/5fUXO0npAGKP0oukx7tHQ6nJsnXdztX3yR3zhgjBnCdqN8DBPr+LzF4kSzG4t2/a6NdFlnPAUrtFZcqRbGDwliIqlKb5XCTu0Pgs6fNjx8tPE6XIW7OX/8NmQIbBw9Qjn28gjSuaTAD9QIDAQAB",
  "plainText":"test",
  "signature":"Fy6kcJsOY38jO+m/OsvmVj9kJdkC8CCl4WwPbMjWP/AAGS3dAAUHgIGQQlkIo3uBiEIIr85axpYmmsvXfeGg3MmYLim1XOeI65oOnDN084EaXjlCvTlFMqnt61YUYcN/9WPRjtbOsfSaK1ivOfKux9Fh8lGzRoNYKahCA1t69Kk=",
  "authorizationCode": "CFZQ-RJWN-VDDH"
}
```

{% endcode %}

**Request example**

<pre class="language-json" data-full-width="false"><code class="lang-json"><strong>{
</strong>  "data": "{\"apiKey\":\"cd384rt80f5575dc\",\"reviewPubkey\":\"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDi7RszjTelyGLJmpyXUPKo7xSUGQSv/5fUXO0npAGKP0oukx7tHQ6nJsnXdztX3yR3zhgjBnCdqN8DBPr+LzF4kSzG4t2/a6NdFlnPAUrtFZcqRbGDwliIqlKb5XCTu0Pgs6fNjx8tPE6XIW7OX/8NmQIbBw9Qjn28gjSuaTAD9QIDAQAB\",\"plainText\":\"test\",\"signature\":\"Fy6kcJsOY38jO+m/OsvmVj9kJdkC8CCl4WwPbMjWP/AAGS3dAAUHgIGQQlkIo3uBiEIIr85axpYmmsvXfeGg3MmYLim1XOeI65oOnDN084EaXjlCvTlFMqnt61YUYcN/9WPRjtbOsfSaK1ivOfKux9Fh8lGzRoNYKahCA1t69Kk=\",\"authorizationCode\":\"CFZQ-RJWN-VDDH\"}",
  "sign": "ee7809433ed0200b55f79e85f3489d455a28ac3f14c8757b7799f890f42d74e8"
}
</code></pre>

### **Response**

{% code fullWidth="false" %}

```json
{
  "code": 200, // State code
  "msg": "Success", // Remarks
  "data": {
    "uuid": "2DEA1BEB-CFE9-4E1D-9D88-F983D84D2E4W"
  }
}
```

{% endcode %}

<table data-full-width="false"><thead><tr><th width="100.4375">Parameter</th><th width="100.47265625">Required</th><th width="69.6796875">Type</th><th>Description</th></tr></thead><tbody><tr><td>uuid</td><td>Yes</td><td>string</td><td>Authorization device’s uuid</td></tr></tbody></table>

**Response status**

<table data-full-width="false"><thead><tr><th width="110.421875">Status code</th><th>Description</th></tr></thead><tbody><tr><td>4015</td><td>Failed to verify authorization code</td></tr><tr><td>4016</td><td>The authorization code does not exist or has expired</td></tr><tr><td>4018</td><td>Failed to add new authorization device</td></tr><tr><td>4019</td><td>Failed to sign through SHA256 with RSA</td></tr></tbody></table>

***

## Withdrawal Record <a href="#withdraw-record-detail" id="withdraw-record-detail"></a>

To view details of withdrawal records

### **Request**

<mark style="color:green;">`POST`</mark> `/v1/listWithdrawRecordDetail`

<table data-full-width="false"><thead><tr><th width="171.24609375">Parameter</th><th width="99.65625">Required</th><th width="79.625">Type</th><th>Description</th></tr></thead><tbody><tr><td>data</td><td>Yes</td><td>string</td><td>Content (JSON string, refer below)</td></tr></tbody></table>

```json
{
    "apiKey": "aa465953d55641b3",
    "businessIdList": "20241125T023627_615, 20241125T013051_799",
    "timestamp": "2847982343622"
}
```

* Data content

<table data-full-width="false"><thead><tr><th width="171.24609375">Parameter</th><th width="99.65625">Required</th><th width="79.625">Type</th><th>Description</th></tr></thead><tbody><tr><td>apiKey</td><td>Yes</td><td>string</td><td>API Key</td></tr><tr><td>businessIdList</td><td>Yes</td><td>string</td><td>Business ID (separate multiple entries with commas)</td></tr><tr><td>timestamp</td><td>Yes</td><td>string</td><td>Timestamp (seconds or milliseconds)</td></tr></tbody></table>

**Request example**

{% code fullWidth="false" %}

```json
{
    "data": "{\"apiKey\":\"aa465953d55641b3\",\"businessIdList\":\"20241125T023627_615, 20241125T013051_799\",\"timestamp\":\"2847982343622\"}",
    "sign": "22212634c772653e4074347d36040d9c51613c9a827591b12ea5888e6c301fbe"
}
```

{% endcode %}

### **Response**

<pre class="language-json" data-full-width="false"><code class="lang-json"><strong>{
</strong>    "success": true,
    "code": 200,
    "msg": "Success",
    "data": [
        {
            "businessId": "20241125T013051_799",
            "chain": "TRX",
            "currency": "TRX",
            "flag": "TRX",
            "coinsDoId": null,
            "fromAddress": "TUsh9f5waEaHmeKPM1dTKg1DAvPYEktB9L",
            "toAddress": "T9yTVCyAvXpHE4MKji5e6nhZf7RqpxyiSZ",
            "amount": "100",
            "withdrawDeviceUuid": "12DEFEF7-6D5B-4C94-8967-4DEC062B790E",
            "dataApprover": "merchant_child_test2",
            "dataApproveTime": "1732498297",
            "executiveApprover": "merchant_child_test2",
            "executiveApproveTime": "1732498368",
            "withdrawStatus": 6,
            "txHash": "ec10197c20a1be2a3c07f98c3ac62ab11b3243a22849f7a77f7d4215499c6314",
            "txTime": "1732498386",
            "callbackStatus": -1,
            "callbackTime": null,
            "createTime": "1732498257",
            "unsentMsgList": null
        },
        {
            "businessId": "20241125T023627_615",
            "chain": "TRX",
            "currency": "TRX",
            "flag": "TRX",
            "coinsDoId": null,
            "fromAddress": "TUsh9f5waEaHmeKPM1dTKg1DAvPYEktB9L",
            "toAddress": "TQPrt12nsL9Ks7on5LUcG99UUXtFhJDgsK",
            "amount": "50",
            "withdrawDeviceUuid": "12DEFEF7-6D5B-4C94-8967-4DEC062B790E",
            "dataApprover": "merchant_child_test2",
            "dataApproveTime": "1732517994",
            "executiveApprover": "merchant_child_test2",
            "executiveApproveTime": "1732518023",
            "withdrawStatus": 6,
            "txHash": "e54b3c7b5ba6a2e46d7c99e2034578f0f5314644c88126a748e6333c6385bc74",
            "txTime": "1732518048",
            "callbackStatus": -1,
            "callbackTime": null,
            "createTime": "1732502211",
            "unsentMsgList": null
        }
    ]
}
</code></pre>

* Data content

<table data-full-width="false"><thead><tr><th width="202.484375">Parameter</th><th width="99.65625">Required</th><th width="111.26171875">Type</th><th>Description</th></tr></thead><tbody><tr><td>businessId</td><td>Yes</td><td>string</td><td>Business ID</td></tr><tr><td>chain</td><td>Yes</td><td>string</td><td>CoinSend client remark</td></tr><tr><td>currency</td><td>Yes</td><td>string</td><td>CoinSend client UUID</td></tr><tr><td>flag</td><td>Yes</td><td>string</td><td>Array of content (refer to Details content)</td></tr><tr><td>coinsDoId</td><td>Yes</td><td>string</td><td>CoinsDoID (refer to currency control)</td></tr><tr><td>fromAddress</td><td>Yes</td><td>string</td><td>Sender's address</td></tr><tr><td>amount</td><td>Yes</td><td>string</td><td>Token amount</td></tr><tr><td>withdrawDeviceUuid</td><td>Yes</td><td>string</td><td>Associated CoinSend client UUID</td></tr><tr><td>dataApprover</td><td>Yes</td><td>string</td><td>Level 1 approver's device UUID</td></tr><tr><td>dataApproveTime</td><td>Yes</td><td>timestamp</td><td>Level 1 approval time</td></tr><tr><td>executiveApprover</td><td>Yes</td><td>string</td><td>Level 2 approver's device UUID</td></tr><tr><td>executiveApproveTime</td><td>Yes</td><td>timestamp</td><td>Level 2 approval time</td></tr><tr><td>withdrawStatus</td><td>Yes</td><td>string</td><td>Transfer status<br>1 - Success<br>2 - Rejected<br>5 - Cancelled<br>6 - Canceled (Contract Restricted)<br>7 - Canceled (Signature Invalid)</td></tr><tr><td>txHash</td><td>Yes</td><td>string</td><td>Transaction hash</td></tr><tr><td>txTime</td><td>Yes</td><td>timestamp</td><td>Transaction time</td></tr><tr><td>callbackStatus</td><td>Yes</td><td>string</td><td>Callback status<br>-1 - No callback / disabled<br>0 - In progress<br>1 - Success<br>2- Failed</td></tr><tr><td>callbackTime</td><td>Yes</td><td>timestamp</td><td>Callback time</td></tr><tr><td>createTime</td><td>Yes</td><td>timestamp</td><td>Record creation time</td></tr><tr><td>unsentMsgList</td><td>No</td><td>array</td><td>Failed transaction details, available only when a transaction fails</td></tr></tbody></table>

***

## Withdrawal Summary <a href="#withdraw-statistic" id="withdraw-statistic"></a>

To check total transfer amount based on network.

### **Request**

<mark style="color:green;">`POST`</mark> `/v1/withdrawStatistic`

<table data-full-width="false"><thead><tr><th width="171.24609375">Parameter</th><th width="99.65625">Required</th><th width="79.625">Type</th><th>Description</th></tr></thead><tbody><tr><td>data</td><td>Yes</td><td>string</td><td>Content (JSON string, refer below)</td></tr></tbody></table>

```json
{
    "apiKey": "7bb52d79e46e47ab",
    "withdrawDeviceUuid": "3FA9B3EE-6275-49F4-8886-13B5A58F32CF",
    "startTime": "1738886400",
    "endTime": "1738943999",
    "timestamp": "1740379248"
}
```

* Data content

<table data-full-width="false"><thead><tr><th width="171.24609375">Parameter</th><th width="99.65625">Required</th><th width="79.625">Type</th><th>Description</th></tr></thead><tbody><tr><td>apiKey</td><td>Yes</td><td>string</td><td>API Key</td></tr><tr><td>withdrawDeviceUuid</td><td>Yes</td><td>string</td><td>CoinSend client UUID</td></tr><tr><td>startTime</td><td>Yes</td><td>string</td><td>Start Time (UTC+0 timezone). Query limit: 1 day, must not span multiple days</td></tr><tr><td>endTime</td><td>Yes</td><td>string</td><td>End Time (UTC+0 timezone). Query limit: 1 day, must not span multiple days</td></tr><tr><td>timestamp</td><td>Yes</td><td>string</td><td>Timestamp (seconds or milliseconds)</td></tr></tbody></table>

**Request example**

{% code fullWidth="false" %}

```json
{
    "data":"{\"apiKey\":\"7bb52d79e46e47ab\",\"withdrawDeviceUuid\":\"3FA9B3EE-6275-49F4-8886-13B5A58F32CF\",\"startTime\":\"1738886400\",\"endTime\":\"1738943999\",\"timestamp\":\"1740379248\"}",
    "sign":"03dabf4073bad9d5fcde3b881bba076cae211ac28b11995289740f96f51162a5"
}
```

{% endcode %}

### **Response**

{% code fullWidth="false" %}

```json
{
    "code": 200,
    "msg": "Success",
    "success": true,
    "data": {
        "deviceName": "alpha",
        "deviceRemark": "Pixel 7-5be6",
        "withdrawDeviceUuid": "3FA9B3EE-6275-49F4-8886-13B5A58F32CF",
        "details": [
            {
              "chain": "ADA",
              "currency": "ADA",
              "currencyName": "ADA",
              "flag": "ADA",
              "customName": "ADA",
              "withdrawTotalAmount": 0,
              "balance": 0,
              "lastUpdateTime": null,
              "currencyType": 0
            },
            {
              "chain": "ALGO",
              "currency": "ALGO",
              "currencyName": "ALGO",
              "flag": "ALGO",
              "customName": "ALGO",
              "withdrawTotalAmount": 0,
              "balance": 0,
              "lastUpdateTime": null,
              "currencyType": 0
            }
        ]
    }
}
```

{% endcode %}

* Data content

<table data-full-width="false"><thead><tr><th width="171.24609375">Parameter</th><th width="99.65625">Required</th><th width="79.625">Type</th><th>Description</th></tr></thead><tbody><tr><td>deviceName</td><td>Yes</td><td>string</td><td>CoinSend client name</td></tr><tr><td>deviceRemark</td><td>Yes</td><td>string</td><td>CoinSend client remark</td></tr><tr><td>withdrawDeviceUuid</td><td>Yes</td><td>string</td><td>CoinSend client UUID</td></tr><tr><td>details</td><td>Yes</td><td>array</td><td>Array of content (refer to Details content)</td></tr></tbody></table>

* Details content

<table data-full-width="false"><thead><tr><th width="171.24609375">Parameter</th><th width="99.65625">Required</th><th width="79.625">Type</th><th>Description</th></tr></thead><tbody><tr><td>chain</td><td>Yes</td><td>string</td><td>Name of Mainnet</td></tr><tr><td>currency</td><td>Yes</td><td>string</td><td>Currency/Protocol</td></tr><tr><td>currencyName</td><td>Yes</td><td>string</td><td>Name of the currency</td></tr><tr><td>flag</td><td>Yes</td><td>string</td><td>Contract address/Currency</td></tr><tr><td>customName</td><td>Yes</td><td>string</td><td>Custom name of the currency</td></tr><tr><td><p>withdrawTotalAmount</p><p><br></p></td><td>Yes</td><td>Decimal</td><td>Total transfer amount</td></tr><tr><td>balance</td><td>Yes</td><td>Decimal</td><td>Balance</td></tr><tr><td>lastUpdateTime</td><td>No</td><td>string</td><td>Last update time</td></tr><tr><td>currencyType</td><td>Yes</td><td>Integer</td><td>Currency type (0-Native coin, 1-Token)</td></tr></tbody></table>

**Response status**

<table data-full-width="false"><thead><tr><th width="110.421875">Status code</th><th>Description</th></tr></thead><tbody><tr><td>4002</td><td>Invalid parameter format</td></tr><tr><td>4003</td><td>JSON data parsing error</td></tr><tr><td>4004</td><td>APIKEY does not exist</td></tr><tr><td>4005</td><td>IP restricted. Current IP:</td></tr><tr><td>4007</td><td>Signature verification failed</td></tr><tr><td>4010</td><td>Request expired</td></tr><tr><td>4032</td><td>Failed to verify wallet</td></tr><tr><td>4068</td><td>APIKEY validation failed</td></tr><tr><td>4099</td><td>Too many requests</td></tr><tr><td>4116</td><td>Selected time exceeds the allowed range</td></tr><tr><td>4117</td><td>Error querying distribution statistics</td></tr><tr><td>4118</td><td>Failed to retrieve coin configuration</td></tr><tr><td>4119</td><td>Failed to retrieve supported coin list</td></tr><tr><td>4123</td><td>Start time is later than end time</td></tr><tr><td>4124</td><td>Query time must be within the same day</td></tr></tbody></table>
