Hosted pages are the easiest and most secure way to integrate chargebee with your website. By using hosted pages, you can avoid the sensitive card information passing through your server and be compliant with most of the PCI DSS requirements.

When you request for a hosted page, a secure & unique URL will be returned which you could either embed or redirect depending upon the embed parameter value that you had passed.

Specifying "embed" parameter as true allows you to embed the "hosted page" in an iframe in your own website. This helps you provide the best experience to your user as they do not have to leave your website to provide card information. Drawbacks are

  • Your site should also be in https
  • You have to be careful with height and width of the iframe otherwise users might get scroll.

To use the hosted pages, you must configure Redirect URL in the Chargebee web interface under HOSTED PAGES SETTINGS -> Configuration. The configured redirect URL will be called with the following parameters after user had submitted the page.

  • id - unique identifier of the hosted page resource
  • state - succeeded, failed or cancelled

After the Redirect URL is called by Chargebee with the above parameters, the details of the hosted page can be fetched using Retrieve a hosted page API. The content attribute will have the details about the customer, subscription, card & invoice based on the type of the hosted page.

For Checkout New Subscription:

  • Customer - The details about the new customer created.
  • Subscription - The details about the new subscription created.
  • Card - The details about the card provided while subscribing.
  • Invoice - The details about the invoice, if one is generated.

For Checkout Existing Subscription:

  • Customer - The updated details of the customer.
  • Subscription - The updated details of the subscription.
  • Card - The details about the card provided while subscribing.
  • Invoice - The details about the invoice, if one is generated.

For Update Payment Method:

  • Customer - The details about the customer for whom the card was updated.
  • Card - The details about the updated card. It will be present only if the type of payment method is card.

When an embedded hosted page is cancelled by your end user, the content attribute will have the unmodified details of customer, subscription & card resources.

Sample hosted page [ JSON ]

{ "created_at": 1517469316, "embed": true, "expires_at": 1517472916, "id": "__test__6gWJ7cu32Lracdocxfnu78ddQhHXiF1sEh", "object": "hosted_page", "resource_version": 1517469316000, "state": "created", "type": "checkout_new", "updated_at": 1517469316, "url": "https://yourapp.chargebee.com/pages/v2/__test__6gWJ7cu32Lracdocxfnu78ddQhHXiF1sEh/checkout" }
id
Unique identifier generated for each hosted page requested.
optional, string, max chars=70
type
Type of the requested hosted page.
optional, enumerated string
Possible values are
checkout_newCheckout new Subscription.checkout_existingCheckout existing Subscription.update_payment_methodUpdate Payment Method for a Customer.
manage_payment_sourcesManage Payments for a customer.collect_nowCollect Unpaid Invoices for a Customer.extend_subscriptionTo extend a Subscription period.checkout_giftCheckout a gift subscription.claim_giftClaim a gift subscription.
Show all values[+]
url
Unique URL for the hosted page that will be included in your website.
optional, string, max chars=250
state
Indicating the current state of the hosted page resource.
optional, enumerated string, default=created
Possible values are
createdIndicates the hosted page is just created.requestedIndicates the hosted page is requested by the website.succeededIndicates 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.acknowledgedIndicates the succeeded hosted page is acknowledged.
pass_thru_content
You can pass through any content specific to the hosted page request and get it back after user had submitted the hosted page.
optional, string, max chars=2048
embed
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.
boolean, default=true
created_at
Indicates when this hosted page url is generated.
optional, timestamp(UTC) in seconds
expires_at
Indicates when this hosted page url will expire. After this, the hosted page cannot be accessed.
optional, timestamp(UTC) in seconds
content
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.
jsonobject
updated_at
Timestamp indicating when this hosted page was last updated. This attribute will be present only if the resource has been updated after 2017-04-14.
optional, timestamp(UTC) in seconds
resource_version
Version number of this resource. Each update of this resource results in incremental change of this number. This attribute will be present only if the resource has been updated after 2017-04-14.
optional, long
checkout_info
Customer Info (email, first name and last name) given in the checkout page used for tracking abandoned carts.
Learn more.
optional, jsonobject

Hosted page to accept card details from the subscriber and create a new subscription. This is similar to our server to server API Create a Subscription.

When the redirect URL is notified of the result, we would advise you to retrieve the subscription and verify the details.

Related Tutorials

Notes

As mentioned before this behavior is very similar to the create subscription API call. All the web hook events will be fired only after the submission of payment details by the customer and successful creation 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
# checkout a new subscription with customer details.
curl  https://{site}.chargebee.com/api/v2/hosted_pages/checkout_new \
     -u {site_api_key}:\
     -d customer[email]="john@user.com" \
     -d customer[first_name]="John" \
     -d customer[last_name]="Doe" \
     -d customer[locale]="fr-CA" \
     -d customer[phone]="+1-949-999-9999" \
     -d subscription[plan_id]="no_trial" \
     -d billing_address[first_name]="John" \
     -d billing_address[last_name]="Doe" \
     -d billing_address[line1]="PO Box 9999" \
     -d billing_address[city]="Walnut" \
     -d billing_address[state]="California" \
     -d billing_address[zip]="91789" \
     -d billing_address[country]="US"
copy

Sample Response [ JSON ]

URL Format POST

https://{site}.chargebee.com/api/v2/hosted_pages/checkout_new
billing_cycles
Number of cycles(plan interval) this subscription should be charged. After the billing cycles exhausted, the subscription will be cancelled.
optional, integer, min=0
mandatory_addons_to_remove[0..n]
List of addons IDs that are mandatory to the plan and has to be removed from the subscription.
optional, list of string
terms_to_charge
The number of future renewals for which advance invoicing is done. However, if a new term gets started in this operation, the specified terms_to_charge will be inclusive of this new term.
optional, integer, min=1
billing_alignment_mode
Applicable when calendar billing is enabled and subscription is getting created in active / non_renewing states. Unless specified the configured default value will be used.
optional, enumerated string
Possible values are
immediateSubscription period will be aligned with the configured billing date immediately.delayedSubscription period will be aligned with the configured billing date at a later date (subsequent renewals).
coupon_ids[0..n]
Identifier of the coupon as a List. Coupon Codes can also be passed.
optional, list of string
redirect_url
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 :
  • 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.
    optional, string, max chars=250
cancel_url
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.
    optional, string, max chars=250
pass_thru_content
You can pass through any content specific to the hosted page request and get it back after user had submitted the hosted page.
optional, string, max chars=2048
embed
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.
optional, boolean, default=true
iframe_messaging
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.
optional, boolean, default=false
+
subscription
Parameters for subscription
pass parameters as subscription[<param name>]
subscription[id]
A unique identifier to identify the subscription. You will use this to perform all operations on this subscription.
optional, string, max chars=50
subscription[plan_id]
Identifier of the plan for this subscription.
required, string, max chars=100
subscription[plan_quantity]
Plan quantity for this subscription.
optional, integer, default=1, min=1
subscription[plan_unit_price]
Amount that will override the Plan's default price.
optional, in cents, min=0
subscription[setup_fee]
Amount that will override the default setup fee.
optional, in cents, min=0
subscription[trial_end]
The time at which the trial ends for this subscription. Can be specified to override the default trial period.If '0' is passed, the subscription will be activated immediately.
optional, timestamp(UTC) in seconds
subscription[start_date]
Allows you to specify a future date or a past date on which the subscription starts.Past dates can be entered in case the subscription has already started. Any past date entered must be within the current billing cycle/plan term. The subscription will start immediately if this parameter is not passed.
optional, timestamp(UTC) in seconds
subscription[auto_collection]
Defines whether payments need to be collected automatically for this subscription. Overrides customer's auto-collection property.
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. All payments must be recorded offline.
subscription[invoice_notes]
Invoice Notes for this resource. Read More.
optional, string, max chars=2000
subscription[affiliate_token]
A unique tracking token.
optional, string, max chars=250
subscription[contract_term_billing_cycle_on_renewal]
Number of billing cycles the new contract term should run for, on contract renewal. The default value is as specified in the site settings.
optional, integer, min=1, max=100
+
customer
Parameters for customer
pass parameters as customer[<param name>]
customer[id]
Id for the new customer. If not given, this will be same as the subscription id.
optional, string, max chars=50
customer[email]
Email of the customer. Configured email notifications will be sent to this email.
optional, string, max chars=70
customer[first_name]
First name of the customer. If not provided it will be got from contact information entered in the hosted page .
optional, string, max chars=150
customer[last_name]
Last name of the customer. If not provided it will be got from contact information entered in the hosted page .
optional, string, max chars=150
customer[company]
Company name of the customer.
optional, string, max chars=250
customer[taxability]
Specifies if the customer is liable for tax.
optional, enumerated string, default=taxable
Possible values are
taxableCustomer is taxable.exempt
  • Customer is exempted from tax
  • 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.
.
customer[locale]
Determines which region-specific language Chargebee uses to communicate with the customer. In the absence of the locale attribute, Chargebee will use your site's default language for customer communication.
optional, string, max chars=50
customer[phone]
Phone number of the customer.
optional, string, max chars=50
customer[vat_number]
VAT/ Tax registration number of the customer. Learn more.
optional, string, max chars=20
customer[consolidated_invoicing]
Applicable when consolidated invoicing is enabled. Indicates whether invoice consolidation should happen during subscription renewals. Needs to be set only if this value is different from the defaults configured.
optional, boolean
+
card
Parameters for card
pass parameters as card[<param name>]
card[gateway_account_id]
The gateway account in which this payment source is stored.
optional, string, max chars=50
+
billing_address
Parameters for billing_address
pass parameters as billing_address[<param name>]
billing_address[first_name]
First name.
optional, string, max chars=150
billing_address[last_name]
Last name.
optional, string, max chars=150
billing_address[email]
Email.
optional, string, max chars=70
billing_address[company]
Company name.
optional, string, max chars=250
billing_address[phone]
Phone number.
optional, string, max chars=50
billing_address[line1]
Address line 1.
optional, string, max chars=150
billing_address[line2]
Address line 2.
optional, string, max chars=150
billing_address[line3]
Address line 3.
optional, string, max chars=150
billing_address[city]
City.
optional, string, max chars=50
billing_address[state_code]
The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set the state_code as AZ (not US-AZ). or, for Tamil Nadu (India), set the state_code as TN (not IN-TN). or, for British Columbia (Canada), set the state_code as BC (not CA-BC).
Note: If the 'state_code' is specified, the 'state' attribute should not be provided as Chargebee will set the value automatically (for US, Canada, India).
optional, string, max chars=50
billing_address[state]
The state/province name. Use this to pass the state/province information for cases where 'state_code' is not supported or cannot be passed.
optional, string, max chars=50
billing_address[zip]
Zip or Postal code.
optional, string, max chars=20
billing_address[country]
2-letter ISO 3166 alpha-2 country code.
optional, string, max chars=50
billing_address[validation_status]
The address verification status.
optional, enumerated string, default=not_validated
Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validAddress is verified but only partially.invalidAddress is invalid.
+
shipping_address
Parameters for shipping_address
pass parameters as shipping_address[<param name>]
shipping_address[first_name]
First name.
optional, string, max chars=150
shipping_address[last_name]
Last name.
optional, string, max chars=150
shipping_address[email]
Email.
optional, string, max chars=70
shipping_address[company]
Company name.
optional, string, max chars=250
shipping_address[phone]
Phone number.
optional, string, max chars=50
shipping_address[line1]
Address line 1.
optional, string, max chars=180
shipping_address[line2]
Address line 2.
optional, string, max chars=150
shipping_address[line3]
Address line 3.
optional, string, max chars=150
shipping_address[city]
City.
optional, string, max chars=50
shipping_address[state_code]
The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set the state_code as AZ (not US-AZ). or, for Tamil Nadu (India), set the state_code as TN (not IN-TN). or, for British Columbia (Canada), set the state_code as BC (not CA-BC).
Note: If the 'state_code' is specified, the 'state' attribute should not be provided as Chargebee will set the value automatically (for US, Canada, India).
optional, string, max chars=50
shipping_address[state]
The state/province name. Use this to pass the state/province information for cases where 'state_code' is not supported or cannot be passed.
optional, string, max chars=50
shipping_address[zip]
Zip or Postal code.
optional, string, max chars=20
shipping_address[country]
2-letter ISO 3166 alpha-2 country code.
optional, string, max chars=50
shipping_address[validation_status]
The address verification status.
optional, enumerated string, default=not_validated
Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validAddress is verified but only partially.invalidAddress is invalid.
+
contract_term
Parameters for contract_term
pass parameters as contract_term[<param name>]
contract_term[action_at_term_end]
Action to be taken when the contract term completes.
optional, enumerated string, default=cancel
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.
    contract_term[cancellation_cutoff_period]
    The number of days before contract_end, during which the customer is barred from canceling the contract term. The customer is allowed to cancel the contract term via the Self-Serve Portal only before this period. This allows you to have sufficient time for processing the contract term closure.
    optional, integer, default=0
    +
    addons
    Parameters for addons. Multiple addons can be passed by specifying unique indices.
    pass parameters as addons[<param name>][<idx:0..n>]
    addons[id][0..n]
    Identifier of the addon. Multiple addons can be passed.
    optional, string, max chars=100
    addons[quantity][0..n]
    Addon quantity. Applicable only for the quantity based addons. Should be passed with the same index as that of associated addon id.
    optional, integer, default=1, min=1
    addons[unit_price][0..n]
    Amount that will override the Addon's default price. The Plan's billing frequency will not be considered for overriding. E.g. If the Plan's billing frequency is every 3 months, and if the price override amount is $10, $10 will be used, and not $30 (i.e $10*3).
    optional, in cents, min=0
    addons[billing_cycles][0..n]
    Number of billing cycles the addon will be charged for. When not set, the addon is attached to the subscription for an indefinite number of billing cycles. While updating a subscription to a plan with a different billing period, set this parameter again or its value will be lost. And so, the addon will be attached indefinitely.
    optional, integer, min=1
    +
    event_based_addons
    Parameters for event_based_addons. Multiple event_based_addons can be passed by specifying unique indices.
    pass parameters as event_based_addons[<param name>][<idx:0..n>]
    event_based_addons[id][0..n]
    A unique 'id' used to identify the addon.
    optional, string, max chars=100
    event_based_addons[quantity][0..n]
    Addon quantity. Applicable only for the quantity based addons. Should be passed with the same index as that of associated addon id.
    optional, integer, min=1
    event_based_addons[unit_price][0..n]
    Amount that will override the Addon's default price.
    optional, in cents, min=0
    event_based_addons[service_period_in_days][0..n]
    Defines service period of the addon in days from the day of charge.
    optional, integer, min=1, max=730
    event_based_addons[on_event][0..n]
    Event on which this addon will be charged.
    optional, enumerated string
    Possible values are
    subscription_creationAddon will be charged on subscription creation.subscription_trial_startAddon will be charged when the trial period starts.plan_activationAddon will be charged on plan activation.subscription_activationAddon will be charged on subscription activation.contract_terminationAddon will be charged on contract termination.
    event_based_addons[charge_once][0..n]
    If enabled, the addon will be charged only at the first occurrence of the event. Applicable only for non-recurring add-ons.
    optional, boolean, default=true
    event_based_addons[charge_on][0..n]
    Indicates when the non-recurring addon will be charged.
    optional, enumerated string
    Possible values are
    immediatelyCharges for the addon will be applied immediately.on_eventCharge for the addon will be applied on the occurrence of a specified event.
    Resource object representing hosted_page.
    always returned

    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

    Notes

    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
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/checkout_existing \
         -u {site_api_key}:\
         -d subscription[id]="__test__KyVnJjRnFZEKj6Fv" \
         -d subscription[plan_id]="sub_plan1"
    copy

    Sample Response [ JSON ]

    URL Format POST

    https://{site}.chargebee.com/api/v2/hosted_pages/checkout_existing
    replace_addon_list
    Should be true if the existing addons should be replaced with the ones that are being passed.
    optional, boolean
    mandatory_addons_to_remove[0..n]
    List of addons IDs that are mandatory to the plan and has to be removed from the subscription.
    optional, list of string
    billing_cycles
    Number of cycles(plan interval) this subscription should be charged. After the billing cycles exhausted, the subscription will be cancelled.
    optional, integer, min=0
    terms_to_charge
    The number of future renewals for which advance invoicing is done. However, if a new term gets started in this operation, the specified terms_to_charge will be inclusive of this new term.
    optional, integer, min=1
    reactivate_from
    The time from which this subscription should be reactivated.
    optional, timestamp(UTC) in seconds
    billing_alignment_mode
    Applicable when calendar billing is enabled and a new term gets started during this operation. Unless specified the configured default value will be used.
    optional, enumerated string
    Possible values are
    immediateSubscription period will be aligned with the configured billing date immediately.delayedSubscription period will be aligned with the configured billing date at a later date (subsequent renewals).
    coupon_ids[0..n]
    Identifier of the coupon as a List. Coupon Codes can also be passed.
    optional, list of string
    reactivate
    Applicable only for cancelled subscriptions. Once this is passed as true, cancelled subscription will become active; otherwise subscription changes will be made but the the subscription state will remain cancelled. If not passed, subscription will be activated only if there is any change in subscription data.
    optional, boolean
    force_term_reset
    Applicable for 'Active' & 'Non Renewing' states alone. Generally, subscription's term will be reset (i.e current term is ended and a new term starts immediately) when a new plan having different billing frequency is specified in the input. For all the other cases, the subscription's term will remain intact. Now for this later scenario, if you want to force a term reset you can specify this param as 'true'.
    Note: Specifying this value as 'false' has no impact on the default behaviour.
    optional, boolean, default=false
    redirect_url
    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 :
    • 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.
      optional, string, max chars=250
    cancel_url
    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.
      optional, string, max chars=250
    pass_thru_content
    You can pass through any content specific to the hosted page request and get it back after user had submitted the hosted page.
    optional, string, max chars=2048
    embed
    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.
    optional, boolean, default=true
    iframe_messaging
    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.
    optional, boolean, default=false
    +
    subscription
    Parameters for subscription
    pass parameters as subscription[<param name>]
    subscription[id]
    A unique identifier to identify the subscription. You will use this to perform all operations on this subscription.
    required, string, max chars=50
    subscription[plan_id]
    Identifier of the plan for this subscription.
    optional, string, max chars=100
    subscription[plan_quantity]
    Represents the plan quantity for this subscription.
    optional, integer, min=1
    subscription[plan_unit_price]
    Amount that will override the Plan's default price.
    optional, in cents, min=0
    subscription[setup_fee]
    Amount that will override the default setup fee.
    optional, in cents, min=0
    subscription[start_date]
    Applicable only for 'future' subscriptions. The new start date of the 'future' subscription.
    optional, timestamp(UTC) in seconds
    subscription[trial_end]
    The time at which the trial should end for this subscription. Can be specified to override the default trial period defined in plan. If '0' is passed, the subscription will be activated immediately.
    optional, timestamp(UTC) in seconds
    subscription[invoice_notes]
    Invoice Notes for this resource. Read More.
    optional, string, max chars=2000
    subscription[contract_term_billing_cycle_on_renewal]
    Number of billing cycles the new contract term should run for, on contract renewal. The default value is as specified in the site settings.
    optional, integer, min=1, max=100
    +
    customer
    Parameters for customer
    pass parameters as customer[<param name>]
    customer[vat_number]
    VAT/ Tax registration number of the customer. Learn more.
    optional, string, max chars=20
    +
    card
    Parameters for card
    pass parameters as card[<param name>]
    card[gateway_account_id]
    The gateway account in which this payment source is stored.
    optional, string, max chars=50
    +
    contract_term
    Parameters for contract_term
    pass parameters as contract_term[<param name>]
    contract_term[action_at_term_end]
    Action to be taken when the contract term completes.
    optional, enumerated string, default=cancel
    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.
    contract_term[cancellation_cutoff_period]
    The number of days before contract_end, during which the customer is barred from canceling the contract term. The customer is allowed to cancel the contract term via the Self-Serve Portal only before this period. This allows you to have sufficient time for processing the contract term closure.
    optional, integer, default=0
    +
    addons
    Parameters for addons. Multiple addons can be passed by specifying unique indices.
    pass parameters as addons[<param name>][<idx:0..n>]
    addons[id][0..n]
    Identifier of the addon. Multiple addons can be passed.
    optional, string, max chars=100
    addons[quantity][0..n]
    Addon quantity. Applicable only for the quantity based addons. Should be passed with the same index as that of associated addon id.
    optional, integer, min=1
    addons[unit_price][0..n]
    Amount that will override the Addon's default price. The Plan's billing frequency will not be considered for overriding. E.g. If the Plan's billing frequency is every 3 months, and if the price override amount is $10, $10 will be used, and not $30 (i.e $10*3).
    optional, in cents, min=0
    addons[billing_cycles][0..n]
    Number of billing cycles the addon will be charged for. When not set, the addon is attached to the subscription for an indefinite number of billing cycles. While updating a subscription to a plan with a different billing period, set this parameter again or its value will be lost. And so, the addon will be attached indefinitely.
    optional, integer, min=1
    +
    event_based_addons
    Parameters for event_based_addons. Multiple event_based_addons can be passed by specifying unique indices.
    pass parameters as event_based_addons[<param name>][<idx:0..n>]
    event_based_addons[id][0..n]
    A unique 'id' used to identify the addon.
    optional, string, max chars=100
    event_based_addons[quantity][0..n]
    Addon quantity. Applicable only for the quantity based addons. Should be passed with the same index as that of associated addon id.
    optional, integer, min=1
    event_based_addons[unit_price][0..n]
    Amount that will override the Addon's default price.
    optional, in cents, min=0
    event_based_addons[service_period_in_days][0..n]
    Defines service period of the addon in days from the day of charge.
    optional, integer, min=1, max=730
    event_based_addons[charge_on][0..n]
    Indicates when the non-recurring addon will be charged.
    optional, enumerated string
    Possible values are
    immediatelyCharges for the addon will be applied immediately.on_eventCharge for the addon will be applied on the occurrence of a specified event.
    event_based_addons[on_event][0..n]
    Event on which this addon will be charged.
    optional, enumerated string
    Possible values are
    subscription_creationAddon will be charged on subscription creation.subscription_trial_startAddon will be charged when the trial period starts.plan_activationAddon will be charged on plan activation.subscription_activationAddon will be charged on subscription activation.contract_terminationAddon will be charged on contract termination.
    event_based_addons[charge_once][0..n]
    If enabled, the addon will be charged only at the first occurrence of the event. Applicable only for non-recurring add-ons.
    optional, boolean
    Resource object representing hosted_page.
    always returned

    Note: If you're using Checkout V3, 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.
    Sample Request
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/update_payment_method \
         -u {site_api_key}:\
         -d customer[id]="__test__KyVnJjRnFZIgb6HG" \
         -d card[gateway_account_id]="gw___test__KyVnLVRnFZDFrJf"
    copy
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/update_payment_method \
         -u {site_api_key}:\
         -d customer[id]="__test__KyVnJjRnFZIgb6HG" \
         -d card[gateway_account_id]="gw___test__KyVnLVRnFZDFrJf"

    Sample Response [ JSON ]

    Show more...
    {"hosted_page": { "created_at": 1517469329, "embed": true, "expires_at": 1517555729, "id": "__test__TgdFdD65nPwzJEV9K2hfnCLbD3p2NvuZ", "object": "hosted_page", "resource_version": 1517469329000, "state": "created", "type": "update_payment_method", "updated_at": 1517469329, "url": "https://yourapp.chargebee.com/pages/v2/__test__TgdFdD65nPwzJEV9K2hfnCLbD3p2NvuZ/update_payment_method" }}

    URL Format POST

    https://{site}.chargebee.com/api/v2/hosted_pages/update_payment_method
    redirect_url
    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 :
    • 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.
      optional, string, max chars=250
    cancel_url
    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.
      optional, string, max chars=250
    pass_thru_content
    You can pass through any content specific to the hosted page request and get it back after user had submitted the hosted page.
    optional, string, max chars=2048
    embed
    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.
    optional, boolean, default=true
    iframe_messaging
    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.
    optional, boolean, default=false
    +
    customer
    Parameters for customer
    pass parameters as customer[<param name>]
    customer[id]
    Identifier of the customer.
    required, string, max chars=50
    +
    card
    Parameters for card
    pass parameters as card[<param name>]
    card[gateway_account_id]
    The gateway account in which this payment source is stored.
    optional, string, max chars=50
    Resource object representing hosted_page.
    always returned
    Sample Request
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/manage_payment_sources \
         -u {site_api_key}:\
         -d customer[id]="__test__KyVnJjRnFZHhI6Gx" \
         -d card[gateway_account_id]="gw___test__KyVnLVRnFZDFrJf"
    copy
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/manage_payment_sources \
         -u {site_api_key}:\
         -d customer[id]="__test__KyVnJjRnFZHhI6Gx" \
         -d card[gateway_account_id]="gw___test__KyVnLVRnFZDFrJf"

    Sample Response [ JSON ]

    Show more...
    {"hosted_page": { "created_at": 1517469325, "embed": false, "expires_at": 1517555725, "id": "__test__cug89TDvY5MoKep8PuVbJUgFMNIzGj30l", "object": "hosted_page", "resource_version": 1517469325000, "state": "created", "type": "manage_payment_sources", "updated_at": 1517469325, "url": "https://yourapp.chargebee.com/pages/v3/__test__cug89TDvY5MoKep8PuVbJUgFMNIzGj30l/" }}

    URL Format POST

    https://{site}.chargebee.com/api/v2/hosted_pages/manage_payment_sources
    redirect_url
    URL to redirect after payment method is added.
    optional, string, max chars=250
    +
    customer
    Parameters for customer
    pass parameters as customer[<param name>]
    customer[id]
    Identifier of the customer.
    required, string, max chars=50
    +
    card
    Parameters for card
    pass parameters as card[<param name>]
    card[gateway_account_id]
    The gateway account in which this payment source is stored.
    optional, string, max chars=50
    Resource object representing hosted_page.
    always returned
    Sample Request
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/collect_now \
         -u {site_api_key}:\
         -d customer[id]="__test__KyVnLVRnFZH7KJr" \
         -d card[gateway_account_id]="gw___test__KyVnLVRnFZDFrJf"
    copy
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/collect_now \
         -u {site_api_key}:\
         -d customer[id]="__test__KyVnLVRnFZH7KJr" \
         -d card[gateway_account_id]="gw___test__KyVnLVRnFZDFrJf"

    Sample Response [ JSON ]

    Show more...
    {"hosted_page": { "created_at": 1517469323, "embed": true, "expires_at": 1517555723, "id": "__test__9pmRMwESFRsefK0fcdKUDL8375EfO3y9v", "object": "hosted_page", "resource_version": 1517469323000, "state": "created", "type": "collect_now", "updated_at": 1517469323, "url": "https://yourapp.chargebee.com/pages/v3/__test__9pmRMwESFRsefK0fcdKUDL8375EfO3y9v/collect_now" }}

    URL Format POST

    https://{site}.chargebee.com/api/v2/hosted_pages/collect_now
    redirect_url
    URL to redirect after invoices are paid.
    optional, string, max chars=250
    currency_code
    The currency code (ISO 4217 format) of the specified credit amount.
    optional, string, max chars=3
    +
    customer
    Parameters for customer
    pass parameters as customer[<param name>]
    customer[id]
    Identifier of the customer.
    required, string, max chars=50
    +
    card
    Parameters for card
    pass parameters as card[<param name>]
    card[gateway_account_id]
    The gateway account in which this payment source is stored.
    optional, string, max chars=50
    Resource object representing hosted_page.
    always returned
    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 \
         -X POST  \
         -u {site_api_key}:\
         -d quote[id]="1"
    copy
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/accept_quote \
         -X POST  \
         -u {site_api_key}:\
         -d quote[id]="1"

    Sample Response [ JSON ]

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

    URL Format POST

    https://{site}.chargebee.com/api/v2/hosted_pages/accept_quote
    +
    quote
    Parameters for quote
    pass parameters as quote[<param name>]
    quote[id]
    The quote number. Acts as a identifier for quote and typically generated sequentially.
    required, string, max chars=50
    Resource object representing hosted_page.
    always returned
    Sample Request
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/extend_subscription \
         -u {site_api_key}:\
         -d subscription[id]="__test__KyVnJjRnFZHZb6Gp" \
         -d billing_cycle=2 \
         -d expiry=14
    copy
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/extend_subscription \
         -u {site_api_key}:\
         -d subscription[id]="__test__KyVnJjRnFZHZb6Gp" \
         -d billing_cycle=2 \
         -d expiry=14

    Sample Response [ JSON ]

    Show more...
    {"hosted_page": { "created_at": 1517469323, "embed": true, "expires_at": 1518678923, "id": "__test__SKeIKXUxsxokBt1JchpVvdfo8H2oUxG7", "object": "hosted_page", "resource_version": 1517469323000, "state": "created", "type": "extend_subscription", "updated_at": 1517469323, "url": "https://yourapp.chargebee.com/pages/v3/__test__SKeIKXUxsxokBt1JchpVvdfo8H2oUxG7/" }}

    URL Format POST

    https://{site}.chargebee.com/api/v2/hosted_pages/extend_subscription
    expiry
    Expiry (in days) for the link generated. No expiry will be set if this is not specified.
    optional, integer, min=1, max=500
    billing_cycle
    Number of billing cycles to extend. If not specified, plan's billing cycle will be used.
    optional, integer, min=1
    +
    subscription
    Parameters for subscription
    pass parameters as subscription[<param name>]
    subscription[id]
    A unique identifier to identify the subscription. You will use this to perform all operations on this subscription.
    required, string, max chars=50
    Resource object representing hosted_page.
    always returned
    Sample Request
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/checkout_gift \
         -u {site_api_key}:\
         -d subscription[plan_id]="GiftPlan$100"
    copy
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/checkout_gift \
         -u {site_api_key}:\
         -d subscription[plan_id]="GiftPlan$100"

    Sample Response [ JSON ]

    Show more...
    {"hosted_page": { "created_at": 1517469315, "embed": false, "expires_at": 1517472915, "id": "__gift___test__np0Ibcuz0o87I7yga1V32kYmt0Prlfuao", "object": "hosted_page", "resource_version": 1517469315000, "state": "created", "type": "checkout_gift", "updated_at": 1517469315, "url": "https://yourapp.chargebee.com/pages/v3/__gift___test__np0Ibcuz0o87I7yga1V32kYmt0Prlfuao/" }}

    URL Format POST

    https://{site}.chargebee.com/api/v2/hosted_pages/checkout_gift
    redirect_url
    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 :
    • 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.
      optional, string, max chars=250
    +
    gifter
    Parameters for gifter
    pass parameters as gifter[<param name>]
    gifter[customer_id]
    Gifter customer id.
    optional, string, max chars=50
    gifter[locale]
    Determines which region-specific language Chargebee uses to communicate with the customer. In the absence of the locale attribute, Chargebee will use your site's default language for customer communication.
    optional, string, max chars=50
    +
    subscription
    Parameters for subscription
    pass parameters as subscription[<param name>]
    subscription[plan_id]
    Identifier of the plan for this subscription.
    required, string, max chars=100
    subscription[plan_quantity]
    Plan quantity for this subscription.
    optional, integer, default=1, min=1
    subscription[coupon]
    Used to uniquely identify the coupon in your website/application and to integrate with Chargebee.
    optional, string, max chars=50
    +
    addons
    Parameters for addons. Multiple addons can be passed by specifying unique indices.
    pass parameters as addons[<param name>][<idx:0..n>]
    addons[id][0..n]
    Identifier of the addon. Multiple addons can be passed.
    optional, string, max chars=100
    addons[quantity][0..n]
    Addon quantity. Applicable only for the quantity based addons. Should be passed with the same index as that of associated addon id.
    optional, integer, default=1, min=1
    Resource object representing hosted_page.
    always returned
    Sample Request
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/claim_gift \
         -u {site_api_key}:\
         -d gift[id]="__test__KyVnJjRnFZGhW6Ge__test__lqLQUJkMc0mcdGu7VtYQYcudRIVCV3rGqR"
    copy
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/claim_gift \
         -u {site_api_key}:\
         -d gift[id]="__test__KyVnJjRnFZGhW6Ge__test__lqLQUJkMc0mcdGu7VtYQYcudRIVCV3rGqR"

    Sample Response [ JSON ]

    Show more...
    {"hosted_page": { "created_at": 1517642120, "embed": false, "expires_at": 1517645720, "id": "__test__GzFJGVx0QrpptUfoUdYG7jYRBp58LtOh", "object": "hosted_page", "resource_version": 1517642120000, "state": "created", "type": "claim_gift", "updated_at": 1517642120, "url": "https://yourapp.chargebee.com/pages/v3/__test__GzFJGVx0QrpptUfoUdYG7jYRBp58LtOh/claim_gift" }}

    URL Format POST

    https://{site}.chargebee.com/api/v2/hosted_pages/claim_gift
    redirect_url
    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 :
    • 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.
      optional, string, max chars=250
    +
    gift
    Parameters for gift
    pass parameters as gift[<param name>]
    gift[id]
    Uniquely identifies a gift.
    required, string, max chars=150
    +
    customer
    Parameters for customer
    pass parameters as customer[<param name>]
    customer[locale]
    Determines which region-specific language Chargebee uses to communicate with the customer. In the absence of the locale attribute, Chargebee will use your site's default language for customer communication.
    optional, string, max chars=50
    Resource object representing hosted_page.
    always returned

    This is applicable only for Direct Debit via SEPA, BACS, Autogiro and BECS. 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 will retrieve the redirect link to the corresponding agreement for customers. The agreement PDF can be present in your Thank You page or sent by email to customers. Communicating this PDF to the your customers is mandatory.

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

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

    Sample Response [ JSON ]

    Show more...
    {"hosted_page": { "created_at": 1517469327, "embed": false, "expires_at": 1520061327, "id": "__test__N1Fa0e73RkHEvTKnHgGUERwKzxBoW6Ag", "object": "hosted_page", "resource_version": 1517469327000, "state": "created", "type": "agreement_pfd", "updated_at": 1517469327, "url": "https://yourapp.chargebee.com/action_pages/__test__N1Fa0e73RkHEvTKnHgGUERwKzxBoW6Ag/agreement_pdf" }}

    URL Format POST

    https://{site}.chargebee.com/api/v2/hosted_pages/retrieve_agreement_pdf
    payment_source_id
    Payment source to be used for this payment.
    required, string, max chars=40
    Resource object representing hosted_page.
    always returned
    Acknowledges the success hosted page. Applicable only if the hosted page state is succeeded.
    Sample Request
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/__test__p541yXSwQO7jD2oRNFlBSvqU2s0oiWY0/acknowledge \
         -X POST  \
         -u {site_api_key}:
    copy
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/__test__p541yXSwQO7jD2oRNFlBSvqU2s0oiWY0/acknowledge \
         -X POST  \
         -u {site_api_key}:

    Sample Response [ JSON ]

    Show more...
    {"hosted_page": { "content": { "card": { "card_type": "american_express", "customer_id": "__test__5SK0bLNFRFuFd5CuE", "expiry_month": 10, "expiry_year": 2020, "first_name": "Hello", "funding_type": "not_known", "gateway": "chargebee", "gateway_account_id": "gw___test__KyVnTyRFuFcGgDu", "iin": "378282", "ip_address": "127.0.0.1", "last4": "0005", "last_name": "World", "masked_number": "***********0005", "object": "card", "payment_source_id": "pm___test__5SK0bLNFRFuFfTGuV", "status": "valid" }, "credit_notes": [ { "allocations": [ { "allocated_amount": 895, "allocated_at": 1517507562, "invoice_date": 1517507562, "invoice_id": "__demo_inv__2", "invoice_status": "paid" }, {..} ], "amount_allocated": 895, "amount_available": 0, "amount_refunded": 0, "base_currency_code": "USD", "currency_code": "USD", "customer_id": "__test__5SK0bLNFRFuFd5CuE", "date": 1517507562, "deleted": false, "exchange_rate": 1, "id": "__demo_cn__1", "line_item_discounts": [], "line_item_taxes": [], "line_items": [ { "amount": 895, "date_from": 1517507562, "date_to": 1519926753, "description": "No Trial - Prorated Credits for 01-Feb-2018 - 01-Mar-2018", "discount_amount": 0, "entity_id": "no_trial", "entity_type": "plan", "id": "li___test__5SK0bLNFRFuFfTvuY", "is_taxed": false, "item_level_discount_amount": 0, "object": "line_item", "pricing_model": "per_unit", "quantity": 1, "subscription_id": "__test__5SK0bLNFRFuFd5CuE", "tax_amount": 0, "tax_exempt_reason": "tax_not_configured", "unit_amount": 895 }, {..} ], "linked_refunds": [], "object": "credit_note", "price_type": "tax_exclusive", "reason_code": "subscription_change", "reference_invoice_id": "__demo_inv__1", "refunded_at": 1517507562, "resource_version": 1517507562000, "round_off_amount": 0, "status": "refunded", "sub_total": 895, "subscription_id": "__test__5SK0bLNFRFuFd5CuE", "taxes": [], "total": 895, "type": "refundable", "updated_at": 1517507562 }, {..} ], "customer": { "allow_direct_debit": false, "auto_collection": "on", "billing_address": { "city": "Chennai", "country": "IN", "first_name": "Hello", "last_name": "World", "line1": "Wow", "line2": "Cool", "object": "billing_address", "phone": "122242222", "state": "Tamil Nadu", "state_code": "TN", "validation_status": "not_validated", "zip": "600041" }, "card_status": "valid", "created_at": 1517507553, "deleted": false, "email": "john@user.com", "excess_payments": 0, "first_name": "John", "id": "__test__5SK0bLNFRFuFd5CuE", "last_name": "Doe", "net_term_days": 0, "object": "customer", "payment_method": { "gateway": "chargebee", "gateway_account_id": "gw___test__KyVnTyRFuFcGgDu", "object": "payment_method", "reference_id": "tok___test__5SK0bLNFRFuFfTDuU", "status": "valid", "type": "card" }, "pii_cleared": "active", "preferred_currency_code": "USD", "primary_payment_source_id": "pm___test__5SK0bLNFRFuFfTGuV", "promotional_credits": 0, "refundable_credits": 0, "resource_version": 1517507562000, "taxability": "taxable", "unbilled_charges": 0, "updated_at": 1517507562 }, "invoice": { "adjustment_credit_notes": [], "amount_adjusted": 0, "amount_due": 0, "amount_paid": 605, "amount_to_collect": 0, "applied_credits": [ { "applied_amount": 895, "applied_at": 1517507562, "cn_date": 1517507562, "cn_id": "__demo_cn__1", "cn_reason_code": "subscription_change", "cn_status": "refunded" }, {..} ], "base_currency_code": "USD", "billing_address": { "city": "Chennai", "country": "IN", "first_name": "Hello", "last_name": "World", "line1": "Wow", "line2": "Cool", "object": "billing_address", "phone": "122242222", "state": "Tamil Nadu", "state_code": "TN", "validation_status": "not_validated", "zip": "600041" }, "credits_applied": 895, "currency_code": "USD", "customer_id": "__test__5SK0bLNFRFuFd5CuE", "date": 1517507562, "deleted": false, "due_date": 1517507562, "exchange_rate": 1, "first_invoice": false, "has_advance_charges": false, "id": "__demo_inv__2", "is_gifted": false, "issued_credit_notes": [], "line_items": [ { "amount": 1500, "date_from": 1517507562, "date_to": 1519926753, "description": "Plan1 - Prorated Charges", "discount_amount": 0, "entity_id": "plan1", "entity_type": "plan", "id": "li___test__5SK0bLNFRFuFfTpuW", "is_taxed": false, "item_level_discount_amount": 0, "object": "line_item", "pricing_model": "per_unit", "quantity": 1, "subscription_id": "__test__5SK0bLNFRFuFd5CuE", "tax_amount": 0, "tax_exempt_reason": "tax_not_configured", "unit_amount": 1500 }, {..} ], "linked_orders": [], "linked_payments": [ { "applied_amount": 605, "applied_at": 1517507562, "txn_amount": 605, "txn_date": 1517507562, "txn_id": "txn___test__5SK0bLNFRFuFfUeua", "txn_status": "success" }, {..} ], "net_term_days": 0, "object": "invoice", "paid_at": 1517507562, "price_type": "tax_exclusive", "recurring": true, "resource_version": 1517507562000, "round_off_amount": 0, "shipping_address": { "city": "Chennai", "country": "IN", "first_name": "Hello", "last_name": "World", "line1": "Wow", "line2": "Cool", "object": "shipping_address", "phone": "122242222", "state": "Tamil Nadu", "state_code": "TN", "validation_status": "not_validated", "zip": "600041" }, "status": "paid", "sub_total": 1500, "subscription_id": "__test__5SK0bLNFRFuFd5CuE", "tax": 0, "term_finalized": true, "total": 1500, "updated_at": 1517507562, "write_off_amount": 0 }, "subscription": { "activated_at": 1517507553, "billing_period": 1, "billing_period_unit": "month", "created_at": 1517507553, "currency_code": "USD", "current_term_end": 1519926753, "current_term_start": 1517507553, "customer_id": "__test__5SK0bLNFRFuFd5CuE", "deleted": false, "due_invoices_count": 0, "has_scheduled_changes": false, "id": "__test__5SK0bLNFRFuFd5CuE", "mrr": 0, "next_billing_at": 1519926753, "object": "subscription", "plan_amount": 1500, "plan_free_quantity": 0, "plan_id": "plan1", "plan_quantity": 1, "plan_unit_price": 1500, "resource_version": 1517507562000, "shipping_address": { "city": "Chennai", "country": "IN", "first_name": "Hello", "last_name": "World", "line1": "Wow", "line2": "Cool", "object": "shipping_address", "phone": "122242222", "state": "Tamil Nadu", "state_code": "TN", "validation_status": "not_validated", "zip": "600041" }, "started_at": 1517507553, "status": "active", "updated_at": 1517507562 } }, "created_at": 1517507553, "embed": false, "expires_at": 1517511153, "id": "__test__p541yXSwQO7jD2oRNFlBSvqU2s0oiWY0", "object": "hosted_page", "resource_version": 1517507577000, "state": "acknowledged", "type": "checkout_existing", "updated_at": 1517507577, "url": "https://yourapp.chargebee.com/pages/v2/__test__p541yXSwQO7jD2oRNFlBSvqU2s0oiWY0/checkout" }}

    URL Format POST

    https://{site}.chargebee.com/api/v2/hosted_pages/{hosted_page_id}/acknowledge
    Resource object representing hosted_page.
    always returned
    Retrieves the hosted page resource.
    Sample Request
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/__test__6v6kMfGnAcLgLFgkRVxTvFmbWQOsTbBQ \
         -u {site_api_key}:
    copy
    curl  https://{site}.chargebee.com/api/v2/hosted_pages/__test__6v6kMfGnAcLgLFgkRVxTvFmbWQOsTbBQ \
         -u {site_api_key}:

    Sample Response [ JSON ]

    Show more...
    {"hosted_page": { "created_at": 1517469325, "embed": true, "expires_at": 1517472925, "id": "__test__6v6kMfGnAcLgLFgkRVxTvFmbWQOsTbBQ", "object": "hosted_page", "resource_version": 1517469325000, "state": "created", "type": "checkout_existing", "updated_at": 1517469325, "url": "https://yourapp.chargebee.com/pages/v2/__test__6v6kMfGnAcLgLFgkRVxTvFmbWQOsTbBQ/checkout" }}

    URL Format GET

    https://{site}.chargebee.com/api/v2/hosted_pages/{hosted_page_id}
    Resource object representing hosted_page.
    always returned
    Sample Request
    curl  https://{site}.chargebee.com/api/v2/hosted_pages \
         -G  \
         -u {site_api_key}:\
         --data-urlencode limit=2
    copy
    curl  https://{site}.chargebee.com/api/v2/hosted_pages \
         -G  \
         -u {site_api_key}:\
         --data-urlencode limit=2

    Sample Response [ JSON ]

    Show more...
    { "list": [ {"hosted_page": { "created_at": 1517642120, "embed": false, "expires_at": 1517645720, "id": "__test__GzFJGVx0QrpptUfoUdYG7jYRBp58LtOh", "object": "hosted_page", "resource_version": 1517642120000, "state": "created", "type": "claim_gift", "updated_at": 1517642120, "url": "https://yourapp.chargebee.com/pages/v3/__test__GzFJGVx0QrpptUfoUdYG7jYRBp58LtOh/claim_gift" }}, {..} ], "next_offset": "[\"1517469323000\",\"157000000042\"]" }

    URL Format GET

    https://{site}.chargebee.com/api/v2/hosted_pages
    limit
    Limits the number of resources to be returned.
    optional, integer, default=10, min=1, max=100
    offset
    Allows you to fetch the next set of resources. The value used for this parameter must be the value returned for next_offset parameter in the previous API call.
    optional, string, max chars=1000
    Filter Params
    For operator usages, see the Pagination and Filtering section.
    id[<operator>]
    To filter based on HostedPage Id.
    Supported operators : is, is_not, starts_with, in, not_in

    Example id[is] = "Edi69nxpu6BeGBd9Fjcd0tqCSwb0sRcuKa"
    optional, string filter
    type[<operator>]
    To filter based on HostedPage Type. Possible values are : checkout_new, checkout_existing, update_payment_method, manage_payment_sources, collect_now, extend_subscription, checkout_gift, claim_gift.
    Supported operators : is, is_not, in, not_in

    Example type[is_not] = "checkout_new"
    optional, enumerated string filter
    state[<operator>]
    To filter based on HostedPage State. Possible values are : created, requested, succeeded, cancelled, acknowledged.
    Supported operators : is, is_not, in, not_in

    Example state[is] = "succeeded"
    optional, enumerated string filter
    updated_at[<operator>]
    To filter based on Updated At.
    Supported operators : after, before, on, between

    Example updated_at[after] = "1490784813"
    optional, timestamp(UTC) in seconds filter
    Resource object representing hosted_page.
    always returned
    next_offset
    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”.
    optional, string, max chars=1000