After having followed the steps found in the section introduction, you can then integrate this API Client
.
To make a withdrawal you needed your API keys in your PayDunya account. So log into your PayDunya account already
created and access your API keys
by the link details
just to the right of the app you created.
So you can withdraw your customers in several ways, namely by ORANGE MONEY PURSE
, CASHPOINT-WARI
and by the account PayDunya
. For this you will need three 03 keys
in the format JSON
.
The three 03 JSON keys
to have are as follows :
"account_alias"
:
Is the recipient's phone number without a country code.
"amount"
Is the amount to be spent inXOF
"withdraw_mode"
Defines the withdrawal endpoint: "orange-money-senegal"
for "Orange Money wallet"
; " wari "
for "cashpoints"
For "PayDunya account"
, you simply must not use the key JSON "withdraw_mode"
.
Make sure that the PER API or disbursement is activated
in your dashboard at API WebPay and MobPay level. your dashboard
https://app.paydunya.com/api/v1/direct-pay/credit-account
curl -H "Content-Type: application/json" \
-H "PAYDUNYA-MASTER-KEY: wQzk9ZwR-Qq9m-0hD0-zpud-je5coGC3FHKW" \
-H "PAYDUNYA-PRIVATE-KEY: test_private_rMIdJM3PLLhLjyArx9tF3VURAF5" \
-H "PAYDUNYA-TOKEN: IivOiOxGJuWhc5znlIiK" \
-X POST -d ' { "account_alias" : "771111111", "amount" : 4500, "withdraw_mode" :
"orange-money-senegal" }' \
"https://app.paydunya.com/api/v1/direct-pay/credit-account "
“account_alias”
and “amount”
are mandatory. If you do not use “withdraw_mode”
the withdrawal will be made to the PayDunya customer account.
“amount”
must not be a decimal value and the supported currency is XOF, “account_alias”
must be a phone number without a country code.
{
"response_code": "00",
"response_text": "Transaction completed successfully"",
"description": "Success! Amount of 4500 FCFA has been transfered to Orange Money Account 771111111",
"transaction_id": "TFA-TX-37XqPpVCjU7ReiycUg97",
"provider_ref": "565486545315"
}
"transaction_id"
is the PayDunya transaction ID, "provider_ref"
the transaction reference for the provider.
https://app.paydunya.com/api/v1/direct-pay/credit-account
curl -H "Content-Type: application/json" \
-H "PAYDUNYA-MASTER-KEY: wQzk9ZwR-Qq9m-0hD0-zpud-je5coGC3FHKW" \
-H "PAYDUNYA-PRIVATE-KEY: test_private_rMIdJM3PLLhLjyArx9tF3VURAF5" \
-H "PAYDUNYA-TOKEN: IivOiOxGJuWhc5znlIiK" \
-X POST -d ' { "account_alias" : "765962914", "amount" : 4500, "withdraw_mode" :
"free-money-senegal" }' \
"https://app.paydunya.com/api/v1/direct-pay/credit-account "
“account_alias”
and “amount”
are mandatory. If you do not use “withdraw_mode”
the withdrawal will be made to the PayDunya customer account.
“amount”
must not be a decimal value and the supported currency is XOF, “account_alias”
must be a phone number without a country code.
{
"response_code": "00",
"response_text": "Transaction completed successfully"",
"description": "Success! Amount of 4500 FCFA has been transfered to Free-Money Account 765962914",
"transaction_id": "TFA-TX-37XqPpVCjU7ReiycUg97",
"provider_ref": "CI191223.1739.AC185"
}
"transaction_id"
is the PayDunya transaction ID, "provider_ref"
the transaction reference for the provider.
https://app.paydunya.com/api/v1/direct-pay/credit-account
curl -H "Content-Type: application/json" \
-H "PAYDUNYA-MASTER-KEY: wQzk9ZwR-Qq9m-0hD0-zpud-je5coGC3FHKW" \
-H "PAYDUNYA-PRIVATE-KEY: test_private_rMIdJM3PLLhLjyArx9tF3VURAF5" \
-H "PAYDUNYA-TOKEN: IivOiOxGJuWhc5znlIiK" \
-X POST -d ' { "account_alias" : "705962914", "amount" : 4500, "withdraw_mode" :
"expresso-senegal" }' \
"https://app.paydunya.com/api/v1/direct-pay/credit-account "
“account_alias”
and “amount”
are mandatory. If you do not use “withdraw_mode”
the withdrawal will be made to the PayDunya customer account.
“amount”
must not be a decimal value and the supported currency is XOF, “account_alias”
must be a phone number without a country code.
{
"response_code": "00",
"response_text": "Transaction completed successfully"",
"description": "Success! Amount of 4500 FCFA has been transfered to E-Money
Account 705962914",
"transaction_id": "TFA-TX-37XqPpVCjU7ReiycUg97",
"provider_ref": "12345678998765"
}
"transaction_id"
is the PayDunya transaction ID, "provider_ref"
the transaction reference for the provider.
If you use "wari"
as "withdraw_mode"
, you must fill in an additional json node:
"receiver_data"
a (02) child nodes: "first-name"
and "last_name"
.
"sender_data"
a (03) child nodes: "first-name"
, "last_name"
and "phone_number"
. The "phone_number" is the phone number with the country code (for example 22177888965).
https://app.paydunya.com/api/v1/direct-pay/credit-account
curl -H "Content-Type: application/json" \
-H "PAYDUNYA-MASTER-KEY: wQzk9ZwR-Qq9m-0hD0-zpud-je5coGC3FHKW" \
-H "PAYDUNYA-PRIVATE-KEY: test_private_KEY: test_private_rMIdJM3PLLhLjyArx9tF3VURAF5" \
-H "PAYDUNYA-TOKEN: IivOiOxGJuWhc5znlIiK" \
-X POST -d '{
"account_alias" : "771111111",
"amount" : 4500,
"withdraw_mode" : "wari",
"receiver_data": {
"first_name":"Christopher",
"last_name":"Jean"
},
"sender_data": {
"first_name":"Aziz",
"last_name":"Mamadou",
"phone_number":"221774441046"
}
}' \
"https://app.paydunya.com/api/v1/direct-pay/credit-account "
{
"response_code": "00",
"response_text": "Transaction completed successfully",
"description": " Success! Wari withdrawal code corresponding to an amount of 4500 FCFA has been transfered to Christopher Jean. Phone number: 771111111",
"transaction_id": "TFA-TX-37XqPpVCjU7ReiycUg97",
"provider_ref": "956548654",
"provider_tx_id": "545665445"
}
"transaction_id"
is the PayDunya transaction ID. In the case of an ATM, "provider_ref"
is the withdrawal code (ie the withdrawal code sent to the client). "provider_tx_id"
is the transaction ID of the provider.
It is "provider_tx_id"
which is used to check the status of the withdrawal code.
You must provide "provider_tx_id"
generated after creating the pickup code. The supplier name is "wari"
.
https://app.paydunya.com/api/v1/direct-pay/check-disburse-status
curl -H "Content-Type: application/json" \
-H "PAYDUNYA-MASTER-KEY: wQzk9ZwR-Qq9m-0hD0-zpud-je5coGC3FHKW" \
-H "PAYDUNYA-PRIVATE-KEY: test_private_rMIdJM3PLLhLjyArx9tF3VURAF5" \
-H "PAYDUNYA-TOKEN: IivOiOxGJuWhc5znlIiK" \
-X POST -d ' {
"provider" : "wari",
"provider_tx_id" : "545665445"
}' \
" http://paydunya.core/api/v1/direct-pay/check-disburse-status "
{
"response_code": "00",
"response_text": "success",
"withdrawal_data": {
"status": "payed",
"message": "Transaction status is payed",
"payed_date": "2019/04/19 11:57:14"
}
}
"response_code"
to 00
means that the request was successful.
“withdrawal_data”
the node will provide you with the final withdrawal with a child node “Status”
. The different statuses are "paid"
, pending
and cancel
. You also have payed_date
for the withdrawal date.
You must provide "provider_tx_id"
and “transaction_id”
generated after the creation of the collection code. The supplier name is "wari"
.
https://app.paydunya.com/api/v1/direct-pay/refund-disburse
curl -H "Content-Type: application/json" \
-H "PAYDUNYA-MASTER-KEY: wQzk9ZwR-Qq9m-0hD0-zpud-je5coGC3FHKW" \
-H "PAYDUNYA-PRIVATE-KEY: test_private_rMIdJM3PLLhLjyArx9tF3VURAF5" \
-H "PAYDUNYA-TOKEN: IivOiOxGJuWhc5znlIiK" \
-X POST -d ' {
"provider" : "wari",
"provider_tx_id" : "545665445",
"transaction_id": "TFA-TX-xx9qRr5rsYRCZTYXhBry"
}' \
" http://paydunya.core/api/v1/direct-pay/refund-disburse "
{
"response_code": "00",
"response_text": "success",
"refund_data": {
"code_pickup_amount": 200,
"refund_amount": 203
}
}
"response_code"
to 00
means that the request was successful.
"refund_amount"
for the refund of the amount on your PayDunya account.
You must provide "provider_tx_id"
and “transaction_id”
generated after the creation of the collection code. The supplier name is "wari"
.
https://app.paydunya.com/api/v1/direct-pay/update-disburse
curl -H "Content-Type: application/json" \
-H "PAYDUNYA-MASTER-KEY: wQzk9ZwR-Qq9m-0hD0-zpud-je5coGC3FHKW" \
-H "PAYDUNYA-PRIVATE-KEY: test_private_rMIdJM3PLLhLjyArx9tF3VURAF5" \
-H "PAYDUNYA-TOKEN: IivOiOxGJuWhc5znlIiK" \
-X POST -d '{
"provider": "wari",
"provider_tx_id": "545665445",
"transaction_id": "TFA-TX-xx9qRr5rsYRCZTYXhBry",
"receiver_data": {
"first_name":"Esther",
"last_name":"Goyette"
},
"sender_data": {
"first_name":"Hector",
"last_name":"Salvador",
"phone_number":"221771911477"
}
}'
"http://paydunya.core/api/v1/direct-pay/update-disburse"
{
"response_code": "00",
"response_text": "success",
"response_data": {
"date": "2019/04/19 11:57:14"
}
}
"response_code"
to 00
means that the request was successful.
"response_data"
is the update date.
https://app.paydunya.com/api/v1/direct-pay/credit-account
curl -H "Content-Type: application/json" \
-H "PAYDUNYA-MASTER-KEY: wQzk9ZwR-Qq9m-0hD0-zpud-je5coGC3FHKW" \
-H "PAYDUNYA-PRIVATE-KEY: test_private_rMIdJM3PLLhLjyArx9tF3VURAF5" \
-H "PAYDUNYA-TOKEN: IivOiOxGJuWhc5znlIiK" \
-X POST -d ' { "account_alias" : "0588118811", "amount" : 4500, "withdraw_mode" :
"mtn-ci" }' \
"https://app.paydunya.com/api/v1/direct-pay/credit-account "
“account_alias”
and “amount”
are mandatory. If you do not use “withdraw_mode”
the withdrawal will be made to the PayDunya customer account.
“amount”
must not be a decimal value and the supported currency is XOF, “account_alias”
must be a phone number without a country code.
{
"response_code": "00",
"response_text": "Transaction completed successfully"",
"description": "Success! Amount of 4500 FCFA has been transfered to Mtn Money Account 0588118811",
"transaction_id": "TFA-TX-37XqPpVCjU7ReiycUg97",
"provider_ref": "565486545315"
}
"transaction_id"
is the PayDunya transaction ID, "provider_ref"
the transaction reference for the provider.
https://app.paydunya.com/api/v1/direct-pay/credit-account
curl -H "Content-Type: application/json" \
-H "PAYDUNYA-MASTER-KEY: wQzk9ZwR-Qq9m-0hD0-zpud-je5coGC3FHKW" \
-H "PAYDUNYA-PRIVATE-KEY: test_private_rMIdJM3PLLhLjyArx9tF3VURAF5" \
-H "PAYDUNYA-TOKEN: IivOiOxGJuWhc5znlIiK" \
-X POST -d ' { "account_alias" : "777969818", "amount" : 4500, "withdraw_mode" :
"airtime" , "operator" : "ORANGE" }' \
"https://app.paydunya.com/api/v1/direct-pay/credit-account"
“operator”
maybe evening :
“account_alias”
and “amount”
are mandatory. If you do not use “withdraw_mode”
the withdrawal will be made to the PayDunya customer account.
“amount”
must not be a decimal value and the supported currency is XOF, “account_alias”
must be a phone number without a country code.
{
"response_code": "00",
"response_text": "Transaction completed successfully"",
"description": "Success! Amount of 4500 FCFA has been transfered to Phone Number 777969818",
"transaction_id": "TFA-TX-37XqPpVCjU7ReiycUg97",
"provider_ref": "565486"
}
"transaction_id"
is the PayDunya transaction ID, "provider_ref"
the transaction reference for the provider.
Withdrawal mode not supported
{
"response_code": "1001",
"response_text":
" Withdrawal mode not supported!"
}
Not enough funds in the PayDunya sender's account
{
"response_code": "4002",
"response_text": " You don't have enough funds. Consider crediting your account",
}
The minimum amount is greater than the amount to be withdrawn
{
"response_code": "4003",
"response_text": " Deposit failed! The amount must be greater than 200 FCFA."
}