---
title: "Update an invoice"
method: PUT
path: "/billing/invoices/{invoiceId}"
---

# Update an invoice

`PUT /billing/invoices/{invoiceId}`

## Request

- Base URL: `https://api-sandbox.ezypay.com/v2`
- URL: `https://api-sandbox.ezypay.com/v2/billing/invoices/{invoiceId}`
- Auth: OAuth 2
  - Client credentials
  - Token URL: `https://identity-sandbox.ezypay.com/token`

Change the details of an invoice. 

For an on-demand invoice that has not been sent for payment processing (status is unpaid), all the values in the body parameters can be updated.

For invoice with status past_due, only the following values can be changed: payment method token, next scheduled payment date, and description. You can also apply a discount on an invoice item. Take note that the invoice amount cannot be updated to have a reduction of the initial invoice amount. This will need to be actioned via a "discount". The "invoiceItemId" need to be provided in the request body if the integrator choose to provide a discount to a specific item in the invoice.

## Path parameters

- `invoiceId` string, required

## Headers

- `merchant` string, required

## Request body

- object
  - `paymentMethodToken` string: The payment method token that will replace the invoice's current payment method token.
  - `scheduledPaymentDate` string: Set the next scheduled payment date to have payment automatically attempted in the future. Future date specified must be at least tomorrow's date (one day after today's date) but no more than one year (365 days). If future date is valid, payment will be attempted as `autoPayment` will always be set to `true`. Supported format is YYYY-MM-DD. If set to null, no scheduled payment will occur as `autoPayment` will be set to `false`. If no value is provided, the current value is retained.
  - `externalInvoiceId` string: The invoice Id from integrator's system.
  - `processingModel` string: Options consist of cardonfile or recurring.
  - `items` object[], required: Details of the individual invoice items of the invoice.
    - `invoiceItemId` string, required: Auto-generated identifier of the invoice item.
    - `discountAmount` object: Discount amount applied to this invoice item, inclusive of tax. This amount cannot exceed the undiscounted amount, which is the original <code>amount</code> minus the discount amount. If item type is a platform fee revenue (e.g. <code>transaction_fee</code>, <code>load_fee</code>, <code>failed_payment_fee</code>), then the discount must be in full or none at all. Default value is 0.
      - `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`
    - `description` string: Description of the invoice item.
    - `amount` object: Gross invoice item amount.
      - `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`
    - `accountingCode` string: accounting code to categorise revenue collected from the invoice item. Max of 50 characters.
    - `reference` string: Additional reference for invoice

## Response `200`

200

- object
  - `id` string
  - `documentNumber` string
  - `date` string
  - `dueDate` string
  - `scheduledPaymentDate` unknown
  - `status` string
  - `memo` unknown
  - `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` unknown
  - `subscriptionName` unknown
  - `paymentMethodToken` string
  - `autoPayment` boolean
  - `createdOn` string

## Other responses

- `400`: 400

## Changes

- **2026-11-03** `924be4030f56`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/ezypay/apis/vault/changes/billing/invoices/:invoiceId/put.md)

---

[API](https://skmtc.dev/ezypay/apis/vault.md) - [All operations](https://skmtc.dev/ezypay/apis/vault/llms.txt) - [OpenAPI document](https://skmtc.dev/ezypay/apis/vault/revisions/924be4030f56?raw)
