# Get Deposit & Withdraw records

/sapi/v1/sunperp/dw/query/deposit-withdraw

Request type: GET

Signature verification: Yes

Interface permission: Read

Rate Limit:  20 times/2s

Interface description:  Parent user and sub user search for all existed withdraws and deposits and return their latest status.

### Request Address

| Environment                         | Address                                     |
| ----------------------------------- | ------------------------------------------- |
| Online                              | [https://api.sunx.io](https://api.sunx.io/) |
| Online (preferred by aws customers) | [https://api.sunx.io](https://api.sunx.io/) |

### Request Parameter

| Parameter | Data Type | Required | Description                                | Value Range                             | Default Value                                                                                                                                                                                                                          |
| --------- | --------- | -------- | ------------------------------------------ | --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| currency  | string    | false    | The crypto currency to withdraw or deposit |                                         | When currency is not specified, the response would include the records of ALL currencies.                                                                                                                                              |
| type      | string    | true     | Define transfer type to search             | deposit, withdraw                       | deposit, withdraw, sub user can only use deposit                                                                                                                                                                                       |
| from      | string    | false    | The transfer id to begin search            |                                         | When 'from' is not specified, the default value would be 1 if 'direct' is 'prev' with the response in ascending order, the default value would be the ID of latest record if 'direct' is 'next' with the response in descending order. |
| size      | string    | false    | The number of items to return              | \[1-50]                                 | 50                                                                                                                                                                                                                                     |
| direct    | string    | false    | the order of response                      | 'prev' (ascending), 'next' (descending) | 'next'                                                                                                                                                                                                                                 |

### Response Parameter

| Parameter       | Data Type | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | Value Range |
| --------------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| status          | string    | true     | Request Processing Result                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |             |
| error-code      | string    | false    | Error code for withdrawal failure, only returned when the type is "withdraw" and the state is "reject", "wallet-reject" and "failed".                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |             |
| error-msg       | string    | false    | Error description of withdrawal failure, only returned when the type is "withdraw" and the state is "reject", "wallet-reject" and "failed".                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |             |
| \<data>         | object    | true     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |             |
| id              | long      | true     | Transfer id                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |             |
| type            | string    | true     | Define transfer type to search, possible values: \[deposit, withdraw] Sub-user can only put "deposit"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |             |
| currency        | string    | true     | The crypto currency to withdraw                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |             |
| tx-hash         | string    | true     | The on-chain transaction hash. If this is a "fast withdraw", then it is not on-chain transfer, and this value is empty.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |             |
| chain           | string    | true     | Block chain name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |             |
| amount          | float     | true     | The number of crypto asset transfered in its minimum unit                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |             |
| address         | string    | true     | The deposit or withdraw target address                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |             |
| address-tag     | string    | true     | The user defined address tag                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |             |
| fee             | float     | true     | Withdrawal fee                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |             |
| state           | string    | true     | <p>deposit state</p><p>\[unknown:On-chain transfer has not been received,confirming:On-chain transfer waits for first confirmation,confirmed:On-chain transfer confirmed for at least one block, user is able to transfer and trade,safe:Multiple on-chain confirmed, user is able to withdraw,orphan:On-chain transfer confirmed but currently in an orphan branch];withdraw state\[verifying:Awaiting verification,failed;verification failed,submitted:Withdraw request submitted successfully,reexamine:Under examination for withdraw validation,canceled:Withdraw canceled by user,pass:Withdraw validation passed,reject:Withdraw validation rejected,pre-transfer:Withdraw is about to be released,wallet-transfer:On-chain transfer initiated,wallet-reject:Transfer rejected by chain,confirmed;On-chain transfer completed with one confirmation,confirm-error:On-chain transfer faied to get confirmation,repealed:Withdraw terminated by system,risk-action-fail:Risk control verification failed,risk-action-timeout:Risk control action timeout]</p> |             |
| created-at      | long      | true     | The timestamp in milliseconds for the transfer creation                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |             |
| updated-at      | long      | true     | The timestamp in milliseconds for the transfer's latest update                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |             |
| sub-type        | string    | true     | Deprecated parameter                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |             |
| request-id      | string    | true     | Deprecated parameter                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |             |
| chain-full-name | string    | true     | Deprecated parameter                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |             |
| from-addr-tag   | string    | true     | Deprecated parameter                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |             |
| address-id      | string    | true     | Deprecated parameter                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |             |
| wallet-confirm  | string    | true     | Deprecated parameter                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |             |
| \</data>        |           | true     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |             |

<mark style="color:red;">Note：</mark>

* <mark style="color:red;">Should input 'CLOUD-EXCHANGE: 6X2K9L4V1C' in the request header</mark>
* <mark style="color:red;">API signature does not include the "/sapi/v1" part for url paths, only the "/sunx/dw/xxx" is considered.</mark>

### Request example

```
GET /sapi/v1/sunperp/dw/query/deposit-withdraw?SignatureVersion=2&AccessKeyId=<your key>&Signature=<your signature>&SignatureMethod=HmacSHA256&Timestamp=2025-12-23T07%3A08%3A24&type=deposit
```

### Success Example

```
{
    "status": "ok",
    "data": [
        {
            "id": 161234626,
            "type": "deposit",
            "sub-type": "SUN_PERP_USER_DEPOSIT",
            "request-id": "trc20usdt-500e802ba8ece8f0022c876109132d601fb7211e0ca406da87f08440b6f19d07-201",
            "currency": "usdt",
            "chain": "trc20usdt",
            "chain-full-name": "TRON",
            "tx-hash": "500e802ba8ece8f0022c876109132d601fb7211e0ca406da87f08440b6f19d07",
            "amount": 18.8,
            "from-addr-tag": "",
            "address-id": 0,
            "address": "TEubMt2TNag5NN1JXVaeysUk8GNTTYmtVX",
            "address-tag": "",
            "fee": 0,
            "state": "safe",
            "wallet-confirm": 20,
            "created-at": 1757935674710,
            "updated-at": 1757935745174
        }
    ]
}
```
