API Reference / Invoices
Create invoice
POSThttps://api.moolre.com/open/invoice/create
Create an invoice with a hosted payment page. The same invoices appear in the Moolre dashboard. The API does not send the email, PDF or SMS that the dashboard sends: give the customer the payment_link.
Headers
- X-API-USER string required
Your Moolre username.
- X-API-KEY string required
Your wallet private API key. A public key is refused.
- Idempotency-Key string optional
Optional. 1 to 128 printable characters. Repeating a request with the same key and the same body returns the stored response with meta.replayed true for 24 hours; the same key with a different body returns IDEM01.
Body parameters
- accountnumber string required
Your Moolre wallet account number.
- currency string required
GHS or NGN. Must equal the wallet currency.
- service_id string optional
Required only when the wallet has several collection services. Otherwise the single service is used.
- invoice_name string required
Title of the invoice, at most 100 characters.
- customer object required
name (required, at most 100 characters), phone (9 to 15 digits, optional leading +) and email (optional). A customer with the same phone on the service is reused.
- amount string optional
A single line for this amount. Send either amount or items.
- items array optional
Send either amount or items: 1 to 50 lines of { description (at most 200 characters), quantity (whole number 1 to 100000, default 1), amount (unit price) }.
- tax number optional
Percent, 0 to 100. Default 0. Total = subtotal x (1 + tax / 100), rounded to the cent.
- due_date string required
YYYY-MM-DD (end of that day) or YYYY-MM-DD HH:MM:SS, UTC. Not in the past and within 2 years.
- narration string optional
At most 500 characters. Defaults to invoice_name.
- reference string optional
Your reference, at most 128 characters, unique per wallet. The same reference with the same body returns the original invoice (INV02); a different body is INV07.
- metadata object optional
Up to 2000 bytes of your own data, returned as given.
Responses
200 Success
The invoice object. INV02 with data.replayed true is returned when the same reference and body are sent again.
{ "status": 1, "code": "INV01", "message": "Invoice created.", "data": { "invoiceid": "5-1", "status": "pending", "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": [] }}200 (HTTP 409 in strict mode) Reference reused
The reference was already used on this wallet for a different invoice.
{ "status": 0, "code": "INV07", "message": "reference was already used on this wallet for a different invoice.", "data": "reference", "go": null, "meta": { "requestid": "req_c68f4c66115c26725c796242", "notices": [] }}