Skip to content

Subscription Plans: Example configuration of a module

Back to Subscription Plans.

This defines two plans with the same features payable either monthly and yearly either in $ or €.

Includes another “lite” plan with only one of the features.

There also is an “unreleased” plan that is not available for purchase, but can be used to enable features that are not yet released. That can be done by manually adding unreleased to the active_plans field of an entity and saving it.

JSON Configuration for a module
{
"resource_module": "buyable_thingy",
"resource": {
"identifier": "buyable_thingy",
"type": "module",
"options": {
"capabilities": [
{
"identifier": "Buyable",
"options": {
"subscription_plans": [
{
"identifier": "pro_monthly",
"name": "Pro subscription monthly",
"description": "This gives you cool PRO features",
"features": [
{
"identifier": "pro_feature_x",
"name": "Feature X"
},
{
"identifier": "pro_feature_y",
"name": "Feature Y"
}
],
"prices": [
{
"identifier": "pro_monthly_usd",
"price": "21.00",
"currency": "usd",
"interval": "month"
},
{
"identifier": "pro_monthly_eur",
"price": "20.00",
"currency": "eur",
"interval": "month"
}
]
},
{
"identifier": "pro_yearly",
"name": "Pro subscription yearly",
"description": "This gives you cool PRO features",
"features": [
{
"identifier": "pro_feature_x",
"name": "Feature X"
},
{
"identifier": "pro_feature_y",
"name": "Feature Y"
}
],
"prices": [
{
"identifier": "pro_yearly_usd",
"price": "180.00",
"currency": "usd",
"interval": "year"
},
{
"identifier": "pro_yearly_eur",
"price": "180.00",
"currency": "eur",
"interval": "year"
}
]
},
{
"identifier": "lite",
"name": "Lite subscription",
"description": "Get a taste of some PRO features",
"features": [
{
"identifier": "pro_feature_x",
"name": "Feature X"
}
],
"prices": [
{
"identifier": "pro_monthly_usd",
"price": "16.00",
"currency": "usd",
"interval": "month"
},
{
"identifier": "pro_monthly_eur",
"price": "15.00",
"currency": "eur",
"interval": "month"
}
]
},
{
"identifier": "unreleased",
"name": "Unreleased plan",
"description": "This is a plan is for features that are not yet released. It can not be bought.",
"features": [
{
"identifier": "unreleased_feature_x",
"name": "Unreleased Feature X"
}
]
}
]
}
}
]
}
}
}

Configure automatic emails in the stripe dashboard to send emails to users when their payment fails, their card expires or they need to confirm a payment.

To do that, navigate to the stripe automatic billing settings. Then set the following options: auto_emails_1.png

auto_emails_2.png

auto_emails_3.png

If payments fail, you want them to be retried automatically and not just canceled immediately. However, if all retries fail, the subscription should be canceled at which point your application will react to that as if the plan was deactivated.

To do that, navigate to the billing settings and set the following options: img.png