curl --location --request GET 'https://api.hub2.io/refunds/1' \
--header 'ApiKey: <YOUR_API_KEY>' \
--header 'MerchantId: <YOUR_MERCHANT_ID>' \
--header 'Environment: sandbox'
async function getRefund(): Promise<void> {
const response = await fetch('https://api.hub2.io/refunds/1', {
method: 'GET',
headers: {
'ApiKey': '<YOUR_API_KEY>',
'MerchantId': '<YOUR_MERCHANT_ID>',
'Environment': 'sandbox',
},
});
if (response.ok) {
console.log(await response.json());
} else {
console.log(`HTTP status: ${response.status}`);
}
}
getRefund();
import requests
headers = {
'ApiKey': '<YOUR_API_KEY>',
'MerchantId': '<YOUR_MERCHANT_ID>',
'Environment': 'sandbox',
}
response = requests.get('https://api.hub2.io/refunds/1', headers=headers)
if response.status_code == 200:
print(response.json())
else:
print(f'HTTP status: {response.status_code}')
{
"id": 1,
"status": "successful",
"transactionId": "tr_R7xkvVd5gRfBCWQCYrWEt",
"amount": 2000,
"currency": "XOF",
"reason": "refund",
"paymentMethod": "mobile_money",
"fallbackUsed": false,
"createdAt": "2026-01-15T12:00:00.000Z",
"updatedAt": "2026-01-15T12:30:00.000Z"
}
Refunds
Retrieve a refund
Retrieve the details of a transfer refund.
GET
/
refunds
/
{id}
curl --location --request GET 'https://api.hub2.io/refunds/1' \
--header 'ApiKey: <YOUR_API_KEY>' \
--header 'MerchantId: <YOUR_MERCHANT_ID>' \
--header 'Environment: sandbox'
async function getRefund(): Promise<void> {
const response = await fetch('https://api.hub2.io/refunds/1', {
method: 'GET',
headers: {
'ApiKey': '<YOUR_API_KEY>',
'MerchantId': '<YOUR_MERCHANT_ID>',
'Environment': 'sandbox',
},
});
if (response.ok) {
console.log(await response.json());
} else {
console.log(`HTTP status: ${response.status}`);
}
}
getRefund();
import requests
headers = {
'ApiKey': '<YOUR_API_KEY>',
'MerchantId': '<YOUR_MERCHANT_ID>',
'Environment': 'sandbox',
}
response = requests.get('https://api.hub2.io/refunds/1', headers=headers)
if response.status_code == 200:
print(response.json())
else:
print(f'HTTP status: {response.status_code}')
{
"id": 1,
"status": "successful",
"transactionId": "tr_R7xkvVd5gRfBCWQCYrWEt",
"amount": 2000,
"currency": "XOF",
"reason": "refund",
"paymentMethod": "mobile_money",
"fallbackUsed": false,
"createdAt": "2026-01-15T12:00:00.000Z",
"updatedAt": "2026-01-15T12:30:00.000Z"
}
Retrieves a transfer refund by its ID, as returned by Create a refund.
Headers
string
required
Your API key.
string
required
Your merchant ID.
string
required
The environment to use:
sandbox or live.Path parameters
number
required
The ID of the refund (e.g.,
1).Response
number
The ID of the refund.
string
The status of the refund. Possible values:
created, pending, pending_manual, successful, failed.string
The ID of the refunded transfer.
number
The refunded amount. It equals the amount of the original transfer.
string
The currency of the refund, as an ISO 4217 code (e.g.,
XOF).string
The reason for the refund.
string
The payment method used for the refund. Possible values:
mobile_money, bank_transfer.boolean
Whether a fallback payment method was used for this refund.
string
The creation date of the refund, in ISO 8601 format.
string
The date of the last update of the refund, in ISO 8601 format.
object
Present only when the latest status change failed. Contains
code (for example insufficient_funds, service_unavailable, not_found, unknown_reason) and message, a human-readable explanation.Errors
| Status | Cause |
|---|---|
400 | The merchant account was not found (merchant_not_found). |
401 | The credentials are invalid. |
403 | Access is refused, for example because your API key lacks the Api.refund_read permission (missing_permission) or the merchant account is closed (merchant_closed). The code field of the error gives the reason. |
404 | The refund does not exist or does not belong to your merchant account. |
429 | More than 10 requests per 5 seconds. |
curl --location --request GET 'https://api.hub2.io/refunds/1' \
--header 'ApiKey: <YOUR_API_KEY>' \
--header 'MerchantId: <YOUR_MERCHANT_ID>' \
--header 'Environment: sandbox'
async function getRefund(): Promise<void> {
const response = await fetch('https://api.hub2.io/refunds/1', {
method: 'GET',
headers: {
'ApiKey': '<YOUR_API_KEY>',
'MerchantId': '<YOUR_MERCHANT_ID>',
'Environment': 'sandbox',
},
});
if (response.ok) {
console.log(await response.json());
} else {
console.log(`HTTP status: ${response.status}`);
}
}
getRefund();
import requests
headers = {
'ApiKey': '<YOUR_API_KEY>',
'MerchantId': '<YOUR_MERCHANT_ID>',
'Environment': 'sandbox',
}
response = requests.get('https://api.hub2.io/refunds/1', headers=headers)
if response.status_code == 200:
print(response.json())
else:
print(f'HTTP status: {response.status_code}')
{
"id": 1,
"status": "successful",
"transactionId": "tr_R7xkvVd5gRfBCWQCYrWEt",
"amount": 2000,
"currency": "XOF",
"reason": "refund",
"paymentMethod": "mobile_money",
"fallbackUsed": false,
"createdAt": "2026-01-15T12:00:00.000Z",
"updatedAt": "2026-01-15T12:30:00.000Z"
}
