curl --request POST \
--url https://api.payaza.africa/live/card/auth_capture/authorize \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"authorization_reference": "AUTH-1234567890",
"amount": 100,
"currency": "NGN",
"order_reference": "ORD-001",
"merchant_reference": "MR-001",
"card_number": "5123456789012346",
"card_expiry_month": "12",
"card_expiry_year": "2025",
"card_cvv": "123",
"card_token": "token_reference_here",
"customer_email": "customer@example.com",
"customer_name": "John Doe",
"expire_in_days": 7,
"authorization_webhook_url": "https://example.com/webhook",
"authorization_redirect_url": "https://merchant-site.com/checkout/complete"
}
'import requests
url = "https://api.payaza.africa/live/card/auth_capture/authorize"
payload = {
"authorization_reference": "AUTH-1234567890",
"amount": 100,
"currency": "NGN",
"order_reference": "ORD-001",
"merchant_reference": "MR-001",
"card_number": "5123456789012346",
"card_expiry_month": "12",
"card_expiry_year": "2025",
"card_cvv": "123",
"card_token": "token_reference_here",
"customer_email": "customer@example.com",
"customer_name": "John Doe",
"expire_in_days": 7,
"authorization_webhook_url": "https://example.com/webhook",
"authorization_redirect_url": "https://merchant-site.com/checkout/complete"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
authorization_reference: 'AUTH-1234567890',
amount: 100,
currency: 'NGN',
order_reference: 'ORD-001',
merchant_reference: 'MR-001',
card_number: '5123456789012346',
card_expiry_month: '12',
card_expiry_year: '2025',
card_cvv: '123',
card_token: 'token_reference_here',
customer_email: 'customer@example.com',
customer_name: 'John Doe',
expire_in_days: 7,
authorization_webhook_url: 'https://example.com/webhook',
authorization_redirect_url: 'https://merchant-site.com/checkout/complete'
})
};
fetch('https://api.payaza.africa/live/card/auth_capture/authorize', 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://api.payaza.africa/live/card/auth_capture/authorize",
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([
'authorization_reference' => 'AUTH-1234567890',
'amount' => 100,
'currency' => 'NGN',
'order_reference' => 'ORD-001',
'merchant_reference' => 'MR-001',
'card_number' => '5123456789012346',
'card_expiry_month' => '12',
'card_expiry_year' => '2025',
'card_cvv' => '123',
'card_token' => 'token_reference_here',
'customer_email' => 'customer@example.com',
'customer_name' => 'John Doe',
'expire_in_days' => 7,
'authorization_webhook_url' => 'https://example.com/webhook',
'authorization_redirect_url' => 'https://merchant-site.com/checkout/complete'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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://api.payaza.africa/live/card/auth_capture/authorize"
payload := strings.NewReader("{\n \"authorization_reference\": \"AUTH-1234567890\",\n \"amount\": 100,\n \"currency\": \"NGN\",\n \"order_reference\": \"ORD-001\",\n \"merchant_reference\": \"MR-001\",\n \"card_number\": \"5123456789012346\",\n \"card_expiry_month\": \"12\",\n \"card_expiry_year\": \"2025\",\n \"card_cvv\": \"123\",\n \"card_token\": \"token_reference_here\",\n \"customer_email\": \"customer@example.com\",\n \"customer_name\": \"John Doe\",\n \"expire_in_days\": 7,\n \"authorization_webhook_url\": \"https://example.com/webhook\",\n \"authorization_redirect_url\": \"https://merchant-site.com/checkout/complete\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://api.payaza.africa/live/card/auth_capture/authorize")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"authorization_reference\": \"AUTH-1234567890\",\n \"amount\": 100,\n \"currency\": \"NGN\",\n \"order_reference\": \"ORD-001\",\n \"merchant_reference\": \"MR-001\",\n \"card_number\": \"5123456789012346\",\n \"card_expiry_month\": \"12\",\n \"card_expiry_year\": \"2025\",\n \"card_cvv\": \"123\",\n \"card_token\": \"token_reference_here\",\n \"customer_email\": \"customer@example.com\",\n \"customer_name\": \"John Doe\",\n \"expire_in_days\": 7,\n \"authorization_webhook_url\": \"https://example.com/webhook\",\n \"authorization_redirect_url\": \"https://merchant-site.com/checkout/complete\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.payaza.africa/live/card/auth_capture/authorize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"authorization_reference\": \"AUTH-1234567890\",\n \"amount\": 100,\n \"currency\": \"NGN\",\n \"order_reference\": \"ORD-001\",\n \"merchant_reference\": \"MR-001\",\n \"card_number\": \"5123456789012346\",\n \"card_expiry_month\": \"12\",\n \"card_expiry_year\": \"2025\",\n \"card_cvv\": \"123\",\n \"card_token\": \"token_reference_here\",\n \"customer_email\": \"customer@example.com\",\n \"customer_name\": \"John Doe\",\n \"expire_in_days\": 7,\n \"authorization_webhook_url\": \"https://example.com/webhook\",\n \"authorization_redirect_url\": \"https://merchant-site.com/checkout/complete\"\n}"
response = http.request(request)
puts response.read_body{
"authorization_reference": "AUTH-1234567890",
"status": "PENDING",
"message": "3DS Authentication Required",
"do3dsAuth": true,
"threeDsHtml": "<html>...</html>",
"threeDsUrl": "https://acs.example.com/3ds",
"formData": "cReq_or_PaReq_data_here"
}Authorize Transaction
This endpoint authorizes a transaction and holds funds for a specified period. This endpoint handles payout requests.
Record Creation:
Authorization record is created with PENDING status before MPGS call, then updated to AUTHORIZED on success or FAILED on error.
curl --request POST \
--url https://api.payaza.africa/live/card/auth_capture/authorize \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"authorization_reference": "AUTH-1234567890",
"amount": 100,
"currency": "NGN",
"order_reference": "ORD-001",
"merchant_reference": "MR-001",
"card_number": "5123456789012346",
"card_expiry_month": "12",
"card_expiry_year": "2025",
"card_cvv": "123",
"card_token": "token_reference_here",
"customer_email": "customer@example.com",
"customer_name": "John Doe",
"expire_in_days": 7,
"authorization_webhook_url": "https://example.com/webhook",
"authorization_redirect_url": "https://merchant-site.com/checkout/complete"
}
'import requests
url = "https://api.payaza.africa/live/card/auth_capture/authorize"
payload = {
"authorization_reference": "AUTH-1234567890",
"amount": 100,
"currency": "NGN",
"order_reference": "ORD-001",
"merchant_reference": "MR-001",
"card_number": "5123456789012346",
"card_expiry_month": "12",
"card_expiry_year": "2025",
"card_cvv": "123",
"card_token": "token_reference_here",
"customer_email": "customer@example.com",
"customer_name": "John Doe",
"expire_in_days": 7,
"authorization_webhook_url": "https://example.com/webhook",
"authorization_redirect_url": "https://merchant-site.com/checkout/complete"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
authorization_reference: 'AUTH-1234567890',
amount: 100,
currency: 'NGN',
order_reference: 'ORD-001',
merchant_reference: 'MR-001',
card_number: '5123456789012346',
card_expiry_month: '12',
card_expiry_year: '2025',
card_cvv: '123',
card_token: 'token_reference_here',
customer_email: 'customer@example.com',
customer_name: 'John Doe',
expire_in_days: 7,
authorization_webhook_url: 'https://example.com/webhook',
authorization_redirect_url: 'https://merchant-site.com/checkout/complete'
})
};
fetch('https://api.payaza.africa/live/card/auth_capture/authorize', 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://api.payaza.africa/live/card/auth_capture/authorize",
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([
'authorization_reference' => 'AUTH-1234567890',
'amount' => 100,
'currency' => 'NGN',
'order_reference' => 'ORD-001',
'merchant_reference' => 'MR-001',
'card_number' => '5123456789012346',
'card_expiry_month' => '12',
'card_expiry_year' => '2025',
'card_cvv' => '123',
'card_token' => 'token_reference_here',
'customer_email' => 'customer@example.com',
'customer_name' => 'John Doe',
'expire_in_days' => 7,
'authorization_webhook_url' => 'https://example.com/webhook',
'authorization_redirect_url' => 'https://merchant-site.com/checkout/complete'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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://api.payaza.africa/live/card/auth_capture/authorize"
payload := strings.NewReader("{\n \"authorization_reference\": \"AUTH-1234567890\",\n \"amount\": 100,\n \"currency\": \"NGN\",\n \"order_reference\": \"ORD-001\",\n \"merchant_reference\": \"MR-001\",\n \"card_number\": \"5123456789012346\",\n \"card_expiry_month\": \"12\",\n \"card_expiry_year\": \"2025\",\n \"card_cvv\": \"123\",\n \"card_token\": \"token_reference_here\",\n \"customer_email\": \"customer@example.com\",\n \"customer_name\": \"John Doe\",\n \"expire_in_days\": 7,\n \"authorization_webhook_url\": \"https://example.com/webhook\",\n \"authorization_redirect_url\": \"https://merchant-site.com/checkout/complete\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://api.payaza.africa/live/card/auth_capture/authorize")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"authorization_reference\": \"AUTH-1234567890\",\n \"amount\": 100,\n \"currency\": \"NGN\",\n \"order_reference\": \"ORD-001\",\n \"merchant_reference\": \"MR-001\",\n \"card_number\": \"5123456789012346\",\n \"card_expiry_month\": \"12\",\n \"card_expiry_year\": \"2025\",\n \"card_cvv\": \"123\",\n \"card_token\": \"token_reference_here\",\n \"customer_email\": \"customer@example.com\",\n \"customer_name\": \"John Doe\",\n \"expire_in_days\": 7,\n \"authorization_webhook_url\": \"https://example.com/webhook\",\n \"authorization_redirect_url\": \"https://merchant-site.com/checkout/complete\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.payaza.africa/live/card/auth_capture/authorize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"authorization_reference\": \"AUTH-1234567890\",\n \"amount\": 100,\n \"currency\": \"NGN\",\n \"order_reference\": \"ORD-001\",\n \"merchant_reference\": \"MR-001\",\n \"card_number\": \"5123456789012346\",\n \"card_expiry_month\": \"12\",\n \"card_expiry_year\": \"2025\",\n \"card_cvv\": \"123\",\n \"card_token\": \"token_reference_here\",\n \"customer_email\": \"customer@example.com\",\n \"customer_name\": \"John Doe\",\n \"expire_in_days\": 7,\n \"authorization_webhook_url\": \"https://example.com/webhook\",\n \"authorization_redirect_url\": \"https://merchant-site.com/checkout/complete\"\n}"
response = http.request(request)
puts response.read_body{
"authorization_reference": "AUTH-1234567890",
"status": "PENDING",
"message": "3DS Authentication Required",
"do3dsAuth": true,
"threeDsHtml": "<html>...</html>",
"threeDsUrl": "https://acs.example.com/3ds",
"formData": "cReq_or_PaReq_data_here"
}Authorizations
Payaza {{Public API Key in Base 64}}
Body
The body is of type any.
Response
Authorize Transaction
Status of the authorization (AUTHORIZED, PENDING, DECLINED).
"AUTHORIZED"
Descriptive message about the status.
"Authorization successful"
Unique reference for the authorization.
"AUTH-1234567890"
Code provided by the issuer if authorized.
"123456"
The amount successfully held.
100
Currency code.
"NGN"
Timestamp when the hold expires.
"2025-01-19T10:30:00"
Indicates if 3D Secure authentication is required.
false
URL to redirect for 3DS authentication.
"https://acs.example.com/3ds"
HTML content for 3DS page rendering.
"<html>...</html>"
Form data (cReq/PaReq) for 3DS.
"cReq_or_PaReq_data_here"
Error code if declined.
"INVALID_CARD"
Detailed error description.
"Card number is invalid"