Make payment
The payment link generated from payment initialization
gives access to a checkout session that allows anyone to purchase the products concerned.
Anyone with access to this link can now purchase your products.
The payment session is valid for 15 minutes only
There are 2 ways to purchase your products in your checkout session:
Using the checkout interface
The payment link generated from payment initialization
is a link that redirect to an interface that allows to easily purchase your products by filling informations. The interface also check the transaction payment status.
Using the make payment API
You can also make a payment in your checkout session using the make payment API. This API can be called using 2 ways depending on what payment method you want to use:
- Mobile money payment
To make a mobile money payment in Payunit Checkout using the make payment API, process as follow:
curl --location --request POST '{{base_url}}/api/gateway/checkout/process' \
--header 'x-api-key: live_xxxxxxxxxxxxxxx' \
--header 'mode: live' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic xxxxxxxxxx' \
--data-raw '{
"checkout_id": "PU_payment_8da2310b-a9d5-4c9c-836e-9cc13b718939",
"customer": {
"email": "[email protected]",
"phone": "+237696968656",
"country": "Cameroon",
"name": "John Doe"
},
"shipping": {
"address": "Douala, Akwa Nord",
"phone": "693632863",
"payment_method": "CM_ORANGE",
"payment_info": {
"phone": "693632863"
}
}
}
End point: {BASE_URL}/api/gateway/checkout/process
Request method: POST
Request body :
Paramètre | Mandatory | Description |
---|---|---|
checkout_id | Yes | The unique identifier that identifies the transaction in your system and which is generated from payment initialization |
Yes | The customer email | |
phone (customer) | No | The customer phone number |
country | No | The customer country |
name | No | The customer name |
address | No | The shipping address |
phone (shipping) | No | The shipping phone number |
payment_method | Yes | The payment method used for the payment |
phone (payment_info) | Yes | The payment phone number |
- Card payment
To make a card payment in Payunit Checkout using the make payment API, process as follow:
curl --location --request POST '{{base_url}}/api/gateway/checkout/process' \
--header 'x-api-key: live_xxxxxxxxxxxxxxx' \
--header 'mode: live' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic xxxxxxxxxx' \
--data-raw '{
"checkout_id": "PU_payment_8da2310b-a9d5-4c9c-836e-9cc13b718939",
"customer": {
"email": "[email protected]",
"phone": "+237696968656",
"country": "Cameroon",
"name": "John Doe"
},
"shipping": {
"address": "Akwa Nord, Pharmacie",
"phone": "237696968656",
"payment_method": "WORLD_VISA",
"payment_info": {
"card_info": {
"card_number": "5531886652142950",
"cvv": "564",
"expiry_month": "09",
"expiry_year": "32",
"card_country": "CM",
"card_state": "Littoral",
"card_city": "Douala",
"card_address": "Akwa Nord, Pharmacie",
"card_zipcode": "568945"
}
}
}
}
End point: {BASE_URL}/api/gateway/checkout/process
Request method: POST
Request body :
Paramètre | Mandatory | Description |
---|---|---|
checkout_id | Yes | The unique identifier that identifies the transaction in your system and which is generated from payment initialization |
Yes | The customer email | |
phone (customer) | No | The customer phone number |
country | No | The customer country |
name | No | The customer name |
address | No | The shipping address |
phone (shipping) | No | The shipping phone number |
payment_method | Yes | The payment method used for the payment |
card_number | Yes | The card number |
cvv | Yes | The card CVV |
expiry_month | Yes | The card expiry month |
expiry_year | Yes | The card expiry year |
card_country | Yes | Alpha code of the card country. Example: CM |
card_state | Yes | The card state |
card_city | Yes | The city card |
card_address | Yes | The card address |
card_zipcode | Yes | The card zip code |
Once the purchase is completed or cancelled, the link expires and becomes unusable.