API Version
Product Catalog
Library

Hosted pages are the easiest way to integrate Chargebee with your website. For card payment methods, they help meet most of your PCI DSS compliance requirements. Chargebee offers hosted pages where your customers can perform the following actions:

When you create a hosted page, it is available at a secure and unique URL. This URL can then be provided to your customer on your website or by other means such as email. On successful completion of the hosted page workflow by the customer, they are redirected to the redirect_url with the hosted page id and state passed as query string parameters. As soon as the redirection happens, retrieve the hosted page to get details of the customer, subscription, invoice etc.

Sample hosted page [ JSON ]

{ "created_at": 1517464663, "embed": false, "expires_at": 1517468263, "id": "__one_time_checkout___test__cdqM9MLUubELMycut0Cr9sHq8gOTKEZSdcu", "object": "hosted_page", "resource_version": 1517444863979, "state": "created", "type": "checkout_one_time", "updated_at": 1517444863, "url": "https://yourapp.chargebee.com/pages/v3/__one_time_checkout___test__cdqM9MLUubELMycut0Cr9sHq8gOTKEZSdcu/" }

API Index URL GET

https://{site}.chargebee.com/api/v2/hosted_pages

Model Class

id
optional, string, max chars=70
Unique identifier generated for each hosted page requested.
type
optional, enumerated string
Type of the requested hosted page.
Possible values are
checkout_newCheckout new Subscriptioncheckout_existingCheckout existing Subscriptionupdate_payment_methodUpdate Payment Method for a Customermanage_payment_sourcesManage Payments for a customer
Show all values[+]
url
optional, string, max chars=250
Unique URL for the hosted page that will be included in your website.
state
optional, enumerated string, default=created
Indicating the current state of the hosted page resource.
Possible values are
createdIndicates the hosted page is just created.requestedIndicates the hosted page is requested by the websitesucceededIndicates the hosted page is successfully submitted by the user and response is sent to the return url.cancelledIndicates the page is cancelled by the end user after requesting it.
Show all values[+]
pass_thru_content
optional, string, max chars=2048
You can pass through any content specific to the hosted page request and get it back after user had submitted the hosted page.
created_at
optional, timestamp(UTC) in seconds
Indicates when this hosted page url is generated.
expires_at
optional, timestamp(UTC) in seconds
Indicates when this hosted page url will expire. After this, the hosted page cannot be accessed.
content
jsonobject
This attribute will be returned only during retrieve hosted page API call and also the retrieved hosted page resource state should be either in "succeeded" or "cancelled" state.
If hosted page state is "succeeded", then the subscription, customer, card & invoice(optional) resources during checkout can be obtained.
If hosted page is state is "cancelled", then it will be empty i.e no information about checkout.

updated_at
optional, timestamp(UTC) in seconds
Timestamp indicating when this hosted page was last updated.
resource_version
optional, long
The version number of this resource. For every change made to the resource, resource_version is updated with a new timestamp in milliseconds.
checkout_info
optional, jsonobject
Customer Info (email, first name and last name) given in the checkout page used for tracking abandoned carts.
Learn more

business_entity_id
optional, string, max chars=50
The unique ID of the business entity of this hosted_page.
id id
optional, string, max chars=70
Unique identifier generated for each hosted page requested.
type type
optional, enumerated string
Type of the requested hosted page.
url url
optional, string, max chars=250
Unique URL for the hosted page that will be included in your website.
state state
optional, enumerated string, default=created
Indicating the current state of the hosted page resource.
pass_thru_content pass_thru_content
optional, string, max chars=2048
You can pass through any content specific to the hosted page request and get it back after user had submitted the hosted page.
created_at created_at
optional, timestamp(UTC) in seconds
Indicates when this hosted page url is generated.
expires_at expires_at
optional, timestamp(UTC) in seconds
Indicates when this hosted page url will expire. After this, the hosted page cannot be accessed.
content
jsonobject
This attribute will be returned only during retrieve hosted page API call and also the retrieved hosted page resource state should be either in "succeeded" or "cancelled" state.
If hosted page state is "succeeded", then the subscription, customer, card & invoice(optional) resources during checkout can be obtained.
If hosted page is state is "cancelled", then it will be empty i.e no information about checkout.

updated_at updated_at
optional, timestamp(UTC) in seconds
Timestamp indicating when this hosted page was last updated.
resource_version resource_version
optional, long
The version number of this resource. For every change made to the resource, resource_version is updated with a new timestamp in milliseconds.
checkout_info
optional, jsonobject
Customer Info (email, first name and last name) given in the checkout page used for tracking abandoned carts.
Learn more

business_entity_id business_entity_id
optional, string, max chars=50
The unique ID of the business entity of this hosted_page.

Create a Chargebee hosted page to accept payment details from a customer and checkout charge-items and one-time charges.

The following steps describe how best to use this API:

  1. Call this endpoint, providing item prices, charges, coupons and a host of other details such as billing and shipping addresses of the customer, to be prefilled on the checkout page.
  2. Send the customer to the Checkout url received in the response.
  3. Once they complete checkout, the set of charge-items and one-time charges are automatically invoiced against the respective customer record in Chargebee, and they are redirected to the redirect_url with the id and state attributes passed as query string parameters.
  4. Retrieve the hosted page at this stage to get the invoice details.

Customer resource lookup and creation

When customer[id] is provided for this operation, it is looked up by Chargebee, and if found, the hosted_page is created for it. If not found, a new customer resource is created with the ID provided, and the hosted_page is created.

Multiple business entities

If multiple business entities are created for the site, the customer resource lookup and creation happen within the context of the business entity specified in this API call. If no business entity is specified, the customer resource lookup is performed within the site context , and if not found, the resource is created for the default business entity of the site.

Notes

Sample Request
# Creates a checkout with non-recurring addon for a customer.
curl  https://{site}.chargebee.com/api/v2/hosted_pages/checkout_one_time_for_items \
     -u {site_api_key}:\
     -d customer[id]="__test__XpbXKKYSOUtL5p2E" 
     -d shipping_address[first_name]="John" \
     -d shipping_address[last_name]="Mathew" \
     -d shipping_address[city]="Walnut" \
     -d shipping_address[state]="California" \
     -d shipping_address[zip]="91789" \
     -d shipping_address[country]="US" 
     -d item_prices[item_price_id][0]="ssl-charge-USD" \
     -d item_prices[unit_price][0]=2000 
copy
Click to Copy

Sample Response [ JSON ]

Show more...
{
    "hosted_page": {
        "created_at": 1517464663,
        "embed": false,
        "expires_at": 1517468263,
        "id": "__one_time_checkout___test__cdqM9MLUubELMycut0Cr9sHq8gOTKEZSdcu",
        "object": "hosted_page",
        "resource_version": 1517444863979,
        "state": "created",
        "type": "checkout_one_time",
        "updated_at": 1517444863,
        "url": "https://yourapp.chargebee.com/pages/v3/__one_time_checkout___test__cdqM9MLUubELMycut0Cr9sHq8gOTKEZSdcu/"
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/hosted_pages/checkout_one_time_for_items

Method

business_entity_id[]
optional, string, max chars=50

Sets the context for this operation to the business entity specified. Applicable only when multiple business entities have been created for the site. When this parameter is provided, the operation is able to read/write data associated only to the business entity specified. When not provided, the operation can read/write data for the entire site.

Note

An alternative way of passing this parameter is by means of a custom HTTP header.

layout[]
optional, enumerated string
Specifies the checkout layout that overrides the default checkout layout configured in the Checkout & Self-Serve Portal settings. .
Possible values are
in_appIndicates in-app checkout versionfull_pageIndicates full page checkout version
Show all values[+]
invoice_note[]
optional, string, max chars=2000
A note for this particular invoice. This, and all other notes for the invoice are displayed on the PDF invoice sent to the customer.
coupon_ids[[0..n]][0..n]
optional, list of string
List of Coupons to be added.
currency_code[]
required if Multicurrency is enabled, string, max chars=3
The currency code (ISO 4217 format) of the invoice amount.
redirect_url[]
optional, string, max chars=250
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.

Note :
  • 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 such as user closing the tab, or exiting the browser, and so on. If there is any synchronization that you are doing after the redirection, you will have to have a backup. Chargebee recommends listening to appropriate webhooks such as subscription_created or invoice_generated to verify a successful checkout.
  • Redirect URL configured in Settings > Hosted Pages Settings would be overriden by this redirect URL.
  • Eg : http://yoursite.com?id=<hosted_page_id>&state=succeeded
  • This parameter is not applicable for iframe messaging.
cancel_url[]
optional, string, max chars=250
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=<hosted_page_id>&state=cancelled
  • This parameter is not applicable for iframe messaging and in-app checkout.
pass_thru_content[]
optional, string, max chars=2048
You can pass through any content specific to the hosted page request and get it back after user had submitted the hosted page.
customer[id]
optional, string, max chars=50
customer[email]
optional, string, max chars=70
customer[first_name]
optional, string, max chars=150
customer[last_name]
optional, string, max chars=150
customer[company]
optional, string, max chars=250
customer[taxability]
optional, enumerated string, default=taxable
Possible values are
taxableComputes tax for the customer based on the site configuration. In some cases, depending on the region, shipping_address is needed. If not provided, then billing_address is used to compute tax. If that’s not available either, the tax is taken as zero.exempt
  • Customer is exempted from tax. When using Chargebee’s native Taxes feature or when using the TaxJar integration, no other action is needed.
  • However, when using our Avalara integration, optionally, specify entity_code or exempt_number attributes if you use Chargebee’s AvaTax for Sales or specify exemption_details attribute if you use Chargebee’s AvaTax for Communications integration. Tax may still be applied by Avalara for certain values of entity_code/exempt_number/exemption_details based on the state/region/province of the taxable address.
Show all values[+]
customer[locale]
optional, string, max chars=50
customer[phone]
optional, string, max chars=50
customer[vat_number]
optional, string, max chars=20
customer[vat_number_prefix]
optional, string, max chars=10
customer[einvoicing_method]
optional, enumerated string
Possible values are
automaticmanualsite_default
Show all values[+]
customer[is_einvoice_enabled]
optional, boolean
customer[entity_identifier_scheme]
optional, string, max chars=50
customer[entity_identifier_standard]
optional, string, default=iso6523-actorid-upis, max chars=50
customer[consolidated_invoicing]
optional, boolean
invoice[po_number]
optional, string, max chars=100
card[gateway_account_id]
optional, string, max chars=50
billing_address[first_name]
optional, string, max chars=150
billing_address[last_name]
optional, string, max chars=150
billing_address[email]
optional, string, max chars=70
billing_address[company]
optional, string, max chars=250
billing_address[phone]
optional, string, max chars=50
billing_address[line1]
optional, string, max chars=150
billing_address[line2]
optional, string, max chars=150
billing_address[line3]
optional, string, max chars=150
billing_address[city]
optional, string, max chars=50
billing_address[state_code]
optional, string, max chars=50
billing_address[state]
optional, string, max chars=50
billing_address[zip]
optional, string, max chars=20
billing_address[country]
optional, string, max chars=50
billing_address[validation_status]
optional, enumerated string, default=not_validated
Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
Show all values[+]
shipping_address[first_name]
optional, string, max chars=150
shipping_address[last_name]
optional, string, max chars=150
shipping_address[email]
optional, string, max chars=70
shipping_address[company]
optional, string, max chars=250
shipping_address[phone]
optional, string, max chars=50
shipping_address[line1]
optional, string, max chars=150
shipping_address[line2]
optional, string, max chars=150
shipping_address[line3]
optional, string, max chars=150
shipping_address[city]
optional, string, max chars=50
shipping_address[state_code]
optional, string, max chars=50
shipping_address[state]
optional, string, max chars=50
shipping_address[zip]
optional, string, max chars=20
shipping_address[country]
optional, string, max chars=50
shipping_address[validation_status]
optional, enumerated string, default=not_validated
Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
Show all values[+]
item_prices[item_price_id][0..n]
optional, string, max chars=100
item_prices[quantity][0..n]
optional, integer, min=1
item_prices[quantity_in_decimal][0..n]
optional, string, max chars=33
item_prices[unit_price][0..n]
optional, in cents, min=0
item_prices[unit_price_in_decimal][0..n]
optional, string, max chars=39
item_prices[date_from][0..n]
optional, timestamp(UTC) in seconds
item_prices[date_to][0..n]
optional, timestamp(UTC) in seconds
item_tiers[item_price_id][0..n]
optional, string, max chars=100
item_tiers[starting_unit][0..n]
optional, integer, min=1
item_tiers[ending_unit][0..n]
optional, integer
item_tiers[price][0..n]
optional, in cents, default=0, min=0
item_tiers[starting_unit_in_decimal][0..n]
optional, string, max chars=33
item_tiers[ending_unit_in_decimal][0..n]
optional, string, max chars=33
item_tiers[price_in_decimal][0..n]
optional, string, max chars=39
charges[amount][0..n]
optional, in cents, min=1
charges[amount_in_decimal][0..n]
optional, string, max chars=39
charges[description][0..n]
optional, string, max chars=250
charges[taxable][0..n]
optional, boolean, default=true
charges[tax_profile_id][0..n]
optional, string, max chars=50
charges[avalara_tax_code][0..n]
optional, string, max chars=50
charges[hsn_code][0..n]
optional, string, max chars=50
charges[taxjar_product_code][0..n]
optional, string, max chars=50
charges[avalara_sale_type][0..n]
optional, enumerated string
Possible values are
wholesaleTransaction is a sale to another company that will resell your product or service to another consumerretailTransaction is a sale to an end userconsumedTransaction is for an item that is consumed directlyvendor_useTransaction is for an item that is subject to vendor use tax
Show all values[+]
charges[avalara_transaction_type][0..n]
optional, integer
charges[avalara_service_type][0..n]
optional, integer
charges[date_from][0..n]
optional, timestamp(UTC) in seconds
charges[date_to][0..n]
optional, timestamp(UTC) in seconds
charges[discount_amount][0..n]
optional, in cents, min=0
charges[discount_percentage][0..n]
optional, double, min=0.01, max=100.0
discounts[percentage][0..n]
optional, double, min=0.01, max=100.0
discounts[amount][0..n]
optional, in cents, min=0
discounts[apply_on][0..n]
required, enumerated string
Possible values are
invoice_amountThe discount is applied to the invoice sub_total.specific_item_priceThe discount is applied to the invoice.line_item.amount that corresponds to the item price specified by item_price_id.
Show all values[+]
discounts[item_price_id][0..n]
optional, string, max chars=100
entity_identifiers[id][0..n]
optional, string, max chars=40
entity_identifiers[scheme][0..n]
optional, string, max chars=50
entity_identifiers[value][0..n]
optional, string, max chars=50
entity_identifiers[operation][0..n]
optional, enumerated string
Possible values are
createCreates a new entity_identifier for the customer.updateUpdates an existing entity_identifier for the customer. entity_identifier[id] must be provided in this case.deleteDeletes an existing entity_identifier for the customer. entity_identifier[id] must be provided in this case.
Show all values[+]
entity_identifiers[standard][0..n]
optional, string, default=iso6523-actorid-upis, max chars=50
hosted_page hosted_page
always returned
Resource object representing hosted_page

Sample admin console URL

https://{site}.chargebee.com/admin-console/hosted_pages/123x

Create a Chargebee hosted page to accept payment details from a customer and checkout a new subscription.

The following steps describe how best to use this API:

  1. Call this endpoint, providing item prices, coupons and a host of other details such as billing and shipping addresses to be prefilled for the customer on the checkout page.
  2. Send the customer to the Checkout url received in the response.
  3. Once they complete checkout, a new subscription is automatically created and the customer is redirected to the redirect_url with the id and state attributes passed as query string parameters.
    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.
  4. Retrieve the hosted page at this stage to get the subscription and invoice details.

Customer resource lookup and creation

When the customer[id] parameter is provided and if a customer resource with the ID is found to be already created in Chargebee, the subscription is created under that customer resource. If not found, then a new customer resource is created with the ID provided and the subscription is created under it.

Multiple business entities

If multiple business entities are created for the site, the customer resource lookup and creation happen within the context of the business entity specified in this API call. If no business entity is specified, the customer resource lookup is performed within the site context, and if not found, the resource is created for the default business entity of the site.

Notes

Sample Request
# checkout a new subscription for items
curl  https://{site}.chargebee.com/api/v2/hosted_pages/checkout_new_for_items \
     -u {site_api_key}:\
     -d subscription_items[item_price_id][0]="basic-USD" \
     -d subscription_items[quantity][0]=1 \
     -d subscription_items[item_price_id][1]="day-pass-USD" \
     -d subscription_items[unit_price][1]=100 
copy
Click to Copy

Sample Response [ JSON ]

Show more...
{
    "hosted_page": {
        "created_at": 1517478505,
        "embed": false,
        "expires_at": 1517482105,
        "id": "__test__bmJkuEShKUEFomgKJsKvpKvKZpcueGpH1",
        "object": "hosted_page",
        "resource_version": 1517478505000,
        "state": "created",
        "type": "checkout_new",
        "updated_at": 1517478505,
        "url": "https://yourapp.chargebee.com/pages/v3/__test__bmJkuEShKUEFomgKJsKvpKvKZpcueGpH1/"
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/hosted_pages/checkout_new_for_items

Method

layout[]
optional, enumerated string
Specifies the checkout layout that overrides the default checkout layout configured in the Checkout & Self-Serve Portal settings. .
Possible values are
in_appIndicates in-app checkout versionfull_pageIndicates full page checkout version
Show all values[+]
business_entity_id[]
optional, string, max chars=50

Sets the context for this operation to the business entity specified. Applicable only when multiple business entities have been created for the site. When this parameter is provided, the operation is able to read/write data associated only to the business entity specified. When not provided, the operation can read/write data for the entire site.

Note

An alternative way of passing this parameter is by means of a custom HTTP header.

billing_cycles[]
optional, integer, min=0
The number of billing cycles the subscription runs before canceling. If not provided, then the billing cycles set for the plan-item price is used.
mandatory_items_to_remove[[0..n]][0..n]
optional, list of string
Item ids of mandatorily attached addons that are to be removed from the subscription.
terms_to_charge[]
optional, integer, min=1
The number of subscription billing cycles (including the first one) to invoice in advance.
billing_alignment_mode[]
optional, enumerated string
Override the billing alignment mode for Calendar Billing. Only applicable when using Calendar Billing. The default value is that which has been configured for the site.
Possible values are
immediateSubscription period will be aligned with the configured billing date immediately, with credits or charges raised accordingly..delayedSubscription period will be aligned with the configured billing date at the next renewal.
Show all values[+]
coupon_ids[[0..n]][0..n]
optional, list of string
List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.
redirect_url[]
optional, string, max chars=250
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.

Note :
  • 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 such as user closing the tab, or exiting the browser, and so on. If there is any synchronization that you are doing after the redirection, you will have to have a backup. Chargebee recommends listening to appropriate webhooks such as subscription_created or invoice_generated to verify a successful checkout.
  • Redirect URL configured in Settings > Hosted Pages Settings would be overriden by this redirect URL.
  • Eg : http://yoursite.com?id=<hosted_page_id>&state=succeeded
  • This parameter is not applicable for iframe messaging.
cancel_url[]
optional, string, max chars=250
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=<hosted_page_id>&state=cancelled
  • This parameter is not applicable for iframe messaging and in-app checkout.
pass_thru_content[]
optional, string, max chars=2048
You can pass through any content specific to the hosted page request and get it back after user had submitted the hosted page.
allow_offline_payment_methods[]
optional, boolean
Allow the customer to select an offline payment method during checkout. The choice of payment methods can be configured via the Chargebee UI.
subscription[id]
optional, string, max chars=50
subscription[trial_end]
optional, timestamp(UTC) in seconds
subscription[start_date]
optional, timestamp(UTC) in seconds
subscription[coupon]
optional, string, max chars=100
subscription[auto_collection]
optional, enumerated string
Possible values are
onWhenever an invoice is created for this subscription, an automatic charge will be attempted on the payment method available.offAutomatic collection of charges will not be made for this subscription. Use this for offline payments.
Show all values[+]
subscription[invoice_notes]
optional, string, max chars=2000
subscription[contract_term_billing_cycle_on_renewal]
optional, integer, min=1, max=100
subscription[affiliate_token]
optional, string, max chars=250
customer[id]
optional, string, max chars=50
customer[email]
optional, string, max chars=70
customer[first_name]
optional, string, max chars=150
customer[last_name]
optional, string, max chars=150
customer[company]
optional, string, max chars=250
customer[taxability]
optional, enumerated string, default=taxable
Possible values are
taxableComputes tax for the customer based on the site configuration. In some cases, depending on the region, shipping_address is needed. If not provided, then billing_address is used to compute tax. If that’s not available either, the tax is taken as zero.exempt
  • Customer is exempted from tax. When using Chargebee’s native Taxes feature or when using the TaxJar integration, no other action is needed.
  • However, when using our Avalara integration, optionally, specify entity_code or exempt_number attributes if you use Chargebee’s AvaTax for Sales or specify exemption_details attribute if you use Chargebee’s AvaTax for Communications integration. Tax may still be applied by Avalara for certain values of entity_code/exempt_number/exemption_details based on the state/region/province of the taxable address.
Show all values[+]
customer[locale]
optional, string, max chars=50
customer[phone]
optional, string, max chars=50
customer[vat_number]
optional, string, max chars=20
customer[vat_number_prefix]
optional, string, max chars=10
customer[is_einvoice_enabled]
optional, boolean
customer[entity_identifier_scheme]
optional, string, max chars=50
customer[entity_identifier_standard]
optional, string, default=iso6523-actorid-upis, max chars=50
customer[einvoicing_method]
optional, enumerated string
Possible values are
automaticmanualsite_default
Show all values[+]
card[gateway_account_id]
optional, string, max chars=50
billing_address[first_name]
optional, string, max chars=150
billing_address[last_name]
optional, string, max chars=150
billing_address[email]
optional, string, max chars=70
billing_address[company]
optional, string, max chars=250
billing_address[phone]
optional, string, max chars=50
billing_address[line1]
optional, string, max chars=150
billing_address[line2]
optional, string, max chars=150
billing_address[line3]
optional, string, max chars=150
billing_address[city]
optional, string, max chars=50
billing_address[state_code]
optional, string, max chars=50
billing_address[state]
optional, string, max chars=50
billing_address[zip]
optional, string, max chars=20
billing_address[country]
optional, string, max chars=50
billing_address[validation_status]
optional, enumerated string, default=not_validated
Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
Show all values[+]
shipping_address[first_name]
optional, string, max chars=150
shipping_address[last_name]
optional, string, max chars=150
shipping_address[email]
optional, string, max chars=70
shipping_address[company]
optional, string, max chars=250
shipping_address[phone]
optional, string, max chars=50
shipping_address[line1]
optional, string, max chars=150
shipping_address[line2]
optional, string, max chars=150
shipping_address[line3]
optional, string, max chars=150
shipping_address[city]
optional, string, max chars=50
shipping_address[state_code]
optional, string, max chars=50
shipping_address[state]
optional, string, max chars=50
shipping_address[zip]
optional, string, max chars=20
shipping_address[country]
optional, string, max chars=50
shipping_address[validation_status]
optional, enumerated string, default=not_validated
Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
Show all values[+]
contract_term[action_at_term_end]
optional, enumerated string
Possible values are
renew
  • Contract term completes and a new contract term is started for the number of billing cycles specified in contract_billing_cycle_on_renewal.
  • The action_at_term_end for the new contract term is set to renew.
  • evergreenContract term completes and the subscription renews.cancelContract term completes and subscription is canceled.
    Show all values[+]
    contract_term[cancellation_cutoff_period]
    optional, integer, default=0
    subscription_items[item_price_id][0..n]
    required, string, max chars=100
    subscription_items[quantity][0..n]
    optional, integer, min=1
    subscription_items[quantity_in_decimal][0..n]
    optional, string, max chars=33
    subscription_items[unit_price][0..n]
    optional, in cents, min=0
    subscription_items[unit_price_in_decimal][0..n]
    optional, string, max chars=39
    subscription_items[billing_cycles][0..n]
    optional, integer, min=0
    subscription_items[trial_end][0..n]
    optional, timestamp(UTC) in seconds
    subscription_items[service_period_days][0..n]
    optional, integer, min=1, max=730
    subscription_items[charge_on_event][0..n]
    optional, enumerated string
    Possible values are
    subscription_creationthe time of creation of the subscription.subscription_trial_startthe time when the trial period of the subscription begins.plan_activationsame as subscription activation, but also includes the case when the plan-item of the subscription is changed.subscription_activationthe moment a subscription enters an active or non-renewing state. Also includes reactivations of canceled subscriptions.
    Show all values[+]
    subscription_items[charge_once][0..n]
    optional, boolean
    subscription_items[charge_on_option][0..n]
    optional, enumerated string
    Possible values are
    immediatelyThe item is charged immediately on being added to the subscription.on_eventThe item is charged at the occurrence of the event specified as charge_on_event.
    Show all values[+]
    discounts[apply_on][0..n]
    required, enumerated string
    Possible values are
    invoice_amountThe discount is applied to the invoice sub_total.specific_item_priceThe discount is applied to the invoice.line_item.amount that corresponds to the item price specified by item_price_id.
    Show all values[+]
    discounts[duration_type][0..n]
    required, enumerated string, default=forever
    Possible values are
    one_timeThe discount stays attached to the subscription till it is applied on an invoice once. It is removed after that from the subscription.foreverThe discount is attached to the subscription and applied on the invoices till it is explicitly removed.limited_periodThe discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by period and period_unit.
    Show all values[+]
    discounts[percentage][0..n]
    optional, double, min=0.01, max=100.0
    discounts[amount][0..n]
    optional, in cents, min=0
    discounts[period][0..n]
    optional, integer, min=1
    discounts[period_unit][0..n]
    optional, enumerated string
    Possible values are
    dayA period of 24 hours.weekA period of 7 days.monthA period of 1 calendar month.yearA period of 1 calendar year.
    Show all values[+]
    discounts[included_in_mrr][0..n]
    optional, boolean
    discounts[item_price_id][0..n]
    optional, string, max chars=100
    item_tiers[item_price_id][0..n]
    optional, string, max chars=100
    item_tiers[starting_unit][0..n]
    optional, integer, min=1
    item_tiers[ending_unit][0..n]
    optional, integer
    item_tiers[price][0..n]
    optional, in cents, default=0, min=0
    item_tiers[starting_unit_in_decimal][0..n]
    optional, string, max chars=33
    item_tiers[ending_unit_in_decimal][0..n]
    optional, string, max chars=33
    item_tiers[price_in_decimal][0..n]
    optional, string, max chars=39
    entity_identifiers[id][0..n]
    optional, string, max chars=40
    entity_identifiers[scheme][0..n]
    optional, string, max chars=50
    entity_identifiers[value][0..n]
    optional, string, max chars=50
    entity_identifiers[operation][0..n]
    optional, enumerated string
    Possible values are
    createCreates a new entity_identifier for the customer.updateUpdates an existing entity_identifier for the customer. entity_identifier[id] must be provided in this case.deleteDeletes an existing entity_identifier for the customer. entity_identifier[id] must be provided in this case.
    Show all values[+]
    entity_identifiers[standard][0..n]
    optional, string, default=iso6523-actorid-upis, max chars=50
    hosted_page hosted_page
    always returned
    Resource object representing hosted_page

    Sample admin console URL

    https://{site}.chargebee.com/admin-console/hosted_pages/123x

    Create a Chargebee hosted page to accept payment details from a customer and checkout to update the subscription.

    The following steps describe how best to use this API:

    1. Provide item prices, coupons and a host of other details such as billing and shipping addresses to be prefilled for the customer on the checkout page.
    2. Send the customer to the Checkout url received in the response. They can now add a payment method or use an existing one, to complete the checkout.
    3. The subscription is updated and the customer is redirected to the redirect_url with the id and state attributes passed as query string parameters.
      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.
    4. Retrieve the hosted page at this stage to get the subscription and invoice details.

    Notes

    Sample Request
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/checkout_existing_for_items \
         -u {site_api_key}:\
         -d subscription[id]="__test__KyVnGWS4EgP3HA" 
         -d subscription_items[item_price_id][0]="basic-USD" \
         -d subscription_items[quantity][0]=4 \
         -d subscription_items[unit_price][0]=1000 
    copy
    Click to Copy

    Sample Response [ JSON ]

    Show more...
    {
        "hosted_page": {
            "created_at": 1517478504,
            "embed": false,
            "expires_at": 1517482104,
            "id": "__test__lxYzKMHM7UcueYo6mZabybQOacdfXv7LtV",
            "object": "hosted_page",
            "resource_version": 1517478504000,
            "state": "created",
            "type": "checkout_existing",
            "updated_at": 1517478504,
            "url": "https://yourapp.chargebee.com/pages/v3/__test__lxYzKMHM7UcueYo6mZabybQOacdfXv7LtV/"
        }
    }

    URL Format POST

    https://{site}.chargebee.com/api/v2/hosted_pages/checkout_existing_for_items

    Method

    layout[]
    optional, enumerated string
    Specifies the checkout layout that overrides the default checkout layout configured in the Checkout & Self-Serve Portal settings. .
    Possible values are
    in_appIndicates in-app checkout versionfull_pageIndicates full page checkout version
    Show all values[+]
    mandatory_items_to_remove[[0..n]][0..n]
    optional, list of string
    Item ids of mandatorily attached addons that are to be removed from the subscription.
    replace_items_list[]
    optional, boolean, default=false
    If true then the existing subscription_items list for the subscription is replaced by the one provided. If false then the provided subscription_items list gets added to the existing list.
    invoice_date[]
    optional, timestamp(UTC) in seconds
    The document date displayed on the invoice PDF. The default value is the current date. Provide this value to backdate the invoice. Backdating an invoice is done for reasons such as booking revenue for a previous date or when the subscription is effective as of a past date. Moreover, if create_pending_invoices is set to true, and if the site is configured to set invoice dates to date of closing, then upon invoice closure, this date is changed to the invoice closing date. taxes and line_item_taxes are computed based on the tax configuration as of invoice_date. When passing this parameter, the following prerequisites must be met:
    • invoice_date must be in the past.
    • invoice_date is not more than one calendar month into the past. For example, if today is 13th January, then you cannot pass a value that is earlier than 13th December.
    • It is not earlier than changes_scheduled_at, reactivate_from, or trial_end.
    • invoice_immediately is true.
    .
    billing_cycles[]
    optional, integer, min=0
    Billing cycles set for plan-item price is used by default.
    terms_to_charge[]
    optional, integer, min=1
    The number of subscription billing cycles to invoice in advance. If a new term is started for the subscription due to this API call, then terms_to_charge is inclusive of this new term. See description for the force_term_reset parameter to learn more about when a subscription term is reset.
    reactivate_from[]
    optional, timestamp(UTC) in seconds
    If the subscription status is cancelled and it is being reactivated via this operation, this is the date/time at which the subscription should be reactivated.
    Note: It is recommended not to pass this parameter along with changed_scheduled_at. reactivate_from can be backdated (set to a value in the past). Use backdating when the subscription has been reactivated already but its billing has been delayed. Backdating is allowed only when the following prerequisites are met:
    • Backdating must be enabled for subscription reactivation operations.
    • The current day of the month does not exceed the limit set in Chargebee for backdating subscription change. This limit is the day of the month by which the accounting for the previous month must be closed.
    • The date is on or after the last date/time any of the product catalog items of the subscription were changed.
    • The date is not more than duration X into the past where X is the billing period of the plan. For example, if the period of the plan in the subscription is 2 months and today is 14th April, changes_scheduled_at cannot be earlier than 14th February.
    .
    billing_alignment_mode[]
    optional, enumerated string
    Override the billing alignment mode chosen for the site for calendar billing. Only applicable when using calendar billing.
    Possible values are
    immediateSubscription period will be aligned with the configured billing date immediately, with credits or charges raised accordingly..delayedSubscription period will be aligned with the configured billing date at the next renewal.
    Show all values[+]
    coupon_ids[[0..n]][0..n]
    optional, list of string
    List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.
    reactivate[]
    optional, boolean
    Applicable only for cancelled subscriptions. When passed as true, the canceled subscription is activated; otherwise subscription changes are made without changing its status. If not passed, subscription will be activated only if subscription_items is passed.
    force_term_reset[]
    optional, boolean, default=false
    Say the subscription has the renewal date as 28th of every month. When the plan-item price of the subscription is set to one that has the same billing period as the current plan-item price, the subscription change does not change the term. In other words, the subscription still renews on the 28th. Passing this parameter as true will have the subscription reset its term to the current date (provided end_of_term is false).
    Note: When the new plan-item price has a billing period different from the current plan-item price of the subscription, the term is always reset, regardless of the value passed for this parameter.
    redirect_url[]
    optional, string, max chars=250
    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.

    Note :
    • 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 such as user closing the tab, or exiting the browser, and so on. If there is any synchronization that you are doing after the redirection, you will have to have a backup. Chargebee recommends listening to appropriate webhooks such as subscription_created or invoice_generated to verify a successful checkout.
    • Redirect URL configured in Settings > Hosted Pages Settings would be overriden by this redirect URL.
    • Eg : http://yoursite.com?id=<hosted_page_id>&state=succeeded
    • This parameter is not applicable for iframe messaging.
    cancel_url[]
    optional, string, max chars=250
    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=<hosted_page_id>&state=cancelled
    • This parameter is not applicable for iframe messaging and in-app checkout.
    pass_thru_content[]
    optional, string, max chars=2048
    You can pass through any content specific to the hosted page request and get it back after user had submitted the hosted page.
    allow_offline_payment_methods[]
    optional, boolean
    Allow the customer to select an offline payment method during checkout. The choice of payment methods can be configured via the Chargebee UI.
    subscription[id]
    required, string, max chars=50
    subscription[start_date]
    optional, timestamp(UTC) in seconds
    subscription[trial_end]
    optional, timestamp(UTC) in seconds
    subscription[auto_collection]
    optional, enumerated string
    Possible values are
    onWhenever an invoice is created for this subscription, an automatic charge will be attempted on the payment method available.offAutomatic collection of charges will not be made for this subscription. Use this for offline payments.
    Show all values[+]
    subscription[offline_payment_method]
    optional, enumerated string
    Possible values are
    no_preferenceNo PreferencecashCashcheckCheckbank_transferBank Transfer
    Show all values[+]
    subscription[invoice_notes]
    optional, string, max chars=2000
    subscription[contract_term_billing_cycle_on_renewal]
    optional, integer, min=1, max=100
    customer[vat_number]
    optional, string, max chars=20
    customer[vat_number_prefix]
    optional, string, max chars=10
    customer[is_einvoice_enabled]
    optional, boolean
    customer[entity_identifier_scheme]
    optional, string, max chars=50
    customer[entity_identifier_standard]
    optional, string, default=iso6523-actorid-upis, max chars=50
    card[gateway_account_id]
    optional, string, max chars=50
    contract_term[action_at_term_end]
    optional, enumerated string
    Possible values are
    renew
  • Contract term completes and a new contract term is started for the number of billing cycles specified in contract_billing_cycle_on_renewal.
  • The action_at_term_end for the new contract term is set to renew.
  • evergreenContract term completes and the subscription renews.cancelContract term completes and subscription is canceled.
    Show all values[+]
    contract_term[cancellation_cutoff_period]
    optional, integer, default=0
    subscription_items[item_price_id][0..n]
    required, string, max chars=100
    subscription_items[quantity][0..n]
    optional, integer, min=1
    subscription_items[quantity_in_decimal][0..n]
    optional, string, max chars=33
    subscription_items[unit_price][0..n]
    optional, in cents, min=0
    subscription_items[unit_price_in_decimal][0..n]
    optional, string, max chars=39
    subscription_items[billing_cycles][0..n]
    optional, integer, min=0
    subscription_items[trial_end][0..n]
    optional, timestamp(UTC) in seconds
    subscription_items[service_period_days][0..n]
    optional, integer, min=1, max=730
    subscription_items[charge_on_event][0..n]
    optional, enumerated string
    Possible values are
    subscription_creationthe time of creation of the subscription.subscription_trial_startthe time when the trial period of the subscription begins.plan_activationsame as subscription activation, but also includes the case when the plan-item of the subscription is changed.subscription_activationthe moment a subscription enters an active or non-renewing state. Also includes reactivations of canceled subscriptions.
    Show all values[+]
    subscription_items[charge_once][0..n]
    optional, boolean
    subscription_items[charge_on_option][0..n]
    optional, enumerated string
    Possible values are
    immediatelyThe item is charged immediately on being added to the subscription.on_eventThe item is charged at the occurrence of the event specified as charge_on_event.
    Show all values[+]
    discounts[apply_on][0..n]
    required, enumerated string
    Possible values are
    invoice_amountThe discount is applied to the invoice sub_total.specific_item_priceThe discount is applied to the invoice.line_item.amount that corresponds to the item price specified by item_price_id.
    Show all values[+]
    discounts[duration_type][0..n]
    required, enumerated string, default=forever
    Possible values are
    one_timeThe discount stays attached to the subscription till it is applied on an invoice once. It is removed after that from the subscription.foreverThe discount is attached to the subscription and applied on the invoices till it is explicitly removed.limited_periodThe discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by period and period_unit.
    Show all values[+]
    discounts[percentage][0..n]
    optional, double, min=0.01, max=100.0
    discounts[amount][0..n]
    optional, in cents, min=0
    discounts[period][0..n]
    optional, integer, min=1
    discounts[period_unit][0..n]
    optional, enumerated string
    Possible values are
    dayA period of 24 hours.weekA period of 7 days.monthA period of 1 calendar month.yearA period of 1 calendar year.
    Show all values[+]
    discounts[included_in_mrr][0..n]
    optional, boolean
    discounts[item_price_id][0..n]
    optional, string, max chars=100
    discounts[operation_type][0..n]
    required, enumerated string
    Possible values are
    addThe discount is attached to the subscription.removeThe discount (given by discounts[id]) is removed from the subscription. Subsequent invoices will no longer have the discount applied. Tip: If you want to replace a discount, remove it and add another in the same API call.
    Show all values[+]
    discounts[id][0..n]
    optional, string, max chars=50
    item_tiers[item_price_id][0..n]
    optional, string, max chars=100
    item_tiers[starting_unit][0..n]
    optional, integer, min=1
    item_tiers[ending_unit][0..n]
    optional, integer
    item_tiers[price][0..n]
    optional, in cents, default=0, min=0
    item_tiers[starting_unit_in_decimal][0..n]
    optional, string, max chars=33
    item_tiers[ending_unit_in_decimal][0..n]
    optional, string, max chars=33
    item_tiers[price_in_decimal][0..n]
    optional, string, max chars=39
    entity_identifiers[id][0..n]
    optional, string, max chars=40
    entity_identifiers[scheme][0..n]
    optional, string, max chars=50
    entity_identifiers[value][0..n]
    optional, string, max chars=50
    entity_identifiers[operation][0..n]
    optional, enumerated string
    Possible values are
    createCreates a new entity_identifier for the customer.updateUpdates an existing entity_identifier for the customer. entity_identifier[id] must be provided in this case.deleteDeletes an existing entity_identifier for the customer. entity_identifier[id] must be provided in this case.
    Show all values[+]
    entity_identifiers[standard][0..n]
    optional, string, default=iso6523-actorid-upis, max chars=50
    hosted_page hosted_page
    always returned
    Resource object representing hosted_page

    Sample admin console URL

    https://{site}.chargebee.com/admin-console/hosted_pages/123x

    Note: If you're using In-App Checkout , use Manage Payment Sources API to request your customers to update their payment method details or change their payment method.

    Using this API, you can request your customers to update their payment method details or change their payment method. This is used in scenarios like customers updating their payment methods before the end of trial or customers switching among payment methods.

    When this API is invoked, it returns a hosted page URL. When the customers are directed to this URL, they will be able to change/update their payment methods.

    Depending on the payment methods (Card, PayPal Express Checkout, Amazon Payments) that you offer your customers, they will find options to switch among the various methods of payment.

    Note:
    • If the card[gateway] parameter is passed, and the customer chooses Card as a payment method, then the card details are stored in the gateway which is passed. However, if the card[gateway] parameter is passed and the customer chooses PayPal Express Checkout/Amazon Payments as a payment method, the gateway passed will be ignored.
    • The option of embedding into an iframe is not supported for PayPal Express Checkout and Amazon Payments as customers are redirected to the respective website pages. Hence if you have PayPal Express Checkout/Amazon Payments configured and pass the parameter embed=true, this will result in an unsuccessful API request. Also, if you have all the three payment methods (Card, Paypal Express Checkout and Amazon Payments) configured and pass the parameter embed=true, the returned hosted page URL will show only Card Payment as a payment method.

    Notes

    Sample Request
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/update_payment_method \
         -u {site_api_key}:\
         -d customer[id]="__test__KyVnHhSBWmKhy2uX" 
         -d card[gateway_account_id]="gw___test__KyVnGlSBWmAIk2Ph"
    copy
    Click to Copy

    Sample Response [ JSON ]

    Show more...
    {
        "hosted_page": {
            "created_at": 1517506020,
            "embed": true,
            "expires_at": 1517592420,
            "id": "__test__Rvi8fL7SS0CURBeH2k0CgkPLH6MyU2Sy",
            "object": "hosted_page",
            "resource_version": 1517506020000,
            "state": "created",
            "type": "update_payment_method",
            "updated_at": 1517506020,
            "url": "https://yourapp.chargebee.com/pages/v2/__test__Rvi8fL7SS0CURBeH2k0CgkPLH6MyU2Sy/update_payment_method"
        }
    }

    URL Format POST

    https://{site}.chargebee.com/api/v2/hosted_pages/update_payment_method

    Method

    redirect_url[]
    optional, string, max chars=250
    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.

    Note :
    • 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 such as user closing the tab, or exiting the browser, and so on. If there is any synchronization that you are doing after the redirection, you will have to have a backup. Chargebee recommends listening to appropriate webhooks such as subscription_created or invoice_generated to verify a successful checkout.
    • Redirect URL configured in Settings > Hosted Pages Settings would be overriden by this redirect URL.
    • Eg : http://yoursite.com?id=<hosted_page_id>&state=succeeded
    • This parameter is not applicable for iframe messaging.
    cancel_url[]
    optional, string, max chars=250
    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=<hosted_page_id>&state=cancelled
    • This parameter is not applicable for iframe messaging and in-app checkout.
    pass_thru_content[]
    optional, string, max chars=2048
    You can pass through any content specific to the hosted page request and get it back after user had submitted the hosted page.
    iframe_messaging[]
    optional, boolean, default=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.
    customer[id]
    required, string, max chars=50
    card[gateway_account_id]
    optional, string, max chars=50
    hosted_page hosted_page
    always returned
    Resource object representing hosted_page

    Sample admin console URL

    https://{site}.chargebee.com/admin-console/hosted_pages/123x
    This API generates a hosted page URL to add new or update existing payment sources for the customer.

    Notes

    Sample Request
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/manage_payment_sources \
         -u {site_api_key}:\
         -d customer[id]="__test__KyVnHhSBWmJIX2uE" 
         -d card[gateway_account_id]="gw___test__KyVnGlSBWmAIk2Ph"
    copy
    Click to Copy

    Sample Response [ JSON ]

    Show more...
    {
        "hosted_page": {
            "created_at": 1517506015,
            "embed": false,
            "expires_at": 1517592415,
            "id": "__test__LycuLPCkhW3axOiXjHWkOOVl3ZE3yLLni",
            "object": "hosted_page",
            "resource_version": 1517506015000,
            "state": "created",
            "type": "manage_payment_sources",
            "updated_at": 1517506015,
            "url": "https://yourapp.chargebee.com/pages/v3/__test__LycuLPCkhW3axOiXjHWkOOVl3ZE3yLLni/"
        }
    }

    URL Format POST

    https://{site}.chargebee.com/api/v2/hosted_pages/manage_payment_sources

    Method

    redirect_url[]
    optional, string, max chars=250
    URL to redirect after payment method is added.
    customer[id]
    required, string, max chars=50
    card[gateway_account_id]
    optional, string, max chars=50
    hosted_page hosted_page
    always returned
    Resource object representing hosted_page

    Sample admin console URL

    https://{site}.chargebee.com/admin-console/hosted_pages/123x
    This API generates a hosted page URL to collect due payments for the customer.

    Notes

    Sample Request
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/collect_now \
         -u {site_api_key}:\
         -d customer[id]="__test__KyVnGlSBWmHH82Pw" 
         -d card[gateway_account_id]="gw___test__KyVnGlSBWmAIk2Ph"
    copy
    Click to Copy

    Sample Response [ JSON ]

    Show more...
    {
        "hosted_page": {
            "created_at": 1517506010,
            "embed": true,
            "expires_at": 1517592410,
            "id": "__test__4cq9mwW1cuoD085nSBLh0KUMKdphVO5cC",
            "object": "hosted_page",
            "resource_version": 1517506010000,
            "state": "created",
            "type": "collect_now",
            "updated_at": 1517506010,
            "url": "https://yourapp.chargebee.com/pages/v3/__test__4cq9mwW1cuoD085nSBLh0KUMKdphVO5cC/collect_now"
        }
    }

    URL Format POST

    https://{site}.chargebee.com/api/v2/hosted_pages/collect_now

    Method

    redirect_url[]
    optional, string, max chars=250
    Used to specify the destination URL to which a user is redirected after invoices are paid. The transaction ID of the transactions made through the Pay Now hosted page will be sent as return variables along with the URL.
    currency_code[]
    optional, string, max chars=3
    The currency code (ISO 4217 format) of the specified credit amount.
    customer[id]
    required, string, max chars=50
    card[gateway_account_id]
    optional, string, max chars=50
    hosted_page hosted_page
    always returned
    Resource object representing hosted_page

    Sample admin console URL

    https://{site}.chargebee.com/admin-console/hosted_pages/123x
    This API generates a hosted page URL for the customer to accept a quote. If the hosted page URL has expired, a new URL will be generated automatically.

    Notes

    • Hosted page URL to accept a quote cannot be generated for one-time charges.
    • Customers with existing subscriptions can generate a quote for new subscriptions. However, Hosted page URL to accept a quote cannot be generated for new subscriptions in V1 and V2 hosted pages.
    Sample Request
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/accept_quote \
         -u {site_api_key}:\
         -d quote[id]="1"
    copy
    Click to Copy

    Sample Response [ JSON ]

    Show more...
    {
        "hosted_page": {
            "created_at": 1517505980,
            "embed": true,
            "expires_at": 1517596199,
            "id": "__test__IKNpcdSoRFV0hFeci8SSkUbhZYjle2dKh",
            "object": "hosted_page",
            "resource_version": 1517505981000,
            "state": "created",
            "type": "checkout_existing",
            "updated_at": 1517505981,
            "url": "https://yourapp.chargebee.com/pages/v2/__test__IKNpcdSoRFV0hFeci8SSkUbhZYjle2dKh/checkout"
        }
    }

    URL Format POST

    https://{site}.chargebee.com/api/v2/hosted_pages/accept_quote

    Method

    redirect_url[]
    optional, string, max chars=250
    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.

    Note :
    • 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 such as user closing the tab, or exiting the browser, and so on. If there is any synchronization that you are doing after the redirection, you will have to have a backup. Chargebee recommends listening to appropriate webhooks such as subscription_created or invoice_generated to verify a successful checkout.
    • Redirect URL configured in Settings > Hosted Pages Settings would be overriden by this redirect URL.
    • Eg : http://yoursite.com?id=<hosted_page_id>&state=succeeded
    • This parameter is not applicable for iframe messaging.
    layout[]
    optional, enumerated string
    null
    Possible values are
    in_appfull_page
    Show all values[+]
    quote[id]
    required, string, max chars=50
    hosted_page hosted_page
    always returned
    Resource object representing hosted_page

    Sample admin console URL

    https://{site}.chargebee.com/admin-console/hosted_pages/123x
    This API generates a hosted page URL to extend the billing cycle of a subscription.

    Notes

    Sample Request
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/extend_subscription \
         -u {site_api_key}:\
         -d billing_cycle=2 \
         -d expiry=14 \
         -d subscription[id]="__test__KyVnHhSBWmIgw2u6"
    copy
    Click to Copy

    Sample Response [ JSON ]

    Show more...
    {
        "hosted_page": {
            "created_at": 1517506012,
            "embed": true,
            "expires_at": 1518715612,
            "id": "__test__Bct8ySC6A1eV2GdMcdUl7dzovgyKhAz4M",
            "object": "hosted_page",
            "resource_version": 1517506012000,
            "state": "created",
            "type": "extend_subscription",
            "updated_at": 1517506012,
            "url": "https://yourapp.chargebee.com/pages/v3/__test__Bct8ySC6A1eV2GdMcdUl7dzovgyKhAz4M/"
        }
    }

    URL Format POST

    https://{site}.chargebee.com/api/v2/hosted_pages/extend_subscription

    Method

    expiry[]
    optional, integer, min=1, max=500
    Expiry (in days) for the link generated. No expiry will be set if this is not specified.
    billing_cycle[]
    optional, integer, min=1
    Number of billing cycles to extend. If not specified, plan's billing cycle will be used.
    subscription[id]
    required, string, max chars=50
    hosted_page hosted_page
    always returned
    Resource object representing hosted_page

    Sample admin console URL

    https://{site}.chargebee.com/admin-console/hosted_pages/123x

    Creates a hosted page for a customer (called the gifter) to gift a subscription to another customer (called the receiver).

    Gifter customer resource lookup and creation

    When gifter[customer_id] is provided, it is looked up in Chargebee when the gifter completes the hosted page checkout. If not found, a new customer resource is created with this ID.

    Multiple business entities

    If multiple business entities are created for the site, the lookup and creation of the gifter customer resource happen within the context of the business entity specified in this API call. If no business entity is specified, the customer resource lookup is performed within the site context, and if not found, the resource is created for the default business entity of the site.

    Gift receiver customer resource lookup and creation

    Once the gifter checks out using the hosted page returned by this endpoint, Chargebee checks if a customer resource with the receiver’s email address exists. The first such customer record is considered the receiver’s customer resource. A new customer resource is created for the receiver if none are found.

    Multiple business entities

    If multiple business entities are created for the site, the lookup and creation of the gift receiver’s customer resource happen within the context of the business entity of the gifter

    Notes

    Sample Request
    # Checkout Gift subscription for Items
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/checkout_gift_for_items \
         -u {site_api_key}:\
         -d gifter[customer_id]="gifter" 
         -d subscription_items[item_price_id][0]="gift-plan-USD" \
         -d subscription_items[quantity][0]=2 
    copy
    Click to Copy

    Sample Response [ JSON ]

    Show more...
    {
        "hosted_page": {
            "created_at": 1517484798,
            "embed": false,
            "expires_at": 1517488398,
            "id": "__gift___test__gPY4LqKkoEdrcdWdxpl6nABSZu2oDcCpR",
            "object": "hosted_page",
            "resource_version": 1517484798645,
            "state": "created",
            "type": "checkout_gift",
            "updated_at": 1517484798,
            "url": "https://yourapp.chargebee.com/pages/v3/__gift___test__gPY4LqKkoEdrcdWdxpl6nABSZu2oDcCpR/"
        }
    }

    URL Format POST

    https://{site}.chargebee.com/api/v2/hosted_pages/checkout_gift_for_items

    Method

    business_entity_id[]
    optional, string, max chars=50

    Sets the context for this operation to the business entity specified. Applicable only when multiple business entities have been created for the site. When this parameter is provided, the operation is able to read/write data associated only to the business entity specified. When not provided, the operation can read/write data for the entire site.

    Note

    An alternative way of passing this parameter is by means of a custom HTTP header.

    redirect_url[]
    optional, string, max chars=250
    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.

    Note :
    • 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 such as user closing the tab, or exiting the browser, and so on. If there is any synchronization that you are doing after the redirection, you will have to have a backup. Chargebee recommends listening to appropriate webhooks such as subscription_created or invoice_generated to verify a successful checkout.
    • Redirect URL configured in Settings > Hosted Pages Settings would be overriden by this redirect URL.
    • Eg : http://yoursite.com?id=<hosted_page_id>&state=succeeded
    • This parameter is not applicable for iframe messaging.
    coupon_ids[[0..n]][0..n]
    optional, list of string
    List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.
    gifter[customer_id]
    optional, string, max chars=50
    gifter[locale]
    optional, string, max chars=50
    subscription_items[item_price_id][0..n]
    optional, string, max chars=100
    subscription_items[quantity][0..n]
    optional, integer, default=1, min=1
    subscription_items[quantity_in_decimal][0..n]
    optional, string, max chars=33
    hosted_page hosted_page
    always returned
    Resource object representing hosted_page

    Sample admin console URL

    https://{site}.chargebee.com/admin-console/hosted_pages/123x
    This API generates a hosted page URL to claim a gifted subscription.

    Notes

    Sample Request
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/claim_gift \
         -u {site_api_key}:\
         -d gift[id]="__test__KyVnHhSBWmGdM2tv__test__21cdZvclBhOULyCT1SBUPDKjoXsuc3wdj"
    copy
    Click to Copy

    Sample Response [ JSON ]

    Show more...
    {
        "hosted_page": {
            "created_at": 1517678804,
            "embed": false,
            "expires_at": 1517682404,
            "id": "__test__yRVH4Pr8siRXJEPsjeJXlcd8Aq1fDqVzd",
            "object": "hosted_page",
            "resource_version": 1517678804000,
            "state": "created",
            "type": "claim_gift",
            "updated_at": 1517678804,
            "url": "https://yourapp.chargebee.com/pages/v3/__test__yRVH4Pr8siRXJEPsjeJXlcd8Aq1fDqVzd/claim_gift"
        }
    }

    URL Format POST

    https://{site}.chargebee.com/api/v2/hosted_pages/claim_gift

    Method

    redirect_url[]
    optional, string, max chars=250
    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.

    Note :
    • 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 such as user closing the tab, or exiting the browser, and so on. If there is any synchronization that you are doing after the redirection, you will have to have a backup. Chargebee recommends listening to appropriate webhooks such as subscription_created or invoice_generated to verify a successful checkout.
    • Redirect URL configured in Settings > Hosted Pages Settings would be overriden by this redirect URL.
    • Eg : http://yoursite.com?id=<hosted_page_id>&state=succeeded
    • This parameter is not applicable for iframe messaging.
    gift[id]
    required, string, max chars=150
    customer[locale]
    optional, string, max chars=50
    hosted_page hosted_page
    always returned
    Resource object representing hosted_page

    Sample admin console URL

    https://{site}.chargebee.com/admin-console/hosted_pages/123x

    This is applicable only for Direct Debit via SEPA, Bacs, Bg Autogiro, BECS (for both Australia and New Zealand) and PAD. For Direct Debit, the customer needs to accept an agreement that allows the merchant to debit their bank account. This agreement PDF allows you to easily display scheme-rules compliant Direct Debit mandates to your customers.

    This API retrieves the redirect link to the corresponding agreement for customers. The agreement PDF can be your “Thank You” page or sent by email to customers. Communicating this PDF to your customers is mandatory.

    Customer locale is used to generate the PDF in the required language. If a customer language is not supported, the PDF is generated in English. Checkout the list of languages supported by GoCardless.

    Notes

    Sample Request
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/retrieve_agreement_pdf \
         -u {site_api_key}:\
         -d payment_source_id="pm___test__KyVnHhSBWmKRg2uT"
    copy
    Click to Copy

    Sample Response [ JSON ]

    Show more...
    {
        "hosted_page": {
            "created_at": 1517506018,
            "embed": false,
            "expires_at": 1520098018,
            "id": "__test__AUCK2LNxny5cXiA1JcdBQE9283e5McdvCC",
            "object": "hosted_page",
            "resource_version": 1517506018000,
            "state": "created",
            "type": "agreement_pfd",
            "updated_at": 1517506018,
            "url": "https://yourapp.chargebee.com/action_pages/__test__AUCK2LNxny5cXiA1JcdBQE9283e5McdvCC/agreement_pdf"
        }
    }

    URL Format POST

    https://{site}.chargebee.com/api/v2/hosted_pages/retrieve_agreement_pdf

    Method

    payment_source_id[]
    required, string, max chars=40
    Payment source to be used for this payment.
    hosted_page hosted_page
    always returned
    Resource object representing hosted_page

    Sample admin console URL

    https://{site}.chargebee.com/admin-console/hosted_pages/123x
    When a hosted page is successfully completed by the user and processed by Chargebee, its state is automatically changed to succeeded. Acknowledging a hosted page confirms that you have moved the customer details from Chargebee into your system and are ready to fulfill it. This API is used to acknowledge the hosted page in succeeded state and change its state to acknowledged.

    Note: The hosted page status must be succeeded for this API call to be allowed.

    Notes

    Sample Request
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/__test__p541yXSwQO7jD2oRNFlBSvqU2s0oiWY0/acknowledge \
         -X POST  \
         -u {site_api_key}:
    copy
    Click to Copy

    Sample Response [ JSON ]

    URL Format POST

    https://{site}.chargebee.com/api/v2/hosted_pages/{hosted-page-id}/acknowledge

    Method

    hosted_page hosted_page
    always returned
    Resource object representing hosted_page

    Sample admin console URL

    https://{site}.chargebee.com/admin-console/hosted_pages/123x

    When you retrieve a hosted page whose status is successful, the content attribute has the following objects based on the type of the hosted page.


    type of hosted page content attribute constituents
    checkout_new
    • customer: the object representing the details of the Customer for whom the subscription was created.
    • subscription: the new Subscription object created.
    • card: the Card object if the payment method type used was card.
    • invoice: the Invoice object, if an invoice was generated.
    checkout_existing
    • customer: the object representing the details of the Customer whose subscription was changed.
    • subscription: the updated Subscription object created.
    • card: the Card object if the payment method type used was card.
    • invoice: the Invoice object, if an invoice was generated for the subscription change.
    update_payment_method
    • customer: the object representing the details of the Customer whose subscription was changed.
    • card: the Card object if the new payment method added was of type card.
    pre_cancel
      retention: Use the bypass flag in this object to route the cancellation flow to the merchants’ portal or the Chargebee Retention.
    • If bypass flag is true, you should route the end-customers to your native cancellation flow.
    • If the bypass flag is false, you should route the end-customers to the hosted page URL.
    • Note: Retention is currently in beta. To enable Retention, Contact Support.
    collect_now
    • transactions: this object should contain a list of
      transactions triggered from the collect_now
      hosted page. Each transaction in the list should be represented as an array that includes relevant information about the transaction, such as transaction ID, customer ID, amount, currency, payment method, and any other relevant details.
    • customer: this object should contain the customer record associated with the transaction. The key, customer_id is used to link the transaction to the corresponding customer record.

    Notes

    Sample Request
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/__test__Mgd44pMvDRJLhuy3KNs2j6qBRNbuGG9r \
         -u {site_api_key}:
    copy
    Click to Copy

    Sample Response [ JSON ]

    Show more...
    {
        "hosted_page": {
            "created_at": 1517506016,
            "embed": true,
            "expires_at": 1517509616,
            "id": "__test__Mgd44pMvDRJLhuy3KNs2j6qBRNbuGG9r",
            "object": "hosted_page",
            "resource_version": 1517506016000,
            "state": "created",
            "type": "checkout_existing",
            "updated_at": 1517506016,
            "url": "https://yourapp.chargebee.com/pages/v2/__test__Mgd44pMvDRJLhuy3KNs2j6qBRNbuGG9r/checkout"
        }
    }

    URL Format GET

    https://{site}.chargebee.com/api/v2/hosted_pages/{hosted-page-id}

    Method

    hosted_page hosted_page
    always returned
    Resource object representing hosted_page

    Sample admin console URL

    https://{site}.chargebee.com/admin-console/hosted_pages/123x

    This API retrieves the list of hosted page resources.

    Notes

    Sample Request
    curl  https://{site}.chargebee.com/api/v2/hosted_pages \
         -G  \
         -u {site_api_key}:\
         --data-urlencode limit=2
    copy
    Click to Copy

    Sample Response [ JSON ]

    Show more...
    {
        "list": [
            {
                "hosted_page": {
                    "created_at": 1517678804,
                    "embed": false,
                    "expires_at": 1517682404,
                    "id": "__test__yRVH4Pr8siRXJEPsjeJXlcd8Aq1fDqVzd",
                    "object": "hosted_page",
                    "resource_version": 1517678804000,
                    "state": "created",
                    "type": "claim_gift",
                    "updated_at": 1517678804,
                    "url": "https://yourapp.chargebee.com/pages/v3/__test__yRVH4Pr8siRXJEPsjeJXlcd8Aq1fDqVzd/claim_gift"
                }
            },
            {..}
        ],
        "next_offset": "[\"1517506012000\",\"186000000018\"]"
    }

    URL Format GET

    https://{site}.chargebee.com/api/v2/hosted_pages

    Method

    limit[]
    optional, integer, default=10, min=1, max=100
    The number of resources to be returned.
    offset[]
    optional, string, max chars=1000
    Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set offset to the value of next_offset obtained in the previous iteration of the API call.
    Filter Params
    For operator usages, see the Pagination and Filtering section.
    id[<operator>]
    optional, string filter
    Unique identifier generated for each hosted page requested. Possible values are :
    Supported operators : is, is_not, starts_with, in, not_in

    Example id[is] = "Edi69nxpu6BeGBd9Fjcd0tqCSwb0sRcuKa"
    id[is][operator]
    optional, string, min chars=1 filter
    Possible values are :
    Supported operators :

    Example
    id[is_not][operator]
    optional, string, min chars=1 filter
    Possible values are :
    Supported operators :

    Example
    id[starts_with][operator]
    optional, string, min chars=1 filter
    Possible values are :
    Supported operators :

    Example
    id[in][operator]
    optional, string filter
    Possible values are :
    Supported operators :

    Example
    id[not_in][operator]
    optional, string filter
    Possible values are :
    Supported operators :

    Example
    type[<operator>]
    optional, enumerated string filter
    Type of the requested hosted page. Possible values are : checkout_new, checkout_existing, update_payment_method, manage_payment_sources, collect_now, extend_subscription, checkout_one_time, pre_cancel, view_voucher
    Supported operators : is, is_not, in, not_in

    Example type[is] = "checkout_new"
    type[is][operator]
    optional, enumerated string filter
    Possible values are : checkout_new, checkout_existing, update_payment_method, manage_payment_sources, collect_now, extend_subscription, checkout_one_time, pre_cancel, view_voucher
    Supported operators :

    Example
    type[is_not][operator]
    optional, enumerated string filter
    Possible values are : checkout_new, checkout_existing, update_payment_method, manage_payment_sources, collect_now, extend_subscription, checkout_one_time, pre_cancel, view_voucher
    Supported operators :

    Example
    type[in][operator]
    optional, string filter
    Possible values are :
    Supported operators :

    Example
    type[not_in][operator]
    optional, string filter
    Possible values are :
    Supported operators :

    Example
    state[<operator>]
    optional, enumerated string filter
    Indicating the current state of the hosted page resource. Possible values are : created, requested, succeeded, cancelled, acknowledged
    Supported operators : is, is_not, in, not_in

    Example state[is] = "succeeded"
    state[is][operator]
    optional, enumerated string filter
    Possible values are : created, requested, succeeded, cancelled, acknowledged
    Supported operators :

    Example
    state[is_not][operator]
    optional, enumerated string filter
    Possible values are : created, requested, succeeded, cancelled, acknowledged
    Supported operators :

    Example
    state[in][operator]
    optional, string filter
    Possible values are :
    Supported operators :

    Example
    state[not_in][operator]
    optional, string filter
    Possible values are :
    Supported operators :

    Example
    updated_at[<operator>]
    optional, timestamp(UTC) in seconds filter
    Timestamp indicating when this hosted page was last updated. Possible values are :
    Supported operators : after, before, on, between

    Example updated_at[after] = "1490784813"
    updated_at[after][operator]
    optional, timestamp(UTC) in seconds filter
    Possible values are :
    Supported operators :

    Example
    updated_at[before][operator]
    optional, timestamp(UTC) in seconds filter
    Possible values are :
    Supported operators :

    Example
    updated_at[on][operator]
    optional, timestamp(UTC) in seconds filter
    Possible values are :
    Supported operators :

    Example
    updated_at[between][operator]
    optional, string filter
    Possible values are :
    Supported operators :

    Example
    hosted_page hosted_page
    always returned
    Resource object representing hosted_page
    next_offset next_offset
    optional, string, max chars=1000
    This attribute is returned only if more resources are present. To fetch the next set of resources use this value for the input parameter `offset`.

    Sample admin console URL

    https://{site}.chargebee.com/admin-console/hosted_pages/123x
    Creates a hosted_page resource of type pre_cancel. Route canceling users to this page to provide them a retention experience and start saving revenue.
    The hosted page is created in accordance with the retention experience configured in the Chargebee Retention app, along with the data provided as input to this endpoint. Call the endpoint before your customer clicks the Cancel button, and when they do, route them to the url in the endpoint response.

    Notes

    Sample Request
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/pre_cancel \
         -u {site_api_key}:\
         -d pass_thru_content="{custom :  {discount_percent: 10}}" \
         -d subscription[id]="__test__KyVnHhSBWmCoF2tJ"
    copy
    Click to Copy

    Sample Response [ JSON ]

    Show more...
    {
        "hosted_page": {
            "id": "__dev__uxMMdSCbO8zweGryJDU37zfbdGxC3Gn9",
            "type": "pre_cancel",
            "url": "https://app.brightback.com/session/mVS0ecj6tswr3Ss",
            "state": "created",
            "pass_thru_content": "{custom :  {discount_percentage: 10}}",
            "embed": false,
            "created_at": 1653382696,
            "expires_at": 1653386296,
            "object": "hosted_page"
        }
    }

    URL Format POST

    https://{site}.chargebee.com/api/v2/hosted_pages/pre_cancel

    Method

    pass_thru_content[]
    optional, string, max chars=2048

    Additional data to be passed to Chargebee Retention. Only the value of pass_thru_content.custom is sent to Chargebee Retention. It is sent as the value of the custom property. The fields provided in pass_thru_content.custom must be preconfigured in Chargebee Retention.

    Although only pass_thru_content.custom is sent to Chargebee Retention, all of pass_thru_content is stored by Chargebee billing and is retrievable as an attribute of the hosted_page.

    .
    cancel_url[]
    optional, string, max chars=250
    The customer is sent to this URL if they finally decide to cancel the subscription, despite the attempt to retain them.
    redirect_url[]
    optional, string, max chars=250
    The customer is sent to this URL upon successful retention. In other words, this is the page to which the customer is sent when they decide not to cancel the subscription.
    subscription[id]
    required, string, max chars=50
    hosted_page hosted_page
    always returned
    Resource object representing hosted_page

    Sample admin console URL

    https://{site}.chargebee.com/admin-console/hosted_pages/123x
    Use this API to notify Chargebee about important events that occur on your web pages, such as subscription cancellations. An event contains data about affected resources and additional details such as when the change occurred.

    Notes

    Sample Request
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/events \
         -u {site_api_key}:\
         -d event_name="CANCELLATION_PAGE_LOADED" \
         -d occurred_at=1435054328 \
         -d event_data="{subscription_id : '__test__KyVnHhSBWmCoF2tJ'}"
    copy
    Click to Copy

    Sample Response [ JSON ]

    Show more...
    {
        "success": true
    }

    URL Format POST

    https://{site}.chargebee.com/api/v2/hosted_pages/events

    Method

    event_name[]
    required, enumerated string
    The event that need to passed to a different system.
    Possible values are
    cancellation_page_loadedIndicates native cancellation flow provided by the merchant is loaded rather than the retention flow.
    Show all values[+]
    occurred_at[]
    optional, timestamp(UTC) in seconds
    Timestamp indicating when this event had occurred. .
    event_data[]
    required, jsonobject

    The meta data description of the event in key-value pair. The value is a JSON object with the following keys and their values.

    • subscription_id: A unique and immutable identifier for the subscription.
    .
    success success
    required, boolean

    Sample admin console URL

    https://{site}.chargebee.com/admin-console/hosted_pages/123x
    Creates a hosted_page resource of type, view_voucher. When your end customers choose the Boleto payment method, you can generate a voucher for their pending invoice. Using this API, you can create a voucher_detail hosted page for your customers and email them a link to this hosted page. Your customers can review the voucher details on the page by clicking the link in the email.

    Notes

    Sample Request
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/view_voucher \
         -u {site_api_key}:\
         -d customer[locale]="fr-CA"
    copy
    Click to Copy

    Sample Response [ JSON ]

    Show more...
    {
        "hosted_page": {
            "id": "__dev__6FL1CcdDKgO1Eui9ys7pkFDirQcu5twVhX",
            "type": "voucher_detail",
            "url": "https://yourapp.chargebee.com/pages/v3/__test__4cq9mwW1cuoD085nSBLh0KUMKdphVO5cC/view_voucher",
            "state": "created",
            "embed": false,
            "created_at": 1653044153,
            "expires_at": 1653047753,
            "object": "hosted_page"
        }
    }

    URL Format POST

    https://{site}.chargebee.com/api/v2/hosted_pages/view_voucher

    Method

    payment_voucher[id]
    required, string, max chars=40
    customer[locale]
    optional, string, max chars=50
    hosted_page hosted_page
    always returned
    Resource object representing hosted_page

    Sample admin console URL

    https://{site}.chargebee.com/admin-console/hosted_pages/123x