API PUSH

  MANDATORY


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 make disbursements to your customers in several ways, namely through ORANGE MONEY PURSE, the PayDunya account and many others. For this you will need four 04 keys in the format JSON .


The four 04 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".

  • "callback_url"

    This is the URL where the transaction details will be returned once the transaction is successful. "The URL must be a Valid URL otherwise the transaction will not be authorized"

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 :

    • paydunya : for account to account

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

    • moov-togo : for Moov Togo wallet.

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

    • orange-money-burkina : for Orange Money Burkina wallet.

  • callback_url : This is the URL where the transaction details will be returned once the transaction is successful. The URL must be a Valid URL otherwise the transaction will not be authorized


Example of information received on the callback :

{
    "status":"success",
    "token":"xZsV7x488d2yGCrJd2R ",
    "withdraw_mode":"orange-money-senegal",
    "amount":"203.00",
    "updated_at":"11/01/2024 14:30:32",
    "disburse_id": "78112205445565",
    "transaction_id":"TFA-TX-N458MPjhA1npWbI6M",
    "disburse_tx_id":"CI000111.1430.A11197"
}

 Note



The disburse_id will only appear if the merchant provides it when submitting invoice.

Endpoints API

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

 Note



“account_alias”, “amount” and “callback_url” 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.


Note


A fourth status has been added. This is the status « created ». When a token is generated the status of the transaction is « created ». The status only changes if you push via the Submit Invoice API after which the 3 possible status are therefore : pending, success, failed.


Expected response


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

1-2 - PAYDUNYA CASE


Endpoints API

https://app.paydunya.com/api/v2/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, "withdraw_mode" : 
"paydunya", "callback_url": "your_callback_url"}' \
"https://app.paydunya.com/api/v2/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.


Détails


  • The different status :

    • success
    • pending
    • failed

Endpoints API

https://app.paydunya.com/api/v2/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/v2/disburse/submit-invoice"

Expected response For PayDunya


{ 
    "response_code": "00",
    "response_text": "Transaction completed successfully",
    "description": " Success! Amount of 200.00 FCFA has been transfered to to Christopher Jean Account 707006948",
    "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",
    "status": "pending",
    "response_text": "Transaction pending",
    "description": "Transaction pending, please check the final status later through our status API",
    "transaction_id": "TFA-TX-37XqPpVCjU7ReiycUg97"
}  

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 IVORY COAST


{ 
    "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 IVORY COAST


{ 
    "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 Moov Togo


{ 
    "response_code": "00",
    "response_text": "Transaction completed successfully",
    "description": "Success! Amount of 4500 FCFA has been transfered to MOOV-TOGO Account 98010101",
    "transaction_id": "TFA-TX-37XqPpVCjU7ReiycUg97", 
    "provider_ref": "24020605401685281675"
} 


Expected response For Orange Money Mali


{
    "response_code": "00",
    "status": "pending",
    "response_text": "Transaction pending",
    "description": "Transaction pending, please check the final status later through our status API",
    "transaction_id": "TFA-TX-37XqPpVCjU7ReiycUg97"
}

Expected SUCCESS RESPONSE For Orange Money Burkina


{
    "response_code": "00",
    "response_text": "Transaction completed successfully",
    "description": "Success! Amount of 200 FCFA has been transfered to   Orange Money Burkina 66123421",
    "transaction_id": "TFA-TX-37XqPpjCjU7ReiycUg97", 
    "provider_ref": "565486545315"
}

Expected PENDING RESPONSE For Orange Money Burkina


{
    "response_code": "00",
    "status": "pending",
    "response_text": "Transaction pending",
    "description": "Transaction pending, please check the final status later through our status API",
    "transaction_id": "TFA-TX-37XqPpVCjU7ReiycUg97"
}

3 - CHECK DISBURSE STATUS


Endpoints API

https://app.paydunya.com/api/v2/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/v2/disburse/check-status"

EXPECTED RESPONSE


{ 
    "response_code": "00",
    "status": "success",
    "token": " xZsV7x488d2yGCrJd2R ",
    "withdraw_mode": "orange-money-senegal", 
    "amount": "203.00",
    "updated_at": "11/01/2024 14:30:35", 
    "disburse_id": "78112205445565",
    "transaction_id": "TFA-TX-NiP89775sdXKA1npWbI6M", 
    "disburse_tx_id": " CI000111.1430.A11197"
} 

 Note



The disburse_id will only appear if the merchant provides it when submitting invoice.

Détails


  • The different status :

    • created
    • success
    • pending
    • failed

4 - RESPONSE CODES


  • HTTP Status 400

    response in case of data validation errors sent via an API


    
    {
        "response_code": ['1001', '5000'], 
        "response_text": text  
    }
    
    
  • 1001

    withdraw_mode non pris en charge.

  • 5000

    Service en maintenance, veuillez réessayer plus tard.


  • HTTP Status 200

    -GET INVOICE

    
    {
        "response_code": ['401', '4002', '5000'], 
        "response_text": text  
    }
    
    
  • 401

    -Initiation not authorize

  • 4002

    -You don't have enough funds. Consider crediting your account

    -the callback is not accessible

  • 5000

    -An error occured from our side. Please retry later.

    -disburse_id already used.


    -SUBMIT INVOICE

    
    {
        "response_code": "5000", 
        "response_text": text  
    }
    
    
  • 5000

    -An error occured from our side. Please retry later.

    -disburse_id already used.