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:
-
Uploading the corresponding catalog (via Kaui or Upload Catalog API call)
-
Creating an account (via Kaui or Create Account API call)
-
Creating a subscription as required (via Kaui or Create Subscription API call)
-
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).
Action | Result |
---|---|
Create a subscription on |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated for |
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
.
Action | Result |
---|---|
Create a subscription on |
Because IN_ARREAR billing mode is specified, the system does not generate an invoice (yet). |
Trigger invoice dry run with target date |
Invoice generated for |
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
, andUsage 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.
Action | Result |
---|---|
Create a subscription on |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated for |
Trigger invoice dry run with target date |
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.
Action | Result |
---|---|
Create a subscription on |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated for |
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.
Action | Result |
---|---|
Create a subscription on |
Invoice generated for |
Trigger invoice dry run with target date |
Trial phase ends so Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated for |
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.
Action | Result |
---|---|
Create a subscription on |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated for |
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.
Action | Result |
---|---|
Create a subscription on |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated for |
Trigger invoice dry run with target date |
Discount phase ends, invoice generated for |
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 Name | Product | Plan Description |
---|---|---|
standard_monthly |
Standard |
Single |
standard_annual |
Standard |
Single |
The following table lists the actions and their results:
Action | Result |
---|---|
Create a subscription for the |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated for |
Create a subscription for the |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated with two invoice items corresponding to both plans for |
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:
Product | Category |
---|---|
Standard |
Base |
RemoteControl |
Add_on |
It has two plans corresponding to both products as follows:
Plan Name | Product | Plan Description |
---|---|---|
standard-monthly |
Standard |
Single |
remotecontrol-monthly |
RemoteControl |
Single |
The following table lists the actions and their results:
Action | Result |
---|---|
Create a subscription corresponding to the |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated for |
Add the |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated for |
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.
Action | Result |
---|---|
Create a new account. Leave BCD field empty |
Account created, BCD is blank. |
Create a subscription on |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated for |
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.
Action | Result |
---|---|
Create a new account. Specify BCD as |
Account created with BCD set to |
Create a subscription on |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated for |
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.
Action | Result |
---|---|
Create a new account. Leave BCD field empty |
Account created, BCD is blank. |
Create a subscription on |
Invoice generated for |
Create a subscription, with date of |
No invoice is generated as a future date is specified |
Trigger invoice dry run with target date |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated with two invoice items corresponding to both subscriptions for |
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.
Action | Result |
---|---|
Create a new account. Specify BCD as |
Account created with BCD set to |
Create a subscription on |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated for |
Create a subscription on |
No invoice is generated as a future date is specified |
Trigger invoice dry run with target date |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated with two invoice items corresponding to both subscriptions for |
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 Name | Product | Plan Description |
---|---|---|
standard-monthly |
Standard |
Single |
standard-annual |
Standard |
Single |
The following table lists the actions and their results:
Action | Result |
---|---|
Create a new account. Specify BCD as |
Account created with BCD set to |
Create a subscription for the |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated for |
Create a subscription for the |
No invoice is generated as a future date is specified |
Trigger invoice dry run with target date |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated for |
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:
Product | Category |
---|---|
Standard |
Base |
RemoteControl |
Add_on |
It has two plans corresponding to both products as follows:
Plan Name | Product | Plan Description |
---|---|---|
standard-monthly |
Standard |
Single |
remotecontrol-monthly |
RemoteControl |
Single |
The following table lists the actions and their results:
Action | Result |
---|---|
Create a new account. Specify BCD as |
Account created with BCD set to |
Create a subscription for the |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated for |
Add the |
No invoice is generated as a future date is specified |
Trigger invoice dry run with target date |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated for |
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
andSTART_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:
Product | Category |
---|---|
Standard |
Base |
RemoteControl |
Add_on |
OilSlick |
Add_on |
It has the following plans corresponding to the products:
Plan Name | Product | Plan Description |
---|---|---|
standard-monthly |
Standard |
|
remotecontrol-monthly |
RemoteControl |
|
oilslick-monthly |
OilSlick |
|
It specifies the following add-on phase alignment rules:
Predicate | Alignment |
---|---|
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.
Action | Result |
---|---|
Create a subscription corresponding to the |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated for |
Add the |
No invoice is generated as a future date is specified |
Trigger invoice dry run with target date |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated with only one invoice item corresponding to |
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.
Action | Result |
---|---|
Create a subscription corresponding to the |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated for |
Add the |
No invoice is generated as a future date is specified |
Trigger invoice dry run with target date |
Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated with two invoice items corresponding to |
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 cancellationpolicy
. -
There are two possible values for cancellation policy,
END_OF_TERM
andIMMEDIATE
. -
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
Product | Category |
---|---|
Standard |
Base |
RemoteControl |
Add_on |
Plans
Plan Name | Product | Plan Description |
---|---|---|
standard-monthly |
Standard |
Single |
remotecontrol-monthly |
RemoteControl |
Single |
It specifies the following plan cancellation rules:
Predicate | Cancellation 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.
Action | Result |
---|---|
Create a subscription for the |
Invoice generated for |
Cancel subscription (specify default policy) |
Invoice with credit is NOT generated (Since |
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.
Action | Result |
---|---|
Create a subscription for the |
Invoice generated for |
Add the |
Invoice generated for |
Cancel add-on subscription (specify default policy) |
An invoice is generated with a credit of |
Cancel base subscription (specify default policy) |
Invoice with credit is NOT generated (Since |
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 changepolicy
. -
There are three possible values for change policy,
END_OF_TERM
,IMMEDIATE
andILLEGAL
. -
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
Product | Category |
---|---|
Standard |
Base |
Sports |
Base |
Super |
Base |
Premium |
Base |
Plans
Plan Name | Product | Plan Description |
---|---|---|
standard-monthly |
Standard |
|
sports-monthly |
Sports |
Single |
super-monthly |
Super |
Single |
premium-monthly |
Premium |
Single |
It specifies the following plan cancellation rules:
Predicate | Change 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.
Action | Result |
---|---|
Create a subscription for the |
Invoice generated for |
Change subscription to use the |
Plan change takes effect immediately (Invoice generated for |
Trigger invoice dry run with target date |
Invoice generated for |
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.
Action | Result |
---|---|
Create a subscription for the |
Invoice generated for |
Change subscription to use the |
Plan change takes effect immediately (Since the monthly price for |
Trigger invoice dry run with target date |
Invoice generated for |
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.
Action | Result |
---|---|
Create a subscription for the |
Invoice generated for |
Change subscription to use the |
Plan change takes effect immediately (Since the monthly price for |
Trigger invoice dry run with target date |
Invoice generated for |
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.
Action | Result |
---|---|
Create a subscription for the |
Invoice generated for |
Change subscription to use the |
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.
Action | Result |
---|---|
Create a subscription for the |
Invoice generated for |
Change subscription to use the |
Plan change takes effect end of term ( Invoice item corresponding to a credit is not generated) |
Trigger invoice dry run with target date |
Invoice generated for |
Usage Billing
Kill Bill supports usage based billing as explained in the Subscription Billing document. A quick summary about usage billing:
-
Users are billed based on their usage data as defined in the catalog. The
Plan
section in the catalog can contain one or more usage section(s) in addition to other non usage based sections. -
Kill Bill supports two types of usage billing:
CONSUMABLE
andCAPACITY
-
In
CONSUMABLE
billing, users are billed based on the number of units consumed. TwoTierBlockPolicy
policies are supported:ALL_TIER
andTOP_TIER
. TheALL_TIER
policy charges users across each tier while theTOP_TIER
policy charges users at the top tier. -
In
CAPACITY
billing users are charged a flat rate based on the units consumed.
Let us take a look at a few catalog examples.
Consumable Billing with ALL_TIERS policy
This example uses the Consumable Billing All Tiers catalog. It has a water-monthly
plan with a MONTHLY
recurring charge of $30
. In addition, it also has a usage section with usageType=CONSUMABLE
, tierBlockPolicy=ALL_TIERS
and the following tieredBlock
sections:
Unit | Size | Price | Max | Explanation |
---|---|---|---|---|
liter |
1 |
$1.50 |
1000 |
Users will be charged at $1.50 per liter for the first 1000 liters |
liter |
1 |
$2.0 |
-1 |
Users will be charged at $2.0 per liter for any units consumed above |
The following table lists the actions and their results:
Action | Result |
---|---|
Create a subscription for the |
Because IN_ARREAR billing mode is specified, the system does not generate an invoice (yet). |
Record a usage of |
Again, invoice not generated since IN_ARREAR billing mode is specified |
Trigger invoice dry run with target date |
Invoice generated for |
Record a usage of |
Invoice generated for |
See Consumable In Arrear Tutorial for additional information.
Consumable Billing with TOP_TIER policy
This example uses the Consumable Billing Top Tier catalog. This catalog is exactly the same as the Consumable Billing All Tiers catalog explained above. The only difference is that it uses tierBlockPolicy=TOP_TIER
.
The following table lists the actions and their results:
Action | Result |
---|---|
Create a subscription for the |
Because IN_ARREAR billing mode is specified, the system does not generate an invoice (yet). |
Record a usage of |
Again, invoice not generated since IN_ARREAR billing mode is specified |
Trigger invoice dry run with target date |
Invoice generated for |
Record a usage of |
Invoice generated for |
Capacity Billing
This example uses the Capacity Billing catalog. It has a water-monthly
plan with a MONTHLY
recurring charge of $30
. In addition, it also has a usage section with usageType=CAPACITY
, and the following tier
sections:
Max Limit | Price | Explanation |
---|---|---|
1000 |
$750.0 |
Users will be charged a flat charge of $750 if their units are less than or equal to 1000 |
10000 |
$500.0 |
Users will be charged a flat charge of $500 if their units exceed 1000. |
The following table lists the actions and their results:
Action | Result |
---|---|
Create a subscription for the |
Because IN_ARREAR billing mode is specified, the system does not generate an invoice (yet). |
Record a usage of |
Again, invoice not generated since IN_ARREAR billing mode is specified |
Trigger invoice dry run with target date |
Invoice generated for |
Record a usage of |
Invoice generated for |
Multiple Usage Sections
This example uses the Consumable Billing Multiple Usage Sections catalog. It has a cell-phone-monthly
plan with a MONTHLY
recurring charge of $30
. In addition, it has two usage sections: cell-phone-minutes-monthly-usage
and mbytes-monthly-usage
. The cell-phone-minutes-monthly-usage
usage section specifies the ALL_TIERS
policy while the mbytes-monthly-usage
usage section specifies the TOP_TIER
policy.
The following table lists the actions and their results:
Action | Result |
---|---|
Create a subscription for the |
Because IN_ARREAR billing mode is specified, the system does not generate an invoice (yet). |
Record a usage of |
Again, invoice not generated since IN_ARREAR billing mode is specified |
Trigger invoice dry run with target date |
Invoice generated for |
Record a usage of |
Invoice generated for |
Block Size Greater Than One
This example uses the Consumable Billing Block Size More Than One catalog. It has a cell-phone-monthly
plan with a MONTHLY
recurring charge of $30
. In addition, it also has a usage section with usageType=CONSUMABLE
, tierBlockPolicy=ALL_TIERS
and the following tieredBlock
sections:
Unit | Size | Price | Max | Explanation |
---|---|---|---|---|
cell-phone-minutes |
10 |
$1.00 |
100 |
A block size |
cell-phone-minutes |
10 |
$0.5 |
-1 |
Users will be charged at $2.0 per block for any blocks consumed above |
The following table lists the actions and their results:
Action | Result |
---|---|
Create a subscription for the |
Because IN_ARREAR billing mode is specified, the system does not generate an invoice (yet). |
Record a usage of |
Again, invoice not generated since IN_ARREAR billing mode is specified |
Trigger invoice dry run with target date |
Invoice generated for |
Record a usage of |
Invoice generated for |
Versioned Catalogs
Kill Bill allows modifying the catalog over time. You can do this by creating a set of catalogs, one XML file for each version. Note that all the versions of a catalog need to have the same catalogName
but different values for effectiveDate
. The system will then rank such files based on their effectiveDate
to create the various versions.
You can do the following using versioned catalogs:
-
Add new plans
-
Modify the price for an existing plan
-
Delete plans
Kill Bill uses the following rules to determine the active catalog version:
-
When there are multiple versions of a catalog, the catalog with an
effectiveDate
not later than the current date is treated as the active catalog. So any catalog version with a futureeffectiveDate
is not treated as active until that date is reached. -
If there are multiple catalog versions with effective dates before the current date, the newest one is considered active.
-
If all the catalog versions have effective dates after the current date, the oldest one is considered active.
-
If there are multiple catalog versions, with the same date component but different time components in the
effectiveDate
, the one with the earliest time component is considered as active. -
When there is only one catalog version, the
effectiveDate
does not matter. So, irrespective of whether it is in the past or in the future, the catalog is treated as the active catalog.
Note
|
Note: Currently Kill Bill requires the catalog names to be the same across different versions. Changing the name of the catalog results in an exception and momentarily freezes any further uploads even with the original catalog name. To workaround this, tenant specific cache can be cleared as explained here. |
The subsequent sections provide some examples of versioned catalogs.
Add New Plan
It is possible to add a new plan in a newer version of a catalog. The new plan is available only when the current date surpasses the effectiveDate
in the new catalog version.
This example uses the following catalogs:
Catalog Name | effectiveDate | Plan Details |
---|---|---|
2020-01-01T00:00:00+00:00 |
|
|
2021-01-15T00:00:00+00:00 |
|
The following table lists the actions and their results:
Action | Result |
---|---|
Set the date to |
- |
Create a subscription to the |
Invoice is generated for |
Create a subscription to the |
Subscription creation fails (Since the |
Move the clock to |
Invoice is generated for |
Create a subscription to the |
Invoice is generated for |
Modify Plan Price Without Affecting Existing Subscriptions
It is possible to change the price of a plan in a newer version of a catalog. In such cases, the price change applies only to new subscriptions (subscriptions created after the catalog with the price change is effective). Older subscriptions continue to be billed as per the original price plan.
This example uses the following catalogs:
Catalog Name | effectiveDate | Plan Details |
---|---|---|
modify-plan-price-without-effective-date-for-existing-sub-v1.xml |
2020-01-01T00:00:00+00:00 |
|
modify-plan-price-without-effective-date-for-existing-sub-v2.xml |
2021-01-15T00:00:00+00:00 |
|
The following table lists the actions and their results:
Action | Result |
---|---|
Set the date to |
- |
Create a subscription to the |
Invoice is generated for |
Move the clock to |
Invoice is generated for |
Create another subscription to the |
Invoice is generated for |
Modify Plan Price And Use New Price for Existing Subscriptions
As mentioned earlier, when a plan price is changed, it applies only to new subscriptions. If you do need to apply the price change to existing subscriptions, the effectiveDateForExistingSubscriptions
attribute needs to be specified corresponding to the plan.
This example uses the following catalogs:
Catalog Name | effectiveDate | Plan Details |
---|---|---|
2020-01-01T00:00:00+00:00 |
|
|
2021-01-15T00:00:00+00:00 |
|
The following table lists the actions and their results:
Action | Result |
---|---|
Set the date to |
- |
Create a subscription to the |
Invoice is generated for |
Move the clock to |
Invoice is generated for |
Move the clock to |
Invoice generated for |
Retire Plan
It is possible to delete a plan in a newer version of a catalog. In such cases, no new subscriptions can be created corresponding to the plan. However, existing subscriptions continue to be billed as per the original price plan.
This example uses the following catalogs:
Catalog Name | effectiveDate | Plan Details |
---|---|---|
2020-01-01T00:00:00+00:00 |
|
|
2021-01-15T00:00:00+00:00 |
|
The following table lists the actions and their results:
Action | Result |
---|---|
Set the date to |
- |
Create a subscription to the |
Invoice is generated for |
Move the clock to |
Invoice is generated for |
Create another subscription to the |
Subscription creation fails since v2 is now active and the |