# Payout history

**POST** `https://api.heleket.com/v1/payout/list`

## Request

### Body parameters

| Name | Parameter type | Default value | Definition |
| --- | --- | --- | --- |
| date\_from | string<br>format: YYYY-MM-DD H:mm:ss| null | Filtering by creation date, from |
| date\_to | string<br>format: YYYY-MM-DD H:mm:ss| null | Filtering by creation date, to |

### Request example

```
curl https://api.heleket.com/v1/payout/list \
-X POST \
-H 'merchant: 8b03432e-385b-4670-8d06-064591096795' \
-H 'sign: f80fa426a89eb62bd53997326865d850' \
-H 'Content-Type: application/json'
```

To filter payouts by creation date from may 4 to may 16.

```
curl https://api.heleket.com/v1/payout/list \
-X POST \
-H 'merchant: 8b03432e-385b-4670-8d06-064591096795' \
-H 'sign: f80fa426a89eb62bd53997326865d850' \
-H 'Content-Type: application/json' \
-d '{
	"date_from": "2023-05-04 00:00:00",
	"date_to": "2023-05-16 23:59:59"
}'
```

## Response

### Response parameters

| Name | Definition |
| --- | --- |
| merchant\_uuid | Merchant's Uuid |
| items | Array of Payouts. [Structure](https://doc.heleket.com/methods/payouts/payout-history.md#items) |
| paginate | Data for pagination. [Structure](https://doc.heleket.com/methods/payments/payment-history.md#paginate) |

### Structure of _item_

| Name | Definition |
| --- | --- |
| uuid | uuid of the payout |
| amount | Payout amount in _currency_ |
| currency | Currency code for the payout |
| network | The code of the blockchain network in which the payout is made |
| address | The address of the wallet to which the payment is made |
| txid | Transaction ID in the blockchain |
| status | Payout status [statuses](https://doc.heleket.com/methods/payouts/payout-statuses.md) |
| is\_final | Whether the payout is finalized<br>The payout process is considered finalized once it has been successfully paid or if it has failed. In the event of a payout failure, the funds will be returned to your balance, requiring you to initiate the payout process again.|
| balance | The remaining funds on the merchant's wallet. |
| created\_at | Creation date of the payout. Timezone is UTC+3 |
| updated\_at | Last payout updated date. Timezone is UTC+3 |

> To get next/previous page entries, specify the next/previous cursor hash in the query parameters (?cursor=nextCursorHash)
> 
> ### Example:
> 
> ```
> curl https://api.heleket.com/v1/payout/list?cursor=eyJpZCI6MjEyLCJf cG9pbnRzVzVG9OZXh0SXRlbXMiOnRydWV9 \
> -X POST \
> -H 'merchant: cb2131ff-a3d4-46dd-94c6-3714fae65f89' \
> -H 'sign: f80fa426a89eb62bd53997326865d850' \
> -H 'Content-Type: application/json' \
> -d '{}'
> ```

### Response example

```
{
"state": 0,
"result": {
	"items": [{
		"uuid": "a7c0caec-a594-4aaa-b1c4-77d511857594",
		"amount": "3",
		"currency": "USDT",
		"network": "TRON",
		"address": "TJ...",
		"txid": null,
		"status": "process",
		"is_final": false,
		"balance": "129.00000000",
		"created_at": "2023-06-21T17:25:55+03:00",
		"updated_at": "2023-06-21T17:34:38+03:00"
	}, {
		"uuid": "92c39264-d180-4503-9c16-ee16f083bbb8",
		"amount": "5.40000000",
		"currency": "DOGE",
		"network": "doge",
		"address": "DEw8CJLfxg9fhumeXP1zvVNjZicsqtDv7V",
		"txid": "5e5810946152ea569d2a2aa9aa32a45c0e4223a4f9aad8e31d2fc660d2cdedb8",
		"order_id": null,
		"payment_status": null,
		"status": "paid",
		"is_final": true,
		"balance": "26.77966652",
		"created_at": "2023-07-21T17:25:55+03:00",
		"updated_at": "2023-07-21T17:34:38+03:00"
	},
	...
	],
	"paginate": {
		"count": 15,
		"hasPages": true,
		"nextCursor": "eyJpZCI6MjkxNTU0MywiX3BvaW50c1RvTmV4dEl0ZW1zIjp0cnVlfQ",
		"previousCursor": null,
		"perPage": 15
	}
}
}
```

## Possible errors

### Validation errors

code : 422

example responses:

If the date\_from or date\_to parameter is passed in the wrong format.

```
{
	"state": 1,
	"errors": {
	"date_from": ["validation.regex"]
	}
}
```
