Docs

Log in to read the version of docs relevant to your site, or use the dropdown versions

Pre-filling/Passing custom fields to hosted pages (via Plan URL)

Description;

Custom fields can be used to capture additional information link to the customer or a specific subscription.

To know how to create custom fields Click Here.

These custom fields can be configured to be Hidden, View only, Mandatory & Editable.

Solution:

To pre-fill the custom field in the hosted page you will need to use the custom field ID, which can be accessed from API documentation.

Sample URL format;

https://domain.chargebee.com/hosted_pages/plans/plan-id?subscription[cf_custom_field_id]="value"

https://domain.chargebee.com/hosted_pages/plans/plan-id?customer[cf_custom_field_id]="value"

If you are using our APIs + Checkout pages, you can pass the custom field value through the API call.

Edited Article

Description:

Custom fields can be used to capture additional information link to the customer or a specific subscription.

To know how to create custom fields Click Here.

These custom fields can be configured to be Hidden, Read-only, Mandatory or Editable.

Solution:

Hosted Pages V2

To pre-fill the custom field on the hosted page, you will need to use the custom field ID, which can be accessed from API documentation.

Sample URL format;

https://domain.chargebee.com/hosted_pages/plans/plan-id?subscription[cf_custom_field_id]="value"

https://domain.chargebee.com/hosted_pages/plans/plan-id?customer[cf_custom_field_id]="value"

If you are using our APIs + Checkout pages, you can pass the custom field value through the API call.

Checkout Page V3

You can pre-fill custom field value in V3 in two ways, either through Checkout page script or through the API call. Please refer the example shown under Cart customizations in Here. The custom field ID can also be added to the script in a similar manner to pre-fill the value in Checkout Page.

Was this article helpful?