Custom fields let you collect arbitrary structured data from customers at checkout — company names, VAT IDs, license seat counts, terms acceptance, and more. Define the fields once in Polar via theDocumentation Index
Fetch the complete documentation index at: https://danestvesllc-2b77d201.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
LaravelPolar facade, attach them to a checkout session, and read the captured values back from the resulting Order.
How it flows: Create field definition in Polar → attach slug-keyed data to a checkout session with
withCustomFieldData() → customer fills it in (or it’s pre-filled) → read it back from $order->customFieldData() after purchase.Field types
Polar supports five field types, each with its own create class:| Type | Class | Stores |
|---|---|---|
| Text | CustomFieldCreateText | Free-form string |
| Number | CustomFieldCreateNumber | Numeric value |
| Date | CustomFieldCreateDate | Date value |
| Checkbox | CustomFieldCreateCheckbox | Boolean (true/false) |
| Select | CustomFieldCreateSelect | One of N options |
Creating a custom field
Choose a field type and create the definition
Pass a create class to The same pattern works for all field types:
LaravelPolar::createCustomField(). The slug is a unique machine-readable identifier used to reference the field’s value later.Manage the definition over time
Use the management methods on the facade to keep your field definitions up to date:
Reading custom field data from an order
After a customer completes checkout, retrieve the captured field values from theOrder model:
customFieldData() fetches the data from Polar on demand — it is not stored in your local database. The result is memoized on the Order instance for the lifetime of the request, so calling the method multiple times in the same controller only hits the Polar API once.