curl --request POST \
--url https://sandbox-api.payfonte.com/payments/v1/checkouts \
--header 'Content-Type: application/json' \
--header 'client-id: <api-key>' \
--header 'client-secret: <api-key>' \
--data '
{
"country": "US, NG, CI, SN, CA, UK",
"currency": "USD, NGN, XOF, XAF",
"amount": 100000,
"user": {
"phoneNumber": "2347012345678",
"name": "Example User",
"email": "user@example.com"
},
"reference": "<string>",
"redirectURL": "https://example.com/redirect/success",
"cancelURL": "https://example.com/redirect/cancel",
"webhook": "https://example.com/webhook",
"metadata": {
"merchantName": "Karis Clothing",
"trafficType": "ECOMMERCE"
}
}
'import requests
url = "https://sandbox-api.payfonte.com/payments/v1/checkouts"
payload = {
"country": "US, NG, CI, SN, CA, UK",
"currency": "USD, NGN, XOF, XAF",
"amount": 100000,
"user": {
"phoneNumber": "2347012345678",
"name": "Example User",
"email": "user@example.com"
},
"reference": "<string>",
"redirectURL": "https://example.com/redirect/success",
"cancelURL": "https://example.com/redirect/cancel",
"webhook": "https://example.com/webhook",
"metadata": {
"merchantName": "Karis Clothing",
"trafficType": "ECOMMERCE"
}
}
headers = {
"client-id": "<api-key>",
"client-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'client-id': '<api-key>',
'client-secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
country: 'US, NG, CI, SN, CA, UK',
currency: 'USD, NGN, XOF, XAF',
amount: 100000,
user: {phoneNumber: '2347012345678', name: 'Example User', email: 'user@example.com'},
reference: '<string>',
redirectURL: 'https://example.com/redirect/success',
cancelURL: 'https://example.com/redirect/cancel',
webhook: 'https://example.com/webhook',
metadata: {merchantName: 'Karis Clothing', trafficType: 'ECOMMERCE'}
})
};
fetch('https://sandbox-api.payfonte.com/payments/v1/checkouts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox-api.payfonte.com/payments/v1/checkouts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'country' => 'US, NG, CI, SN, CA, UK',
'currency' => 'USD, NGN, XOF, XAF',
'amount' => 100000,
'user' => [
'phoneNumber' => '2347012345678',
'name' => 'Example User',
'email' => 'user@example.com'
],
'reference' => '<string>',
'redirectURL' => 'https://example.com/redirect/success',
'cancelURL' => 'https://example.com/redirect/cancel',
'webhook' => 'https://example.com/webhook',
'metadata' => [
'merchantName' => 'Karis Clothing',
'trafficType' => 'ECOMMERCE'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"client-id: <api-key>",
"client-secret: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox-api.payfonte.com/payments/v1/checkouts"
payload := strings.NewReader("{\n \"country\": \"US, NG, CI, SN, CA, UK\",\n \"currency\": \"USD, NGN, XOF, XAF\",\n \"amount\": 100000,\n \"user\": {\n \"phoneNumber\": \"2347012345678\",\n \"name\": \"Example User\",\n \"email\": \"user@example.com\"\n },\n \"reference\": \"<string>\",\n \"redirectURL\": \"https://example.com/redirect/success\",\n \"cancelURL\": \"https://example.com/redirect/cancel\",\n \"webhook\": \"https://example.com/webhook\",\n \"metadata\": {\n \"merchantName\": \"Karis Clothing\",\n \"trafficType\": \"ECOMMERCE\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("client-id", "<api-key>")
req.Header.Add("client-secret", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox-api.payfonte.com/payments/v1/checkouts")
.header("client-id", "<api-key>")
.header("client-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"country\": \"US, NG, CI, SN, CA, UK\",\n \"currency\": \"USD, NGN, XOF, XAF\",\n \"amount\": 100000,\n \"user\": {\n \"phoneNumber\": \"2347012345678\",\n \"name\": \"Example User\",\n \"email\": \"user@example.com\"\n },\n \"reference\": \"<string>\",\n \"redirectURL\": \"https://example.com/redirect/success\",\n \"cancelURL\": \"https://example.com/redirect/cancel\",\n \"webhook\": \"https://example.com/webhook\",\n \"metadata\": {\n \"merchantName\": \"Karis Clothing\",\n \"trafficType\": \"ECOMMERCE\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.payfonte.com/payments/v1/checkouts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["client-id"] = '<api-key>'
request["client-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"country\": \"US, NG, CI, SN, CA, UK\",\n \"currency\": \"USD, NGN, XOF, XAF\",\n \"amount\": 100000,\n \"user\": {\n \"phoneNumber\": \"2347012345678\",\n \"name\": \"Example User\",\n \"email\": \"user@example.com\"\n },\n \"reference\": \"<string>\",\n \"redirectURL\": \"https://example.com/redirect/success\",\n \"cancelURL\": \"https://example.com/redirect/cancel\",\n \"webhook\": \"https://example.com/webhook\",\n \"metadata\": {\n \"merchantName\": \"Karis Clothing\",\n \"trafficType\": \"ECOMMERCE\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"url": "<string>",
"shortURL": "<string>",
"reference": "<string>",
"amount": 100000,
"currency": "USD, NGN, XOF, XAF"
}
}Collections API - Generate Checkout
Generate a Payment Checkout URL for customers to make payment
curl --request POST \
--url https://sandbox-api.payfonte.com/payments/v1/checkouts \
--header 'Content-Type: application/json' \
--header 'client-id: <api-key>' \
--header 'client-secret: <api-key>' \
--data '
{
"country": "US, NG, CI, SN, CA, UK",
"currency": "USD, NGN, XOF, XAF",
"amount": 100000,
"user": {
"phoneNumber": "2347012345678",
"name": "Example User",
"email": "user@example.com"
},
"reference": "<string>",
"redirectURL": "https://example.com/redirect/success",
"cancelURL": "https://example.com/redirect/cancel",
"webhook": "https://example.com/webhook",
"metadata": {
"merchantName": "Karis Clothing",
"trafficType": "ECOMMERCE"
}
}
'import requests
url = "https://sandbox-api.payfonte.com/payments/v1/checkouts"
payload = {
"country": "US, NG, CI, SN, CA, UK",
"currency": "USD, NGN, XOF, XAF",
"amount": 100000,
"user": {
"phoneNumber": "2347012345678",
"name": "Example User",
"email": "user@example.com"
},
"reference": "<string>",
"redirectURL": "https://example.com/redirect/success",
"cancelURL": "https://example.com/redirect/cancel",
"webhook": "https://example.com/webhook",
"metadata": {
"merchantName": "Karis Clothing",
"trafficType": "ECOMMERCE"
}
}
headers = {
"client-id": "<api-key>",
"client-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'client-id': '<api-key>',
'client-secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
country: 'US, NG, CI, SN, CA, UK',
currency: 'USD, NGN, XOF, XAF',
amount: 100000,
user: {phoneNumber: '2347012345678', name: 'Example User', email: 'user@example.com'},
reference: '<string>',
redirectURL: 'https://example.com/redirect/success',
cancelURL: 'https://example.com/redirect/cancel',
webhook: 'https://example.com/webhook',
metadata: {merchantName: 'Karis Clothing', trafficType: 'ECOMMERCE'}
})
};
fetch('https://sandbox-api.payfonte.com/payments/v1/checkouts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox-api.payfonte.com/payments/v1/checkouts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'country' => 'US, NG, CI, SN, CA, UK',
'currency' => 'USD, NGN, XOF, XAF',
'amount' => 100000,
'user' => [
'phoneNumber' => '2347012345678',
'name' => 'Example User',
'email' => 'user@example.com'
],
'reference' => '<string>',
'redirectURL' => 'https://example.com/redirect/success',
'cancelURL' => 'https://example.com/redirect/cancel',
'webhook' => 'https://example.com/webhook',
'metadata' => [
'merchantName' => 'Karis Clothing',
'trafficType' => 'ECOMMERCE'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"client-id: <api-key>",
"client-secret: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox-api.payfonte.com/payments/v1/checkouts"
payload := strings.NewReader("{\n \"country\": \"US, NG, CI, SN, CA, UK\",\n \"currency\": \"USD, NGN, XOF, XAF\",\n \"amount\": 100000,\n \"user\": {\n \"phoneNumber\": \"2347012345678\",\n \"name\": \"Example User\",\n \"email\": \"user@example.com\"\n },\n \"reference\": \"<string>\",\n \"redirectURL\": \"https://example.com/redirect/success\",\n \"cancelURL\": \"https://example.com/redirect/cancel\",\n \"webhook\": \"https://example.com/webhook\",\n \"metadata\": {\n \"merchantName\": \"Karis Clothing\",\n \"trafficType\": \"ECOMMERCE\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("client-id", "<api-key>")
req.Header.Add("client-secret", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox-api.payfonte.com/payments/v1/checkouts")
.header("client-id", "<api-key>")
.header("client-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"country\": \"US, NG, CI, SN, CA, UK\",\n \"currency\": \"USD, NGN, XOF, XAF\",\n \"amount\": 100000,\n \"user\": {\n \"phoneNumber\": \"2347012345678\",\n \"name\": \"Example User\",\n \"email\": \"user@example.com\"\n },\n \"reference\": \"<string>\",\n \"redirectURL\": \"https://example.com/redirect/success\",\n \"cancelURL\": \"https://example.com/redirect/cancel\",\n \"webhook\": \"https://example.com/webhook\",\n \"metadata\": {\n \"merchantName\": \"Karis Clothing\",\n \"trafficType\": \"ECOMMERCE\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.payfonte.com/payments/v1/checkouts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["client-id"] = '<api-key>'
request["client-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"country\": \"US, NG, CI, SN, CA, UK\",\n \"currency\": \"USD, NGN, XOF, XAF\",\n \"amount\": 100000,\n \"user\": {\n \"phoneNumber\": \"2347012345678\",\n \"name\": \"Example User\",\n \"email\": \"user@example.com\"\n },\n \"reference\": \"<string>\",\n \"redirectURL\": \"https://example.com/redirect/success\",\n \"cancelURL\": \"https://example.com/redirect/cancel\",\n \"webhook\": \"https://example.com/webhook\",\n \"metadata\": {\n \"merchantName\": \"Karis Clothing\",\n \"trafficType\": \"ECOMMERCE\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"url": "<string>",
"shortURL": "<string>",
"reference": "<string>",
"amount": 100000,
"currency": "USD, NGN, XOF, XAF"
}
}Body
Generate A Payment Checkout URL
2 character country code
"NG"
This is the base currency to be charged in.
"NGN"
This is the amount to charge the customer. Amount should be sent in the lowest denomination e.g for 100 USD you should send 100 * 100 = 10000
10000
Show child attributes
Show child attributes
A reference code you'll generate to identify this transaction. This must be unique for every transaction. If you don't pass one, we will generate one for you.
Fully qualified URL to which the customer should be redirected after the payment is completed
"https://example.com/redirect/success"
Fully qualified URL to which the customer should be redirected if the cancel the payment session
"https://example.com/redirect/cancel"
Show child attributes
Show child attributes
Response
Checkout URL Successfully Generated
Show child attributes
Show child attributes