Custom Fields Vs. Metadata
| Custom Fields | Metadata |
|---|---|
You can create up to 50 fields for each supported object. | Because metadata is stored as JSON, only one metadata object can be stored for each entity (customer, subscription, plan, and similar objects). You can store a large amount of data in that object. |
A maximum of 250 characters can be stored for string fields. | A maximum of 65K characters can be stored for metadata. |
You can filter for data using custom fields, and also export custom fields. This is available through the API only. | You can't filter with metadata as a criterion, or export it. However, you can retrieve metadata through the API. |
Data for custom fields can be added via the web interface, and can also be collected via Chargebee Checkout and the Customer Portal. | Metadata can only be added via the web interface or API. |
You can add custom fields to invoices and emails received by end customers. | You can't display metadata to end customers. |
Only a few field types are supported, such as string, number, date, and email. | You can store any data, but in valid JSON format. |
Validation will be carried out based on field configuration. | You need to handle all validation. |
Once updated, earlier values will not be retained. | You can retain old values as part of your metadata. |
Custom fields can be created for supported objects such as customers, subscriptions, invoices, credit notes, features, product families, plans, addons, price points, and coupons. Availability can vary by catalog configuration and enabled features. | You can have metadata for Customers, Subscriptions, Plans, Addons, Coupons. |
Can be used with both API and Hosted Page integrations. | Best when used via API. |
Data sent in webhooks. | Data sent in webhooks. |