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

# Custom Fields Overview

> Collect additional customer data during checkout to identify users in your system.

Custom fields let you collect additional information from customers during checkout. This is essential for integrating Fungies with your application, especially for in-game purchases or user-specific products.

## Use Cases

Custom fields are commonly used to:

* **Identify players** - Collect a `playerId` or `username` to deliver in-game items
* **Server selection** - Let customers choose which game server to receive items on
* **Account linking** - Capture external account IDs to sync purchases with your system
* **Order customization** - Collect preferences or configuration options

## How It Works

```mermaid theme={null}
flowchart LR
    A["🛒 Checkout<br/>Customer enters playerId"] --> B["📤 Webhook<br/>customFields in payload"]
    B --> C["🎮 Your App<br/>Receives playerId"]
    
    style A fill:#e0f2fe
    style B fill:#fef3c7
    style C fill:#d1fae5
```

1. You define custom fields in the Fungies Dashboard
2. Customers fill in the fields during checkout
3. The data is included in webhook event payloads
4. Your application uses the data to fulfill the order

## Example Event Payload

When a customer completes a purchase, the custom field data is included under the `customFields` key:

```json theme={null}
{
  "id": "6f97c060-570d-46e8-81af-033539210df3",
  "data": {
    "items": [
      {
        "id": "a0bf335d-25b9-4eda-bf92-f45f7bd2ed18",
        "name": "Legendary Sword",
        "quantity": "1",
        "internalId": null,
        "customFields": {
          "playerId": "123",
          "serverName": "US-1"
        }
      },
      {
        "id": "adb745b7-b23a-4960-ab21-7f21b7312840",
        "name": "Legendary Shield",
        "quantity": "1",
        "internalId": null,
        "customFields": {
          "playerId": "123",
          "serverName": "US-1"
        }
      }
    ]
    // ...
}
```

## Key Concepts

<CardGroup cols={2}>
  <Card title="Project-Level Fields" icon="folder">
    Custom fields are defined at the project level and apply to all products in that project
  </Card>

  <Card title="Required by Default" icon="asterisk">
    All custom fields are required—customers must fill them out to complete checkout
  </Card>

  <Card title="Validation Support" icon="check">
    Fields can be validated with regex patterns or your own validation API
  </Card>

  <Card title="Multiple Field Types" icon="list">
    Support for text inputs and dropdown selections
  </Card>
</CardGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Set Up Custom Fields" icon="gear" href="/developers/customer-data/setup">
    Create custom fields in the Fungies Dashboard
  </Card>

  <Card title="Validate Customer Data" icon="shield-check" href="/developers/customer-data/validate">
    Add validation rules to ensure data quality
  </Card>
</CardGroup>
