Skip to content

Create invoice

POST
/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.

history

Request History

Your request history will appear here.

Headers

X-API-USER stringrequired

Your Moolre username.

X-API-KEY stringrequired

Your wallet private API key. A public key is refused.

Idempotency-Key stringoptional

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 Params

accountnumberstringrequired

Your Moolre wallet account number.

currencystringrequired

GHS or NGN. Must equal the wallet currency.

service_idstringoptional

Required only when the wallet has several collection services. Otherwise the single service is used.

invoice_namestringrequired

Title of the invoice, at most 100 characters.

customerobjectrequired

The customer being invoiced. A customer with the same phone on the service is reused.

Show fields (3)
customer.namestringrequired
At most 100 characters.
customer.phonestringrequired
9 to 15 digits, optional leading +.
customer.emailstringoptional
Customer email address.
JSON2 fields
amountstringoptional

A single line for this amount. Send either amount or items.

itemsarrayoptional

Send either amount or items: 1 to 50 invoice lines, each an object with the fields below.

Show item fields (3)
items[].descriptionstringrequired
At most 200 characters.
items[].quantityintegeroptional
Whole number from 1 to 100000. Default 1.
items[].amountstringrequired
Unit price.
JSONEmpty
taxnumberoptional

Percent, 0 to 100. Default 0. Total = subtotal x (1 + tax / 100), rounded to the cent.

due_datestringrequired

YYYY-MM-DD (end of that day) or YYYY-MM-DD HH:MM:SS, UTC. Not in the past and within 2 years.

narrationstringoptional

At most 500 characters. Defaults to invoice_name.

referencestringoptional

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.

metadataobjectoptional

Up to 2000 bytes of your own data, returned as given.

JSONEmpty

Responses

The invoice object. INV02 with data.replayed true is returned when the same reference and body are sent again.

statusinteger
1 for success
codestring
Response code, INV01
messagestring
Response message
dataobject
Result
gonull
Navigation hint
metaobject
Always present. meta.requestid is the unique id of this request (also the X-Request-Id header); quote it to support. meta.notices is an array, empty when there is nothing to report. meta.replayed is true only on an idempotent replay.
{  "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": []  }}

The reference was already used on this wallet for a different invoice.

statusinteger
0 for failure
codestring
Response code, for example INV07
messagestring
Error message
datastring | object | null
The failing field, or details
metaobject
Always present: meta.requestid (the unique id of this request) and meta.notices (an array)
{  "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": []  }}

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.

Language

curl --request POST \     --url 'https://api.moolre.com/open/invoice/create' \     --header 'X-API-USER: Your Username' \     --header 'X-API-KEY: YOUR_API_KEY' \     --header 'Content-Type: application/json' \     --data '{  "accountnumber": "",  "currency": "GHS",  "invoice_name": "Term 1 fees",  "customer": {    "name": "Ama Mensah",    "phone": "0240000001"  },  "amount": "100.00",  "due_date": "2026-12-31",  "reference": "INV-1001"}'

Response

Body

{  "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": []  }}