Refunds
The Refunds API lets you send all or part of a successful payment back to your customer. Refunds are paid from your balance. Read the refunds guide for timelines and statuses.
Create Refund
Refund a successful transaction. Leave out amount to refund everything that has not already been refunded. You can make several partial refunds until the full amount is used up.
Headers
authorizationStringrequired- Set value to
Bearer YOUR_SECRET_KEY. content-typeStringrequired- Set value to
application/json. idempotency-keyStringoptional- A unique value you choose so a retried request is processed only once. See idempotent requests.
Body parameters
transactionStringrequired- Reference or ID of the transaction to refund.
amountIntegeroptional- Amount to refund in pesewas. Defaults to the full amount not yet refunded.
customer_noteStringoptional- A reason you are happy for the customer to see.
merchant_noteStringoptional- An internal note for your team.
curl https://api.wiregh.com/refund \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"transaction": "WG2611096D4HQE52FMY9KW",
"amount": 2000,
"merchant_note": "Item out of stock"
}' \
-X POSTconst response = await fetch('https://api.wiregh.com/refund', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_SECRET_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
transaction: 'WG2611096D4HQE52FMY9KW',
amount: 2000,
merchant_note: 'Item out of stock'
})
});
const result = await response.json();
console.log(result);<?php
$ch = curl_init('https://api.wiregh.com/refund');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode([
'transaction' => 'WG2611096D4HQE52FMY9KW',
'amount' => 2000,
'merchant_note' => 'Item out of stock',
]),
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_SECRET_KEY',
'Content-Type: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($result);{
"status": true,
"message": "Refund has been queued for processing",
"data": {
"id": 34,
"integration": 100231,
"domain": "test",
"transaction": 173,
"transaction_reference": "WG2611096D4HQE52FMY9KW",
"amount": 2000,
"currency": "GHS",
"status": "processed",
"refunded_by": "merchant_api",
"customer_note": null,
"merchant_note": "Item out of stock",
"refunded_at": "2026-11-09T01:03:40.000Z",
"createdAt": "2026-11-09T01:03:40.000Z"
}
}{
"status": false,
"message": "Refund amount cannot exceed 3000 pesewas (amount not yet refunded).",
"code": "refund_exceeds"
}List Refunds
List the refunds on your integration, newest first. Results are paginated.
Headers
authorizationStringrequired- Set value to
Bearer YOUR_SECRET_KEY.
Query parameters
transactionIntegeroptional- Only return refunds for this transaction ID.
perPageIntegeroptional- Records per page, from 1 to 100. Defaults to 50.
pageIntegeroptional- Page to return. Defaults to 1.
curl https://api.wiregh.com/refund?perPage=1 \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-X GETconst response = await fetch('https://api.wiregh.com/refund?perPage=1', {
method: 'GET',
headers: {
Authorization: 'Bearer YOUR_SECRET_KEY'
}
});
const result = await response.json();
console.log(result);<?php
$ch = curl_init('https://api.wiregh.com/refund?perPage=1');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_SECRET_KEY',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($result);{
"status": true,
"message": "Refunds retrieved",
"data": [
{
"id": 34,
"integration": 100231,
"domain": "test",
"transaction": 173,
"transaction_reference": "WG2611096D4HQE52FMY9KW",
"amount": 2000,
"currency": "GHS",
"status": "processed",
"refunded_by": "merchant_api",
"customer_note": null,
"merchant_note": "Item out of stock",
"refunded_at": "2026-11-09T01:03:40.000Z",
"createdAt": "2026-11-09T01:03:40.000Z"
}
],
"meta": {
"total": 1,
"perPage": 1,
"page": 1,
"pageCount": 1
}
}Fetch Refund
Get the details of a refund. status is pending, processing, processed, failed, or needs_attention when our team is looking into it.
Headers
authorizationStringrequired- Set value to
Bearer YOUR_SECRET_KEY.
Path parameters
idIntegerrequired- The refund ID.
curl https://api.wiregh.com/refund/34 \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-X GETconst response = await fetch('https://api.wiregh.com/refund/34', {
method: 'GET',
headers: {
Authorization: 'Bearer YOUR_SECRET_KEY'
}
});
const result = await response.json();
console.log(result);<?php
$ch = curl_init('https://api.wiregh.com/refund/34');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_SECRET_KEY',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($result);{
"status": true,
"message": "Refund retrieved",
"data": {
"id": 34,
"integration": 100231,
"domain": "test",
"transaction": 173,
"transaction_reference": "WG2611096D4HQE52FMY9KW",
"amount": 2000,
"currency": "GHS",
"status": "processed",
"refunded_by": "merchant_api",
"customer_note": null,
"merchant_note": "Item out of stock",
"refunded_at": "2026-11-09T01:03:40.000Z",
"createdAt": "2026-11-09T01:03:40.000Z"
}
}