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/add-merchant-config-ui), [Shopify Flow triggers](/docs/apps/build/flow/triggers), [Shopify Flow actions](/docs/apps/build/flow/actions), [Shopify Flow templates](/docs/apps/build/flow/templates), and [Shopify Functions](/docs/apps/build/functions) extensions.
>
> The TOML file structure for other extensions follow a different pattern:
>
> - [Post-purchase UI](/docs/api/checkout-extensions/post-purchase/configuration)
> - [Product subscription](/docs/apps/build/purchase-options/product-subscription-app-extensions/start-building)
> - [Web pixel](/docs/apps/build/marketing-analytics/build-web-pixels)
> - [Shopify POS UI](/docs/api/pos-ui-extensions/getting-started)
> - [Theme app extensions](/docs/apps/build/online-store/theme-app-extensions/build)
## 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).
## 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/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` |
| [Order discount](/docs/api/functions/reference/order-discounts) | `function` | `order_discounts` |
| [Product discount](/docs/api/functions/reference/product-discounts) | `function` | `product_discounts` |
| [Shipping discount](/docs/api/functions/reference/shipping-discounts)
Developer preview | `function` | `shipping_discounts` |
| [Discounts allocator](/docs/api/functions/reference/discounts-allocator)
Developer preview | `function` | `discounts_allocator` |
| [Delivery customization](/docs/api/functions/reference/delivery-customization) | `function` | `delivery_customization` |
| [Payment customization](/docs/api/functions/reference/payment-customization) | `function` | `payment_customization` |
| [Order routing location rule](/docs/api/functions/reference/order-routing-location-rule)
Beta | `function` | `order_routing_location_rule` |
| [Cart and checkout validation](/docs/api/functions/reference/cart-checkout-validation) | `function` |`cart_checkout_validation` |
| [Cart transform](/docs/api/functions/reference/cart-transform) | `function` | `cart_transform` |
| [Fulfillment constraints](/docs/api/functions/reference/fulfillment-constraints) | `function` | `fulfillment_constraints` |
## 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. |
| Shopify Functions | [Shopify function APIs and targets](/docs/api/functions#available-apis)
The available targets depend on the Function APIs that you're using. |
## 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/add-merchant-config-ui), [Shopify Flow triggers](/docs/apps/build/flow/triggers), [Shopify Flow actions](/docs/apps/build/flow/actions), [Shopify Flow templates](/docs/apps/build/flow/templates), and [Shopify Functions](/docs/apps/build/functions) 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)
- [Shopify Functions extensions](#shopify-functions-extensions)
### Checkout UI extensions
The following example TOML file contains configuration settings for a [checkout UI extension](/docs/api/checkout-ui-extensions):
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 one of the [checkout placements](/docs/apps/build/checkout/test-checkout-ui-extensions#block-targets) for the block extension target.
|
### 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):
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):
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):
### Product configuration extensions
The following example TOML file contains configuration settings for a [product configuration extension](/docs/apps/build/product-merchandising/bundles/add-merchant-config-ui). The properties in the TOML file are similar to a [checkout UI extension](#checkout-ui-extensions):
### Shopify Flow actions
The following example TOML file contains configuration settings for a [Shopify Flow action](/docs/apps/build/flow/actions):
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):
### Shopify Flow templates
The following example TOML file contains configuration settings for a [Shopify Flow template](/docs/apps/build/flow/templates).
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.
|
### Shopify Functions extensions
The following example TOML file contains configuration settings for a [Shopify Function extension](/docs/apps/build/functions):
The following table describes the properties in the TOML file that are specific to a Shopify Function extension:
| Property | Description |
|---|---|
| `[[extensions.targeting]]`
Required | The name of the array that contains a target and its associated WebAssembly module export. Contains the following properties:
- `target`:Required An identifier that specifies where you're injecting code into the Shopify backend. Refer to the [Function API references](/docs/api/functions) for available function targets.
- `input_query`:Optional The path to the [input query](/docs/apps/build/functions/input-output#input) file for the target. If omitted, then the function receives no input.
- `export`:Optional The name of the [WebAssembly](/docs/apps/build/functions/programming-languages/webassembly-for-functions) export in your module that executes for the target. Functions don't use the `extensions.targeting.module` setting. Use `export` instead. Defaults to `_start`.
|
| `[extensions.build]`
Optional | The settings related to the build and deployment of the function extension's WebAssembly module. Contains the following properties:
- `command`:Optional The command to build the function, which is invoked by the Shopify CLI [`build` command](/docs/api/shopify-cli/app/app-build).
- `path`:Optional The relative path to the function's [WebAssembly](/docs/apps/build/functions/programming-languages/webassembly-for-functions) module. For example, `build/my-module.wasm`. Defaults to `dist/index.wasm`.
- `watch`:Optional The relative paths that Shopify CLI should watch when the [`dev` command](/docs/api/shopify-cli/app/app-dev) is invoked. Changes to matched files trigger a build of the function and update it in your application drafts. This setting accepts a single file path or glob pattern, or an array of file paths and glob patterns.
For JavaScript and TypeScript functions, this setting defaults to `['src/**/*.js', 'src/**/*.ts']`..
Only paths inside the function directory are allowed (no "../").
[Input queries](/docs/apps/build/functions/input-output/metafields-for-input-queries) are automatically included in watch paths and don't need to be configured in `build.watch`. - `wasm_opt`:Optional Whether to optimize your module before upload. Defaults to `true`.
|
| `[extensions.ui]`
Optional | The settings related to the [merchant interface](/docs/apps/build/functions/input-output/metafields-for-input-queries#creating-your-merchant-interface) for your function. Contains the following properties:
- `handle`: Optional Learn how to [create your function merchant interface](/docs/apps/build/functions/input-output/metafields-for-input-queries#creating-your-merchant-interface).
- `enable_create`:Optional Learn how to [configure creation workflows for function owners](/docs/apps/build/functions/input-output/metafields-for-input-queries#configuring-creation-workflows-for-function-owners).
|
| `[extensions.ui.paths]`
Optional | The settings related to the App Bridge paths of the [merchant interface](/docs/apps/build/functions/input-output/metafields-for-input-queries#creating-your-merchant-interface) for your function. Contains the following properties:
- `create`:Optional Refer to [create your function merchant interface](/docs/apps/build/functions/input-output/metafields-for-input-queries#creating-your-merchant-interface).
- `details`:Optional Refer to [create your function merchant interface](/docs/apps/build/functions/input-output/metafields-for-input-queries#creating-your-merchant-interface).
|
| `[extensions.input.variables]`
Optional | The [variables to use in your input query](/docs/apps/build/functions/input-output/use-variables-input-queries). Contains the following properties:
- `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.
|
## 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/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`
- **Shopify Functions**: `shopify.function.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`.