When you [generate an app extension](/docs/api/shopify-cli/app/app-generate-extension), a TOML configuration file named `shopify.extension.toml` is automatically generated in your app's extension directory.
> Note:
> This guide describes the TOML file structure that only applies to [checkout UI](/docs/api/checkout-ui-extensions), [admin UI](/docs/api/admin-extensions), [customer account UI](/docs/api/customer-account-ui-extensions), [product configuration](/docs/apps/build/product-merchandising/bundles/product-configuration-extension/add-merchant-config-ui), [Shopify Flow triggers](/docs/apps/build/flow/triggers), [Shopify Flow actions](/docs/apps/build/flow/actions), and [Shopify Flow templates](/docs/apps/build/flow/templates) extensions.
>
> The TOML file structure for other extensions is described in the following topics:
>
> - [Post-purchase UI](/docs/api/checkout-extensions/post-purchase/configuration)
> - [Product subscription](/docs/apps/build/purchase-options/product-subscription-app-extensions/start-building)
> - [Shopify Functions](/docs/api/functions/latest#configuration)
> - [Shopify POS UI](/docs/api/pos-ui-extensions/getting-started)
> - [Theme app extensions](/docs/apps/build/online-store/theme-app-extensions/build)
> - [Web pixel](/docs/apps/build/marketing-analytics/build-web-pixels)
## How it works
[Shopify CLI](/docs/apps/build/cli-for-apps) builds and serves app extensions using information defined in a TOML file named `shopify.extension.toml`. The TOML file is located in a directory within the [`extensions/` directory](/docs/apps/build/cli-for-apps/app-structure#directory-structure) of your app project.
The following example shows a `shopify.extension.toml` file that contains configuration settings for a [checkout UI extension](/docs/api/checkout-ui-extensions).
```toml
api_version = "2023-04"
[[extensions]]
name = "My UI extension"
description = "A UI extension"
handle = "my-ui-extension"
type = "ui_extension"
[extensions.capabilities]
api_access = true
block_progress = true
network_access = true
[[extensions.targeting]]
module = "./src/CheckoutDynamicRender.js"
target = "purchase.checkout.block.render"
[[extensions.targeting.metafields]]
key = "my-key"
namespace = "my-namespace"
[settings]
[[settings.fields]]
key = "banner_title"
type = "single_line_text_field"
name = "Banner title"
description = "Enter a title for the banner"
```
## Extension types
Some extensions require specific configurations. To accommodate this, Shopify CLI groups extensions into different types in the TOML file:
| Extension |`type` value in the TOML file | `--template` flag value in the generate command |
| --- | --- | --- |
| [Checkout UI](/docs/api/checkout-ui-extensions) |`ui_extension` | `checkout_ui` |
| [Customer account UI](/docs/api/customer-account-ui-extensions) |`ui_extension` | `customer_account_ui` |
| [Editor extension collection](/docs/apps/build/customer-accounts/editor-extension-collections)
Developer preview |`editor_extension_collection` | `editor_extension_collection` |
| [Admin action](/docs/apps/build/admin/actions-blocks/build-admin-action) | `ui_extension` | `admin_action` |
| [Admin block](/docs/apps/build/admin/actions-blocks/build-admin-block) | `ui_extension` | `admin_block` |
| [Product configuration](/docs/apps/build/product-merchandising/bundles/product-configuration-extension/add-merchant-config-ui) | `ui_extension` | `product_configuration` |
| [Shopify Flow trigger](/docs/apps/build/flow/triggers) | `flow_trigger` | `flow_trigger` |
| [Shopify Flow action](/docs/apps/build/flow/actions) | `flow_action` | `flow_action` |
| [Shopify Flow template](/docs/apps/build/flow/templates) | `flow_template` | `flow_template` |
> Note:
> The `--template` flag value in the command to generate Shopify Functions extensions depends on the [Functions API](/docs/api/functions) that you're using.
## Targets
A target is an identifier in `shopify.extension.toml` that specifies where you're injecting code into Shopify APIs, or other parts of the Shopify platform.
Each target is composed of three to four namespaces. The name begins with a broad Shopify context and ends with the behavior of the extensible element. For example, a checkout UI extension that renders a shipping address form has a target named `purchase.checkout.delivery-address.render-before`:
- `purchase`: The broad Shopify context.
- `checkout`: The targeted page.
- `delivery-address`: The element that the extension will be positioned near.
- `render-before`: An action verb that describes the behavior of the extensible element.
### Supported targets
The following table provides links to documentation on the supported targets associated with each app extension type.
> Note:
> Shopify Flow triggers and actions don't support configurable targets.
| Extension type | Documentation on supported targets |
| --- | --- |
| Checkout UI | [Checkout UI targets](/docs/api/checkout-ui-extensions/current/targets) |
| Customer account UI | [Customer Account UI targets](/docs/api/customer-account-ui-extensions/targets) |
| Admin UI | [Admin UI targets](/docs/api/admin-extensions/extension-targets) |
| Product configuration | Product configuration app extensions use the [admin.product-details.configuration.render](/docs/api/admin-extensions/extension-targets#extensiontargets-propertydetail-adminproductdetailsconfigurationrender) or [admin.product-variant-details.configuration.render](/docs/api/admin-extensions/extension-targets#extensiontargets-propertydetail-adminproductvariantdetailsconfigurationrender) target. |
## Common properties
This section describes the configuration settings in `shopify.extension.toml` that are common to [checkout UI extensions](/docs/apps/build/checkout/technologies), [admin UI](/docs/api/admin-extensions), [product configuration](/docs/apps/build/product-merchandising/bundles/product-configuration-extension/add-merchant-config-ui), [Shopify Flow triggers](/docs/apps/build/flow/triggers), [Shopify Flow actions](/docs/apps/build/flow/actions), and [Shopify Flow templates](/docs/apps/build/flow/templates) extensions.
| Property | Description |
|---|---|
| `api_version`
Required | The version of the API that's being used for the extension. If provided in the `[[extensions]]` array, then the specified API version is used instead of the root level `api_version`. |
| `[[extensions]]`
Required | The name of the array that contains all extensions listed in the TOML file. Contains the following properties:
- `name`:Required The merchant-facing name of the extension. After you [generate an extension](/docs/api/shopify-cli/app/app-generate-extension), you're prompted to provide a name for your extension.
The `name` property is translatable if it starts with a `t:` and uses a key defined in your translation data. For example, you might have a `t:name` key that matches a translation key called `name`. [Learn more about localization](/docs/apps/build/checkout/localized-checkout-ui-extensions#how-it-works).
Limitations:- Supports any characters. Shopify Flow actions and Shopify Flow triggers extensions can only include alphanumeric characters and spaces.
- 5 characters minimum
- 30 characters maximum
- `description`:Required The merchant-facing description of the extension.
The `description` property is translatable if it starts with a `t:` and uses a key defined in your translation data. For example, `t:description` and you have a matching translation key called `description`. [Learn more about localization](/docs/apps/build/checkout/localized-checkout-ui-extensions#how-it-works). - `handle`:Required The unique internal identifier for the extension.
After you create a draft version of the extension, or deploy an extension, you can't change the `handle` value.
If not specified, the `handle` value is automatically populated using a transformed `name` value that removes any unsupported characters. For example, if you enter `google maps` as the extension name, then Shopify populates the `handle` value as `google-maps`.
Limitations:- Allowed characters: `a-z`, `A-Z`, `0-9`, `-`
- 100 characters maximum
- Must be unique within the app
- `type`:Required The extension type. For more information, refer to [Extension types](#extension-types).
|
| `[settings]`
Optional | The name of the array that defines settings that a merchant can set values for. If provided in the `[[extensions]]` array, then the specified settings are used instead of the root level `settings`. |
| `[[settings.fields]]`
Optional | The name of the array that contains the [settings fields](/docs/api/checkout-ui-extensions/latest/configuration#settings-definition). |
| `[[extensions.targeting]]`
Required | The name of the array that contains a target and path to the related extension code. Contains the following required properties:
- `target`:Required An identifier that specifies where you're injecting code into Shopify APIs, or other parts of the Shopify platform. For more information, refer to [Targets](#targets).
- `module`:Required The file that contains the extension code.
|
## Extension-specific properties
This section describes the configuration settings in `shopify.extension.toml` that are specific to the following extensions:
- [Checkout UI extensions](#checkout-ui-extensions)
- [Customer account UI extensions](#customer-account-ui-extensions)
- [Editor extension collection](#editor-extension-collection)
- [Admin UI extensions](#admin-ui-extensions)
- [Product configuration extensions](#product-configuration-extensions)
- [Shopify Flow actions](#shopify-flow-actions)
- [Shopify Flow triggers](#shopify-flow-triggers)
- [Shopify Flow templates](#shopify-flow-templates)
### Checkout UI extensions
The following example TOML file contains configuration settings for a [checkout UI extension](/docs/api/checkout-ui-extensions):
```toml
api_version = "2023-04"
[[extensions]]
name = "My UI extension"
description = "A UI extension"
handle = "my-ui-extension"
type = "ui_extension"
[extensions.capabilities]
api_access = true
block_progress = true
network_access = true
[[extensions.targeting]]
module = "./src/CheckoutDynamicRender.js"
target = "purchase.checkout.block.render"
default_placement = "WALLETS1"
[[extensions.targeting.metafields]]
key = "my-key"
namespace = "my-namespace"
[settings]
[[settings.fields]]
key = "banner_title"
type = "single_line_text_field"
name = "Banner title"
description = "Enter a title for the banner"
```
The following table describes the properties in the TOML file that are specific to checkout UI extensions:
| Property | Description |
|---|---|
| `[extensions.capabilities]`
Optional | The name of the array that contains the checkout UI extension's capabilities:- `api_access`:Optional Whether your app extension can [query the Storefront API](/docs/api/checkout-ui-extensions/latest/configuration#api-access).
- `block_progress`:Optional Whether your app extension can [block the customer's progress](/docs/api/checkout-ui-extensions/latest/configuration#block-progress).
- `network_access`:Optional Whether your app extension can make [external network calls](/docs/api/checkout-ui-extensions/latest/configuration#network-access).
|
| `[extensions.metafields]`
Optional | An array that sets the default for each `[[extensions.targeting.metafields]]`, if `[[extensions.targeting.metafields]]` isn't specified. |
| `[[extensions.targeting.metafields]]`
Optional | The [metafields](/docs/api/checkout-ui-extensions/latest/targets/block/purchase-thank-you-block-render#standardapi-propertydetail-metafields) that your extension target needs to read:- `key`:Optional The name for the metafield.
- `namespace`:Optional A container for a group of metafields. Grouping metafields within a namespace prevents your metafields from conflicting with other metafields with the same key name.
You can specify up to five `key` and `namespace` pairs in the configuration file. When the extension is executed, Shopify looks for the metafields in each resource and returns their contents. |
| `[[extensions.targeting.default_placement]]`
Optional | Defines which location of a block extension target an extension is placed in when added. After adding the extension, the merchant can move it to other locations. Value must be a checkout [block extension target](/docs/apps/build/checkout/test-checkout-ui-extensions#block-extension targets). |
### Customer account UI extensions
The following example TOML files contain configuration settings for [a static and a full page extension](/docs/api/customer-account-ui-extensions/extension-targets-overview). The properties in the TOML files are similar to [checkout UI extensions](#checkout-ui-extensions):
```toml
api_version = "2023-07"
[[extensions]]
type = "ui_extension"
name = "customer-account-ui"
handle = "customer-account-ui"
[[extensions.targeting]]
module = "./src/CustomerAccountOrderIndexExtension.tsx"
target = "customer-account.order-index.block.render"
default_placement = "ORDER_INDEX"
[[extensions.targeting]]
module = "./src/CustomerAccountExtensionFullPage.tsx"
target = "customer-account.page.render"
```
The following table describes the properties in the TOML file that are specific to customer account UI extensions:
| Property | Description |
|---|---|
| `[extensions.capabilities]`
Optional | The name of the array that contains the checkout UI extension's capabilities:- `api_access`: Whether your app extension can [query the Storefront API](/docs/api/customer-account-ui-extensions/configuration#api-access).
- `network_access`: Whether your app extension can make [external network calls](/docs/api/customer-account-ui-extensions/configuration#network-access).
|
| `[extensions.metafields]`
Optional| An array that sets the default for each `[[extensions.targeting.metafields]]`, if `[[extensions.targeting.metafields]]` isn't specified. |
| `[[extensions.targeting.metafields]]`
Optional | The [metafields](/docs/api/customer-account-ui-extensions/latest/targets/order-status/customer-account-order-status-block-render#orderstatusapi-propertydetail-metafields) that your extension target needs to read:- `key`: The name for the metafield.
- `namespace`: A container for a group of metafields. Grouping metafields within a namespace prevents your metafields from conflicting with other metafields with the same key name.
You can specify up to five `key` and `namespace` pairs in the configuration file. When the extension is executed, Shopify looks for the metafields in each resource and returns their contents. |
| `[[extensions.targeting.default_placement]]`
Optional | Defines which location of a block extension target an extension is placed in when added. After adding the extension, the merchant can move it to other locations. Value must be one of the [customer account placements](/docs/apps/build/customer-accounts/extension-placement#define-default-placement) for the block extension target.|
### Editor extension collection
The following example TOML files contain configuration settings for an [editor extension collection](/docs/apps/build/customer-accounts/editor-extension-collections):
```toml
[[extensions]]
name = "t:collection_name"
type = "editor_extension_collection"
handle = "editor-extension-collection"
includes=["customer-account-ui", "checkout-ui-extension"]
```
The following table describes the properties in the TOML file that are specific to editor extension collections:
| Property | Required? | Description |
|---|---|---|
| `[extensions.includes]` | Yes | An array that sets the supported extensions that belong in the editor extension collection.
Limitations:- Currently, can only contain customer account UI and checkout UI extensions.
- Must contain two or more extensions.
|
### Admin UI extensions
The following example TOML files contain configuration settings for [an action and a block extension](/docs/apps/build/admin/actions-blocks). The properties in the TOML files are similar to [checkout UI extensions](#checkout-ui-extensions):
```toml
api_version = "2023-04"
[[extensions]]
name = "My feature"
handle = "action-extension"
type = "ui_extension"
[[extensions.targeting]]
module = "actionExtension.jsx"
target = "admin.product.item.action.render"
```
```toml
api_version = "2023-04"
[[extensions]]
name = "My block extension"
handle = "block-extension"
type = "ui_extension"
[[extensions.targeting]]
module = "blockExtension.jsx"
target = "admin.product.item.block.render"
```
### Product configuration extensions
The following example TOML file contains configuration settings for a [product configuration extension](/docs/apps/build/product-merchandising/bundles/product-configuration-extension/add-merchant-config-ui). The properties in the TOML file are similar to a [checkout UI extension](#checkout-ui-extensions):
```toml
api_version = "2023-07"
[[extensions]]
name = "My product config extension"
handle = "my-product-config-extension"
type = "ui_extension"
[[extensions.targeting]]
module = "./src/ProductDetailsConfigurationExtension.tsx"
target = "admin.product-details.configuration.render"
[[extensions.targeting]]
module = "./src/ProductVariantDetailsConfigurationExtension.tsx"
target = "admin.product-variant-details.configuration.render"
```
### Shopify Flow actions
The following example TOML file contains configuration settings for a [Shopify Flow action](/docs/apps/build/flow/actions):
```toml
[[extensions]]
name = "Send email action"
description = "Send an email to a customer."
handle = "send-email-action"
type = "flow_action"
runtime_url = "https://runtime-endpoint.com"
schema = "./schema.graphql"
return_type_ref = "EmailDelivered"
validation_url = "https://validation-url"
config_page_url = "https://url.com/config"
config_page_preview_url = "https://url.com/config/preview"
[settings]
[[settings.fields]]
description = "The email address to send to"
key = "email_address"
name = "Email address"
type = "single_line_text_field"
required = true
[[settings.fields]]
description = "The subject of the email"
key = "subject"
name = "Subject"
type = "single_line_text_field"
required = true
[[settings.fields]]
description = "The body of the email"
key = "body"
name = "Body"
type = "multi_line_text_field"
required = true
```
The following table describes the properties in the TOML file that are specific to a Shopify Flow action:
| Property | Description |
|---|---|
| `[[extensions]]`
Required | The name of the array that contains all extensions listed in the TOML file. Contains the following properties:
- `runtime_url`:Required The endpoint where Flow sends your action's payload when your step is being executed at runtime. [The payload](/docs/apps/build/flow/actions/endpoints#flow-action-execution) contains data that you can use to execute the action in your app.
- `validation_url`:Optional [An endpoint](/docs/apps/build/flow/actions/endpoints#custom-validation) that validates the contents of custom properties in an action payload when an action is saved. This endpoint is only required if you want to use a [custom configuration page](/docs/apps/build/flow/actions/build-config-ui).
- `schema`:Optional A relative path to a GraphQL schema definition file that contains custom types that you can use as part of your action. Only required if `return_type_ref` is also present.
- `return_type_ref`:Optional The name of the type to be returned by the action. This type must be present in the referenced schema file. Only required if `schema` is also present.
- `config_page_url`:Optional A route that renders your [custom configuration page](/docs/apps/build/flow/actions/build-config-ui).
- `config_page_preview_url`:Optional [An endpoint](/docs/apps/build/flow/actions/endpoints#custom-configuration-page-preview) that provides data about your custom configuration page to display in the automation tool. This endpoint is only required if you want to use a [custom configuration page](/docs/apps/build/flow/actions/build-config-ui).
|
| `[[settings.fields]]`
Required | The name of the array that contains the settings fields. Contains the following property:
- `required`:Required Specifies whether a field is required (`true`) or optional (`false`).
|
### Shopify Flow triggers
The following example TOML file contains configuration settings for a [Shopify Flow trigger](/docs/apps/build/flow/triggers). The properties in the TOML file are similar to a [Shopify Flow action](#shopify-flow-actions):
```toml
[[extensions]]
name = "Shopify Email sent"
description = "Triggered when an email is sent from Shopify"
handle = "shopify-email-sent"
type = "flow_trigger"
[settings]
[[settings.fields]]
description = "The customer who received the email."
key = "customer_id"
name = "Customer ID"
type = "customer_reference"
[[settings.fields]]
description = "The marketing campaign ID."
key = "campaign_id"
name = "Campaign ID"
type = "single_line_text_field"
```
### Shopify Flow templates
The following example TOML file contains configuration settings for a [Shopify Flow template](/docs/apps/build/flow/templates).
```toml
[[extensions]]
name = "t:name"
type = "flow_template"
handle = "example-name"
description = "t:description"
[extensions.template]
categories = ["orders", "risk"]
module = "./template.flow"
require_app = false
discoverable = true
enabled = true
```
The following table describes the properties in the TOML file that are specific to a Shopify Flow template:
| Property | Description |
|---|---|
| `[extensions.template]`
Required | Settings related to the template. Contains the following properties:
- `categories`:Required The categories that best describe the function of your template. Must be an array containing only strings of valid categories. Must choose at least one category. Max 2 recommended. Valid categories are: `buyer_experience`, `customers`, `inventory_and_merch`, `loyalty`, `orders`, `promotions`, `risk`, `fulfillment`, `b2b`, `payment_reminders`, `custom_data`, and `error_monitoring`.
- `module`:Required The file path of the template workflow in the extension's folder.
- `require_app`:Optional Whether your template is visible only to merchants who have your app installed. Defaults to `false` if not provided.
- `discoverable`:Optional Whether your template should be displayed in the template browser. When `false`, the template is accessible only through a deep link. Defaults to `true` if not provided.
- `enabled`:Optional Whether your template should be made available after being approved and released. Defaults to `true` if not provided.
|
## Differences in TOML file names
TOML file names can differ, depending on when you generated an extension:
- If you generated an extension before July 26, 2023, then your TOML file maps to one of the following names:
- **Checkout UI**: `shopify.ui.extension.toml`
- **Bundles UI extension**: `shopify.ui.extension.toml` (maps to a [product configuration extension](/docs/apps/build/product-merchandising/bundles/product-configuration-extension/add-merchant-config-ui))
- **Post-purchase UI**: `shopify.ui.extension.toml`
- **Product subscription**: `shopify.ui.extension.toml`
- **Web pixel**: `shopify.ui.extension.toml`
- **Shopify POS UI**: `shopify.ui.extension.toml`
- **Theme app extensions**: `shopify.theme.extension.toml`
- If you generated an extension after July 26, 2023, then the TOML file is named `shopify.extension.toml`.