The periodicity defines how much is charged and the frequency of the payment.
Periodicity is a key component to working with plans and powers the billing relationship.
Periodicity is comprised of three attributes: type
, duration
, and cents
. A periodicity's type must be one of: day
, week
, month
, or year
. The periodicity's duration
multiplied by its type
determines its total length.
- To charge someone $14.99 every month, you would create a plan with a periodicity where:
type=month
,duration=1
, andcents=1499
. - To charge someone $24.99 every quarter, you would create a plan with a periodicity where:
type=month
,duration=3
, andcents=2499
.
Frequently you will want to provide some sort of introductory pricing (whether a free trial period or a discounted initial period). This will be outlined in discounts and offers. But the plan is defined based on the recurring charge, without consideration of any promotional period.
This will allow you to create (and test) many different types of offers to see what resonates. All without having to duplicate plans or plan groups.
Attributes:
Name | Type | Description |
---|---|---|
type | string | One of: day , week , month , or year . |
duration | integer | The multiple against type that defines the total period length. |
cents | integer | How much to charge for the period duration. |