Cancel invoice
Cancel an unpaid invoice. Its hosted link stops working. Cancelling an invoice that is already cancelled succeeds again (INV17); an invoice that is paid or has payments cannot be cancelled (INV18).
Request History
Your request history will appear here.
Headers
Your Moolre username.
Your wallet private API key. A public key is refused.
Body Params
Your Moolre wallet account number.
The invoiceid to cancel.
Responses
The invoice is cancelled.
{ "status": 1, "code": "INV17", "message": "Invoice cancelled.", "data": { "invoiceid": "5-1", "status": "cancelled", "reference": "INV-1001", "invoice_name": "Term 1 fees", "currency": "GHS", "total": "100.00", "amount_paid": "0.00", "tax": "0", "items": [ { "amount": "50.00", "quantity": "2", "description": "Tuition" } ], "customer": { "name": "Ama Mensah", "phone": "0240000001", "email": "" }, "narration": "Term 1 fees", "due_date": "2026-12-31T23:59:59Z", "payment_link": "https://invoice.moolre.com/5-1", "payment_code": "*203*0621#", "metadata": null, "created": "2026-11-15T09:00:00Z" }, "go": null, "meta": { "requestid": "req_c68f4c66115c26725c796242", "notices": [] }}The invoice is paid or has payments. data is the invoice.
{ "status": 0, "code": "INV18", "message": "This invoice has payments and cannot be cancelled.", "data": { "invoiceid": "5-1", "status": "paid", "reference": "INV-1001", "invoice_name": "Term 1 fees", "currency": "GHS", "total": "100.00", "amount_paid": "0.00", "tax": "0", "items": [ { "amount": "50.00", "quantity": "2", "description": "Tuition" } ], "customer": { "name": "Ama Mensah", "phone": "0240000001", "email": "" }, "narration": "Term 1 fees", "due_date": "2026-12-31T23:59:59Z", "payment_link": "https://invoice.moolre.com/5-1", "payment_code": "*203*0621#", "metadata": null, "created": "2026-11-15T09:00:00Z" }, "go": null, "meta": { "requestid": "req_c68f4c66115c26725c796242", "notices": [] }}Fields every response can carry
On failures, read code, message and data (the first failing field). meta is always present and holds requestid (also the X-Request-Id header), notices and, only on idempotent replays, replayed. There is no outcome field: use status, code and data.txstatus. Send X-Moolre-Http-Status: strict to receive real HTTP status codes. See Responses and request IDs and Errors and status codes.
