Chargebee provides the option of creating custom fields for the Customer and Subscription objects. You can use this option to track additional information about a customer or their subscription. Once the custom fields are created, they can be added to the hosted checkout pages and invoices. They can be accessed through the web interface, and via the API.
Use the option to create custom fields for the Customer object if you need to collect customer-specific information, such as date of birth, age, or gender.
Use the option to create custom fields for the Subscription object when the information you need is subscription-specific, and your customers have multiple subscriptions. E.g. Domain URLs, phone numbers, Tracking ID, Shipping Date, t-shirt size, etc.
The supported custom field types are:
Single line text: This field will appear as a textbox, and the maximum character limit is 99.
Multiline text: This field will appear as a text area, and the maximum character limit is 250.
Dropdown: This field type will appear as a dropdown menu. You can add as many options as you'd want, but ensure that the total number of characters used for all the options put together, does not exceed 5000.
Checkbox: As is evident from the name, the field type can be used for creating checkbox options. The default value of this field type will be false.
URL: This field type will appear as a text area. The URL provided here will be validated for "http://" and "https://".
Email: This field type will appear as a textbox. The email address will be validated.
Date picker: Use this field type if you want to collect date-related information.
Timestamp: If you need to collect information related to date as well as time as a timestamp, use this field type.
Numbers: You could use this field type for collecting information such as phone number. This field does not accept input other than numbers.
You can add up to a total of 50 custom fields to your site. The breakdown is as follows:
To create custom fields to your Chargebee site, go to Settings › Site Settings › Custom Fields in your test site. You'll be provided with a 'toolbox' for creating the fields you require:
1. Create Custom Field in Test Site
Pick the field type you want to create, and fill in the details in the field creation screen that appears:
The custom fields are considered 'active', and will now be available only on the test site. You need to publish the fields to your live site to include custom field information in the invoices that you send to your customers, or in the hosted pages viewed by them. Ensure that you check how the fields work for all your use cases before pushing it to your live site.
2. Publish Custom Field to Live Site
In the Custom Fields main page, click Publish to Live and confirm changes.
The custom fields will now be available on your live site. To display the same on your hosted checkout page, go to Settings › Hosted Pages Settings › Field Configurations and configure the custom field display settings as explained here.
You can archive 'active' custom fields. Open the required custom field, and click the Archive button available on the top right corner. The field will be listed under the Archived section in the main Custom Fields page.
To unarchive, open the archived field and click the Unarchive option available on the top right corner.
Archived custom fields that have not been pushed to the live site can be discarded. Open the archived field, and click the Discard Field option available on the top right corner.
You can discard changes you've made to existing custom fields that have also been pushed to the live site. Open the modified field, and click the Discard Changes option available on the top right corner.
Clicking Rollback changes will discard all changes that have not been published to your Live site. If you have created new fields but haven't pushed them to your live site, they will be discarded as well.
Once the custom fields have been added to your site, you can add data to the custom fields by editing an existing subscription or when creating a new subscription.
To add data to a custom field for an existing customer, open the subscription and use the Change Customer Details option. This will display all the custom fields that are available in your site and you can add the data here.
You can capture custom field data during sign up through the hosted pages, using the API or through the web interface.
Capturing custom field data via hosted pages
You can collect the custom field data via the hosted checkout page. The custom fields that you create will be automatically enabled for customer portal.
To display the same on your hosted checkout page, go to Settings › Hosted Pages Settings › Field Configurations and configure the custom field display settings as explained here.
You can also collect custom field data during sign up through hosted pages by capturing the data on a page prior to directing users to the hosted checkout page. Learn how to capture custom field data for hosted checkout pages during sign up here.
Updating custom field data through the customer portal
As mentioned earlier, the custom fields that you create will be available and Editable in the customer portal, by default. Your customers can also login to their customer portal and update the data for your custom fields. If you'd like to hide these fields on the customer portal or make them non-editable, change your preferences as explained here.
Using the API to collect custom field data
For API users, if you have custom fields created in your Chargebee site, they will be listed in your API documentation as part of your input parameters. You need to be logged in to your Chargebee site to view the custom fields in the API documentation.
Adding custom field data through the web interface
When creating a new subscription or a customer using the web interface, the list of custom fields will be displayed in the creation page.
Once the data for the custom fields are captured and stored, they will appear on the customer details section within the subscription.
The custom fields created for your site will be available in the advanced filters section when you search or filter subscriptions.
Custom fields will also be available as mail merge fields and can be used in your email notification templates.