Free Trial with Freemium Plans and a Usage Limit

Plans

Free, Pro, Premium etc. all with a stipulated trial period.

Scenario

Tim signs up for your product and by default you put him on a free but limited trial. When the trial period is about to expire, you send him an email asking him to pick a plan. After he chooses the plan, you ask him to key in his card information. If he doesn’t pick a plan, his account will be disabled.

P.S. The freemium plan also requires a valid card on file to remain active. If Tim exceeds the free usage limit, usage charges will be applied.

Implementation

Step 1: User Signup

Have a simple sign up form which collects user’s basic information (Name, Email, etc.).

Step 2: Create Plans

Set up plans that correspond to your Pricing Structure. Also, enable Metered Billing in Chargebee for handling usage related charges. Ensure that you have the API configuration for the same in place.

                        
                          curl  https://{site}.chargebee.com/api/v1/plans \
                               -u {site_api_key}: \
                               -d id="pro" \
                               -d name="Pro" \
                               -d invoice_name="Pro Plan" \
                               -d price="5000"
                        
                        
Step 3: Create a Subscription

After a customer signs up, create a subscription in Chargebee (Creating a subscription automatically creates a customer in Chargebee).

                        
                            curl  https://{site}.chargebee.com/api/v1/subscriptions \
                                 -u {site_api_key}: \
                                 -d customer[email]="john@user.com" \
                                 -d customer[first_name]="John" \
                                 -d customer[last_name]="Doe" \
                                 -d customer[phone]="+1-949-999-9999" \
                                 -d plan_id="premium" \
                                 -d billing_address[first_name]="John" \
                                 -d billing_address[last_name]="Doe" \
                                 -d billing_address[line1]="PO Box 9999" \
                                 -d billing_address[city]="Walnut" \
                                 -d billing_address[state]="California" \
                                 -d billing_address[zip]="91789" \
                                 -d billing_address[country]="US"
                            
                        
Step 4: Watch out for when the trial ends

Have a webhook configured which listens to the subscription_trial_ending event. With the event response as a trigger, send automatic email reminders to your customers asking them to pick a plan and update their payment method information.

P.S. You could also make this information appear as a notification inside your app using the webhook as a trigger.

                            
                            curl  https://{site}.chargebee.com/api/v1/subscriptions/8avVGOkx8U1MX \
                                    -u {site_api_key}:
                             
                        
Step 5: Cancel Account or Collect Card Information

After the notification is sent:

  • If customers do not pick a plan or cancel your account, Cancel the account using the Cancel a Subscription API.

                                        
                                        curl https://{site}.chargebee.com/api/v1/subscriptions/8avVGOkx8U1MX/cancel \
                                            -X POST  \
                                            -u {site_api_key}:
                                        
                                    
  • If customers update their payment information and pick a plan, update the plan and payment information using the Update a Subscription API.

                                        
                                        curl  https://{site}.chargebee.com/api/v1/subscriptions/8avVGOkx8U1MX \
                                                 -u {site_api_key}: \
                                                 -d plan_id="premium" \
                                                 -d billing_address[first_name]="John" \
                                                 -d billing_address[last_name]="Doe" \
                                                 -d billing_address[line1]="PO Box 9999" \
                                                 -d billing_address[city]="Walnut" \
                                                 -d billing_address[state]="California" \
                                                 -d billing_address[zip]="91789" \
                                                 -d billing_address[country]="US"
                                        
                                    

    If you use Chargebee’s Hosted Pages + API, make use of the Checkout Existing Subscription API to collect information and pass it on to Chargebee.