---
title: "Create an invoice"
method: POST
path: "/billing/invoices"
---

# Create an invoice

`POST /billing/invoices`

## Headers

- `merchant` string, required

## Request body

- object
  - `customerId` string, required — Identifier of the customer the invoice is billed to.
  - `paymentMethodToken` string — An existing payment method token that was generated by the Ezypay Vault. If no value is provided the system will attempt to use the current default payment token associated with the customer. In the event that no value is provided and no default payment method is associated with the customer the system will create an invoice with a status of `past_due`.
  - `memo` string — Description of the invoice item. Max of 100 characters.
  - `items` object[], required — Details of the individual items that are included in the invoice.
    - `description` string — Description of the invoice Item.
    - `accountingCode` string — Specify an accounting code to categorise revenue collected from the invoice item. Max of 50 characters.
    - `amount` object
      - `currency` string, required — Three letter ISO 4217 currency code for the amount.
      - `value` number, double, required — The value of the amount. Must be positive value greater than zero.
      - `type` string — The type of the amount value. Supported values are: `percentage`, `fixed_amount`
    - `tax` object
      - `rate` number, double — Rate of the specified tax in percentage. Supported values are from 0 to 99.99.
    - `reference` string — Additional reference for invoice
  - `autoPayment` string — Determines if auto payment processing occurs for invoices generated from the subscription. Supported value are: `true` - Default value. Invoices generated will automatically proceed to payment processing. `false` - Invoices are generated but will not automatically proceed to payment processing.
  - `scheduledPaymentDate` string — Set the next scheduled payment date to have payment automatically attempted in the future. Must be at least one day after today's date but no more than one year (365 days). If null or no value is provided, attempts payment on invoice issue date. However, payment processing will only be attempted if `autoPayment = true`. Supported format is YYYY-MM-DD.
  - `externalInvoiceId` string — [Recommended] An invoice id from integrator's system that works as a correlation id with the invoice from Ezypay's system, which helps to identify the invoice. It should be unique per merchant
  - `processingModel` string — The processing model used when attempting payment against the invoice. Set to `cardonfile` when processing on-demand payments, and `recurring` if the invoice is associated with a recurring scheduled payment agreement. If no value is provided, the default value is `recurring`.

## Response `200`

200

- object
  - `id` string
  - `documentNumber` string
  - `date` string
  - `dueDate` string
  - `scheduledPaymentDate` string
  - `status` string
  - `memo` string
  - `items` object[]
    - `description` string
    - `amount` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `tax` object
      - `rate` integer
    - `id` string
    - `type` string
    - `discounted` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `accountingCode` unknown
  - `amount` object
    - `currency` string
    - `value` integer
    - `type` unknown
  - `amountWithoutDiscount` object
    - `currency` string
    - `value` integer
    - `type` unknown
  - `totalDiscounted` object
    - `currency` string
    - `value` integer
    - `type` unknown
  - `totalRefunded` object
    - `currency` string
    - `value` integer
    - `type` unknown
  - `totalTax` object
    - `currency` string
    - `value` integer
    - `type` unknown
  - `customerId` string
  - `subscriptionId` string
  - `checkoutId` string
  - `subscriptionName` string
  - `paymentMethodToken` string
  - `autoPayment` boolean
  - `processingModel` string
  - `createdOn` string
  - `payNowUrl` string
  - `channel` string
  - `qrData` object
    - `qrString` string
    - `expires` string, date-time

## Other responses

- `400` — 400

---

[API](https://skmtc.dev/ezypay/apis/vault.md) · [All operations](https://skmtc.dev/ezypay/apis/vault/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ezypay/vault/revisions/2ca692551cdf/schema)
