Skip to content

The Withdrawal Object

Attributes

ParameterTypeDescription
idstringThe object's unique identifier.
display_amountobjectWithdrawal amount object, containing value and currency.
display_amount.amountintegerThe withdrawal amount value.
display_amount.currencystringThe currency code.
statusenumStatus of the withdrawal. Possible values: -3 (Failed), -2 (Canceled), -1 (Pending cancellation), 0 (Pending), 1 (Processing), 2 (Completed).
status_nameenumThe status in text format. Possible values: failed, canceled, pending cancellation, pending, processing, completed.
provider_idenumID of the gateway used for the withdrawal. Possible values: 1 (bank account), 2 (CashPlus).
provider_nameenumName of the provider bound to the ID. Possible values: bank_account, cashplus.
paid_attimestampThe withdrawal date. null if not processed yet.
created_attimestampTimestamp when the withdrawal was first requested.

Request

Endpoint: https://api.youcanpay.com/withdrawals/{withdrawal_id}Method: GET

bash
$ curl --location -g --request GET 'https://api.youcanpay.com/withdrawals/756e502e-d363-42f1-85f0-0b6b43f4d486' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_TOKEN_eyJpc3...'

Response

json
{
  "id": "io420po0969-e801-416b-8fe3-0c88f3fff6de",
  "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"
}