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/intentsHow to Generate a Payment Link
In the header, you will need to send the following parameters:
| Header Parameter | Type | Size | Mandatory | Value |
|---|---|---|---|---|
| x-api-key | String | - | Yes | Your apikey (provided by Paynah) |
| x-api-secret | String | - | Yes | Your apisecret (provided by Paynah) |
In your request body, you will need to specify the following values:
| Variable Name | Type | Size | Mandatory | Description |
|---|---|---|---|---|
| transaction_id | String | - | Yes | Transaction identification (Provide a unique identifier) |
| amount | Integer | - | Yes | The transaction amount (must be a multiple of 5) |
| currency | String | 3 | Yes | The currency (XOF) |
| description | String | - | Yes | Description of the ongoing payment. For better operation, do not put special characters in the parameter value (#,/, $, _, &) |
| notif_url | Url | - | Yes | The payment notification link |
| return_url | Url | - | Yes | The link where the client will be redirected after the payment |
| channel | String | - | Yes | Used to define the universes present at the counter (ALL, MOBILE_MONEY, CREDIT_CARD). By default, channels is ALL |
| lang | String | - | Yes | The default language of the payment counter (fr, en) |
| country_code | String | - | No | Allows you to select the default country |
| customer_firstname | String | - | No | |
| customer_lastname | String | - | No | |
| customer_email | String | - | No | |
| customer_address | String | - | No | |
| customer_city | String | - | No | |
| customer_country | String | - | No | |
| customer_phone_number | String | - | No | |
| customer_zip_code | String | - | No |
To activate the credit card payment universe, you must add the information about your customer.
| Variable Name | Type | Size | Mandatory | Description |
|---|---|---|---|---|
| customer_firstname | String | - | Yes | Customer's first name |
| customer_lastname | String | - | Yes | Customer's last name |
| customer_phone_number | String | - | Yes | Customer's phone number |
| customer_email | String | - | Yes | Customer's email (In case of claim, this address will be used to pre-fill the field on the form) |
| customer_address | String | - | Yes | Customer's address |
| customer_city | String | - | Yes | Customer's city |
| customer_country | String | 2 | Yes | Customer'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_code | String | 5 | Yes | Customer'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"
}'