# Block Extension API This API is available to all block extension types. Refer to the [tutorial](/docs/apps/admin/admin-actions-and-blocks/build-an-admin-block) for more information. ## BlockExtensionApi ### BlockExtensionApi ### auth Provides methods for authenticating calls to an app backend. ### data Information about the currently viewed or selected items. ### extension The identifier of the running extension target. ### i18n Utilities for translating content according to the current localization of the admin. More info - /docs/apps/checkout/best-practices/localizing-ui-extensions ### intents Provides information to the receiver the of an intent. ### navigation Provides methods to navigate to other features in the Admin. Currently, only navigation from an admin block to an admin action extension *on the same resource page* is supported. For example, you can navigate from an admin block on the product details page (`admin.product-details.block.render`) to an admin action on the product details page (`admin.product-details.action.render`). ### query Used to query the Admin GraphQL API ### resourcePicker Renders the [Resource Picker](/docs/api/app-bridge-library/apis/resource-picker), allowing users to select a resource for the extension to use as part of its flow. ### Auth ### idToken Retrieves a Shopify OpenID Connect ID token for the current user. ### Data ### selected Information about the currently viewed or selected items. ### ExtensionTarget keyof ExtensionTargets ### ExtensionTargets ### admin.abandoned-checkout-details.action.render Renders an admin action extension in the abandoned checkout page. Open this extension from the "More Actions" menu. See the [list of available components](/docs/api/admin-extensions/components). ### admin.abandoned-checkout-details.block.render Renders an admin block in the abandoned checkout details page. See the [list of available components](/docs/api/admin-extensions/components). ### admin.catalog-details.action.render Renders an admin action extension in the catalog details page. Open this extension from the "More Actions" menu. See the [list of available components](/docs/api/admin-extensions/components). ### admin.catalog-details.block.render Renders an admin block in the catalog details page. See the [list of available components](/docs/api/admin-extensions/components). ### admin.collection-details.action.render Renders an admin action extension in the collection details page. Open this extension from the "More Actions" menu. See the [list of available components](/docs/api/admin-extensions/components). ### admin.collection-details.block.render Renders an admin block in the collection details page. See the [list of available components](/docs/api/admin-extensions/components). ### admin.collection-index.action.render Renders an admin action extension in the collection index page. Open this extension from the "More Actions" menu. See the [list of available components](/docs/api/admin-extensions/components). ### admin.company-details.action.render Renders an admin action extension in the company details page. Open this extension from the "More Actions" menu. See the [list of available components](/docs/api/admin-extensions/components). ### admin.company-details.block.render Renders an admin block in the company details page. See the [list of available components](/docs/api/admin-extensions/components). ### admin.company-location-details.block.render Renders an admin block in the company location details page. See the [list of available components](/docs/api/admin-extensions/components). ### admin.customer-details.action.render Renders an admin action extension in the customer details page. Open this extension from the "More Actions" menu. See the [list of available components](/docs/api/admin-extensions/components). ### admin.customer-details.block.render Renders an admin block in the customer details page. See the [list of available components](/docs/api/admin-extensions/components). ### admin.customer-index.action.render Renders an admin action extension in the customer index page. Open this extension from the "More Actions" menu. See the [list of available components](/docs/api/admin-extensions/components). ### admin.customer-index.selection-action.render Renders an admin action extension in the customer index page when multiple resources are selected. Open this extension from the "More Actions" menu of the resource list. The resource ids are available to this extension at runtime. See the [list of available components](/docs/api/admin-extensions/components). ### admin.customer-segment-details.action.render Renders an admin action extension in the customer segment details page. Open this extension from the "Use segment" button. See the [list of available components](/docs/api/admin-extensions/components). ### admin.customers.segmentation-templates.render Renders a [`CustomerSegmentTemplate`](/docs/api/admin-extensions/components/customersegmenttemplate) in the [customer segment editor](https://help.shopify.com/en/manual/customers/customer-segmentation/customer-segments). ### admin.discount-details.action.render Renders an admin action extension in the discount details page. Open this extension from the "More Actions" menu. See the [list of available components](/docs/api/admin-extensions/components). ### admin.discount-index.action.render Renders an admin action extension in the discount index page. Open this extension from the "More Actions" menu. See the [list of available components](/docs/api/admin-extensions/components). ### admin.draft-order-details.action.render Renders an admin action extension in the draft order details page. Open this extension from the "More Actions" menu. See the [list of available components](/docs/api/admin-extensions/components). ### admin.draft-order-details.block.render Renders an admin block in the draft order details page. See the [list of available components](/docs/api/admin-extensions/components). ### admin.draft-order-index.action.render Renders an admin action extension in the draft orders page. Open this extension from the "More Actions" menu. See the [list of available components](/docs/api/admin-extensions/components). ### admin.draft-order-index.selection-action.render Renders an admin action extension in the draft order page when multiple resources are selected. Open this extension from the "3-dot" menu. See the [list of available components](/docs/api/admin-extensions/components). ### admin.gift-card-details.action.render Renders an admin action extension in the gift card details page. Open this extension from the "More Actions" menu. See the [list of available components](/docs/api/admin-extensions/components). ### admin.gift-card-details.block.render Renders an admin block in the gift card details page. See the [list of available components](/docs/api/admin-extensions/components). ### admin.order-details.action.render Renders an admin action extension in the order details page. Open this extension from the "More Actions" menu. See the [list of available components](/docs/api/admin-extensions/components). ### admin.order-details.block.render Renders an admin block in the order details page. See the [list of available components](/docs/api/admin-extensions/components). ### admin.order-details.print-action.render Renders an admin print action extension in the order index page when multiple resources are selected. Open this extension from the "Print" menu of the resource list. The resource ids are available to this extension at runtime. See the [list of available components](/docs/api/admin-extensions/components). ### admin.order-fulfilled-card.action.render Renders an admin action extension in the order fulfilled card. Open this extension from the "3-dot" menu inside the order fulfilled card. Note: This extension will only be visible on orders which were fulfilled by your app. See the [list of available components](/docs/api/admin-extensions/components). ### admin.order-index.action.render Renders an admin action extension in the order index page. Open this extension from the "More Actions" menu. See the [list of available components](/docs/api/admin-extensions/components). ### admin.order-index.selection-action.render Renders an admin action extension in the order index page when multiple resources are selected. Open this extension from the "More Actions" menu of the resource list. The resource ids are available to this extension at runtime. See the [list of available components](/docs/api/admin-extensions/components). ### admin.order-index.selection-print-action.render Renders an admin print action extension in the order index page when multiple resources are selected. Open this extension from the "Print" menu of the resource list. The resource ids are available to this extension at runtime. See the [list of available components](/docs/api/admin-extensions/components). ### admin.product-details.action.render Renders an admin action extension in the product details page. Open this extension from the "More Actions" menu. See the [list of available components](/docs/api/admin-extensions/components). ### admin.product-details.block.render Renders an admin block in the product details page. See the [list of available components](/docs/api/admin-extensions/components). ### admin.product-details.configuration.render Renders Product Configuration on product details and product variant details See the [tutorial](/docs/apps/selling-strategies/bundles/product-config) for more information ### admin.product-details.print-action.render Renders an admin print action extension in the product index page when multiple resources are selected. Open this extension from the "Print" menu of the resource list. The resource ids are available to this extension at runtime. See the [list of available components](/docs/api/admin-extensions/components). ### admin.product-details.reorder.render Renders an admin block in the product details page. See the [list of available components](/docs/api/admin-extensions/components). ### admin.product-index.action.render Renders an admin action extension in the product index page. Open this extension from the "More Actions" menu. See the [list of available components](/docs/api/admin-extensions/components). ### admin.product-index.selection-action.render Renders an admin action extension in the product index page when multiple resources are selected. Open this extension from the "More Actions" menu of the resource list. The resource ids are available to this extension at runtime. See the [list of available components](/docs/api/admin-extensions/components). ### admin.product-index.selection-print-action.render Renders an admin print action extension in the product index page when multiple resources are selected. Open this extension from the "Print" menu of the resource list. The resource ids are available to this extension at runtime. See the [list of available components](/docs/api/admin-extensions/components). ### admin.product-variant-details.action.render Renders an admin action extension in the product variant details page. Open this extension from the "More Actions" menu. See the [list of available components](/docs/api/admin-extensions/components). ### admin.product-variant-details.block.render Renders an admin block in the product variant details page. See the [list of available components](/docs/api/admin-extensions/components). ### admin.product-variant-details.configuration.render Renders Product Configuration on product details and product variant details See the [tutorial](/docs/apps/selling-strategies/bundles/product-config) for more information ### admin.settings.internal-order-routing-rule.render Renders Order Routing Rule Configuration on order routing settings. See the [list of available components](/docs/api/admin-extensions/components). ### admin.settings.order-routing-rule.render ### admin.settings.validation.render Renders Validation Settings within a given validation's add and edit views. See the [list of available components](/docs/api/admin-extensions/components). ### Playground ### RenderExtension export interface RenderExtension< Api, AllowedComponents extends RemoteComponentType< string, any, any > = RemoteComponentType, > { ( connection: RenderExtensionConnection, api: Api, ): void | Promise; } ### ActionExtensionApi ### auth Provides methods for authenticating calls to an app backend. ### close Closes the extension. Calling this method is equivalent to the merchant clicking the "x" in the corner of the overlay. ### data Information about the currently viewed or selected items. ### extension The identifier of the running extension target. ### i18n Utilities for translating content according to the current localization of the admin. More info - /docs/apps/checkout/best-practices/localizing-ui-extensions ### intents Provides information to the receiver the of an intent. ### query Used to query the Admin GraphQL API ### I18n ### formatCurrency Returns a localized currency value. This function behaves like the standard `Intl.NumberFormat()` with a style of `currency` applied. It uses the buyer's locale by default. ### formatDate Returns a localized date value. This function behaves like the standard `Intl.DateTimeFormatOptions()` and uses the buyer's locale by default. Formatting options can be passed in as options. ### formatNumber Returns a localized number. This function behaves like the standard `Intl.NumberFormat()` with a style of `decimal` applied. It uses the buyer's locale by default. ### translate Returns translated content in the buyer's locale, as supported by the extension. - `options.count` is a special numeric value used in pluralization. - The other option keys and values are treated as replacements for interpolation. - If the replacements are all primitives, then `translate()` returns a single string. - If replacements contain UI components, then `translate()` returns an array of elements. ### I18nTranslate This defines the i18n.translate() signature. export interface I18nTranslate { /** * This returns a translated string matching a key in a locale file. * * @example translate("banner.title") */ ( key: string, options?: Record, ): ReplacementType extends string | number ? string : (string | ReplacementType)[]; } ### Intents ### launchUrl The URL that was used to launch the intent. ### ApiVersion Union of supported API versions '2023-04' | '2023-07' | '2023-10' | '2024-01' | '2024-04' | '2024-07' | '2024-10' | 'unstable' ### AllComponents See the [list of available components](/docs/api/admin-extensions/components). AnyComponentBuilder< Omit< Components, | 'CustomerSegmentTemplate' | 'InternalCustomerSegmentTemplate' | 'InternalLocationList' > > ### AnyComponentBuilder ComponentsBuilder[keyof ComponentsBuilder] ### ComponentsBuilder { [K in keyof ComponentTypes]: ComponentTypes[K] extends RemoteComponentType< any, any > ? ComponentTypes[K] : never; } ### ComponentTypes typeof import('./components') ### Components ComponentsBuilder ### CustomerSegmentTemplateApi ### __enabledFeatures ### auth Provides methods for authenticating calls to an app backend. ### extension The identifier of the running extension target. ### i18n Utilities for translating content according to the current localization of the admin. More info - /docs/apps/checkout/best-practices/localizing-ui-extensions ### intents Provides information to the receiver the of an intent. ### query Used to query the Admin GraphQL API ### CustomerSegmentTemplateComponent AnyComponentBuilder< Pick< Components, 'CustomerSegmentTemplate' | 'InternalCustomerSegmentTemplate' > > ### PrintActionExtensionApi ### auth Provides methods for authenticating calls to an app backend. ### data Information about the currently viewed or selected items. ### extension The identifier of the running extension target. ### i18n Utilities for translating content according to the current localization of the admin. More info - /docs/apps/checkout/best-practices/localizing-ui-extensions ### intents Provides information to the receiver the of an intent. ### query Used to query the Admin GraphQL API ### ProductDetailsConfigurationApi ### auth Provides methods for authenticating calls to an app backend. ### data ### extension The identifier of the running extension target. ### i18n Utilities for translating content according to the current localization of the admin. More info - /docs/apps/checkout/best-practices/localizing-ui-extensions ### intents Provides information to the receiver the of an intent. ### query Used to query the Admin GraphQL API ### Product ### handle ### hasOnlyDefaultVariant ### id ### onlineStoreUrl ### options ### productCategory ### productComponents ### productType ### status ### title ### totalInventory ### totalVariants ### ProductComponent ### componentVariantsCount ### featuredImage ### id ### nonComponentVariantsCount ### productUrl ### title ### totalVariants ### ProductConfigurationComponents AnyComponentBuilder< Pick< Components, | 'Box' | 'InlineStack' | 'BlockStack' | 'Divider' | 'HeadingGroup' | 'Heading' | 'Text' | 'Link' | 'Image' | 'Icon' > > ### Image ### altText ### id ### originalSrc ### ProductVariantDetailsConfigurationApi ### auth Provides methods for authenticating calls to an app backend. ### data ### extension The identifier of the running extension target. ### i18n Utilities for translating content according to the current localization of the admin. More info - /docs/apps/checkout/best-practices/localizing-ui-extensions ### intents Provides information to the receiver the of an intent. ### query Used to query the Admin GraphQL API ### ProductVariant ### barcode ### compareAtPrice ### displayName ### id ### price ### productVariantComponents ### selectedOptions ### sku ### taxable ### taxCode ### title ### weight ### ProductVariantComponent ### displayName ### id ### image ### productVariantUrl ### selectedOptions ### sku ### title ### OrderRoutingRuleApi ### applyMetafieldsChange ### auth Provides methods for authenticating calls to an app backend. ### data ### extension The identifier of the running extension target. ### i18n Utilities for translating content according to the current localization of the admin. More info - /docs/apps/checkout/best-practices/localizing-ui-extensions ### intents Provides information to the receiver the of an intent. ### query Used to query the Admin GraphQL API ### ApplyMetafieldsChange #### Returns: void #### Params: - changes: MetafieldsChange[] export type ApplyMetafieldsChange = (changes: MetafieldsChange[]) => void; ### MetafieldsChange MetafieldUpdateChange | MetafieldRemoveChange | MetafieldUpdateChange[] | MetafieldRemoveChange[] ### MetafieldUpdateChange ### key ### namespace ### type ### value ### valueType ### SupportedDefinitionType (typeof supportedDefinitionTypes)[number] ### MetafieldRemoveChange ### key ### namespace ### type ### OrderRoutingComponents "InternalLocationList" & { readonly type?: "InternalLocationList"; readonly props?: InternalLocationListProps; readonly children?: true; } ### InternalLocationListProps ### locationGroups An array of location groups. ### onCreateGroup Callback when a new group is created. It receives the id of the new group as a parameter. ### onDeleteGroup Callback when a location group is deleted. It receives the id of the group as a parameter. ### onMoveGroup Callback when a location group is moved. It receives the old index and the new index as parameters. ### onMoveTag Callback when a tag is moved from one group to another. It receives the id of the tag, the old group index, and the new group index as parameters. ### onRenameGroup Callback when a location group is renamed. It receives the id of the group and the new name as parameters. ### LocationGroup ### id A unique identifier for the location group. ### label The label for the location group. ### locations An array of locations within the group. ### Location ### id A unique identifier for the location. ### name The name of the location. ### ValidationSettingsApi ### applyMetafieldChange Applies a change to the validation settings. ### auth Provides methods for authenticating calls to an app backend. ### data ### extension The identifier of the running extension target. ### i18n Utilities for translating content according to the current localization of the admin. More info - /docs/apps/checkout/best-practices/localizing-ui-extensions ### intents Provides information to the receiver the of an intent. ### query Used to query the Admin GraphQL API ### ApplyMetafieldChange #### Returns: Promise #### Params: - change: MetafieldChange export type ApplyMetafieldChange = ( change: MetafieldChange, ) => Promise; ### MetafieldChange MetafieldUpdateChange | MetafieldRemoveChange ### MetafieldChangeResult MetafieldChangeSuccess | MetafieldChangeResultError ### MetafieldChangeSuccess ### type ### MetafieldChangeResultError ### message ### type ### ValidationData The object that exposes the validation with its settings. ### shopifyFunction ### validation ### ShopifyFunction ### id the validation function's unique identifier ### Validation ### id the validation's gid when active in a shop ### metafields the metafields owned by the validation ### Metafield ### description ### id ### key ### namespace ### type ### value ### StandardApi The following APIs are provided to all extension targets. ### auth Provides methods for authenticating calls to an app backend. ### extension The identifier of the running extension target. ### i18n Utilities for translating content according to the current localization of the admin. More info - /docs/apps/checkout/best-practices/localizing-ui-extensions ### intents Provides information to the receiver the of an intent. ### query Used to query the Admin GraphQL API ### GraphQLError GraphQL error returned by the Shopify Admin API. ### locations ### message ### Navigation ### navigate Navigate to a specific route. ### ResourcePickerApi #### Returns: Promise | undefined> #### Params: - options: ResourcePickerOptions export type ResourcePickerApi = ( options: ResourcePickerOptions, ) => Promise | undefined>; ### ResourcePickerOptions ### action The action verb appears in the title and as the primary action of the Resource Picker. ### filter Filters for what resource to show. ### multiple Whether to allow selecting multiple items of a specific type or not. If a number is provided, then limit the selections to a maximum of that number of items. When type is Product, the user may still select multiple variants of a single product, even if multiple is false. ### query GraphQL initial search query for filtering resources available in the picker. See [search syntax](/docs/api/usage/search-syntax) for more information. This is displayed in the search bar when the picker is opened and can be edited by users. For most use cases, you should use the `filter.query` option instead which doesn't show the query in the UI. ### selectionIds Resources that should be preselected when the picker is opened. ### type The type of resource you want to pick. ### Filters ### archived Whether to show [archived products](https://help.shopify.com/en/manual/products/details?shpxid=70af7d87-E0F2-4973-8B09-B972AAF0ADFD#product-availability). Only applies to the Product resource type picker. Setting this to undefined will show a badge on draft products. ### draft Whether to show [draft products](https://help.shopify.com/en/manual/products/details?shpxid=70af7d87-E0F2-4973-8B09-B972AAF0ADFD#product-availability). Only applies to the Product resource type picker. Setting this to undefined will show a badge on draft products. ### hidden Whether to show hidden resources, referring to products that are not published on any sales channels. ### query GraphQL initial search query for filtering resources available in the picker. See [search syntax](/docs/api/usage/search-syntax) for more information. This is not displayed in the search bar when the picker is opened. ### variants Whether to show product variants. Only applies to the Product resource type picker. ### BaseResource ### id in GraphQL id format, ie 'gid://shopify/Product/1' ### variants ### Resource ### id in GraphQL id format, ie 'gid://shopify/Product/1' ### SelectPayload SelectPayload