How to set up subscription-based products and plan groups
Subscription-based product is a service or a set of services provided to a user when they purchase the subscription. Product creation is necessary if you set up the sale of separate subscriptions for different services or if you want to give a user the ability to get several subscriptions at the same time. An example of a subscription-based product access to the streamer's channel, to the game, or to a unique item/unique ability.
A group of plans is a set of plans that have the same group_id
parameter value. The group_id
parameter is used to form a group of plans and associate this group with subscription-based products. Creating a group of plans allows you to:
- limit the number of plans you can choose to subscribe to a product
- let the user switch to another plan inside the group
“group_id”:null
parameter and included in the general group. You can choose not to create groups if no products are created in your project.Groups, plans and products interact with each other according to the following rules:
- One plan can belong only to one group.
- One product can be created based on only one group.
- One group can be linked to several products.
To create a subscription-based product and plan group, pass the following parameters to the Create Product API call:
name
with the name of the productgroup_id
with the name of the plan group
group_id
parameter to the Create Plan or Update Plan API calls, and then create a product using the existing group_id
value.To change, delete, or get a list of all products, use the corresponding API calls:
To link a plan to a plan group and to a product, pass the group_id
parameter with the name of the plan group to the Update plan API call. To remove a group, pass “group_id”:null
.
To open the payment interface when purchasing a plan linked to a product, pass the following parameters to the Create token API call:
purchase.subscription.plan_id
with plan IDpurchase.subscription.product_id
with the ID of the product associated with the plan viagroup_id
Examples
- If you want to sell game access with only one subscription option, you need to set up a subscription plan but you do not need to configure the product.
- If you want to sell access to the game for different terms, for example, for 1 and 3 months, you need to set up 2 subscription plans with the appropriate conditions. You do not need to configure the product either. Plans will have the
“group_id”:null
parameter by default, that is, they will be in the general group. The user will be able to choose any of them when purchasing a subscription, as well as switch from one plan to another. - You want to sell not only access to the game for 1 and 3 months, but also an additional subscription, for example, a sword upgrade for 6 months. In this case:
- Create 2 products “game” and “sword” by passing unique
name
andgroup_id
parameters for each product to the Create Product API call. - Create plans for 1, 3 and 6 months in one of the following ways:
- Set up the plans in your Publisher Account, then use the Update plan API call to pass the product
group_id
parameter “game” to the subscription plans for selling the game and the productgroup_id
parameter “sword” to the subscription plans for selling the sword. - Use the Create Plan API call, where you pass the data about the plans, as well as the
group_id
parameter of the “game” product to the subscription plans for selling the game, and thegroup_id
parameter of the “sword” product to the subscription plans for selling the sword.
- Set up the plans in your Publisher Account, then use the Update plan API call to pass the product
- Implement the display of “game subscription” and “sword upgrade subscription” products in the store interface.
- Create 2 products “game” and “sword” by passing unique
Was this article helpful?
Rate this page
Don’t want to answer
Thank you for your feedback!
Found a typo or other text error? Select the text and press Ctrl+Enter.