Skip to content

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

ParameterTypeDescription
sort_fieldenum optionalField you want to sort by. Possible values: amount, paid_at, 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. Possible values: id, amount, provider_id, provider_transaction_id, status, paid_at, withdrawal_bank_account_id.
filters[].valuestringThe value to compare by.
filters[].operatorstringComparison 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": {...}
}