Skip to main content

Use case 1: target date recurs at end of month

Zuora

Use case 1: target date recurs at end of month

Suppose you want to schedule a bill run to execute on the 25th of each month, the invoice date recurs on the 25th of the same month, and the target date recurs on the end day of the same month, as follows.

Execution #

Bill Run Date

Invoice Date

Target Date

1

04/25/2024

04/25/2024

04/30/2024

2

05/25/2024

05/25/2024

05/31/2024

3

06/25/2024

06/25/2024

06/30/2024

...      

Configure use case 1 through UI

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

  1. Specify the Bill Run Date as 04/25/2024 and Repeats as Monthly
  2. Specify the Invoice Date as 04/25/2024
  3. Specify the Target Date as 04/30/2024 and select Month end of the same month as the run date
  4. 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 1.png

The logic is as below:

  • Bill run date scheduled results: By specifying the Bill Run Date as 04/25/2024 and the Repeats field as Monthly, the bill run is scheduled to be executed on the 25th of each month. 
  • Invoice date scheduled results: By specifying the Invoice Date as 04/25/2024, Zuora identifies that your specified bill run date and invoice date are the same date. The invoice date recurs on the same date as the monthly scheduled bill run date. 
  • Target date scheduled results: By specifying the Target Date as 04/30/2024, Zuora identifies that your specified bill run date and invoice date are in the same month, 30 is the end day, and thus displays the following options:
    • 5 days after the bill run date
    • Day 30 of the same month as the run date
    • Month end of the same month as the run date

After you select the Month end of the same month as the run date option, the target date recurs in the same month as the monthly scheduled bill run date, but the day value is the end day of the month instead of 30th of each month. 

If you use the 29th of February as the invoice or target date, you also need to select to schedule the date to reoccur on the 29th or at the end of the month.

Configure use case 1 through API

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

  • Bill run date settings:
    • repeatFrom: 2024-04-25
    • repeatType: Monthly
  • Invoice date settings:
    • invoiceDate:2024-04-25
  • Target date settings:
    • targetDateMonthOffset:0
    • targetDateDayofMonth:31

The logic is as below:

  • Since you want to schedule the invoice date to recur on the 25th of each month, set the invoiceDateto 2024-04-25.
  • Since you want to schedule the bill run date and target date in the same month, that is, the scheduled target dates have the same month offset 0 from monthly scheduled bill run dates, set the targetDateMonthOffset to 0
  • Since you want to schedule the target date to recur on the end day of each month, set the targetDateDayofMonth to 31

Since April only has 30 days, when you set the targetDateDayofMonth to 31, Zuora identifies that you want to schedule the target date to recur on the end day of the month rather than the 30th of the month. You can follow the same setting for February, which has only 28 or 29 days.

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":"2024-04-25",
"name": "test",
"noEmailForZeroAmountInvoice": false,
"targetDate": null,
"targetDateMonthOffset": 0,
"targetDateDayOfMonth": 31,
"schedule":
{
"repeatFrom": "2024-04-25",
"repeatType": "Monthly",
"runTime": 0
}
}