v1

latestOpenAPI 3.1.02026-07-24120106.5 KB

Create an invoice

post/billing/invoices

Headers

merchantstring required

Merchant ID

Request body

customerIdstring required

Identifier of the customer the invoice is billed to.

paymentMethodTokenstring

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.

memostring

Description of the invoice item. Max of 100 characters.

autoPaymentstring

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.

scheduledPaymentDatestring

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.

externalInvoiceIdstring

[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

processingModelstring

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

idstring
documentNumberstring
datestring
dueDatestring
scheduledPaymentDatestring
statusstring
memostring
customerIdstring
subscriptionIdstring
checkoutIdstring
subscriptionNamestring
paymentMethodTokenstring
autoPaymentboolean
processingModelstring
createdOnstring
payNowUrlstring
channelstring

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,
  "processingModel": "CARD_ON_FILE",
  "createdOn": "2019-07-01T00:33:42.562",
  "channel": "api"
}