Create an invoice
Creates an invoice. By default it’s a draft: finalize it to give it a number and a payment link, or send it straight away with send: true. Your customer pays on the hosted page with MTN Mobile Money or Airtel Money and gets a receipt.
invoices:writeHeaders#
Idempotency-Keystringheader8–80 letters, digits, - or _. Lets you retry safely: the same key and body return the first answer and never move money twice. See Idempotency.
Body#
JSON, with Content-Type: application/json.
customerobjectrequiredWho you are billing.
Show child attributes
namestringrequiredThe customer’s name.
emailstringNeeded to email the invoice and the receipt.
phonestringNeeded to text the invoice. It also fills in the payment page.
addressstringPrinted on the invoice.
itemsarrayrequiredUp to 50 lines.
Show child attributes
descriptionstringrequiredWhat the line is for.
quantityintegerrequiredHow many.
unit_amountintegerrequiredThe price of one, in whole UGX.
tax_percentnumberTax on the subtotal, such as 18 for VAT. Rounded to the nearest shilling.
due_datestringA date such as 2026-11-30. Or use days_until_due.
days_until_dueintegerDays from today. Defaults to your invoice settings (14 days unless you changed it).
wallet_idstringWhere payments land. Defaults to your main wallet.
fee_bearerstringwallet or customer. With customer, the collection fee is added on the payment page and the wallet receives the full total.
memostringA note on the invoice, up to 1,000 characters.
footerstringSmall print at the bottom, up to 500 characters.
referencestringYour own unique id for the invoice, up to 64 characters.
metadataobjectUp to 20 keys of your own, with simple values. Returned on the object and in webhooks.
finalizebooleantrue gives it a number and payment link now.
sendbooleantrue finalizes it and sends it.
send_viaarraydefault: ["email"]["email"], ["sms"] or both.
Returns#
The invoice. Once finalized, hosted_invoice_url is the payment link: share it anywhere. invoice_pdf downloads the PDF without a key. With send, delivery says what was sent.
Errors#
| Status | Code | When |
|---|---|---|
| 422 | INVALID_TOTAL | The total must be between UGX 500 and UGX 5,000,000 to be paid with mobile money. |
| 422 | NO_CUSTOMER_EMAIL | You asked to email it, but there’s no customer.email. |
| 422 | NO_CUSTOMER_PHONE | You asked to text it, but there’s no customer.phone. |
| 409 | DUPLICATE_REFERENCE | Another invoice already has this reference. |
The common codes, such as UNAUTHENTICATED and RATE_LIMITED, can come from any endpoint. See Errors.