Skip to content

Create a Withdrawal

Request a withdrawal via your method of choice by providing the desired amount.

Parameters

ParameterTypeDescription
payment_methodstring requiredYour preferred withdrawal method. Can either be bank_account or cashplus.
amountinteger requiredThe amount you wish to withdraw. Note that this amount should be more than 100 MAD and can't be greater than your account balance.
withdrawal_bank_account_idstring optionalID of the bank account the withdrawal should process to. This is only required if payment_method was set to bank_account.

Returns

Returns a message in case the withdrawal was requested successfully or if it failed.

Request

Endpoint: https://api.youcanpay.com/withdrawalsMethod: POST

bash
$ curl --location --request POST 'https://api.youcanpay.com/withdrawals' \
  --form 'payment_method="bank_account"' \
  --form 'amount="500"' \
  --form 'withdrawal_bank_account_id="hj753opsj71-4164-4072-pl209-70740485bc6d"' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_TOKEN_eyJpc3...'

Response

json
{
  "message": "Withdrawal requested successfully"
}