Receipts and payment history
Read the payments applied to an invoice and download the receipt of each one.
An invoice can take several payments: through its pay link, recorded by you, or both. Each payment applied to an invoice gets its own receipt with its own number.
The payment history of an invoice
Retrieve an invoice and read payments, oldest first. It is empty
while the invoice has no payment. The same list is in the invoice.updated and invoice.paid
webhook events, and the invoice PDF lists each payment with its receipt number.
{
"status": "open",
"unitAmount": 10000,
"amountRemaining": 3000,
"payments": [
{
"id": "6f1c0a52-9d3e-4b7a-8c21-0e5d7a9b3c14",
"kind": "online_payment",
"method": "mobile_money",
"amount": 4000,
"paidAt": "2026-12-01T08:12:40Z",
"receiptNumber": "RCT-000011",
"payment_method_details": {
"type": "mobile_money",
"mobile_money": { "network": "mpesa", "phone": "25574*****11" }
},
"transactionCode": "QJK4A7XMN2",
"paymentId": "0b6f3c1e-8f2a-4a51-9a57-6d1f0c2b7e93"
},
{
"id": "b7e2d4c8-1a6f-4d93-a0b5-3c8e9f1d2a47",
"kind": "payment_record",
"method": "bank_transfer",
"reference": "TRF-20261201-0042",
"amount": 3000,
"paidAt": "2026-12-01T09:30:00Z",
"receiptNumber": "RCT-000012",
"payment_method_details": { "type": "bank_transfer" }
}
]
}The example leaves out issuer and the other invoice fields.
| Field | Meaning |
|---|---|
id | The payment's ID in this list. Use it to download the receipt. |
kind | online_payment for a payment your customer made through the pay link, payment_record for one you recorded. |
method | mobile_money, bank_transfer, cash, cheque or custom. The same as payment_method_details.type. |
amount | The amount paid, an integer in the currency's minor unit. |
paidAt | When it was paid. |
reference | The reference your customer sees. Left out when there is none. |
receiptNumber | The number of the receipt. Left out until the payment has one. |
payment_method_details | For a payment through the pay link, the network and the customer's number with the middle hidden, when they are known. For a recorded payment, the type you sent, and for custom the name you gave. |
transactionCode | The network's own code for the transaction. Left out for a recorded payment, and when it is not known. |
paymentId | The ID of the payment in the payments API, for a payment through the pay link. Left out for a recorded payment. |
refunds | The refunds paid out against this payment, each with the creditNoteNumber of the credit note that records it, its amount and refundedAt. Left out when there are none. |
issuer | Who issued the receipt, as it was when the payment was made. |
To refund a payment made through the pay link, send its paymentId to Create a refund.
A recorded payment has no paymentId.
Download a receipt
Download a receipt takes the invoice's ID and the id of an
item in payments, and returns a PDF file. The key needs the billing.read scope.
curl "https://api-malipo.flex.co.tz/api/v1/invoices/<invoice id>/payments/<payment id>/receipt" \
-H "Authorization: Bearer <token>" \
-o receipt.pdfThe receipt carries:
- its number,
RCT-followed by at least six digits, counted per merchant and mode with no gaps; - your merchant name, and what the payment paid and what is still to pay on the invoice;
- for a mobile money payment, the network, the customer's number with the middle hidden and the network's transaction code.
The receipt is in English. You get 404 when you have no invoice with this ID or the invoice has no payment with this
ID, and 503 when the receipt cannot be prepared right now: try again in a moment.
What your customer gets
- For every payment you record, your customer gets a receipt by email.
- A customer who paid through the pay link can open the receipt of that payment from the payment page.
Which list holds what
| You want | Read |
|---|---|
| Every payment on one invoice, whichever way it was paid | payments on the invoice. |
| Mobile money payments made through Flex Malipo | List payments. |
| Payments you recorded, across all invoices | List payment records. |