States, events, and phase transitions
In the Bango Subscriptions API:
As time passes, a subscription to a product under a plan passes through each of the plan's phases in turn. The subscription might eventually end (for example, by user cancellation) or might continue indefinitely.
In addition, each subscription has a state value. The state is always one of:
State | Description |
---|---|
PENDING | The user does not yet have access to the product or service associated with the subscription. Subscriptions start in |
ACTIVE | The user has access to the product or service associated with the subscription. Subscriptions start in |
CANCELLED | The user no longer has access to the product or service associated with the subscription. Subscriptions transition from The Bango Subscriptions API allows for immediate cancellation (access stops instantly) or scheduled cancellation (access stops at a future date). The subscription changes to To identify whether a subscription is scheduled for cancellation, check its Subscriptions with a scheduled cancellation date can be "uncanceled": the |
Let's look at an example plan and see what happens over time.
The product catalog contains the product "Bango Music", with a full price of USD 5.99 per month, and one of its plans is "Free trial – three months". The phases would be:
On September 1, 2020, Alice creates a subscription to the Bango Music service under the "Free trial – three months" plan. The service is made available to her immediately. In mid February 2021 she decides to cancel the plan, and the customer portal she uses ensures she continues to have access to the service until the next payment point. Here's the complete timeline:
Date | Event | State | Phase | Payment |
---|---|---|---|---|
Sep 1, 2020 | Alice creates subscription | ACTIVE | Trial | None |
Dec 1, 2020 | Phase change + billing | ACTIVE | Evergreen | USD 5.99 |
Jan 1, 2021 | Billing | ACTIVE | Evergreen | USD 5.99 |
Feb 1, 2021 | Billing | ACTIVE | Evergreen | USD 5.99 |
Feb 14, 2021 | Alice decides to cancel | ACTIVE | Evergreen | None |
March 1, 2021 | Subscription ends | CANCELLED | Evergreen | None |