Overview
Custom fields enable you to:- Collect specific data during checkout
- Store data with orders and customers
- Use data in webhooks and integrations
- Support various field types
Custom fields are defined at the organization level and can be attached to specific products.
Field Types
Polar supports multiple custom field types:Text
Single-line text input for short answers
Textarea
Multi-line text input for longer content
Number
Numeric input with validation
Date
Date picker for date selection
Checkbox
Boolean yes/no field
Select
Dropdown with predefined options
Creating Custom Fields
Field Configuration
Basic Properties
- name: Display name shown to customers
- slug: Unique identifier (alphanumeric with underscores)
- type: Field type (text, number, select, etc.)
- required: Whether the field must be filled
Custom Field Structure
Type-Specific Properties
Text Fields
Number Fields
Select Fields
Field Slugs
Slugs are unique identifiers used to reference field data:- Must be unique within your organization
- Can only contain lowercase letters, numbers, and underscores
- Used in API responses and webhooks
- Cannot be changed after field creation
Attaching to Products
Custom fields can be attached to specific products:When a customer checks out a product with attached custom fields, they’ll be prompted to fill them in.
Accessing Custom Field Data
In Orders
Custom field data is stored with orders:Order with Custom Fields
In Customers
Data is also attached to customer records:Customer with Custom Fields
Via API
Retrieve custom field data via the API:Updating Custom Fields
You can update most field properties: ✅ Can Update:- Name
- Required status
- Properties (options, min/max, etc.)
- Product attachments
- Type (text → number)
- Slug
Validation
Polar validates custom field input:- Required fields: Must have a value
- Type validation: Values must match the field type
- Property constraints: Min/max length, number ranges, etc.
- Select options: Value must be one of the defined options
Validation Error
Use Cases
B2B Information
Collect company name, size, and industry for B2B customers
Shipping Details
Gather delivery preferences and special instructions
Personalization
Collect preferences for product customization
Compliance
Gather required information for regulatory compliance
Webhooks
Custom field data is included in webhook payloads:order.created Webhook
Best Practices
Minimize Required Fields
Only require fields that are absolutely necessary to reduce checkout friction
Use Clear Labels
Make field names clear and specific to help customers understand what to enter
Provide Examples
Use placeholder text to show expected format
Validate Early
Use proper field types and constraints to prevent invalid data
Field Data Storage
Custom field data is stored as JSONB:- Efficient: Stored in a structured, queryable format
- Flexible: No schema changes needed for new fields
- Indexed: Fast lookups by field slug
Example Query
Deleting Custom Fields
When you delete a custom field:- Field marked deleted: Soft-deleted, not permanently removed
- Detached from products: No longer shown in checkout
- Data preserved: Existing field data in orders/customers remains
- API access: Can still retrieve old data via API
API Reference
Manage custom fields programmatically via the Polar API:POST /v1/custom-fields- Create custom fieldPATCH /v1/custom-fields/{id}- Update custom fieldGET /v1/custom-fields- List custom fieldsDELETE /v1/custom-fields/{id}- Delete custom field