Update an invoice

Changed on

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.

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

Path parameters

invoiceIdstring required

Auto-generated identifier of the invoice.

Headers

merchantstring required

Merchant ID

Request body

paymentMethodTokenstring

The payment method token that will replace the invoice's current payment method token.

scheduledPaymentDatestring

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.

externalInvoiceIdstring

The invoice Id from integrator's system.

processingModelstring

Options consist of cardonfile or recurring.

Response

200

idstring
documentNumberstring
datestring
dueDatestring
scheduledPaymentDateunknown
statusstring
memounknown
customerIdstring
subscriptionIdunknown
subscriptionNameunknown
paymentMethodTokenstring
autoPaymentboolean
createdOnstring

Example response

{
  "id": "5cfda744-1dc5-4f21-b020-fb648429bce9",
  "documentNumber": "IN0000000000000628",
  "date": "2019-07-01",
  "dueDate": "2019-07-01",
  "status": "PROCESSING",
  "items": [
    {
      "description": "testing",
      "amount": {
        "currency": "NZD",
        "value": 100
      },
      "id": "110944ba-4f14-4ccf-bd72-9c5522ab5399",
      "type": "on_demand_payment",
      "discounted": {
        "currency": "NZD"
      }
    }
  ],
  "amount": {
    "currency": "NZD",
    "value": 100
  },
  "amountWithoutDiscount": {
    "currency": "NZD",
    "value": 100
  },
  "totalDiscounted": {
    "currency": "NZD"
  },
  "totalRefunded": {
    "currency": "NZD"
  },
  "totalTax": {
    "currency": "NZD"
  },
  "customerId": "4c999653-9473-472e-b478-d56d2a7572a9",
  "paymentMethodToken": "d178cea3-fdf9-4743-90d8-856af429ab18",
  "autoPayment": true,
  "createdOn": "2019-07-01T00:33:42.562"
}

Changes