Invoices

An invoice is the core object in Muamla. It represents an amount to collect and provides a hosted page (url) where the customer pays from their bank wallet. All amounts are integers in the smallest MRU unit (1 MRU = 100).

Create an invoice

POST /v1/invoices with your secret key (HTTP Basic — key as the username, empty password). The endpoint accepts form-encoded or JSON bodies. Only amount and description are required.

bash
curl https://app.muamla.org/v1/invoices \
  -u sk_test_your_key: \
  -d "amount=500000" \
  -d "description=Order #1024" \
  -d "currency=MRU" \
  -d "callback_url=https://example.com/webhooks/muamla" \
  -d "success_url=https://example.com/thanks" \
  -d "expired_at=2026-07-01T00:00:00Z"

Request fields

FieldTypeRequiredDescription
amountintegerYesSmallest MRU unit, ≥ 100 (e.g. 500000 = 5,000 MRU).
descriptionstringYesShown to the customer on the hosted page.
currencystringNoDefaults to MRU (the only supported currency today).
callback_urluriNoReceives signed webhook events for this invoice. See Webhooks.
success_urluriNoWhere the customer is sent after a successful payment.
back_urluriNoWhere the customer is sent if they go back / cancel.
expired_attimestampNoISO-8601. Payment is blocked after this time.
metadataobjectNoCustom key/value pairs echoed back on the invoice (JSON bodies only).
given_idstringNoIdempotency — set the invoice id yourself. Sending the same given_id again returns the existing invoice instead of creating a duplicate.

Response (201 Created)

json
{
  "id": "inv_8x2K9aFqR3mB7nZ1",
  "status": "initiated",
  "amount": 500000,
  "currency": "MRU",
  "amount_format": "5,000 MRU",
  "description": "Order #1024",
  "reference": "MR-KSIEYR",
  "url": "https://app.muamla.org/pay/inv_8x2K9aFqR3mB7nZ1",
  "metadata": {},
  "expired_at": "2026-07-01T00:00:00.000Z",
  "created_at": "2026-06-29T19:00:00.000Z",
  "updated_at": "2026-06-29T19:00:00.000Z"
}
  • url — the hosted checkout page. Redirect the customer here, or share it as a payment link.
  • reference — the payment reference the customer uses inside their wallet.

Retrieve an invoice

bash
curl https://app.muamla.org/v1/invoices/inv_8x2K9aFqR3mB7nZ1 \
  -u sk_test_your_key:

Returns the same invoice object. Use this to poll status if you aren't using webhooks.

List invoices

bash
curl https://app.muamla.org/v1/invoices -u sk_test_your_key:
json
{ "data": [ { "id": "inv_…", "status": "verified", "amount": 500000, "…": "…" } ] }

Invoice statuses

StatusMeaning
initiatedCreated, awaiting payment.
verifiedThe transfer was confirmed with the bank — safe to fulfil.
failedVerification failed (wrong reference, no matching transfer).
expiredPassed its expired_at before being paid.
canceledCanceled by the merchant.
refundedA verified payment was refunded (planned).
Next: see Payment & verification for how the customer pays and how an invoice becomes verified.