Void Transaction
curl --request POST \
--url https://api.payaza.africa/live/card/auth_capture/void \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"authorization_reference": "AUTH-ABCD1234EFGH5678IJKL",
"void_reference": "VOID-001",
"void_reason": "Customer cancellation"
}
'import requests
url = "https://api.payaza.africa/live/card/auth_capture/void"
payload = {
"authorization_reference": "AUTH-ABCD1234EFGH5678IJKL",
"void_reference": "VOID-001",
"void_reason": "Customer cancellation"
}
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-ABCD1234EFGH5678IJKL',
void_reference: 'VOID-001',
void_reason: 'Customer cancellation'
})
};
fetch('https://api.payaza.africa/live/card/auth_capture/void', 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/void",
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-ABCD1234EFGH5678IJKL',
'void_reference' => 'VOID-001',
'void_reason' => 'Customer cancellation'
]),
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/void"
payload := strings.NewReader("{\n \"authorization_reference\": \"AUTH-ABCD1234EFGH5678IJKL\",\n \"void_reference\": \"VOID-001\",\n \"void_reason\": \"Customer cancellation\"\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/void")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"authorization_reference\": \"AUTH-ABCD1234EFGH5678IJKL\",\n \"void_reference\": \"VOID-001\",\n \"void_reason\": \"Customer cancellation\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.payaza.africa/live/card/auth_capture/void")
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-ABCD1234EFGH5678IJKL\",\n \"void_reference\": \"VOID-001\",\n \"void_reason\": \"Customer cancellation\"\n}"
response = http.request(request)
puts response.read_body{
"void_reference": "VOID-1705123456-WXYZ5678",
"status": "VOIDED",
"voided_amount": 100,
"remaining_amount": 0,
"message": "Void successful"
}Auth-Capture-Void
Void Transaction
This endpoint voids a previously authorized transaction. This request can only be done on transactions that are fully authorized and have not been captured
Notes:
- Partially captured authorizations cannot be voided: If any amount has been captured, void is not allowed. The response will indicate the remaining capturable amount..
- Fully captured authorizations cannot be voided:: Once a transaction is fully captured (status becomes CAPTURED), it cannot be voided. You must use the refund API instead.
- Authentication: Valid Authorization header required (same format as authorize endpoint).
- Only fully authorized (uncaptured) transactions can be voided: Void is only allowed for authorizations that have never been captured.
POST
/
card
/
auth_capture
/
void
Void Transaction
curl --request POST \
--url https://api.payaza.africa/live/card/auth_capture/void \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"authorization_reference": "AUTH-ABCD1234EFGH5678IJKL",
"void_reference": "VOID-001",
"void_reason": "Customer cancellation"
}
'import requests
url = "https://api.payaza.africa/live/card/auth_capture/void"
payload = {
"authorization_reference": "AUTH-ABCD1234EFGH5678IJKL",
"void_reference": "VOID-001",
"void_reason": "Customer cancellation"
}
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-ABCD1234EFGH5678IJKL',
void_reference: 'VOID-001',
void_reason: 'Customer cancellation'
})
};
fetch('https://api.payaza.africa/live/card/auth_capture/void', 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/void",
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-ABCD1234EFGH5678IJKL',
'void_reference' => 'VOID-001',
'void_reason' => 'Customer cancellation'
]),
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/void"
payload := strings.NewReader("{\n \"authorization_reference\": \"AUTH-ABCD1234EFGH5678IJKL\",\n \"void_reference\": \"VOID-001\",\n \"void_reason\": \"Customer cancellation\"\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/void")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"authorization_reference\": \"AUTH-ABCD1234EFGH5678IJKL\",\n \"void_reference\": \"VOID-001\",\n \"void_reason\": \"Customer cancellation\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.payaza.africa/live/card/auth_capture/void")
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-ABCD1234EFGH5678IJKL\",\n \"void_reference\": \"VOID-001\",\n \"void_reason\": \"Customer cancellation\"\n}"
response = http.request(request)
puts response.read_body{
"void_reference": "VOID-1705123456-WXYZ5678",
"status": "VOIDED",
"voided_amount": 100,
"remaining_amount": 0,
"message": "Void successful"
}Authorizations
Payaza {{Public API Key in Base 64}}
Body
application/json
The reference of the authorization to be voided.
Example:
"AUTH-ABCD1234EFGH5678IJKL"
A unique reference for this void transaction generated by the merchant.
Example:
"VOID-001"
Reason for voiding the transaction.
Example:
"Customer cancellation"
Response
Void Transaction
Status of the void operation (e.g., VOIDED, ERROR).
Example:
"VOIDED"
Descriptive message about the operation status.
Example:
"Void successful"
Unique reference for the void transaction (present on success).
Example:
"VOID-1705123456-WXYZ5678"
The amount successfully voided.
Example:
100
Any remaining amount on the authorization (usually 0 after a full void).
Example:
0