Subscription Payment Scenarios

This section concerns examples of different subscription scenarios and how they can be built using the API. You could combine multiple scenarios below to create a subscription that suits you.

Pending subscription

A 'pending subscription' is a subscription that does not have a start date and will not generate any invoices until it is manually activated. To create a pending subscription, add"markAsPending": true, in the request body. Below is an example of how the request body should look:

{
  "markAsPending": true,
  "amount": {
    "currency": "AUD",
    "value": 128.5
  },
  "billingEnd": "ongoing",
  "customerId": "55220ffc-bc5a-4f50-adaf-fa58c061ebd1",
  "planId": "8ff2e3ea-aaa9-4978-8e2a-319d67e8f302",
}

Future subscription

A 'future subscription' is a subscription that automatically starts at a given date without manual interference. You can create one by setting the startDate parameter to any future date in the request body. Below is an example of how the request body should look:

{
  "amount": {
    "currency": "AUD",
    "value": 128.5
  },
  "billingEnd": "ongoing",
  "customerId": "55220ffc-bc5a-4f50-adaf-fa58c061ebd1",
  "planId": "8ff2e3ea-aaa9-4978-8e2a-319d67e8f302",
  "startDate": "2026-03-11"
}

Monthly subscription

To create a monthly subscription, set:

"intervalUnit": "month",

"interval": 1

Below is an example of how the request body should look:

{
  "amount": {
    "currency": "AUD",
    "value": 128.5
  },
  "intervalUnit": "month",
  "interval": "1",
  "billingEnd": "ongoing",
  "customerId": "55220ffc-bc5a-4f50-adaf-fa58c061ebd1",
  "planId": "8ff2e3ea-aaa9-4978-8e2a-319d67e8f302",
}

Fortnightly subscription

To create a fortnightly subscription, set:

"intervalUnit": "week",

"interval": 2

Below is an example of how the request body should look:

{
  "amount": {
    "currency": "AUD",
    "value": 128.5
  },
  "intervalUnit": "week",
  "interval": "2",
  "billingEnd": "ongoing",
  "customerId": "55220ffc-bc5a-4f50-adaf-fa58c061ebd1",
  "planId": "8ff2e3ea-aaa9-4978-8e2a-319d67e8f302",
}

Ongoing subscription

An 'ongoing subscription' is a subscription that does not end until it is cancelled. You could create it by setting the "billingEnd": "ongoing" in the request body. Below is an example of how the request body should look:

{
  "amount": {
    "currency": "AUD",
    "value": 128.5
  },
  "intervalUnit": "week",
  "billingEnd": "ongoing",
  "customerId": "55220ffc-bc5a-4f50-adaf-fa58c061ebd1",
  "planId": "8ff2e3ea-aaa9-4978-8e2a-319d67e8f302",
  "interval": "1",
}

Subscription ends after number of cycles

This type of subscription will automatically stop billing and mark itself as COMPLETED when it reaches the defined number of cycles. Also known as a TAC (Total Amount Collected) subscription. You can create one by setting

"billingEnd": "billing_cycles",

"billingEndValue": 12

in the request body. This means the subscription will end after 12 successful billing cycles. Below is an example of how the request body should look:

{
  "amount": {
    "currency": "AUD",
    "value": 128.5
  },
  "intervalUnit": "week",
  "billingEnd": "ongoing",
  "customerId": "55220ffc-bc5a-4f50-adaf-fa58c061ebd1",
  "planId": "8ff2e3ea-aaa9-4978-8e2a-319d67e8f302",
  "interval": "1",
  "billingEnd": "billing_cycles",
  "billingEndValue": 12
}

Subscription ends after specified amount collected

This type of subscription will automatically stop billing and mark itself as COMPLETED when it reaches the defined amount to be collected. You can create one by setting the

"billingEnd": "amount_collected",

"billingEndValue": 3600

in the request body. This means the subscription will end after $3600 is collected. Below is an example of how the request body should look:

{
  "amount": {
    "currency": "AUD",
    "value": 128.5
  },
  "intervalUnit": "week",
  "billingEnd": "ongoing",
  "customerId": "55220ffc-bc5a-4f50-adaf-fa58c061ebd1",
  "planId": "8ff2e3ea-aaa9-4978-8e2a-319d67e8f302",
  "interval": "1",
  "billingEnd": "amount_collected",
  "billingEndValue": 3600`
}

Subscription with Prorated first billing

To specify a prorated first billing, set "firstBilling": "prorate" in the request body, and the initial billing value will be automatically calculated by the Ezypay system. Please note: the first billing value for the subscription will be the full amount if it is not defined. To understand how Ezypay work out the prorated amount, please refer to the guide. Below is an example of how the request body should look:

{
  "amount": {
    "currency": "AUD",
    "value": 128.5
  },
  "intervalUnit": "week",
  "billingEnd": "ongoing",
  "customerId": "55220ffc-bc5a-4f50-adaf-fa58c061ebd1",
  "planId": "8ff2e3ea-aaa9-4978-8e2a-319d67e8f302",
  "interval": "1",
  "firstBilling": "prorate"
}

Subscription with customised first billing

The first billing of any given subscription is customisable by integrators. You could define your own customised first billing value and add additional invoice items to it. firstBillingAmount objects allow integrators to define the first billing value. setupPayments allows you to add additional items to the first billing. Below is an example of how the request body should look for first billing value of $99.90 and additional "Gym Deposits" is collected:

{
  "amount": {
    "currency": "AUD",
    "value": 128.5
  },
  "intervalUnit": "week",
  "billingEnd": "ongoing",
  "customerId": "55220ffc-bc5a-4f50-adaf-fa58c061ebd1",
  "planId": "8ff2e3ea-aaa9-4978-8e2a-319d67e8f302",
  "interval": "1",
  "firstBillingAmount": {
    "currency": "AUD",
    "value": 99.9
  },
  "setupPayments": {
    "amount": {
      "currency": "AUD",
      "value": 357
    },
    "description": "Gym Deposite"
  },
}

Subscription billing on specific day of the month

For subscriptions with monthly intervals, the billing day can be specified by the integrator. The default day of billing is the default starting date of the subscription - i.e. if the subscription starts on the 20th, the customer will be automatically billed on the 20th of every month. If this is not the desired recurring date, you can define your own.

{
  "amount": {
    "currency": "AUD",
    "value": 128.5
  },
  "intervalUnit": "month",
  "billingEnd": "ongoing",
  "customerId": "55220ffc-bc5a-4f50-adaf-fa58c061ebd1",
  "planId": "8ff2e3ea-aaa9-4978-8e2a-319d67e8f302",
  "interval": "1",
  "billingStart": "day_of_month",
  "billingStartValue": 31,
}

Subscription billing on specific day of the week

Like with monthly subscriptions, for subscriptions with weekly intervals, the billing day can be specified by the integrator - i.e., in the example below, the billing day has been set to 'Tuesday'. If this is not the desired recurring day, you can define your own.

{
  "amount": {
    "currency": "AUD",
    "value": 128.5
  },
  "intervalUnit": "week",
  "billingEnd": "ongoing",
  "customerId": "55220ffc-bc5a-4f50-adaf-fa58c061ebd1",
  "planId": "8ff2e3ea-aaa9-4978-8e2a-319d67e8f302",
  "interval": "1",
  "billingStart": "day_of_week",
  "billingStartValue": "tuesday"
}