---
title: Create an invoice
description: Send a bill the customer pays later from any MoMo channel. Needs the collect permission.
api: POST /invoices
---

When it's paid, RazPay adds a collection to the ledger with the same `external_reference` and sends `invoice.paid`. See [Invoices](/docs/guides/invoices).

- **`external_reference`** · body · `string` · required

  Your unique reference for this invoice. It can't already be used by a transaction. Retrying with it returns the original invoice.

- **`provider`** · body · `string` · required · default `momo`

  Provider to issue it through.

- **`amount`** · body · `number` · required

  Amount due, in major units.

- **`currency`** · body · `string` · required · default `SZL`

  ISO 4217 code.

- **`phone_number`** · body · `string` · required

  Who should pay it.

- **`description`** · body · `string`

  Shown to the payer. Up to 160 characters.

- **`validity_seconds`** · body · `integer` · required

  How long it can be paid.

- **`metadata`** · body · `object`

  Your own data. Copied onto the collection when the invoice is paid.

## The invoice object

- **`external_reference`** · `string` · required

  Your reference.

- **`provider_id`** · `string` · required

  The provider.

- **`provider_ref`** · `string` · required

  The reference RazPay gave the provider.

- **`provider_invoice_id`** · `string`

  The provider's own invoice id, once assigned.

- **`payment_reference`** · `string`

  The provider's payment reference for the payer, once assigned.

- **`amount`** · `number` · required

  Amount due.

- **`currency`** · `string` · required

  ISO 4217 code.

- **`payer_phone`** · `string` · required

  Who should pay it, canonical form.

- **`description`** · `string`

  As sent.

- **`validity_seconds`** · `integer` · required

  As sent.

- **`status`** · `string` · required

  `pending`, `paid`, `failed`, `cancelled` or `expired`.

- **`failure_reason`** · `string`

  Why it failed.

- **`expires_at`** · `integer`

  Unix time (seconds) it stops being payable.

- **`metadata`** · `object` · required

  Your own data.

- **`created_at`** · `integer` · required

  Unix time (seconds) it was created.

- **`updated_at`** · `integer` · required

  Unix time (seconds) of its last change.

```json 200
{
  "success": true,
  "message": "invoice created",
  "data": {
    "external_reference": "fees-term2-0042",
    "provider_id": "momo",
    "provider_ref": "5d1e7a2b-9c3f-4e6a-8b0d-2f4c6e8a0b1d",
    "amount": 1500,
    "currency": "SZL",
    "payer_phone": "26876123456",
    "description": "Term 2 school fees",
    "validity_seconds": 1209600,
    "status": "pending",
    "expires_at": 1761984000,
    "metadata": {},
    "created_at": 1760774400,
    "updated_at": 1760774400
  }
}
```
