This article covers
I need to extend the number of trial days from 7 to 30 days if the customers have subscriptions in the trial, will add the payment method. How to achieve that in Chargebee in an automated way?
If you need to extend the trial period of the subscription when your customer adds their payment method, you can do that in two ways -
- Manual: You can extend the Trial period by clicking on the “Edit trial end date” on that particular subscription details page
- Automate: You can use the API call to update the subscription to specify the trial end date with the combined use of Webhook calls.
- Manually - You need to monitor when the customer will add the payment method, after adding the payment method you can use the “Edit Trial End Date” action to extend the trial days. This option is available on the right-hand side of the action panel of the subscription details page.
Automatically - When a payment method gets added via Hosted pages or via API call by the customer, it will generate the event 'Payment Source Added'. You need to set up a webhook call to listen to this particular event by navigating to Settings >> Configure Chargebee >> Webhooks. You can read about Webhook configuration in the following links- For PC 1.0, For PC 2.0. As soon as the 'Payment source added' event takes place, the configured webhook will send the information of the event to your system. You can set up an API call to update the subscription upon receiving this webhook notification. In the API call, you need to pass the value of the parameter “trial_end” in the UTC Epoch timestamp. The required API call is mentioned in the links here, For PC 1.0, For PC 2.0.
Related articles and Documentation