Skip to content

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

ParameterTypeDescription
sort_fieldenum optionalField you want to sort by. Accepted values: amount, created_at.
sort_orderstring optionalSorting order, can either be asc or desc.
limitinteger optionalLimit query result (when working with pagination).
filtersarray optionalAn array of filter criteria where each entry has the following keys.
filters[].fieldenumField you want to filter by. Accepted values: id, amount, currency, sender_id, recipient_id, created_at.
filters[].valuestringThe value to compare by.
filters[].operatorstringComparison 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": {...}
}