List All Transfers
Returns a paginated list of transfer objects related to the current authenticated account. The list is sorted, with the most recent transfers appearing first by default.
Endpoint: https://youcanpay.com/api/transfers
Method: GET
Parameters
| Parameter | Type | Description |
|---|---|---|
sort_field | enum optional | Field you want to sort by. Accepted values: amount, 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. Accepted values: id, amount, currency, sender_id, recipient_id, created_at. |
filters[].value | string | The value to compare by. |
filters[].operator | string | Comparison operator (=: default, !=, >, <, =>, <=, is, is_not, in). |
Returns
Returns a paginated collection of transfer objects. If no transfers are found, returns an empty collection.
Request
bash
$ curl --location -g --request GET 'https://youcanpay.com/api/transfers' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_TOKEN_eyJpc3...'Request with Filters
bash
$ curl --location -g --request GET 'https://youcanpay.com/api/transfers?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": "0595c470-e87a-48ec-bcd6-c70d17f370ac",
"display_amount": "MAD 5.00",
"message": null,
"is_incoming": false,
"created_at": "2021-12-10 14:23:58",
"transceiver": {
"data": {
"id": "635bbef8-6468-4d59-894a-501fdba4863b",
"first_name": "YouCan",
"last_name": "YouCan",
"phone": "0676461601",
"email": "payment@youcan.shop",
"type": 2,
"type_text": "BUSINESS"
}
}
},
{...}
],
"meta": {...}
}