Receipts API
Retrieve payment receipts issued by your business.
Receipts are automatically generated when payments are processed against invoices, orders, or subscriptions. The Receipts API gives you read access to all issued receipts — useful for reconciliation, record keeping, or sharing receipts with customers.
Read-Only
The Receipts API is read-only. Receipts are created automatically when payments are confirmed.
Use Cases
- Record Keeping: Archive issued receipts in your own systems
- Customer Support: Retrieve receipts to share with customers on request
- Reconciliation: Match receipt records against your accounting system
Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /business/receipt/list | List all receipts |
GET | /business/receipt/details/:id | Get receipt details |
List Receipts
Retrieve a paginated list of receipts.
http
GET /business/receipt/listQuery Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number |
limit | integer | 10 | Results per page (max: 100) |
search | string | - | Search by title or receipt number |
status | string | - | Filter by status: draft, issued, cancelled |
Example Request
bash
curl -X GET "https://api.cashfin.africa/business/receipt/list?page=1&limit=10" \
-H "Authorization: cs_your_client_secret"javascript
const response = await fetch(
"https://api.cashfin.africa/business/receipt/list?page=1&limit=10",
{
headers: { Authorization: "cs_your_client_secret" },
}
);
const data = await response.json();python
import requests
response = requests.get(
'https://api.cashfin.africa/business/receipt/list',
headers={'Authorization': 'cs_your_client_secret'},
params={'page': 1, 'limit': 10}
)Success Response
json
{
"success": true,
"data": [
{
"_id": "507f1f77bcf86cd799439055",
"receiptno": "RCP-2024-001",
"title": "Receipt for INV-2024-001",
"amount": 12500.0,
"status": "issued",
"date": "2024-01-15T14:22:00.000Z",
"createdat": "2024-01-15T14:22:00.000Z"
}
],
"pagination": {
"total": 45,
"page": 1,
"limit": 10,
"pages": 5
}
}Get Receipt Details
Retrieve full details of a specific receipt.
http
GET /business/receipt/details/:idPath Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Receipt ID (MongoDB ObjectID) |
Example Request
bash
curl -X GET "https://api.cashfin.africa/business/receipt/details/507f1f77bcf86cd799439055" \
-H "Authorization: cs_your_client_secret"javascript
const receiptId = "507f1f77bcf86cd799439055";
const response = await fetch(
`https://api.cashfin.africa/business/receipt/details/${receiptId}`,
{
headers: { Authorization: "cs_your_client_secret" },
}
);
const data = await response.json();python
import requests
receipt_id = '507f1f77bcf86cd799439055'
response = requests.get(
f'https://api.cashfin.africa/business/receipt/details/{receipt_id}',
headers={'Authorization': 'cs_your_client_secret'}
)Success Response
json
{
"success": true,
"data": {
"_id": "507f1f77bcf86cd799439055",
"receiptno": "RCP-2024-001",
"title": "Receipt for INV-2024-001",
"amount": 12500.0,
"status": "issued",
"description": "Payment received via M-Pesa",
"date": "2024-01-15T14:22:00.000Z",
"transactionid": "507f1f77bcf86cd799439050",
"section": "invoice",
"createdat": "2024-01-15T14:22:00.000Z",
"updatedat": "2024-01-15T14:22:00.000Z"
}
}Error Responses
Receipt Not Found
json
{
"success": false,
"error": "Receipt not found"
}Invalid Receipt ID
json
{
"success": false,
"error": "Invalid receipt ID format"
}