> For the complete documentation index, see [llms.txt](https://docs.kublau.com/kublau-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kublau.com/kublau-docs/guides/including-order-and-customer-data/resource-metafields.md).

# Resource metafields

Setting up new Metafields involves the following tasks:

1. Adding [Metafield definitions](#configuring-your-widget-for-embedding) to add fields for your specialized information.
2. [Adding Metafield values](/kublau-docs/guides/including-order-and-customer-data.md#using-custom-fields-with-metafields) as part of your API calls.

## **Adding metafield definitions**

Metafield definitions act as the schema that specify what values the metafield can have. Before you can add metafield values to specific trackers, orders, or other resources in Kublau, you need to add the metafield definition for that information. Adding metafield definitions ensures that the same validation rules apply to every value that you enter for a specific metafield.<br>

1. From your Kublau dashboard, go to **Settings** > **Custom fields**.
2. Click on create a new custom field.
   1. Provide the **key** that this metafield will be represented with. This key will be used in the API and in CSV/XLSX import/exports.
   2. Provide a **label** for the metafield. This will be used to display the field on the Kublau Dashboard.
   3. Provide a metafield **value type**.

## Metafield value types and values

Each type of metafield accepts a range of supported values for different use cases. Refer to the table below of value types for information about the following:

* supported values for each type of metafield
* example use cases for each type of metafield

| Value type   | Description                                                                                                                                                                      | Example                                                                               |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| DATE         | Supports date values in ISO 8601 format, without a time zone.                                                                                                                    | Add tracker expiration dates, order delivery dates, or customer birth dates.          |
| DATETIME     | Supports date values in ISO 8601 format and time values in UTC time.                                                                                                             | Add order creation time, event dates or any timestamp.                                |
| INTEGER      | <p>Supports integer values.</p><p></p><p>Integer values can be in the range of -4,611,686,018,427,387,904 to 4,611,686,018,427,387,903. </p>                                     | <p>An integer metafield might be used to add a priority count to an order.</p><p></p> |
| FLOAT        | <p>Supports decimal values.</p><p></p><p>Decimal values can be in the range of +/-9999999999999.999999999, with up to 13 digits before the decimal and up to 9 digits after.</p> | A decimal metafield might be used to add a weight for a product.                      |
| STRING       | Supports plain text in either single-line or multi-line. Multi-line values can include line breaks.                                                                              | Add shipping notes, store extra order fields, or include external IDs.                |
| BOOLEAN      | Supports boolean values of true or false.                                                                                                                                        | Add whether an order belongs to a specific group, mark a shipment for priority.       |
| JSON\_STRING | Supports raw JSON data for advanced use cases when you need a structured data source.                                                                                            | Add an array of multi-field objects related to your order.                            |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.kublau.com/kublau-docs/guides/including-order-and-customer-data/resource-metafields.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
