Collections API - Generate Checkout
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": "https://checkout-staging.payfonte.com/payfusion/66579afe04916ddcfcf73e7b",
"shortURL": "https://l.6bd.co/XXXXX",
"reference": "<string>",
"amount": 100000,
"currency": "USD, NGN, XOF, XAF"
}
}Collections
Collections API - Generate Checkout
Generate a Payment Checkout URL for customers to make payment
POST
/
payments
/
v1
/
checkouts
Collections API - Generate Checkout
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": "https://checkout-staging.payfonte.com/payfusion/66579afe04916ddcfcf73e7b",
"shortURL": "https://l.6bd.co/XXXXX",
"reference": "<string>",
"amount": 100000,
"currency": "USD, NGN, XOF, XAF"
}
}Body
application/json
Generate A Payment Checkout URL
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. See Amount Specification.
Example:
10000
This is a URL, if this is passed we will send the event webhook payload to this endpoint. Use this to override the webhook url provided on the dashboard for this transaction. Read more on Webhooks
Example:
"https://example.com/webhook"