curl --location --request GET 'https://api.hub2.io/refunds?fromDate=2023-01-01T00:00:00.000&toDate=2023-01-01T12:00:00.000&page=1&perPage=100' \
--header 'ApiKey: [REDACTED]' \
--header 'MerchantId: [REDACTED]' \
--header 'Environment: sandbox' \
--header 'Content-Type: application/json'
import fetch from 'node-fetch';
async function getRefunds() {
const response = await fetch('https://api.hub2.io/refunds?fromDate=2023-01-01T00:00:00.000&toDate=2023-01-01T12:00:00.000&page=1&perPage=100', {
method: 'GET',
headers: {
'ApiKey': '[REDACTED]',
'MerchantId': '[REDACTED]',
'Environment': 'sandbox',
'Content-Type': 'application/json'
}
});
if (response.ok) {
const refunds = await response.json();
console.log(refunds);
} else {
console.log(`HTTP Status: ${response.status}`);
}
}
getRefunds();
import requests
headers = {
'ApiKey': '[REDACTED]',
'MerchantId': '[REDACTED]',
'Environment': 'sandbox',
'Content-Type': 'application/json',
}
response = requests.get(
'https://api.hub2.io/refunds?fromDate=2023-01-01T00:00:00.000&toDate=2023-01-01T12:00:00.000&page=1&perPage=100',
headers=headers
)
if response.status_code == 200:
print(response.json())
else:
print(f'HTTP Status: {response.status_code}')
{
"data": [
{
"id": 123,
"status": "successful",
"transactionId": "tr_000000000000000000011",
"amount": 2000,
"currency": "XOF",
"reason": "Customer requested refund",
"paymentMethod": "mobile_money",
"fallbackAllowed": true,
"fallbackUsed": false,
"metadata": {},
"zendeskTicketId": "zd_123456",
"createdAt": "2023-01-01T12:00:00.000Z",
"updatedAt": "2023-01-01T12:30:00.000Z"
},
{
"id": 124,
"status": "pending",
"transactionId": "tr_000000000000000000012",
"amount": 1500,
"currency": "XOF",
"reason": "Merchant initiated refund",
"paymentMethod": "mobile_money",
"fallbackAllowed": true,
"fallbackUsed": false,
"metadata": {},
"zendeskTicketId": "zd_789012",
"createdAt": "2023-01-01T11:30:00.000Z",
"updatedAt": "2023-01-01T11:30:00.000Z"
}
],
"pagination": {
"page": 1,
"perPage": 100,
"total": 2,
"totalPages": 1
}
}
Refunds
Retrieve refunds collection
This endpoint allows you to retrieve a list of refunds with filtering and pagination options.
GET
/
refunds
curl --location --request GET 'https://api.hub2.io/refunds?fromDate=2023-01-01T00:00:00.000&toDate=2023-01-01T12:00:00.000&page=1&perPage=100' \
--header 'ApiKey: [REDACTED]' \
--header 'MerchantId: [REDACTED]' \
--header 'Environment: sandbox' \
--header 'Content-Type: application/json'
import fetch from 'node-fetch';
async function getRefunds() {
const response = await fetch('https://api.hub2.io/refunds?fromDate=2023-01-01T00:00:00.000&toDate=2023-01-01T12:00:00.000&page=1&perPage=100', {
method: 'GET',
headers: {
'ApiKey': '[REDACTED]',
'MerchantId': '[REDACTED]',
'Environment': 'sandbox',
'Content-Type': 'application/json'
}
});
if (response.ok) {
const refunds = await response.json();
console.log(refunds);
} else {
console.log(`HTTP Status: ${response.status}`);
}
}
getRefunds();
import requests
headers = {
'ApiKey': '[REDACTED]',
'MerchantId': '[REDACTED]',
'Environment': 'sandbox',
'Content-Type': 'application/json',
}
response = requests.get(
'https://api.hub2.io/refunds?fromDate=2023-01-01T00:00:00.000&toDate=2023-01-01T12:00:00.000&page=1&perPage=100',
headers=headers
)
if response.status_code == 200:
print(response.json())
else:
print(f'HTTP Status: {response.status_code}')
{
"data": [
{
"id": 123,
"status": "successful",
"transactionId": "tr_000000000000000000011",
"amount": 2000,
"currency": "XOF",
"reason": "Customer requested refund",
"paymentMethod": "mobile_money",
"fallbackAllowed": true,
"fallbackUsed": false,
"metadata": {},
"zendeskTicketId": "zd_123456",
"createdAt": "2023-01-01T12:00:00.000Z",
"updatedAt": "2023-01-01T12:30:00.000Z"
},
{
"id": 124,
"status": "pending",
"transactionId": "tr_000000000000000000012",
"amount": 1500,
"currency": "XOF",
"reason": "Merchant initiated refund",
"paymentMethod": "mobile_money",
"fallbackAllowed": true,
"fallbackUsed": false,
"metadata": {},
"zendeskTicketId": "zd_789012",
"createdAt": "2023-01-01T11:30:00.000Z",
"updatedAt": "2023-01-01T11:30:00.000Z"
}
],
"pagination": {
"page": 1,
"perPage": 100,
"total": 2,
"totalPages": 1
}
}
Retrieves a paginated list of refunds. You can filter the results using various query parameters.
Query Parameters
string
Filter by refund ID
string
Filter refunds created after this date (ISO 8601 format, e.g.,
2023-01-01T00:00:00.000Z)string
Filter refunds created before this date (ISO 8601 format, e.g.,
2023-01-01T12:00:00.000Z)string
Filter by refund status. Possible values:
created, pending, pending_manual, successful, failedstring
Filter by transfer reference (original transfer reference)
number
default:"1"
Page number for pagination
number
default:"100"
Number of results per page (max 100)
Response
array
Array of refund objects
Show Refund Object
Show Refund Object
number
The unique refund ID
string
The current status of the refund
string
The original transfer ID that is being refunded
number
The refund amount
string
The currency of the refund
string
The reason for the refund
string
The payment method used for the refund
boolean
Whether fallback methods are allowed
boolean
Whether a fallback method was used
object
Additional metadata associated with the refund
string
The Zendesk ticket ID associated with the refund
string
The date and time when the refund was created
string
The date and time when the refund was last updated
object
curl --location --request GET 'https://api.hub2.io/refunds?fromDate=2023-01-01T00:00:00.000&toDate=2023-01-01T12:00:00.000&page=1&perPage=100' \
--header 'ApiKey: [REDACTED]' \
--header 'MerchantId: [REDACTED]' \
--header 'Environment: sandbox' \
--header 'Content-Type: application/json'
import fetch from 'node-fetch';
async function getRefunds() {
const response = await fetch('https://api.hub2.io/refunds?fromDate=2023-01-01T00:00:00.000&toDate=2023-01-01T12:00:00.000&page=1&perPage=100', {
method: 'GET',
headers: {
'ApiKey': '[REDACTED]',
'MerchantId': '[REDACTED]',
'Environment': 'sandbox',
'Content-Type': 'application/json'
}
});
if (response.ok) {
const refunds = await response.json();
console.log(refunds);
} else {
console.log(`HTTP Status: ${response.status}`);
}
}
getRefunds();
import requests
headers = {
'ApiKey': '[REDACTED]',
'MerchantId': '[REDACTED]',
'Environment': 'sandbox',
'Content-Type': 'application/json',
}
response = requests.get(
'https://api.hub2.io/refunds?fromDate=2023-01-01T00:00:00.000&toDate=2023-01-01T12:00:00.000&page=1&perPage=100',
headers=headers
)
if response.status_code == 200:
print(response.json())
else:
print(f'HTTP Status: {response.status_code}')
{
"data": [
{
"id": 123,
"status": "successful",
"transactionId": "tr_000000000000000000011",
"amount": 2000,
"currency": "XOF",
"reason": "Customer requested refund",
"paymentMethod": "mobile_money",
"fallbackAllowed": true,
"fallbackUsed": false,
"metadata": {},
"zendeskTicketId": "zd_123456",
"createdAt": "2023-01-01T12:00:00.000Z",
"updatedAt": "2023-01-01T12:30:00.000Z"
},
{
"id": 124,
"status": "pending",
"transactionId": "tr_000000000000000000012",
"amount": 1500,
"currency": "XOF",
"reason": "Merchant initiated refund",
"paymentMethod": "mobile_money",
"fallbackAllowed": true,
"fallbackUsed": false,
"metadata": {},
"zendeskTicketId": "zd_789012",
"createdAt": "2023-01-01T11:30:00.000Z",
"updatedAt": "2023-01-01T11:30:00.000Z"
}
],
"pagination": {
"page": 1,
"perPage": 100,
"total": 2,
"totalPages": 1
}
}
⌘I
