This document provides examples of catalogs and how they affect invoices/subscriptions.

How to Use This Document

Each section in this document corresponds to a particular catalog component and provides examples of catalogs that demonstrate that catalog component.

You can try out the various examples in each section by:

  1. Uploading the corresponding catalog (via Kaui or Upload Catalog API call)

  2. Creating an account (via Kaui or Create Account API call)

  3. Creating a subscription as required (via Kaui or Create Subscription API call)

  4. Triggering an invoice dry-run (via Kaui or Generate Dry Run API call)

Prerequisites

Ensure that you have gone through the Subscription User Guide and are familiar with the various catalog components like products, plans, phases, and so forth.

Billing Modes

A catalog needs to include a Billing Mode as explained in the Invoice Subsystem document.

A quick summary of billing modes:

  • Can be specified at the catalog level or on a per-plan basis.

  • IN_ADVANCE indicates that each recurring subscription is charged at the beginning of the billing period.

  • IN_ARREAR indicates that each recurring subscription is charged at the end of the billing period.

This section provides examples of catalogs with different billing modes. For simplicity’s sake, only catalogs with catalog-level billing modes are demonstrated below. However, the behavior is the same even when a per-plan billing mode is used.

Also for the sake of simplicity, all the catalogs demonstrated in this section include a single product (STANDARD) and a single plan (standard-monthly) corresponding to it.

IN_ADVANCE Billing Mode

This example uses the In Advance Billing catalog. It specifies an IN_ADVANCE billing mode. In this case, the standard-monthly plan has a single EVERGREEN phase with a monthly recurring charge of $24.95 (plan phases are explained in the next section).

ActionResult

Create a subscription on 2021-09-17 (current date)

Invoice generated for $24.95 for 2021-09-17 to 2021-10-17 since IN_ADVANCE billing is used.

Trigger invoice dry run with target date 2021-10-17

Invoice generated for $24.95 for 2021-10-17 to 2021-11-17

IN_ARREAR Billing Mode

This example uses the In Arrear Billing catalog. It specifies an IN_ARREAR billing mode. Just like the earlier catalog, the standard-monthly plan has a single EVERGREEN phase with a monthly recurring charge of $24.95.

ActionResult

Create a subscription on 2021-09-17 (current date)

Because IN_ARREAR billing mode is specified, the system does not generate an invoice (yet).

Trigger invoice dry run with target date 2021-10-17

Invoice generated for $24.95 for 2021-09-17 to 2021-10-17

Plan Phases

Each plan can consist of multiple phases as explained in the Subscription Billing document.

A quick summary of plan phases:

  • Can be one of the type TRIAL, DISCOUNT, FIXEDTERM, EVERGREEN.

  • Each phase has a Duration, Billing Period, Recurring Price, Fixed Price, and Usage Sections.

This section provides examples of catalogs that demonstrate the various plan phases.

All the catalogs demonstrated in this section use IN_ADVANCE billing mode. Also, as before, all the catalogs include a single product (STANDARD) and a single plan (standard-monthly) corresponding to it.

No Trial Phase and Fixed Term Phase

This example uses the Fixed Term No Trial catalog. In this case, the standard-weekly plan has a single FIXEDTERM phase for a period of 6 weeks with a weekly recurring charge of $24.95. So, users will be charged $24.95 weekly for 6 weeks, after which the fixed term ends.

ActionResult

Create a subscription on 2021-09-10 (current date)

Invoice generated for $24.95 for 2021-09-10 to 2021-10-10

Trigger invoice dry run with target date 2021-09-18

Invoice generated for $24.95 for 2021-09-17 to 2021-09-24

Trigger invoice dry run with target date 2021-10-15

Invoice generated for $24.95 for 2021-10-15 to 2021-10-22

Trigger invoice dry run with target date 2021-10-29

No invoice generated as the fixed term is over.

No Trial Phase and Monthly Evergreen Phase

This example uses the Monthly No Trial catalog. In this case, the standard-monthly plan has a single EVERGREEN phase with a monthly recurring charge of $24.95. So, users will be charged $24.95 monthly in perpetuity.

ActionResult

Create a subscription on 2021-09-10 (current date)

Invoice generated for $24.95 for 2021-09-10 to 2021-10-10

Trigger invoice dry run with target date 2021-10-10

Invoice generated for $24.95 for 2021-10-10 to 2021-11-10

Trigger invoice dry run with target date 2022-05-10

Invoice generated for $24.95 for 2022-05-10 to 2022-06-10

Trial Phase and Monthly Evergreen Phase

This example uses the Monthly With Trial catalog. In this case, the standard-monthly plan has a TRIAL phase of 10 days followed by an EVERGREEN phase with a monthly recurring charge of $24.95. So, users will not be charged for the first 10 days, after which they will be charged $24.95 monthly in perpetuity.

ActionResult

Create a subscription on 2021-09-10 (current date)

Invoice generated for $0 due to trial phase

Trigger invoice dry run with target date 2021-09-20

Trial phase ends so Invoice generated for $24.95 for 2021-09-20 to 2021-10-20

Trigger invoice dry run with target date 2021-10-20

Invoice generated for $24.95 for 2021-10-20 to 2022-11-20

Trigger invoice dry run with target date 2022-01-20

Invoice generated for $24.95 for 2022-01-20 to 2022-02-20

Fixed and Recurring Price Evergreen Phase

This example uses the Fixed and Recurring Price Evergreen Phase catalog. In this case, the standard-monthly plan has a single EVERGREEN phase. It has a fixed price of $50 and a recurring charge of $24.95. So, users will be charged $74.95 (fixed and recurring price) for the first month. After that, they will be charged a recurring price of $24.95 monthly in perpetuity.

ActionResult

Create a subscription on 2021-09-13 (current date)

Invoice generated for $74.95 for 2021-09-13 to 2021-10-13 (Fixed price as well as recurring price)

Trigger invoice dry run with target date 2021-10-13

Invoice generated for $24.95 for 2021-10-13 to 2021-11-13 (only recurring price)

Discount Phase and Evergreen Phase

This example uses the Discount and Evergreen catalog. In this case, the standard-monthly plan has a DISCOUNT phase of 3 months (with a monthly charge of $4.95) followed by an EVERGREEN phase with a monthly recurring charge of $24.95. So, users will be charged $4.95 (discounted price) for the first 3 months. After that, they will be charged a recurring price of $24.95 monthly in perpetuity.

ActionResult

Create a subscription on 2021-09-15 (current date)

Invoice generated for $4.95 due to DISCOUNT phase

Trigger invoice dry run with target date 2021-10-15

Invoice generated for $4.95 for 2021-10-15 to 2021-11-15

Trigger invoice dry run with target date 2021-12-15

Discount phase ends, invoice generated for $24.95 for 2021-12-15 to 2022-01-15

Catalog with Multiple Plans

A catalog can contain multiple products. Each product can be associated with multiple plans. Each plan can, in turn, have multiple phases (trial, discount, etc.).

This section provides examples of catalogs that include multiple products and plans.

Catalog with Monthly Plan and Annual Plan

This example uses the Monthly and Annual Plan catalog.

Just like the catalogs explained above, this catalog has only one product (Standard). However, it has multiple plans that correspond to the Standard product as follows:

Plan NameProductPlan Description

standard_monthly

Standard

Single EVERGREEN phase with a monthly recurring charge of $24.95

standard_annual

Standard

Single EVERGREEN phase with an annual recurring charge of $275

The following table lists the actions and their results:

ActionResult

Create a subscription for the standard-monthly plan on 2021-09-17 (current date)

Invoice generated for $24.95 corresponding to the standard-monthly plan

Trigger invoice dry run with target date 2021-10-17

Invoice generated for $24.95 for 2021-10-17 to 2021-11-17 corresponding to the standard-monthly plan

Create a subscription for the standard-annual plan on 2021-09-17 (current date)

Invoice generated for $275 corresponding to the standard-annual plan

Trigger invoice dry run with target date 2021-10-17

Invoice generated for $24.95 for 2021-10-17 to 2021-11-17 corresponding to the standard-monthly plan

Trigger invoice dry run with target date 2022-09-17

Invoice generated with two invoice items corresponding to both plans for $299.95.

Catalog with Add-on plan

This section uses the Monthly No Trial With Add-on catalog.

It has a BASE product and ADD_ON product as follows:

ProductCategory

Standard

Base

RemoteControl

Add_on

It has two plans corresponding to both products as follows:

Plan NameProductPlan Description

standard-monthly

Standard

Single EVERGREEN phase with a monthly recurring charge of $24.95

remotecontrol-monthly

RemoteControl

Single EVERGREEN phase with a monthly recurring charge of $17.95

The following table lists the actions and their results:

ActionResult

Create a subscription corresponding to the standard_monthly plan on 2021-09-15 (current date)

Invoice generated for $24.95 corresponding to the standard-monthly plan

Trigger invoice dry run with target date 2021-10-15

Invoice generated for $24.95 for 2021-10-15 to 2021-11-15 corresponding to the standard-monthly plan

Add the remotecontrol-monthly add-on to the existing subscription on 2021-09-15 (current date)

Invoice generated for $17.95 corresponding to the remotecontrol-monthly plan

Trigger invoice dry run with target date 2021-10-15

Invoice generated for $42.90 for 2021-10-15 to 2021-11-15 corresponding to both plans.

Billing Alignment Rules

Another important section in the catalog is the Billing Alignment Rules section.

A brief summary of billing alignment rules:

  • The "Billing Alignment Rules" section specifies whether customers are billed at the account level, subscription level, or subscription bundle level.

  • If the catalog specifies ACCOUNT billing alignment, all the subscriptions belonging to the account are aligned and invoiced with the Bill Cycle Day (BCD) that was specified when the account was created.

  • If the catalog specifies SUBSCRIPTION billing alignment, each subscription is invoiced as per its bill date.

  • If the catalog specifies BUNDLE billing alignment, all the subscriptions within a bundle are aligned and invoiced on the same day.

This section provides examples of catalogs with different billing alignment rules.

Account Billing Alignment

When ACCOUNT billing alignment is specified in the catalog, the billing cycle of all the subscriptions are aligned with the BCD of the account. Note that this is the default billing alignment, so even when billing alignment rules are not explicitly specified in a catalog, it defaults to ACCOUNT.

This example uses the Account Billing Alignment catalog. It specifies ACCOUNT billing alignment.

For simplicity’s sake, this catalog includes a single product (STANDARD) and a single plan (standard-monthly) corresponding to it.

Case 1: Account with No BCD

If no BCD is specified with the account, it defaults to the first bill date of the first subscription.

ActionResult

Create a new account. Leave BCD field empty

Account created, BCD is blank.

Create a subscription on 2021-09-16 (current date)

Invoice generated for $24.95 for 2021-09-16 to 2021-10-16. BCD set to 16 (Since subscription is created on 16th)

Trigger invoice dry run with target date 2021-10-16

Invoice generated for $24.95 for 2021-10-16 to 2021-11-16

Case 2: Account with BCD

If a BCD is specified with the account, the subscriptions are invoiced on the specified day. If the start date of a subscription is different from the BCD, the first invoice is prorated. All subsequent invoices are aligned with the BCD.

ActionResult

Create a new account. Specify BCD as 25

Account created with BCD set to 25

Create a subscription on 2021-09-16 (current date)

Invoice generated for $7.24 for 2021-09-16 to 2021-09-25 (prorated)

Trigger invoice dry run with target date 2021-09-25

Invoice generated for $24.95 for 2021-09-25 to 2021-10-25

Case 3: Account with No BCD and Multiple Subscriptions on Different Days

Even if there are multiple subscriptions associated with an account, all the subscriptions are aligned with the BCD. If the BCD is not explicitly set, it defaults to the first bill date of the first subscription. All subsequent subscriptions use this BCD.

ActionResult

Create a new account. Leave BCD field empty

Account created, BCD is blank.

Create a subscription on 2021-09-17 (current date)

Invoice generated for $24.95 for 2021-09-17 to 2021-10-17. BCD set to 17 (Since subscription is created on 17th)

Create a subscription, with date of 2021-09-25 (future date)

No invoice is generated as a future date is specified

Trigger invoice dry run with target date 2021-09-25

Invoice generated for $18.30 for 2021-09-25 to 2021-10-17 (Prorated since BCD is 17)

Trigger invoice dry run with target date 2021-10-17

Invoice generated with two invoice items corresponding to both subscriptions for $49.90.

Case 4: Account with BCD, Multiple Subscriptions on Different Days

If there is a BCD specified with the account, all subscriptions use this BCD irrespective of the subscription creation day.

ActionResult

Create a new account. Specify BCD as 25

Account created with BCD set to 25

Create a subscription on 2021-09-17 (current date)

Invoice generated for $6.44 for 2021-09-17 to 2021-09-25 (Prorated since BCD is 25)

Trigger invoice dry run with target date 2021-09-25

Invoice generated for $24.95 for 2021-09-25 to 2021-10-25

Create a subscription on 2021-09-30 (future date)

No invoice is generated as a future date is specified

Trigger invoice dry run with target date 2021-09-25

Invoice generated for $24.95 for 2021-09-25 to 2021-10-25 (Second subscription not yet active)

Trigger invoice dry run with target date 2021-09-30

Invoice generated for $20.79 for 2021-09-30 to 2021-10-25 (Prorated since BCD is 25)

Trigger invoice dry run with target date 2021-10-25

Invoice generated with two invoice items corresponding to both subscriptions for $49.90.

Subscription Billing Alignment

When SUBSCRIPTION billing alignment is specified in the catalog, each subscription is invoiced separately as per its bill date.

Note
Note: SUBSCRIPTION billing alignment applies even for subscriptions that are part of the same subscription bundle. So, if a subscription bundle consists of a base plan and an add-on plan, the add-on plan is invoiced as per its own date and is NOT aligned with the base subscription billing date.

This example uses the Subscription Billing Alignment catalog. It specifies SUBSCRIPTION billing alignment.

It has only one product (Standard). However, it has multiple plans corresponding to the Standard product as follows:

Plan NameProductPlan Description

standard-monthly

Standard

Single EVERGREEN phase with a monthly recurring charge of $24.95

standard-annual

Standard

Single EVERGREEN phase with an annual recurring charge of $275

The following table lists the actions and their results:

ActionResult

Create a new account. Specify BCD as 25

Account created with BCD set to 25

Create a subscription for the standard-monthly plan on 2021-09-17 (current date)

Invoice generated for $24.95 for 2021-09-17 to 2021-10-17 (BCD is ignored, subscription is billed as per its creation date)

Trigger invoice dry run with target date 2021-10-17

Invoice generated for $24.95 for 2021-10-17 to 2021-11-17

Create a subscription for the standard-annual plan with date of 2021-09-30 (future date)

No invoice is generated as a future date is specified

Trigger invoice dry run with target date 2021-09-30

Invoice generated for $275 for 2021-09-30 to 2022-09-30

Trigger invoice dry run with target date 2021-10-17

Invoice generated for $24.95 for 2021-10-17 to 2021-11-17 corresponding to standard-monthly plan

Trigger invoice dry run with target date 2022-09-30

Invoice generated for $275 for 2022-09-30 to 2023-09-30 corresponding to standard-annual plan

Bundle Billing Alignment

When BUNDLE billing alignment is specified in the catalog, all subscriptions in a bundle are invoiced together. The bill day is derived from the first bill date of the first subscription.

Note
Note: BUNDLE billing alignment applies only to subscriptions within a single bundle. This type of billing alignment does not affect subscriptions across different bundles. So, when multiple subscriptions are created in different bundles, each subscription is still billed as per its creation date.

This example uses the Bundle Billing Alignment catalog. It specifies BUNDLE billing alignment.

It has a BASE and an ADD_ON product as follows:

ProductCategory

Standard

Base

RemoteControl

Add_on

It has two plans corresponding to both products as follows:

Plan NameProductPlan Description

standard-monthly

Standard

Single EVERGREEN phase with a monthly recurring charge of $24.95

remotecontrol-monthly

RemoteControl

Single EVERGREEN phase with a monthly recurring charge of $17.95

The following table lists the actions and their results:

ActionResult

Create a new account. Specify BCD as 25

Account created with BCD set to 25

Create a subscription for the standard-monthly plan on 2021-09-20 (current date)

Invoice generated for $24.95 for 2021-09-20 to 2021-10-20 (BCD is ignored, subscription is billed as per its creation date)

Trigger invoice dry run with target date 2021-10-20

Invoice generated for $24.95 for 2021-10-20 to 2021-11-20

Add the remotecontrol-monthly add-on to the existing subscription with date of 2021-09-30 (future date)

No invoice is generated as a future date is specified

Trigger invoice dry run with target date 2021-09-30

Invoice generated for $11.97 for 2021-09-30 to 2021-10-20 corresponding to the remotecontrol-monthly plan (Prorated since BUNDLE billing alignment is used)

Trigger invoice dry run with target date 2021-10-20

Invoice generated for $42.90 for 2021-10-20 to 2021-11-20 corresponding to both plans

Subscription Alignment Rules

The Subscription Alignment Rules section in the catalog can be used to specify rules that are useful for advanced use cases. This section explains some of these rules.

Plan Creation Addon Phase Alignment

The plan creation addon phase alignment rules specify how the phases of an addon subscription align with the phases of the base subscription.

A quick summary of plan creation phase alignment rules:

  • A rule specifies the name of an addon product and how its phases should align with the phases of the base product.

  • There are two possible values for phase alignment, START_OF_BUNDLE and START_OF_SUBSCRIPTION.

  • START_OF_BUNDLE causes the phases of the add-on to start on the date when the base plan was first created. This causes the phases of add-on subscription to align with the phases of the base subscription (provided the phases are of the same length)

  • START_OF_SUBSCRIPTION causes the phases of the add-on subscription to start with the add-on subscription irrespective of the base subscription.

This example uses the Plan Creation Addon Phase Alignment catalog.

It has a BASE product and two ADD_ON products as follows:

ProductCategory

Standard

Base

RemoteControl

Add_on

OilSlick

Add_on

It has the following plans corresponding to the products:

Plan NameProductPlan Description

standard-monthly

Standard

TRIAL phase of 10 days followed by an EVERGREEN phase with a monthly recurring charge of $25

remotecontrol-monthly

RemoteControl

TRIAL phase of 10 days followed by an EVERGREEN phase with a monthly recurring charge of $15

oilslick-monthly

OilSlick

TRIAL phase of 10 days followed by an EVERGREEN phase with a monthly recurring charge of $10

It specifies the following add-on phase alignment rules:

PredicateAlignment

product=RemoteControl

START_OF_SUBSCRIPTION

product=OilSlick

START_OF_BUNDLE

; (Anything else)

START_OF_BUNDLE

Rule 1: If product=RemoteControl, alignment=START_OF_SUBSCRIPTION

This rule specifies that if the RemoteControl add-on is added to a base subscription, its phases should start on the date that the the add-on subscription is added irrespective of the base subscription.

ActionResult

Create a subscription corresponding to the standard-monthly plan on 2021-09-23 (current date)

Invoice generated for $0 (since subscription is in trial phase)

Trigger invoice dry run with target date 2021-10-03

Invoice generated for $25 for 2021-10-03 to 2021-11-03 (Trial phase ends)

Add the remotecontrol-monthly add-on to the existing subscription with date 2021-09-30 (future date)

No invoice is generated as a future date is specified

Trigger invoice dry run with target date 2021-09-30

Invoice generated for $0 corresponding to the remotecontrol-monthly plan (since the subscription is in trial phase)

Trigger invoice dry run with target date 2021-10-03

Invoice generated with only one invoice item corresponding to standard-monthly plan. Since RemoteControl uses START_OF_SUBSCRIPTION alignment rule, its phases start on the day the subscription starts (2021-09-30). So, remotecontrol-monthly is still in TRIAL phase and does not have an invoice entry.

Rule 2: If product=OilSlick, alignment=START_OF_BUNDLE

This rule specifies that if the OilSlick add-on is added to a base subscription, its phases should start on the date of the base subscription.

ActionResult

Create a subscription corresponding to the standard-monthly plan on 2021-09-23 (current date)

Invoice generated for $0 (since subscription is in trial phase)

Trigger invoice dry run with target date 2021-10-03

Invoice generated for $25 for 2021-10-03 to 2021-11-03 (Trial phase ends)

Add the oilslick-monthly add-on to the existing subscription with date 2021-09-30 (future date)

No invoice is generated as a future date is specified

Trigger invoice dry run with target date 2021-09-30

Invoice generated for $0 corresponding to the oilslick-monthly plan (since subscription is in trial phase)

Trigger invoice dry run with target date 2021-10-03

Invoice generated with two invoice items corresponding to standard-monthly and oilslick-monthly plans. Since OilSlick uses START_OF_BUNDLE alignment rule, its phases start on the day the base subscription starts (2021-09-23). So, TRIAL phase ends on 2021-10-03 and an invoice item is created.

Plan Cancellation Timing

The plan cancellation timing rules specify how the billing policy is affected when a plan is canceled.

A quick summary of plan cancellation rules:

  • A rule specifies one of productCategory, billingPeriod,priceList, phaseType and its cancellation policy.

  • There are two possible values for cancellation policy, END_OF_TERM and IMMEDIATE.

  • END_OF_TERM causes the cancellation to be applied at the end of the billing period. This type of cancellation rule avoids generating credits.

  • IMMEDIATE causess the cancellation to be applied immediately. This type of cancellation rule results in a credit being generated corresponding to the balance of the subscription that has been paid for but not used.

  • The cancellation policy specified here is the default cancellation policy. This is applicable only in the case when an explicit cancellation policy is not specified (via Kaui or API call).

Note
Note: The cancellation policy specified in this section applies only to billing. The cancellation policy for entitlements can be specified explicitly via Kaui or an API call. It defaults to immediate as explained in the Subscription Billing document.

This example uses the Plan Cancellation Timing catalog.

It has the following products/plans:

Products

ProductCategory

Standard

Base

RemoteControl

Add_on

Plans

Plan NameProductPlan Description

standard-monthly

Standard

Single EVERGREEN phase with a monthly recurring charge of $25

remotecontrol-monthly

RemoteControl

Single EVERGREEN phase with a monthly recurring charge of $15

It specifies the following plan cancellation rules:

PredicateCancellation Policy

productCategory=BASE

END_OF_TERM

productCategory=ADD_ON

IMMEDIATE

; (anything else)

END_OF_TERM

Rule 1: If productCategory=BASE, cancellation policy=END_OF_TERM

This rule specifies that if the category of a product is BASE product, cancellation should should occur at the end of the billing period.

ActionResult

Create a subscription for the standard-monthly plan on 2021-09-29 (current date)

Invoice generated for $25 for 2021-09-29 to 2021-10-29

Cancel subscription (specify default policy)

Invoice with credit is NOT generated (Since BASE product category uses END_OF_TERM cancellation policy)

Rule 2: If productCategory=ADD_ON, cancellation policy=IMMEDIATE

This rule specifies that if the category of a product is ADD_ON product, cancellation should should occur immediately.

ActionResult

Create a subscription for the standard-monthly plan on 2021-09-29 (current date)

Invoice generated for $25 for 2021-09-29 to 2021-10-29

Add the remotecontrol-monthly add-on to the existing subscription on 2021-09-29 (current date)

Invoice generated for $15 for 2021-09-29 to 2021-10-29 corresponding to remotecontrol-monthly plan

Cancel add-on subscription (specify default policy)

An invoice is generated with a credit of $15(Since ADDON product uses IMMEDIATE cancellation policy)

Cancel base subscription (specify default policy)

Invoice with credit is NOT generated (Since BASE product uses END_OF_TERM cancellation policy)

Plan Change Timing

The plan change timing rules specify how the system should behave when a subscription plan is changed.

A quick summary of plan change rules:

  • A rule specifies one of phaseType, fromProduct/toProduct, fromProductCategory/ toProductCategory, fromBillingPeriod/ toBillingPeriod, fromPriceList/toPriceList and its change policy.

  • There are three possible values for change policy, END_OF_TERM, IMMEDIATE and ILLEGAL.

  • END_OF_TERM specifies that the plan change should happen at the end of the current billing period.

  • IMMEDIATE specifies that the plan change should happen immediately.

  • ILLEGAL specifies that the plan change is not allowed.

This example uses the Plan Change Timing catalog.

It has the following products/plans:

Products

ProductCategory

Standard

Base

Sports

Base

Super

Base

Premium

Base

Plans

Plan NameProductPlan Description

standard-monthly

Standard

TRIAL phase of 30 days followed by an EVERGREEN phase with a monthly recurring charge of $100

sports-monthly

Sports

Single EVERGREEN phase with a monthly recurring charge of $500

super-monthly

Super

Single EVERGREEN phase with a monthly recurring charge of $1000

premium-monthly

Premium

Single EVERGREEN phase with a monthly recurring charge of $2000

It specifies the following plan cancellation rules:

PredicateChange Policy

phaseType=TRIAL

IMMEDIATE

fromProduct=Sports and toProduct=Super

IMMEDIATE

fromProduct=; and toProduct=Super (any fromProduct)

IMMEDIATE

fromProduct=Premium and toProduct=Standard

ILLEGAL

; (anything else)

END_OF_TERM

Rule 1: If phaseType=TRIAL, change policy=IMMEDIATE

This rule specifies that if a product is in TRIAL phase, plan change should take effect immediately.

ActionResult

Create a subscription for the standard-monthly plan on 2021-09-29 (current date)

Invoice generated for $0 (since subscription is in trial phase)

Change subscription to use the sports-monthly plan (specify default policy)

Plan change takes effect immediately (Invoice generated for $500 for 2021-09-29 to 2021-10-29 corresponding to the sports-monthly plan)

Trigger invoice dry run with target date 2021-10-29

Invoice generated for $500 for 2021-10-29 to 2021-11-29 corresponding to the sports-monthly plan

Rule 2: If fromProduct=Sports and toProduct=Super, change policy=IMMEDIATE

This rule specifies that if the plan change involves upgrading a product from Sports to Super, it should take effect immediately.

ActionResult

Create a subscription for the sports-monthly plan on 2021-09-29 (current date)

Invoice generated for $500 for 2021-09-29 to 2021-10-29

Change subscription to use the super-monthly plan (specify default policy)

Plan change takes effect immediately (Since the monthly price for super-monthly is $1000, an invoice is generated for $500 for 2021-09-29 to 2021-10-29 corresponding to the balance amount)

Trigger invoice dry run with target date 2021-10-29

Invoice generated for $1000 for 2021-10-29 to 2021-11-29 corresponding to the super-monthly plan

Rule 3: If toProduct=Premium, change policy=IMMEDIATE (any fromProduct value)

This rule specifies that if the plan change involves upgrading to Premium, it should take effect immediately.

ActionResult

Create a subscription for the sports-monthly plan on 2021-09-29 (current date)

Invoice generated for $500 for 2021-09-29 to 2021-10-29

Change subscription to use the premium-monthly plan (specify default policy)

Plan change takes effect immediately (Since the monthly price for premium-monthly is $2000, an invoice is generated for $1500 for 2021-09-29 to 2021-10-29 corresponding to the balance amount)

Trigger invoice dry run with target date 2021-10-29

Invoice generated for $2000 for 2021-10-29 to 2021-11-29 corresponding to the premium-monthly plan

Rule 4: If fromProduct=Premium and toProduct=Standard, change policy=ILLEGAL

This rule specifies that if the plan change involves upgrading from Standard to Premium, it should not be allowed.

ActionResult

Create a subscription for the premium-monthly plan on 2021-09-29 (current date)

Invoice generated for $2000 for 2021-09-29 to 2021-10-29

Change subscription to use the standard-monthly plan (specify default policy)

Plan change not allowed

Rule 5: For anything else, change policy=END_OF_TERM

This is the default rule. It specifies that any other plan changes should occur at the end of the billing period.

ActionResult

Create a subscription for the sports-monthly plan on 2021-09-29 (current date)

Invoice generated for $500 for 2021-09-29 to 2021-10-29

Change subscription to use the standard-monthly plan (specify default policy)

Plan change takes effect end of term ( Invoice item corresponding to a credit is not generated)

Trigger invoice dry run with target date 2021-10-29

Invoice generated for $100 for 2021-10-29 to 2021-11-29 corresponding to the standard-monthly plan