Retry a payment on an invoice

Changed on

Integrators are able to retry a "PAST_DUE" invoice using the retry payment API. Once the retry payment is actioned, the status of the invoice will return to "PROCESSING".

The retry payment API will validate if the paymentMethodToken is still a valid token before allowing the retry payment to proceed. If the paymentMethodToken used is an invalid token, integrators are required to replace the paymentMethodToken for the "PAST_DUE" invoice.

NOTE: It is important to note that integrators are required to manage the MAX retry on their application.

post/billing/invoices/{invoiceId}/retrypayment

Request

  • Base URL
    https://api-sandbox.ezypay.com/v2
  • URL
    https://api-sandbox.ezypay.com/v2/billing/invoices/{invoiceId}/retrypayment
  • 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

oneOffstring

Specify if the invoice will re-use the existing payment method token or use a different token as a one-off payment. Supported values are: false - The default value. Use the existing payment method token associated with this invoice. You do not need to provide a new payment method token. true - Use a different payment method token for this one-off payment. Specify the token in paymentMethodToken.

paymentMethodTokenstring

Specify the payment method token that will be used for this payment. Only needs to be provided if oneOff is true. Future invoices will not be affected.

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