List All Withdrawals
Returns a paginated list of withdrawal objects related to the current authenticated account. The list is sorted, with the most recent withdrawal appearing first by default.
Parameters
| Parameter | Type | Description |
|---|---|---|
sort_field | enum optional | Field you want to sort by. Possible values: amount, paid_at, created_at. |
sort_order | string optional | Sorting order, can either be asc or desc. |
limit | integer optional | Limit query result (when working with pagination). |
filters | array optional | An array of filter criteria where each entry has the following keys. |
filters[].field | enum | Field you want to filter by. Possible values: id, amount, provider_id, provider_transaction_id, status, paid_at, withdrawal_bank_account_id. |
filters[].value | string | The value to compare by. |
filters[].operator | string | Comparison operator (=: default, !=, >, <, =>, <=, is, is_not, in). |
Returns
Returns a paginated collection of withdrawal objects. If no withdrawals are found, returns an empty collection.
Request
Endpoint: https://api.youcanpay.com/withdrawalsMethod: GET
bash
$ curl --location -g --request GET 'https://api.youcanpay.com/withdrawals' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_TOKEN_eyJpc3...'Request with Filters
bash
$ curl --location -g --request GET 'https://api.youcanpay.com/withdrawals?sort_field=amount&sort_order=asc&filters[0][field]=amount&filters[0][value]=100' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_TOKEN_eyJpc3...'Response
json
{
"data": [
{
"id": "po83gh78a-e801-416b-p0db3-0c88bsh7mff6de",
"display_amount": {
"amount": "50000",
"currency": "MAD"
},
"status": 0,
"status_name": "pending",
"provider_id": 2,
"provider_name": "cashplus",
"paid_at": null,
"created_at": "2022-01-31 15:11:50"
},
{...}
],
"meta": {...}
}