You can checkout an existing subscription(typically in the trial state) by passing in the plan, quantity and addon details(like Update a Subscription)
When the redirect URL is notified of the result, we would advise you to retrieve the subscription and verify the details.
Related Tutorial
As mentioned before this behavior is very similar to the update subscription API call. All the web hook events will be fired only after the submission of payment details by the customer and successful checkout of subscription. Any errors related to the payment form that is submitted is handled as a response within the form so that the user is kept informed about the reason for failure to take corrective action.
Sample Request
URL Format
Input Parameters
Should be true if the existing addons should be replaced with the ones that are being passed.
The number of billing cycles the subscription runs before canceling. If not provided, then the billing cycles set for the plan is used.
The customers will be redirected to this URL upon successful checkout. The hosted page id and state will be passed as parameters to this URL.
Although the customer will be redirected to the redirect_url
after successful checkout,
we do not recommend relying on it for completing critical post-checkout actions.
This is because redirection may not happen due to unforeseen reasons.
Chargebee recommends listening to appropriate webhooks such as subscription_created
or invoice_generated
to verify a successful checkout.
Note
: - Redirect URL configured in Settings > Hosted Pages Settings would be overriden by this redirect URL.
Eg : http://yoursite.com?id=&state=succeeded
- This parameter is not applicable for iframe messaging.
The customers will be redirected to this URL upon canceling checkout. The hosted page id and state will be passed as parameters to this URL.
Note
: - Cancel URL configured in Settings > Hosted Pages Settings would be overriden by this cancel URL.
Eg : http://yoursite.com?id=&state=cancelled
- This parameter is not applicable for iframe messaging and in-app checkout.
You can pass through any content specific to the hosted page request and get it back after user had submitted the hosted page.
If true then hosted page formatted to be shown in iframe. If false, it is formatted to be shown as a separate page.
Note : For in-app checkout, default is false.
If true then iframe will communicate with the parent window. Applicable only for embedded(iframe) hosted pages. If you're using iframe_messaging you need to implement onSuccess & onCancel callbacks.
Note : This parameter is not applicable for in-app checkout.