SOFTPAY


Read all the sections in blue to better understand the documentation and the sections in orange signifying the alert in order to avoid mistakes to be made during the integrations and the detailed procedures for the integrations.

GENERATION OF API KEYS

API keys are your digital references towards PayDunya systems. We use them to identify your account and the applications you will create. These keys are necessary for any integration of the APIs of PayDunya's payments APIs. Here are the steps to follow:

  • First you need have a PayDunya Business account activated. Create one if it is not yet the case.
  • Login to your account and click on Integration API at the menu level on the left.
  • Click on the button Set up a new application and fill out the form.
  • Choose Test mode, I want to make payment tests and Enable production mode.

API integration


ENDPOINTS API LIVE

https://app.paydunya.com/api/v1/checkout-invoice/create


POST REQUEST HTTP


curl -H "Content-Type: application/json" \
-H "PAYDUNYA-MASTER-KEY: wQzk9ZwR-Qq9m-0hD0-zpud-je5coGC3FHKW" \
-H "PAYDUNYA-PRIVATE-KEY: live_private_rMIdJM3PLLhLjyArx9tF3VURAF5" \
-H "PAYDUNYA-TOKEN: IivOiOxGJuWhc5znlIiK" \
-X POST -d '{"invoice": {"total_amount": 5000, "description": "Chaussure VANS dernier modèle"},"store": {"name": "Magasin le Choco"}}' \
"https://app.paydunya.com/api/v1/checkout-invoice/create"

EXPECTED RESPONSE


{
    "response_code":"00",
    "response_text":"https://app.paydunya.com/checkout/invoice/ERtyuILouhhRHICF0HboN",
    "description":"Checkout Invoice Created",
    "token":"ERtyuILouhhRHICF0HboN"
}

1 - Complete JSON structure of the data to be sent


Here is presented below, the complete structure of the PayDunya invoicing JSON object. Most items are optional, but get in the habit of providing them all as it will give you much more flexibility. The required JSON nodes for submitting a bill payment HTTP POST request to our API Endpoints are: the root node invoice and its child node total_amount as well as the root node store and its child node name.


{
    "invoice": {
        "items": {},
        "taxes": {},
        "total_amount": 5000,
        "description": "",
        "store": {
                "name": "Magasin le Choco",
                "tagline": "",
                "postal_address": "",
                "phone": "",
                "logo_url": "",
                "website_url": ""
         },
        "custom_data": {},
        "actions": {
            "cancel_url": "",
            "return_url": "",
            "callback_url": ""
        }
      }
}

2 - Adding items to the PayDunya invoice


Refer to the full JSON structure to you know exactly where to insert the following structure. The "items" are used to display to the customer on the payment page the list of items he has ordered. Under no circumstances will PayDunya use any of the amounts declared in "items" to bill the customer.


{
    "items": {
        "item_0": {
            "name": "Chaussures Croco",
            "quantity": 3,
            "unit_price": "10000",
            "total_price": "30000",
            "description": "Chaussures faites en peau de crocrodile authentique qui chasse la pauvreté"
        },
        "item_1": {
            "name": "Chemise Glacée",
            "quantity": 1,
            "unit_price": "5000",
            "total_price": "5000",
            "description": ""
        }
}

3 - Add taxes (optional)


If you want to display on the PayDunya invoice the taxes you apply (TVA, delivery costs...) you can do so using the JSON node taxes as shown below.


"taxes": {
    "tax_0": {
        "name": "TVA (18%)",
        "amount": 6300
    },
    "tax_1": {
        "name": "Livraison",
        "amount": 1000
    }
}

4 - Adding custom data (optional)


If you need to add additional data (for example for a contest, you can save information about each winner) for later use, we offer you the possibility to save this data on our servers and to be able to get them back after successful payment.

{info.fa-lightbulb-o}


Exemple 1


"custom_data": {
    "categorie": "Jeu concours",
    "periode":  "Noël 2015",
    "numero_gagnant": 5,
    "prix" : "Bon de réduction de 50%"
}

Exemple 2


"custom_data": {
    "phone_brand": "Nokia",
    "IMEI": "72892821010728",
    "model": "Luna"
}

5 - IPN configuration (Instant Payment Notification)


It may be that for reasons x or y, that the payment confirmation is not instantaneous (for example the time that the customer types his secret code on his telephone or the latency time of the telephone network), the IPN allows you Instantly receive transaction information for payment confirmed, canceled or failed.

The IPN corresponds to the URL of a file on your server on which you wish to receive payment transaction information, this information is to be processed in the back office. PayDunya uses this URL to send you instantly, by request POST, payment transaction information.


"actions": {
    "callback_url": "http://www.magasin-le-choco.com/callback_url.php"
}

The successful validation of the payment transaction returns the structure below containing the information on the customer, the URL of his PayDunya invoice in PDF version and also a hash to verify that the data received does indeed come from our servers. Furthermore, it is essential to understand for information purposes that the payments canceled or Failed keep the same response format except the status value changes : for failed payments the status becomes failed and for payments cancelled becomes cancelled.


Expected Response:


array (
  'data' => 
    array (
     'response_code' => '00',
     'response_text' => 'Transaction Found',
     'hash' => '8c6666a27fe5daeb76dae6abc7308a557dca5be1bda85dfe5d81fa330cdc0bc3c4b37765fe5d2cc36aa2ba0f9284226a80f5488d14740fa70769d6079a179406',
     'invoice' => 
        array (
         'token' => 'test_jkEdPY8SuG',
         'items' => 
            array (
             'item_0' => 
                array (
                  'name' => 'Chaussures Croco',
                  'quantity' => '3',
                  'unit_price' => '10000',
                  'total_price' => '30000',
                  'description' => 'Chaussures faites en peau de crocrodile authentique qui chasse la pauvreté',
               ),
             'item_1' => 
                array (
                 'name' => 'Chemise Glacée',
                 'quantity' => '1',
                 'unit_price' => '5000',
                 'total_price' => '5000',
                 'description' => '',
               ),
           ),
          'taxes' => 
            array (
              'tax_0' => 
                array (
                  'name' => 'TVA (18%)',
                  'amount' => '6300',
               ),
              'tax_1' => 
                array (
                'name' => 'Livraison',
                'amount' => '1000',
              ),
      ),
      'token': 'test_Jh2T8skw1j',
      'total_amount' => '42300',
      'description' => 'Payment de 42300 FCFA pour article(s) achetés sur Magasin le Choco',
      ),
      'custom_data' => 
        array (
          'categorie' => 'Jeu concours',
          'periode' => 'Noël 2015',
          'numero_gagnant' => '5',
          'prix' => 'Bon de réduction de 50%',
        ),
      'actions' => 
        array (
          'cancel_url' => 'http://magasin-le-choco.com/cancel_url.aspx',
          'callback_url' => 'http://magasin-le-choco.com/callback_url.aspx',
          'return_url' => 'http://magasin-le-choco.com/return_url.aspx',
        ),
      'mode' => 'test',
      'status' => 'completed',
      'customer' => 
        array (
         'name' => 'Alioune Faye',
         'phone' => '774563209',
         'email' => '[email protected]',
        ),
      'receipt_url' => 'https://paydunya.com/sandbox-checkout/receipt/pdf/test_jkEdPY8SuG.pdf',
    ),
  )  

The hash returned by PayDunya is the hash of your MasterKey (main key). This hash will allow you to ensure that the data you have received comes from our servers. The algorithm used to obtain the hash is SHA-512. In the expected response, a failure message is entered in the node fail_reason only for transactions by card failed ou canc.

Payment by BANK CARD


  Alerte


The SOFTPAY API for bank card payments is only available to PCI-DSS certified companies. Activation is done on request.

BANK CARD API

https://app.paydunya.com/api/v1/softpay/card


REQUEST HTTP POST

{
  "full_name": "John Doe",
  "email": "[email protected]",
  "card_number": "1234567890123456",
  "card_cvv": "123",
  "card_expired_date_year": "25",
  "card_expired_date_month": "11",
  "token": "T3JgbeD3xHXoWtmqOktm"
}


Expected Response

{
  "success": true,
  "message": "Le paiement a été effectué avec succès.",
  "fees"   : 100, // Si c'est le payeur qui supporte les frais.
  "currency" : "XOF" // Si c'est le payeur qui supporte les frais.
}


Expected Response 3DS CARD CASE

{
  "success": true,
  "message": "Rediriger vers cette URL pour completer le paiement.",
  "url": "https://paydunya.com/card_3ds_redirect?key=eyJ0aHJlZURTU2VydmVyVHJhbnNJRCI6IjYwYmRjNmU0LWRjNjMtNDIxNy05OTU3LTVjZDc0M5zSUQiOiJmZjkxMzc1Mi0zOGRmLTRjZTYtYjM5Zi00MTg4MTE0OTg1ZWQiLCJjaGFsbGVuZ2VXaW5kb3dTaXplIjoiMDUiLCJtZXNzYWdlVHlwZSI6IkNSZXEiLCJtZXNzYWdlVmVyc2lvbiI6IjIuMS4wIn0&url=https://authentication.cardinalcommerce.com/ThreeDSecure/V2_1_0/CReq",
  "fees"   : 100, // Si c'est le payeur qui supporte les frais.
  "currency" : "XOF" // Si c'est le payeur qui supporte les frais.
}


Expected Failed Response

{
  "success": false,
    "message": "Transaction annulée ou Refus de paiement en lien avec votre établissement bancaire.",
    "errors": {
        "message": "Transaction annulée ou Refus de paiement en lien avec votre établissement bancaire.",
        "description": "Transaction annulée ou Refus de paiement en lien avec votre établissement bancaire."
  }
}

Payment by ORANGE MONEY SENEGAL

After generating the token, you must ask the end user to generate an Orange Money payment code by following the following USSD code:


#144#391*USER_ORANGE_MONEY_PIN_CODE#


ORANGE MONEY SENEGAL API

https://app.paydunya.com/api/v1/softpay/orange-money-senegal


REQUEST HTTP POST


{
  "customer_name": "Fallou",
  "customer_email": "[email protected]",
  "phone_number": "778676477",
  "authorization_code": "152347",
  "invoice_token": "GS46gkCAnRv3WfRwFdJU"
}
  • "customer_name": This is the name of the payer
  • "customer_email": This is the email of the payer
  • "phone_number": This is the payer phone number
  • "authorization_code":This is the USSD code generated by the payer
  • "invoice_token": This is the payment TOKEN generated above


Expected Response


{
  "success": true,
  "message": "Transaction éffectué avec succés"
  "fees"   : 100, // Si c'est le payeur qui supporte les frais.
  "currency": "XOF" // Si c'est le payeur qui supporte les frais.
}

Payment by FREE MONEY SENEGAL


FREE MONEY API

https://app.paydunya.com/api/v1/softpay/free-money-senegal


REQUEST HTTP POST


{
  "customer_name": "Fallou",
  "customer_email": "[email protected]",
  "phone_number": "768690999",
  "payment_token": "GS46gkCAnRv3WfRwFdJU"
}


Expected Response


{
  "success": true,
  "message": "Opération réussi, Veuillez tapez #150# pour finaliser votre paiement",
  "fees"   : 100, // Si c'est le payeur qui supporte les frais.
  "currency": "XOF" // Si c'est le payeur qui supporte les frais.

  "data": {
    "status": "PENDING",
    "amount": 200,
    "currency": "XOF",
    "customermsisdn": 768690999,
    "transactionid": "MP210921.1230.B04577",
    "externaltransactionid": "FM076_93108370"
  },
}

Payment by EXPRESSO SENEGAL


EXPRESSO API

https://app.paydunya.com/api/v1/softpay/expresso-senegal


REQUEST HTTP POST


{
  "expresso_sn_fullName": "Fallou",
  "expresso_sn_email": "[email protected]",
  "expresso_sn_phone": "705189525",
  "payment_token": "GS46gkCAnRv3WfRwFdJU"
}


Expected Response


{
  "success": true,
  "message": "Votre paiement est en cours de traitement. Merci de valider le paiement après reception de sms pour le compléter.",
  "fees"   : 100, // Si c'est le payeur qui supporte les frais.
  "currency": "XOF" // Si c'est le payeur qui supporte les frais.
}

Payment by WAVE SENEGAL


WAVE API

https://app.paydunya.com/api/v1/softpay/wave-senegal


REQUEST HTTP POST


{
  "wave_senegal_fullName": "Fallou",
  "wave_senegal_email": "[email protected]",
  "wave_senegal_phone": "777777777",
  "wave_senegal_payment_token": "OnW1IkMIQDTiJnQ9S3Ix"
}


Expected Response


{
  "success": true,
  "message": "Rediriger vers cette URL pour completer le paiement.",
  "url": "https://pay.wave.com/c/cos-1cj669hbr1350?a=200&c=XOF&m=JOE",
  "fees"   : 100, // Si c'est le payeur qui supporte les frais.
  "currency": "XOF" // Si c'est le payeur qui supporte les frais.
}

Payment by WIZALL SENEGAL


WIZALL API

https://app.paydunya.com/api/v1/softpay/wizall-money-senegal


REQUEST HTTP POST

{
  "customer_name": "John Doe",
  "customer_email": "[email protected]",
  "phone_number": "777777777",
  "invoice_token": "RAV6KK9Ncfy2a6vb3KDT"
}


Expected Response

{
    "success": true,
    "message": "Requête de paiement effectuée!",
    "data": {
        "Operation": "MerchantGetMoney",
        "TransactionID": "286513913",
        "details": {
            "message": "MerchantGetMoney Successful",
            "service": "merchant-get-money",
            "cid": "489eca906856e440e193ab19"
        }
    },
    "fees"   : 100, // Si c'est le payeur qui supporte les frais.
    "currency": "XOF" // Si c'est le payeur qui supporte les frais.
}


WIZALL API CONFIRM

https://app.paydunya.com/api/v1/softpay/wizall-money-senegal/confirm


REQUEST HTTP POST

{
  "authorization_code": "461050",
  "phone_number": "777777777",
  "transaction_id": "286513913"
}


Expected Response

{
  "success": true,
  "message": "Paiement réussi",
  "return_url": "https://www.paydunya.com/successful-payment",
  "token": "oeKyZGwexXkBk4uYyRoJ"
}

Payment by ORANGE MONEY CÔTE D'IVOIRE


After generating the token, you must ask the end user to generate an Orange Money payment code by following the following USSD code:

#144*82# + option 2 to generate an payment code


ORANGE MONEY CÔTE D'IVOIRE API

https://app.paydunya.com/api/v1/softpay/orange-money-ci


REQUEST HTTP POST

{
  "orange_money_ci_customer_fullname": "John Doe",
  "orange_money_ci_email": "[email protected]",
  "orange_money_ci_phone_number": "0777568646",
  "orange_money_ci_otp": "8562",
  "payment_token": "ljUZxD5T3RRxhpoOl66b"
}


Expected Response

{
    "success": true,
    "message": "Paiement effectué avec succès."
    "fees"   : 100, // Si c'est le payeur qui supporte les frais.
    "currency": "XOF" // Si c'est le payeur qui supporte les frais.
}

Payment by MTN CÔTE D'IVOIRE


MTN CÔTE D'IVOIRE API

https://app.paydunya.com/api/v1/softpay/mtn-ci


REQUEST HTTP POST


{
  "mtn_ci_customer_fullname": "Fallou",
  "mtn_ci_email": "[email protected]",
  "mtn_ci_phone_number": "664142312",
  "mtn_ci_wallet_provider": "MTNCI",
  "payment_token": "OnW1IkMIQDTiJnQ9S3Ix"
}


Expected Response


{
  "success": true,
  "message": "success message",
  "fees"   : 100, // Si c'est le payeur qui supporte les frais.
  "currency": "XOF" // Si c'est le payeur qui supporte les frais.
}

Payment by MOOV CÔTE D'IVOIRE


MOOV CÔTE D'IVOIRE API

https://app.paydunya.com/api/v1/softpay/moov-ci


REQUEST HTTP POST


{
    "moov_ci_customer_fullname": "Camille",
    "moov_ci_email": "[email protected]",
    "moov_ci_phone_number": "0153401679",
    "payment_token": "dzSNGqLCohvsFq9KlCmN"
}


Expected Response


{
    "success": true,
    "message": "Votre transaction a été validé avec succès.",
    "fees"   : 100, // Si c'est le payeur qui supporte les frais.
    "currency": "XOF" // Si c'est le payeur qui supporte les frais.
}

Note


When you make a payment by MOOV CI, a popup automatically opens on your phone with a field for entering your secret code for payment validation.

If the validation time exceeds 30 seconds , the API returns the response below:


Expected Response


{
    "success": false,
    "message": "Vous avez dépassé le délais de validation de la transaction."
}

Payment by WAVE CÔTE D'IVOIRE


WAVE CÔTE D'IVOIRE API

https://app.paydunya.com/api/v1/softpay/wave-ci


REQUEST HTTP POST


{
  "wave_ci_fullName": "Fallou",
  "wave_ci_email": "[email protected]",
  "wave_ci_phone": "777777777",
  "wave_ci_payment_token": "OnW1IkMIQDTiJnQ9S3Ix"
}


Expected Response


{
  "success": true,
  "message": "Rediriger vers cette URL pour completer le paiement.",
  "url": "https://pay.wave.com/c/cos-1cj669hbr1350?a=200&c=XOF&m=JOE",
  "fees"   : 100, // Si c'est le payeur qui supporte les frais.
  "currency": "XOF" // Si c'est le payeur qui supporte les frais.
}

Payment by ORANGE MONEY BURKINA FASO


ORANGE MONEY BURKINA FASO API

https://app.paydunya.com/api/v1/softpay/orange-money-burkina


REQUEST HTTP POST


{
  "name_bf": "Fallou",
  "email_bf": "[email protected]",
  "phone_bf": "76950976",
  "otp_code": "89525",
  "payment_token": "lLTs7h0tor82tchzvSec"
}


Expected Response


{
  "success": true,
  "message": "success message",
  "fees"   : 100, // Si c'est le payeur qui supporte les frais.
  "currency": "XOF" // Si c'est le payeur qui supporte les frais.
}

Payment by MOOV BURKINA FASO


MOOV BURKINA FASO API

https://app.paydunya.com/api/v1/softpay/moov-burkina


REQUEST HTTP POST


{
  "moov_burkina_faso_fullName": "Fallou",
  "moov_burkina_faso_email": "[email protected]",
  "moov_burkina_faso_phone_number": "51765664",
  "moov_burkina_faso_payment_token": "lLTs7h0tor82tchzvSec"
}


Expected Response


{
  "success": true,
  "message": "Veuillez compléter le paiement en composant le *555*6#.",
  "fees"   : 100, // Si c'est le payeur qui supporte les frais.
  "currency": "XOF" // Si c'est le payeur qui supporte les frais.
}

Payment by Moov BENIN


MOOV BENIN API

https://app.paydunya.com/api/v1/softpay/moov-benin


REQUEST HTTP POST


{
   "moov_benin_customer_fullname": "Camille",
   "moov_benin_email": "[email protected]",
   "moov_benin_phone_number": "0140253725",
   "payment_token": "lLTs7h0tor82tchzvSec"
}


Expected Response


{
  "success": true,
  "message": "Success message",
  "fees"   : 100, // Si c'est le payeur qui supporte les frais.
  "currency": "XOF" // Si c'est le payeur qui supporte les frais.
}

Payment by MTN BENIN


MTN BENIN API

https://app.paydunya.com/api/v1/softpay/mtn-benin


REQUEST HTTP POST


{
  "mtn_benin_customer_fullname": "Camille",
  "mtn_benin_email": "[email protected]",
  "mtn_benin_phone_number": "66414231",
  "mtn_benin_wallet_provider": "MTNBENIN",
  "payment_token": "lLTs7h0tor82tchzvSec"
}


Expected Response


{
  "success": true,
  "message": "Votre paiement est en cours de traitement. Merci de valider le paiement après reception de sms pour le compléter",
  "fees"   : 100, // Si c'est le payeur qui supporte les frais.
  "currency": "XOF" // Si c'est le payeur qui supporte les frais.
}

Payment by T-MONEY TOGO


T-MONEY API

https://app.paydunya.com/api/v1/softpay/t-money-togo


REQUEST HTTP POST


{
  "name_t_money": "Camille",
  "email_t_money": "[email protected]",
  "phone_t_money": "70707070","
  "payment_token": "lLTs7h0tor82tchzvSec"
}


Expected Response


{
  "success": true,
  "message": "Votre paiement est en cours de traitement. Merci de valider le paiement après reception de sms pour le compléter.",
  "fees"   : 100, // Si c'est le payeur qui supporte les frais.
  "currency": "XOF" // Si c'est le payeur qui supporte les frais.
}

Payment by MOOV TOGO


Moov Togo API

https://app.paydunya.com/api/v1/softpay/moov-togo


REQUEST HTTP POST

{
  "moov_togo_customer_fullname": "TEST",
  "moov_togo_email": "[email protected]",
  "moov_togo_customer_address": "DAKAR",
  "moov_togo_phone_number": "12345678",
  "payment_token": "ERtyuIrLouhhRHICF0HboN"
}


Expected Response

{
  "success": true,
  "message": "Transaction effectuée avec succès",
  "fees"   : 100, // Si c'est le payeur qui supporte les frais.
  "currency"   : "XOF" // Si c'est le payeur qui supporte les frais.
}

Payment by ORANGE MONEY MALI


ORANGE MONEY MALI API

https://app.paydunya.com/api/v1/softpay/orange-money-mali


REQUEST HTTP POST

{
    "orange_money_mali_customer_fullname": "Camille",
    "orange_money_mali_email": "[email protected]",
    "orange_money_mali_phone_number": "90239415",
    "orange_money_mali_customer_address" : "Bamako",
    "payment_token": "9MHW084mlDTpExGW8OY4",
    "orange_money_mali_wallet_otp" : "3333"
}


Expected Response

{
    "success": true,
    "message": "Paiement effectué avec succès.",
    "fees"   : 100, // Si c'est le payeur qui supporte les frais.
    "currency"   : "XOF" // Si c'est le payeur qui supporte les frais.
}

Payment by MOOV MALI


MOOV MALI API

https://app.paydunya.com/api/v1/softpay/moov-mali


REQUEST HTTP POST

{
  "moov_ml_customer_fullname": "John Doe",
  "moov_ml_email": "[email protected]",
  "moov_ml_phone_number": "90239415",
  "moov_ml_customer_address" : "Bamako",
  "payment_token": "6KIFXkAiAU70uuam5Dix"
}


Expected Response

{
    "success": true,
    "message": "Merci de finaliser le paiement sur votre téléphone.",
    "fees"   : 100, // Si c'est le payeur qui supporte les frais.
    "currency"   : "XOF" // Si c'est le payeur qui supporte les frais.
}

Payment by PAYDUNYA


PAYDUNYA API

https://app.paydunya.com/api/v1/softpay/paydunya


REQUEST HTTP POST


{
  "customer_name": "John Doe",
  "customer_email": "[email protected]",
  "phone_phone": "77777777",
  "password": "12345678",
  "invoice_token": "lLTs7h0tor82tchzvSec"
}


Expected Response


{
  "success": true,
  "message": "Success message",
  "fees"   : 100, // Si c'est le payeur qui supporte les frais.
  "currency": "XOF" // Si c'est le payeur qui supporte les frais.
}