Docs

Hosted Pages Articles & FAQ

hosted page, iframe embed, chargebee API

461783

2013-11-14T09:27:17Z

2024-04-30T07:26:36Z

8320

16

16

164405

[API Users] How to generate hosted page URL and embed via iFrame

[API Users] How to generate hosted page URL and embed via iFrame 

This article covers:

Hosted pages API

This article applies for hosted pages V2.

If you want to integrate with Chargebee using iFrame, you can use the Hosted Pages APIs.

To create a new subscription, you can generate the hosted page URL using the “Checkout New Subscription” hosted page API call. To checkout an existing trial subscription, use the Checkout Existing Subscription.

Chargebee will return a response with the checkout URL. Below is a sample snippet for reference, which can you load in your Iframe.

{"hosted_page": {
    "id": "7R24UkirlHejZgMgUQt9ea*******5S",
    "type": "checkout_new",
    "url": "https://yourapp.chargebee.com/pages/v2/7R24UkirlHejZgMgUQt9eahrkOu7ZO5S/checkout",
    "state": "created",
    "embed": true,
    "created_at": 1528093752,
    "expires_at": 1528097352,
    "object": "hosted_page",
    "updated_at": 1528093752,
    "resource_version": 1528093752000
}}

Additionally, you can the return URLs for hosted payment page so that the customers are redirected to this page upon successful checkout. To configure the Redirect URL for checkout page generated using the APIs, navigate to Settings > Configure Chargebee > Checkout & Self Service Portal.

You can also configure the “Cancel URL” here to redirect customers to a link when they'd like to cancel the subscription.

Customers will be redirected to the above-configured URL after successful signup using the generated hosted payment page.

Related Articles 

“Subscription[Start_Date] should not be passed for cancelled subscription” error while importing subscriptions via Bulk operation.
How to customise the Consent management settings in Chargebee’s hosted page
Error: Session Expired
Chargebee's site name was renamed but why does this still show a different name?
How to edit the fields that appear on the hosted customer portal? Will it appear only in English?
Can I group plans and display them in the customer portal?
How to import a Google font which has two words in the name?
How to set a landing page URL for the logo added to the theme?
Why is the checkout page not loading?
How to collect the coupon codes during signup on the V2 checkout pages?
Checkout V3 - FAQ
How can I collect the coupon codes on the V3 checkout pages during signup?
Content security policy for the Checkout page
How do I control the Quantity increments on the Checkout page?
Redirect URL not working
Checkout page returns with exclamation marks when my customer tries to add his card details. What should I do?
Is it possible to change the order in which the payment methods are displayed in checkout?
“Wrong format” error while passing email id in checkout
How to make the billing address mandatory in the self-serve portal when my customer reactivates his subscription?
Google Analytics: track_info_error on Checkout V3
Can I let my customers set the Auto collection status at the self-serve portal?
How to hide the discount prompt from displaying?
How can my customers set a password for their self serve portal?
How to add shipping address?
Allow customers to add addons on Self serve portal
How to navigate to the specific step in the Portal popup using JS/PHP?
Where do I add my domain for the allow-list?
Was this article helpful?
Loading…