Create Refund
curl --request POST \
--url https://api-sandbox.pavewaygroup.com/v1/refunds \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transaction_id": "<string>",
"amount": "<string>",
"reason": "<string>",
"notes": "<string>"
}
'import requests
url = "https://api-sandbox.pavewaygroup.com/v1/refunds"
payload = {
"transaction_id": "<string>",
"amount": "<string>",
"reason": "<string>",
"notes": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
transaction_id: '<string>',
amount: '<string>',
reason: '<string>',
notes: '<string>'
})
};
fetch('https://api-sandbox.pavewaygroup.com/v1/refunds', 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-sandbox.pavewaygroup.com/v1/refunds",
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([
'transaction_id' => '<string>',
'amount' => '<string>',
'reason' => '<string>',
'notes' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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-sandbox.pavewaygroup.com/v1/refunds"
payload := strings.NewReader("{\n \"transaction_id\": \"<string>\",\n \"amount\": \"<string>\",\n \"reason\": \"<string>\",\n \"notes\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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-sandbox.pavewaygroup.com/v1/refunds")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transaction_id\": \"<string>\",\n \"amount\": \"<string>\",\n \"reason\": \"<string>\",\n \"notes\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.pavewaygroup.com/v1/refunds")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transaction_id\": \"<string>\",\n \"amount\": \"<string>\",\n \"reason\": \"<string>\",\n \"notes\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status_code": 200,
"response_type": "success",
"data": {
"id": "658dc...",
"refund_id": "rf_abc123...",
"amount": "1000",
"currency": "XAF",
"status": "succeeded",
"reason": "requested_by_customer"
}
}
Payments API
Create Refund
Issue a full or partial refund for a successful transaction.
POST
/
refunds
Create Refund
curl --request POST \
--url https://api-sandbox.pavewaygroup.com/v1/refunds \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transaction_id": "<string>",
"amount": "<string>",
"reason": "<string>",
"notes": "<string>"
}
'import requests
url = "https://api-sandbox.pavewaygroup.com/v1/refunds"
payload = {
"transaction_id": "<string>",
"amount": "<string>",
"reason": "<string>",
"notes": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
transaction_id: '<string>',
amount: '<string>',
reason: '<string>',
notes: '<string>'
})
};
fetch('https://api-sandbox.pavewaygroup.com/v1/refunds', 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-sandbox.pavewaygroup.com/v1/refunds",
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([
'transaction_id' => '<string>',
'amount' => '<string>',
'reason' => '<string>',
'notes' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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-sandbox.pavewaygroup.com/v1/refunds"
payload := strings.NewReader("{\n \"transaction_id\": \"<string>\",\n \"amount\": \"<string>\",\n \"reason\": \"<string>\",\n \"notes\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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-sandbox.pavewaygroup.com/v1/refunds")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transaction_id\": \"<string>\",\n \"amount\": \"<string>\",\n \"reason\": \"<string>\",\n \"notes\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.pavewaygroup.com/v1/refunds")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transaction_id\": \"<string>\",\n \"amount\": \"<string>\",\n \"reason\": \"<string>\",\n \"notes\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status_code": 200,
"response_type": "success",
"data": {
"id": "658dc...",
"refund_id": "rf_abc123...",
"amount": "1000",
"currency": "XAF",
"status": "succeeded",
"reason": "requested_by_customer"
}
}
Authentication
Include your Secret Key in theAuthorization header as a Bearer token.
Request Body
The ID of the original successful transaction.
Refund amount in smallest currency unit. If omitted, a full refund is issued.
Code for the refund reason:
requested_by_customer, duplicate, fraudulent, other.Additional context for the refund (up to 500 characters).
Response
Unique identifier for the transaction/refund wrapper.
The specific ID of the refund (e.g.,
rf_...).The amount refunded.
The currency code.
Status of the refund (
succeeded, pending, failed).Reason for the refund.
{
"status_code": 200,
"response_type": "success",
"data": {
"id": "658dc...",
"refund_id": "rf_abc123...",
"amount": "1000",
"currency": "XAF",
"status": "succeeded",
"reason": "requested_by_customer"
}
}
⌘I

