# Get trading bills

#### /sapi/v1/account/bill\_record

Request type: POST

Signature verification: Yes

Interface permission: Read

Rate Limit: Generally, the private interface rate limit of API key is at most 144 times every 3 seconds for each UID (Trade Interface: at most 72 times every 3 seconds. Read Interface: at most 72 times every 3 seconds) (this rate limit is shared by all the altcoins contracts delivered by different date).

Interface description: The interface supports cross margin mode and isolated margin mode. The request parameter "contract" supports the contract code of futures, in that the format is BTC-USDT-210625.

### 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 |
| ----------- | --------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
| contract    | string    | false    | contract code                                                                                                                                                                                | Case-Insenstive.Both uppercase and lowercase are supported.e.g. "BTC-USDT"                                                              |               |
| mar\_acct   | string    | true     | margin account                                                                                                                                                                               | USDT                                                                                                                                    |               |
| start\_time | long      | false    | Query start time, query by data creation time                                                                                                                                                | Value range \[((end-time) – 48h), (end-time)], maximum query window size is 48 hours, query window shift should be within past 90 days. |               |
| end\_time   | long      | false    | Query end time, query data by creation time                                                                                                                                                  | Value range \[(present-90d), present], maximum query window size is 48 hours, query window shift should be within past 90 days.         | now           |
| direct      | string    | false    | Search direct, If the direction is NEXT, the data is returned in positive chronological order; if the direction is PREV, the data is returned in reverse chronological order                 | next, prev default is prev                                                                                                              | next          |
| from\_id    | long      | false    | If the query direction is prev, from\_id should be the min query\_id in the last query result. If the query direction is next, from\_id should be the max query\_id in the last query result | Search query\_id to begin with                                                                                                          |               |

### Response Parameter

| Parameter             | Data Type    | Required | Description                                                                                                                                | Value Range                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| --------------------- | ------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| code                  | int          | true     | State code                                                                                                                                 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| msg                   | string       | true     | The code description                                                                                                                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ts                    | long         | true     | Timestamp                                                                                                                                  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| \<data>               | object array | true     |                                                                                                                                            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| query\_id             | long         | true     |                                                                                                                                            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| id                    | long         | true     |                                                                                                                                            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ts                    | long         | true     | create time                                                                                                                                |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| asset                 | string       | true     | asset                                                                                                                                      | "USDT"...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| contract\_code        | string       | true     | contract code                                                                                                                              | swap: "BTC-USDT"... , future: "BTC-USDT-210625" ...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| margin\_account       | string       | true     | margin account                                                                                                                             | "BTC-USDT","USDT"...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| face\_margin\_account | string       | true     | the counterparty margin account, only has value when the transaction Type is 34, 35, 36, 37, 38, 39, and the other types are empty strings | "BTC-USDT"...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| type                  | int          | true     | transaction Type                                                                                                                           | 3:close long; 4:close short; 5:fees for open positions-taker; 6:fees for open positions-maker; 7:fees for close positions-taker; 8:fees for close positions-maker; 9:close long for delivery; 10:close short for delivery; 11:delivery fee; 12:close long for liquidation; 13:lose short for liquidation; 14:transfer from spot exchange to contract exchange; 15:tranfer from contract exchange to spot exchange; 19:clawback; 26:system; 28:activity prize rewards; 29:rebate; 30:Funding fee-income; 31:Funding fee-expenditure; 34:transfer to sub; 35:transfer from sub; 36:transfer to master; 37:transfer from master; 38:transfer from other margin account; 39:transfer to another margin account;46:ADL close long; 47:ADL close short;66 (system advance account - user currency delivery account (transfer out advance account)); 67 (user currency delivery account - system advance payment account (transfer in advance account)) |
| amount                | decimal      | true     | amount(quote currency)                                                                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| trade\_partition      | string       | true     |                                                                                                                                            | Deprecated                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| \</data>              |              | false    |                                                                                                                                            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

### Request Example

```
POST https://api.sunx.io/sapi/v1/account/bill_record?SignatureVersion=2&AccessKeyId=<your key>&Signature=<your signature>&SignatureMethod=HmacSHA256&Timestamp=2025-09-16T07%3A16%3A15
{
    "mar_acct":"USDT"
}
```

### Response Example

```
{
	"code": 200,
	"msg": "ok",
	"data": [{
			"id": 235,
			"amount": 18.800000000000000000,
			"asset": "USDT",
			"query_id": 235,
			"type": 14,
			"ts": 1757935751532,
			"contract_code": "",
			"margin_account": "USDT",
			"face_margin_account": "",
			"trade_partition": "USDT"
		}
	],
	"ts": 1758107162495
}
```
