Api of paiement
Initialization

Payment Initialization

API Url

Submit all requests to the API URL. All requests are submitted via the HTTP POST method in JSON format.

https://payin.api-v2.paynah.com/v2/intents

How to Generate a Payment Link

In the header, you will need to send the following parameters:

Header ParameterTypeSizeMandatoryValue
x-api-keyString-YesYour apikey (provided by Paynah)
x-api-secretString-YesYour apisecret (provided by Paynah)

In your request body, you will need to specify the following values:

Variable NameTypeSizeMandatoryDescription
transaction_idString-YesTransaction identification (Provide a unique identifier)
amountInteger-YesThe transaction amount (must be a multiple of 5)
currencyString3YesThe currency (XOF)
descriptionString-YesDescription of the ongoing payment. For better operation, do not put special characters in the parameter value (#,/, $, _, &)
notif_urlUrl-YesThe payment notification link
return_urlUrl-YesThe link where the client will be redirected after the payment
channelString-YesUsed to define the universes present at the counter (ALL, MOBILE_MONEY, CREDIT_CARD). By default, channels is ALL
langString-YesThe default language of the payment counter (fr, en)
country_codeString-NoAllows you to select the default country
customer_firstnameString-No
customer_lastnameString-No
customer_emailString-No
customer_addressString-No
customer_cityString-No
customer_countryString-No
customer_phone_numberString-No
customer_zip_codeString-No

To activate the credit card payment universe, you must add the information about your customer.

Variable NameTypeSizeMandatoryDescription
customer_firstnameString-YesCustomer's first name
customer_lastnameString-YesCustomer's last name
customer_phone_numberString-YesCustomer's phone number
customer_emailString-YesCustomer's email (In case of claim, this address will be used to pre-fill the field on the form)
customer_addressString-YesCustomer's address
customer_cityString-YesCustomer's city
customer_countryString2YesCustomer's country, the value to send is the ISO code of the country (two-letter code) e.g.: CI, BF, US, CA, FR
customer_zip_codeString5YesCustomer's postal code

Example Payload

curl --location --request POST 'https://api-v2.paynah.com/payin/v2/intents' \
--header 'Content-Type: application/json' \
--header 'x-api-key: [your_api_key]' \
--header 'x-api-secret: [your_api_secret]' \
--data-raw '{
    "amount": 100,
    "transaction_id": "transaction_id",
    "description": "Payment Description",
    "lang": "en",
    "currency": "XOF",
    "channel": "MOBILE_MONEY", 
    "country_code": "CI",
    "customer_firstname": null,
    "customer_lastname": null,
    "customer_email": null,
    "customer_phone_number": null,
    "customer_address": "",
    "customer_city": "",
    "customer_country": null,
    "customer_zip_code": "",
    "notif_url": "https://www.webhook.ci",
    "return_url": "https://mysite-return.co"
}'