Start a new topic
Answered

Create new subscription for the existing customer using hosted page

Hi there!


I'm integretaing Chargbee into our application. Our requirements are:

1. Each user gets free subscription on signup

2. User can purchase additional subscription (in addition to free subscription)

3. We want use hosted pages to avoid possible security issues on custom implementation of the billing pages.


I found two methods on HostedPage class those look promising: CheckoutNew and CheckoutExisting.

In our case we want to create new subscription thus I've first tried CheckoutNew method. But it seems that it creates new chargebee customer. At that moment we already have it for each user.

In contrary, CheckoutExisting does not create new customer but modifies existing subscription of the existing customer. This also does not fit our requirements.


Is there any way to create new subscription for the existing customer using hosted pages?


Best Answer

Hey Pavel,


1} If you’d like your users to get a free subscription on signup, you could create a $0 plan {with desired number of billing cycles} in Chargebee and make them subscribe to it using ‘Create a subscription’ API.


2} If you’d like to give users the option to purchase additional products/services, you could create addons {preferably recurring type} in Chargebee and associate them with the free subscription. If it’s one time payment for these additional purchases, you could go for non-recurring addons.


3} Apart from this, if you'd like to create a new subscription {with no trial period} for an existing customer {with a valid card on file}, you could make use of 'Create Subscription for Customer' API. Since they have a card already, there’s no need to use the hosted pages again.


If you want customers to update their card details, you can use the ‘Update Payment Method' API to get the card details using the hosted pages.


'Checkout existing Subscription' API would not help since it is used only for updating an existing subscription. This is normally used to collect the card details (if there is no card on file) and the customer is upgrading from a trial subscription to an active one.

1 Comment

Answer

Hey Pavel,


1} If you’d like your users to get a free subscription on signup, you could create a $0 plan {with desired number of billing cycles} in Chargebee and make them subscribe to it using ‘Create a subscription’ API.


2} If you’d like to give users the option to purchase additional products/services, you could create addons {preferably recurring type} in Chargebee and associate them with the free subscription. If it’s one time payment for these additional purchases, you could go for non-recurring addons.


3} Apart from this, if you'd like to create a new subscription {with no trial period} for an existing customer {with a valid card on file}, you could make use of 'Create Subscription for Customer' API. Since they have a card already, there’s no need to use the hosted pages again.


If you want customers to update their card details, you can use the ‘Update Payment Method' API to get the card details using the hosted pages.


'Checkout existing Subscription' API would not help since it is used only for updating an existing subscription. This is normally used to collect the card details (if there is no card on file) and the customer is upgrading from a trial subscription to an active one.

Login or Signup to post a comment