API PUSH

  OBLIGATOIRE


After having followed the steps found in the section introduction, you can then integrate this API Client.


INTRODUCTION


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 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".

 Note



For "PayDunya account", you simply must not use the key JSON" withdraw_mode".

IMPORTANT



Make sure that the PER API or disbursement is activated in your dashboard at API WebPay and MobPay level. your dashboard

1 - Initiate Disbursement

Note


  • account_alias : is the receiver phone number without country code.

  • amount : is the amount to disburse in XOF.

  • withdraw_mode : with have different types of withdraw mode mentioned below :

    • orange-money-senegal : for orange money Sénégal wallet

    • free-money-senegal : for free money Sénégal wallet.

    • expresso-senegal : for e-money Sénégal wallet.

    • wave-senegal : for wave Sénégal wallet.

    • mtn-benin : for mtn Bénin wallet.

    • moov-benin : for Moov Bénin wallet.

    • mtn-ci : for mtn Ivory Coast wallet.

    • orange-money-ci : for Orange Money Ivory Coast wallet.

    • moov-ci : for moov Ivory Coast wallet.

    • wave-ci : for wave Ivory Coast wallet.

    • t-money-togo : for T-Money Togo wallet.

    • orange-money-mali : for Orange Money Mali wallet.

Endpoints API

https://app.paydunya.com/api/v1/disburse/get-invoice

Request POST HTTP


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/disburse/get-invoice" 

 Note



“account_alias” and “amount” are mandatory. For Free money and E money Wallet just change with the corresponding “withdraw_mode” value. “amount” must not be a decimal value and the supported currency is XOF, “account_alias” must be a phone number without a country code.


Expected response


{ 
    "response_code": "00",
    "disburse_token": "hwTHAS0WvTmTaYT2zDoO"
} 

1-2 - PAYDUNYA CASE


Endpoints API

https://app.paydunya.com/api/v1/disburse/get-invoice

Request POST HTTP


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}' \
"https://app.paydunya.com/api/v1/disburse/get-invoice"

Expected response


{ 
    "response_code": "00",
    "disburse_token": "hwTHAS0WvTmTaYT2zDoO"
} 

2 - SUBMIT DISBURSEMENT

Note


disburse_id is your own transaction reference number, it is optional. If you don’t have this just post the request with only disburse_invoice (required) as input parameter.

Endpoints API

https://app.paydunya.com/api/v1/disburse/submit-invoice

Request POST HTTP


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 ' {"disburse_invoice": "hwTHAS0WvTmTaYT2zDoO ", " disburse_id ": "456678900309" }' \ 
"https://app.paydunya.com/api/v1/disburse/submit-invoice"

Expected response For PayDunya


{ 
    "response_code": "00",
    "response_text": "Transaction completed successfully",
    "description": " Success! PayDunya withdrawal code corresponding to an amount of 4500 FCFA has been transfered to Christopher Jean. Phone number: 771111111",
    "transaction_id": "TFA-TX-37XqPpVCjU7ReiycUg97"
} 


Expected response For Orange Money


{ 
    "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"
} 


Expected response For Free Money


{ 
    "response_code": "00",
    "response_text": "Transaction completed successfully",
    "description": "Success! Amount of 4500 FCFA has been transfered to Free-Money Account 761111111",
    "transaction_id": "TFA-TX-37XqPpVCjU7ReiycUg97", 
    "provider_ref": "565486545315"
}
OR
{ 
    "response_code": "00",
    "response_text": "Transaction pending",
    "description": "Transaction pending, please check the final status later through our status API or contact our customer care",
    "transaction_id": "TFA-TX-37XqPpVCjU7ReiycUg97", 
    "provider_ref": null
}  

Expected response For E MONEY SENEGAL


{ 
    "response_code": "00", 
    "response_text": "Transaction completed successfully"", 
    "description": "Success! Amount of 4500 FCFA has been transfered to E Money Account 0588118811", 
    "transaction_id": "TFA-TX-37XqPpVCjU7ReiycUg97", 
    "provider_ref": "565486545315" 
} 


Expected response For WAVE SENEGAL


{
    "response_code": "00",
    "response_text": "Transaction completed successfully",
    "description": "Success! Amount of 4500 FCFA has been transfered to Wave Account 777777777",
    "transaction_id": "TFA-TX-0sks0bagCMQkZ0SG91nc",
    "provider_ref": "pt-67Ggh7zgm013syghghjkhgjh"
}


Expected response For MTN MOMO BENIN


{ 
    "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" 
} 


Expected response For Moov Bénin


{
    "response_code": "00",
    "response_text": "Transaction completed successfully",
    "description": "Success! Amount of 200.00 FCFA has been transfered to MOOV BJ Account 95920904",
    "transaction_id": "TFA-TX-E36T8kfja2cpR00CKuVq",
    "provider_ref": "920230224297772"
}

Expected response For MTN MOMO IVORY COAST


{ 
    "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" 
} 


Expected response For Orange Money Côte d'ivoire

{ 
    "response_code": "00",
    "response_text": "Transaction completed successfully",
    "description": "Success! Amount of 4500 FCFA has been transfered to Orange Money CI Account 771111111",
    "transaction_id": "TFA-TX-37XqPpVCjU7ReiycUg97", 
    "provider_ref": "565486545315"
} 


Expected response For Moov Côte d'ivoire

=======

Expected response For Moov IVORY COAST

>>>>>>> master

{ 
    "response_code": "00",
    "response_text": "Transaction completed successfully",
    "description": "Success! Amount of 4500 FCFA has been transfered to Moov CI Account 771111111",
    "transaction_id": "TFA-TX-37XqPpVCjU7ReiycUg97", 
    "provider_ref": "565486545315"
} 


Expected response For WAVE IVORY COAST


{
    "response_code": "00",
    "response_text": "Transaction completed successfully",
    "description": "Success! Amount of 4500 FCFA has been transfered to Wave Account 777777777",
    "transaction_id": "TFA-TX-0sks0bagCMQkZ0SG91nc",
    "provider_ref": "pt-67Ggh7zgm013syghghjkhgjh"
}


Expected response For T-Money Togo


{ 
    "response_code": "00",
    "response_text": "Transaction completed successfully",
    "description": "Success! Amount of 4500 FCFA has been transfered to T-money Account 771111111",
    "transaction_id": "TFA-TX-37XqPpVCjU7ReiycUg97", 
    "provider_ref": "565486545315"
} 


Expected response For Orange Money Mali


{
   'response_text'  => 'PENDING',
   'description'    => 'Transaction in pending'
}

3 - CHECK DISBURSE STATUS


Endpoints API

https://app.paydunya.com/api/v1/disburse/check-status

Request POST HTTP


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 ' {"disburse_invoice": "hwTHAS0WvTmTaYT2zDoO"}' \ 
"https://app.paydunya.com/api/v1/disburse/check-status"

EXPECTED RESPONSE


{ 
   "status": "success",
   "token": "hwTHAS0WvTmTaYT2zDoO",
   "withdraw_mode": "orange-money-senegal",
   "amount": "4500",
   "updated_at": "20/04/2020 15:57"
} 

4 - Response codes


  • 1001

    Withdrawal mode not supported


    
    {
        "response_code": "1001", 
        "response_text": 
        " Withdrawal mode not supported!"   
    }
    
    
  • 4002

    Not enough funds in the PayDunya sender's account


    
    {
        "response_code": "4002", 
        "response_text": " You don't have enough funds. Consider crediting your account", 
    }
    
    
  • 4003

    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." 
    }