Overview
Retrieve a paginated list of your wallet transactions, including both debits (payments) and credits (deposits).
Required permission: payment:read
Endpoint
GET /api/payments/list-transactions
Request
Query parameters
Page number for pagination
Number of items per page (max 100)
Response
Success response
Always true for successful requests
Total number of transactions
Array of transaction objects
Examples
curl "https://api.chidori.africa/api/payments/list-transactions?page=1&limit=20" \
-H "X-API-Key: sk_live_xxx.yyy"
{
"status": true,
"data": {
"page": 1,
"limit": 20,
"total": 45,
"items": [
{
"id": "txn-123-456-789",
"type": "DEBIT",
"amount": 2500,
"reference": "order_12345_payment",
"description": "Delivery payment - CHI-ABC123",
"balanceBefore": 50000,
"balanceAfter": 47500,
"createdAt": "2025-01-15T10:30:00.000Z"
},
{
"id": "txn-456-789-012",
"type": "CREDIT",
"amount": 100000,
"reference": "deposit_paystack_xyz",
"description": "Wallet funding",
"balanceBefore": 0,
"balanceAfter": 100000,
"createdAt": "2025-01-15T09:00:00.000Z"
}
]
}
}
Transaction types
| Type | Description |
|---|
DEBIT | Money deducted from wallet (delivery payments) |
CREDIT | Money added to wallet (deposits, refunds) |
Use cases
Generate monthly statement
async function getMonthlyStatement(year, month) {
const transactions = [];
let page = 1;
let hasMore = true;
while (hasMore) {
const response = await fetch(
`https://api.chidori.africa/api/payments/list-transactions?page=${page}&limit=100`,
{ headers: { 'X-API-Key': apiKey } }
);
const { data } = await response.json();
// Filter by month
const monthlyTxns = data.items.filter(txn => {
const date = new Date(txn.createdAt);
return date.getFullYear() === year && date.getMonth() === month - 1;
});
transactions.push(...monthlyTxns);
hasMore = data.items.length === 100;
page++;
}
return transactions;
}
async function calculateTotalSpending() {
let totalSpent = 0;
let page = 1;
let hasMore = true;
while (hasMore) {
const response = await fetch(
`https://api.chidori.africa/api/payments/list-transactions?page=${page}&limit=100`,
{ headers: { 'X-API-Key': apiKey } }
);
const { data } = await response.json();
totalSpent += data.items
.filter(txn => txn.type === 'DEBIT')
.reduce((sum, txn) => sum + txn.amount, 0);
hasMore = data.items.length === 100;
page++;
}
return totalSpent;
}
Next steps