> ## Documentation Index
> Fetch the complete documentation index at: https://polar.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom Fields

> Learn how to add custom input fields to your checkout with Polar

By default, the Checkout form will only ask basic information from the customer to fulfill the order: a name, an email address, billing information, etc. But you might need more! A few examples:

* A checkbox asking the customer to accept your terms
* An opt-in newsletter consent
* A select menu to ask where they heard from you
* ...

With Polar, you can easily add such fields to your checkout using **Custom Fields**.

## Create Custom Fields

Custom Fields are managed at an organization's level. To create them, go to **Settings** and **Custom Fields**. You'll see the list of all the available fields on your organization.

<img className="block dark:hidden" src="https://mintcdn.com/polar/Ut0vPUvE1pIdMcH2/assets/features/custom-fields/custom_fields.light.png?fit=max&auto=format&n=Ut0vPUvE1pIdMcH2&q=85&s=9336e8c093e8554f3c876539b0a04dfc" width="3840" height="2400" data-path="assets/features/custom-fields/custom_fields.light.png" />

<img className="hidden dark:block" src="https://mintcdn.com/polar/Ut0vPUvE1pIdMcH2/assets/features/custom-fields/custom_fields.dark.png?fit=max&auto=format&n=Ut0vPUvE1pIdMcH2&q=85&s=5ef991dece22a9936a56ba80ff2b7f0b" width="3840" height="2400" data-path="assets/features/custom-fields/custom_fields.dark.png" />

Click on **New Custom Field** to create a new one.

### Type

The type of the field is the most important thing to select. It determines what type of input will be displayed to the customer during checkout.

The type can't be changed after the field is created.

We support five types of fields:

#### Text

This will display a simple text field to input textual data. By default, it'll render a simple input field but you can render a **textarea** by toggling the option under `Form input options`.

Under `Validation constraints`, you can add minimum and maximum length validation.

Underneath, the data will be stored as a string.

#### Number

This will display a number input field. Under `Validation constraints`, you can add minimum and maximum validation.

Underneath, the data will be stored as a number.

#### Date

This will display a date input field. Under `Validation constraints`, you can add minimum and maximum validation.

Underneath, the data will be stored as a string using the ISO 8601 format.

#### Checkbox

This will display a checkbox field.

Underneath, the data will be stored as a boolean (`true` or `false`).

#### Select

This will display a select field with a predefined set of options. Each option is a pair of `Value` and `Label`, the first one being the value that'll be stored underneath and the latter the one that will be shown to the customer.

### Slug and name

The slug determines the key that'll be used to store the data inside objects related to the checkout, like Orders and Subscriptions. It must be unique across your organization. You can change it afterwards, we'll automatically update the data to reflect the new slug.

The name is what we'll be displayed to you to recognize the field across your dashboard. By default, it'll also be the label of the field displayed to the customer, unless you customize it under `Form input options`.

<img className="block dark:hidden" src="https://mintcdn.com/polar/Ut0vPUvE1pIdMcH2/assets/features/custom-fields/create_custom_field.light.png?fit=max&auto=format&n=Ut0vPUvE1pIdMcH2&q=85&s=6f8ed2dbf246c197d69eabc7b21f0c11" width="1620" height="2334" data-path="assets/features/custom-fields/create_custom_field.light.png" />

<img className="hidden dark:block" src="https://mintcdn.com/polar/Ut0vPUvE1pIdMcH2/assets/features/custom-fields/create_custom_field.dark.png?fit=max&auto=format&n=Ut0vPUvE1pIdMcH2&q=85&s=7b328aefe3e549d8f5b3239ed4ab6c8a" width="1620" height="2334" data-path="assets/features/custom-fields/create_custom_field.dark.png" />

### Form input options

Those options allow you to customize how the field is displayed to the customer. You can set:

* The label, displayed above the field
* The help text, displayed below the field
* The placeholder, displayed inside the field when there is no value

The label and help text supports basic Markdown syntax, so you can add bold, italic or even links.

<img className="block dark:hidden" src="https://mintcdn.com/polar/Ut0vPUvE1pIdMcH2/assets/features/custom-fields/label_markdown.light.png?fit=max&auto=format&n=Ut0vPUvE1pIdMcH2&q=85&s=ab5165a85316c4f7fcf18a7a1fddc1ed" width="1383" height="132" data-path="assets/features/custom-fields/label_markdown.light.png" />

<img className="hidden dark:block" src="https://mintcdn.com/polar/Ut0vPUvE1pIdMcH2/assets/features/custom-fields/label_markdown.dark.png?fit=max&auto=format&n=Ut0vPUvE1pIdMcH2&q=85&s=37edbb93d8023a969f300f0c6ed64ec1" width="1383" height="132" data-path="assets/features/custom-fields/label_markdown.dark.png" />

## Add Custom Field to Checkout

Custom Fields are enabled on Checkout specifically on each **product**. While [creating or updating](/features/products) a product, you can select the custom fields you want to include in the checkout for this product.

<img className="block dark:hidden" src="https://mintcdn.com/polar/Ut0vPUvE1pIdMcH2/assets/features/custom-fields/add_custom_field.light.png?fit=max&auto=format&n=Ut0vPUvE1pIdMcH2&q=85&s=3e6f915cce570e5557be4840a8b3635f" width="3837" height="2400" data-path="assets/features/custom-fields/add_custom_field.light.png" />

<img className="hidden dark:block" src="https://mintcdn.com/polar/Ut0vPUvE1pIdMcH2/assets/features/custom-fields/add_custom_field.dark.png?fit=max&auto=format&n=Ut0vPUvE1pIdMcH2&q=85&s=112f8074ec995496251095ebd4df8357" width="3837" height="2400" data-path="assets/features/custom-fields/add_custom_field.dark.png" />

Note that you can make the field `Required`.

<Tip>
  If you make a **checkbox** field **required**, customers will have to check
  the box before submitting the checkout. Very useful for terms acceptance!
</Tip>

The fields are now added as part of the Checkout form for this product.

<img className="block dark:hidden" src="https://mintcdn.com/polar/Ut0vPUvE1pIdMcH2/assets/features/custom-fields/custom_fields_checkout.light.png?fit=max&auto=format&n=Ut0vPUvE1pIdMcH2&q=85&s=4e3f32d0f537cf0380c4a8a115202768" width="1866" height="4245" data-path="assets/features/custom-fields/custom_fields_checkout.light.png" />

<img className="hidden dark:block" src="https://mintcdn.com/polar/Ut0vPUvE1pIdMcH2/assets/features/custom-fields/custom_fields_checkout.dark.png?fit=max&auto=format&n=Ut0vPUvE1pIdMcH2&q=85&s=68bf181a740cd2112944ad02fac3cd19" width="1866" height="4245" data-path="assets/features/custom-fields/custom_fields_checkout.dark.png" />

## Read data

Once you have added Custom Fields to your organization, they'll be automatically displayed as a column in your `Sales` page, both on Orders and Subscriptions. From there, you'll be able to see the data input by the customer.

<img className="block dark:hidden" src="https://mintcdn.com/polar/Ut0vPUvE1pIdMcH2/assets/features/custom-fields/custom_field_data.light.png?fit=max&auto=format&n=Ut0vPUvE1pIdMcH2&q=85&s=775aed8bcca102fe3a9caf11e8206589" width="3840" height="2400" data-path="assets/features/custom-fields/custom_field_data.light.png" />

<img className="hidden dark:block" src="https://mintcdn.com/polar/Ut0vPUvE1pIdMcH2/assets/features/custom-fields/custom_field_data.dark.png?fit=max&auto=format&n=Ut0vPUvE1pIdMcH2&q=85&s=e519df0b07c7c4ce98f43d2db87d617d" width="3840" height="2400" data-path="assets/features/custom-fields/custom_field_data.dark.png" />

This data is also available from the [Orders](/api-reference/orders/get) and [Subscriptions](/api-reference/subscriptions/get) API, under the `custom_field_data` property. Each value is referenced by the **slug** of the field.

```json theme={null}
{
  // ...
  "custom_field_value": {
    "terms": true,
    "source": "social_media"
  }
}
```
