> ## Documentation Index
> Fetch the complete documentation index at: https://docs-en.basswallet.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Query Order History

> Retrieve historical deposit or withdrawal orders, suitable for reconciliation tasks.

### Endpoint

**GET** `/v1/account/order/history`

### Request Parameters

| Parameter     | Type     | Required | Description                                                            |
| ------------- | -------- | -------- | ---------------------------------------------------------------------- |
| **type**      | `String` | Yes      | Order type. Supported values: `Deposit`, `Payment`, `Withdraw`.        |
| **timestamp** | `Long`   | Yes      | UNIX timestamp (in milliseconds).                                      |
| **tokenName** | `String` | No       | Token name. Defaults to querying all tokens.                           |
| **startTime** | `Long`   | No       | Start time for the query. Defaults to 30 days before the current time. |
| **endTime**   | `Long`   | No       | End time for the query. Defaults to the current timestamp.             |

**Note**: The maximum query time range is 30 days, i.e., `endTime - startTime <= 30 Days`.

<Tip>
  There are currently three order types, and the response parameters vary by type:

  * **`Deposit`**: Orders related to deposits to fixed addresses.
  * **`Payment`**: Orders created via payment order links. Use status to determine order completion.
  * **`Withdraw`**: Withdrawal orders.
</Tip>

***

### Response Parameters: `Deposit`

| Parameter        | Type     | Required | Description                                       |
| ---------------- | -------- | -------- | ------------------------------------------------- |
| **id**           | `String` | Yes      | Order ID                                          |
| **chainName**    | `String` | Yes      | Blockchain name                                   |
| **tokenName**    | `String` | Yes      | Token name                                        |
| **amount**       | `String` | Yes      | Deposit amount                                    |
| **fromAddress**  | `String` | Yes      | Sender's address                                  |
| **toAddress**    | `String` | Yes      | Recipient's address                               |
| **txHash**       | `String` | Yes      | On-chain transaction hash                         |
| **createdTime**  | `Long`   | Yes      | Creation time (UTC)                               |
| **completeTime** | `Long`   | Yes      | Completion time (UTC)                             |
| **status**       | `String` | Yes      | Order status. See "Enum Definitions" for details. |

***

### Response Parameters: `Payment`

| Parameter        | Type     | Required | Description                                       |
| ---------------- | -------- | -------- | ------------------------------------------------- |
| **id**           | `String` | Yes      | Order ID                                          |
| **businessId**   | `String` | No       | Merchant-defined order ID                         |
| **chainName**    | `String` | Yes      | Blockchain name                                   |
| **tokenName**    | `String` | Yes      | Token name                                        |
| **amount**       | `String` | No       | Merchant-defined payment amount                   |
| **amountActual** | `String` | No       | Actual payment amount                             |
| **fromAddress**  | `String` | No       | Sender's address                                  |
| **toAddress**    | `String` | Yes      | Recipient's address                               |
| **txHash**       | `String` | No       | On-chain transaction hash                         |
| **createdTime**  | `Long`   | Yes      | Creation time (UTC)                               |
| **expiryTime**   | `Long`   | Yes      | Expiration time (UTC)                             |
| **completeTime** | `Long`   | No       | Completion time (UTC)                             |
| **status**       | `String` | Yes      | Order status. See "Enum Definitions" for details. |

***

### Response Parameters: `Withdraw`

| Parameter        | Type     | Required | Description                                       |
| ---------------- | -------- | -------- | ------------------------------------------------- |
| **id**           | `String` | Yes      | Order ID                                          |
| **businessId**   | `String` | No       | Merchant-defined order ID                         |
| **chainName**    | `String` | Yes      | Blockchain name                                   |
| **tokenName**    | `String` | Yes      | Token name                                        |
| **amount**       | `String` | Yes      | Withdrawal amount                                 |
| **toAddress**    | `String` | Yes      | Recipient's address                               |
| **txHash**       | `String` | Yes      | On-chain transaction hash                         |
| **networkFee**   | `String` | Yes      | Network transaction fee                           |
| **platformFee**  | `String` | Yes      | Platform commission fee                           |
| **totalFee**     | `String` | Yes      | Total fee (network + platform)                    |
| **createdTime**  | `Long`   | Yes      | Creation time (UTC)                               |
| **completeTime** | `Long`   | Yes      | Completion time (UTC)                             |
| **status**       | `String` | Yes      | Order status. See "Enum Definitions" for details. |

***

### Response Examples

<CodeGroup>
  ```json Withdrawal theme={null}
  {
      "code": 200,
      "msg": "success",
      "timestamp": "1725853275828",
      "data": [
          {
              "id": "588076016694595584",
              "businessId": "0909_test7",
              "chainName": "Tron",
              "tokenName": "USDT",
              "amount": "52.89",
              "toAddress": "TKjLDbk7LC9NXzRBCYahKa8pzMHRfahJjn",
              "txId": "3eeee30367dd33e257458fe34098a5ee353cc1501053d756484b8b52fdbe5795",
              "networkFee": "2",
              "platformFee": "0.1",
              "totalFee": "2.1",
              "createdTime": 1729475874520,
              "completeTime": 1729475874520,
              "status": "Success"
          }
      ]
  }
  ```

  ```json Deposit theme={null}
      {
      "code": 200,
      "msg": "success",
      "timestamp": "1725853367355",
      "data": [
          {
              "id": "588061066492252160",
              "chainName": "Tron",
              "tokenName": "TRX",
              "amount": "20.00",
              "fromAddress": "TKjLDbk7LC9NXzRBCYahKa8pzMHRfahJjn",
              "toAddress": "TSWoFUDouEfFdGrDEvd6S6WBhQsLKs7Kqo",
              "txHash": "5efd31cca2c3e1b8a0812aa9da58dddb4c8f8421ede1778c18fe3cee6aa586ae",
              "createdTime": 1729475874520,
              "completeTime": 1729475874520,
              "status": "Success"
          }
      ]
  }
  ```
</CodeGroup>
