Skip to main content

Use case 3: bill run date recurs on end of month

Zuora

Use case 3: bill run date recurs on end of month

Suppose you want to schedule a bill run to execute on the end day of each month, the invoice date and target date recur on the 1st day of each following month.

Execution #

Bill Run Date

Invoice Date

Target Date

1

06/30/2024

07/01/2024

07/01/2024

2

07/31/2024

08/01/2024

08/01/2024

3

08/31/2024

09/01/2024

09/01/2024

Configure use case 3 through UI

To achieve the scheduled results of use case 3, when creating a scheduled bill run on the Create Scheduled Bill Run page, configure the following fields:

  1. Specify the Bill Run Date as 06/30/2024, Repeats as Monthly, and select the Always on month end option.
  2. Specify the Invoice Date and Target Date as 07/01/2024 and select Day 1 of the next month of the run date on
  3. Preview the recurrence and scheduled dates at the right

Ensure you specify the Bill Run Date, Invoice Date, and Target Date as today or a future date. 

Monthly scheduled bill run use case 3 new.png

The logic is as below:

  • Bill run date scheduled results: After you specify the Bill Run Date as 06/30/2024, the Repeats field as monthly. Zuora identifies that the 30th is the end day of the month, and thus displays the following options:
    • Monthly on day 30
    • Always on month end

Select Always on month end, the bill run is scheduled to be executed on the end day of each month. 

In case the end day is 31st, the Always on month end option is not available, however, the bill run is still scheduled to be executed on the end day of each month

  • Invoice and target dates scheduled results: By specifying the Invoice Date and Target Date as 07/01/2024, Zuora calculates the difference in months from your specified Bill Run Date 06/30/2024 to the Invoice Date and Target Date 07/01/2024 is one month (next month), and the day value of the Invoice Date and Target Date is 01. Zuora displays the following two options:
    • 1 days after the bill run date
    • Day 1 of the next month of the run date on

After you select the Day 1 of the next month of the run date on option, the invoice and target dates recur on the 1st day of the next month from the monthly scheduled bill run date.

Configure use case 3 through API

To achieve the scheduled results of use case 3, configure the following fields through the Create a bill run operation. 

  • Bill run date settings:
    • repeatFrom: 2024-06-30
    • repeatType: Monthly
    • monthlyOnEndOfMonth:True
  • Invoice date settings:
    • invoiceDateMonthOffset:1
    • invoiceDateDayofMonth:1
  • Target date settings:
    • targetDateMonthOffset:1
    • targetDateDayofMonth:1

The logic is as below:

  • Since you want to schedule the bill run date to recur on the end of each month, set the repeatFrom to end date of the month and monthlyOnEndOfMonth to True.
  • Since you want to schedule the invoice date and target date in the next month from the monthly schedule bill run date, that is, the scheduled invoice and target dates have the same offset 1 from monthly scheduled bill run dates, set the invoiceDateMonthOffset and targetDateMonthOffset to 1.
  • Since you want to schedule the invoice and target dates to recur on the 1st of each month, set the invoiceDateDayofMonth to 1.

Request API example

Request POST /v1/bill-runs
Request Body
{
"autoEmail": false,
"autoPost": false,
"autoRenewal": false,
"billRunFilters": [
{
"accountId": "2c9081a03c63c94c013c66688a2c00bf",
"filterType": "Account"
}
],
"chargeTypeToExclude": [
"OneTime",
"Usage"
],
"invoiceDate":null,
"invoiceDateMonthOffset": 1,
"invoiceDateDayOfMonth": 1,
"name": "test",
"noEmailForZeroAmountInvoice": false,
"targetDate": null,
"targetDateMonthOffset": 1,
"targetDateDayOfMonth": 1,
"schedule":
{
"repeatFrom": "2024-06-30",
"repeatType": "Monthly",
"runTime": 0,
"monthlyOnEndOfMonth":true
}
}