Skip to content

The Withdrawal Object

Required scope: view-withdrawals

Attributes

ParameterTypeDescription
objectstringAlways v2.withdrawal.
idstringThe object's unique identifier.
processorstringOne of bank_account, cashplus, chari_money.
statusstringOne of pending, processing, completed, canceled, failed.
amountobject|nullThe withdrawal amount, as a money object.
feeobject|nullThe fee charged on the withdrawal, as a money object.
is_paidbooleanWhether the withdrawal has been paid out.
rejection_reasonstring|nullWhy the withdrawal was rejected.
metadataobjectArbitrary metadata attached to the withdrawal.
bank_account_idstring|nullID of the destination bank account.
approved_atstring|nullWhen the withdrawal was approved.
created_atstring|nullWhen the withdrawal was first requested.

Includes

Pass ?include=bank_account on the details endpoint below to embed the related bank account under a bank_account key. Only populated when processor is bank_account or chari_money. Not supported on the list endpoint.

The Bank Account Object

ParameterTypeDescription
objectstringAlways v2.bank_account.
idstringThe object's unique identifier.
numberstringThe bank account's RIB.
namestring|nullThe bank account's label.
defaultbooleanWhether this is the account's default bank account.
created_atstring|nullDate and time the bank account was added.

Request

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

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

Response

json
{
  "object": "v2.withdrawal",
  "id": "756e502e-d363-42f1-85f0-0b6b43f4d486",
  "processor": "cashplus",
  "status": "pending",
  "amount": {
    "amount": "500.00",
    "currency": "MAD",
    "localized": "MAD 500.00"
  },
  "fee": {
    "amount": "10.00",
    "currency": "MAD",
    "localized": "MAD 10.00"
  },
  "is_paid": false,
  "rejection_reason": null,
  "metadata": [],
  "bank_account_id": null,
  "approved_at": null,
  "created_at": "2024-01-31 15:11:50"
}