--- title: customer-account.order.action.menu-item.render description: >- A [static extension target](/docs/api/customer-account-ui-extensions/extension-targets-overview#static-extension-targets) that renders as 1 order action on the Order Index and Order Status pages in customer accounts. api_version: 2025-01 api_name: customer-account-ui-extensions source_url: html: >- https://shopify.dev/docs/api/customer-account-ui-extensions/2025-01/targets/order-action-menu/customer-account-order-action-menu-item-render md: >- https://shopify.dev/docs/api/customer-account-ui-extensions/2025-01/targets/order-action-menu/customer-account-order-action-menu-item-render.md --- # customer-account.​order.​action.​menu-item.​renderTarget A [static extension target](https://shopify.dev/docs/api/customer-account-ui-extensions/extension-targets-overview#static-extension-targets) that renders as 1 order action on the Order Index and Order Status pages in customer accounts. ## OrderApi The API object provided to this and other `customer-account.order` extension targets. * orderId string required ## StandardApi The base API object provided to this and other `customer-account` extension targets. * authenticatedAccount AuthenticatedAccount required Information about the authenticated account. * extension Extension required Meta information about the extension. * i18n I18n required Utilities for translating content and formatting values according to the current `localization` of the user. * localization Localization required Details about the language of the buyer. * navigation StandardExtensionNavigation required * query \(query: string, options?: { variables?: Variables; version?: StorefrontApiVersion; }) => Promise<{ data?: Data; errors?: GraphQLError\[]; }> required Used to query the Storefront GraphQL API with a prefetched token. See [storefront api access examples](https://shopify.dev/docs/api/customer-account-ui-extensions/apis/storefront-api#examples) for more information. * sessionToken SessionToken required Provides access to session tokens, which can be used to verify token claims on your app's server. See [session token examples](https://shopify.dev/docs/api/customer-account-ui-extensions/apis/session-token#examples) for more information. * settings StatefulRemoteSubscribable\ required The settings matching the settings definition written in the [`shopify.ui.extension.toml`](https://shopify.dev/docs/api/customer-account-ui-extensions/configuration) file. See [settings examples](https://shopify.dev/docs/api/customer-account-ui-extensions/apis/order-status-api/settings#examples) for more information. Note When an extension is being installed in the editor, the settings will be empty until a merchant sets a value. In that case, this object will be updated in real time as a merchant fills in the settings. * storage Storage required Key-value storage for the extension target. * ui Ui required Methods to interact with the extension's UI. * version Version required The renderer version being used for the extension. * extensionPoint Target required deprecated The identifier that specifies where in Shopify’s UI your code is being injected. This will be one of the targets you have included in your extension’s configuration file. Deprecated Deprecated as of version `2023-07`, use `extension.target` instead. ### AuthenticatedAccount * customer Provides the customer information of the authenticated customer. ```ts StatefulRemoteSubscribable ``` * purchasingCompany Provides the company info of the authenticated business customer. If the customer is not authenticated or is not a business customer, this value is \`undefined\`. ```ts StatefulRemoteSubscribable ``` ```ts export interface AuthenticatedAccount { /** * Provides the company info of the authenticated business customer. * If the customer is not authenticated or is not a business customer, this value is `undefined`. */ purchasingCompany: StatefulRemoteSubscribable; /** * Provides the customer information of the authenticated customer. */ customer: StatefulRemoteSubscribable; } ``` ### Customer Information about the authenticated customer. {% include /apps/checkout/privacy-icon.md %} Requires access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). * id Customer ID. ```ts string ``` ```ts export interface Customer { /** * Customer ID. * * @example 'gid://shopify/Customer/123' */ id: string; } ``` ### PurchasingCompany * company Include information of the company of the logged in business customer. ```ts Company ``` ```ts export interface PurchasingCompany { /** * Include information of the company of the logged in business customer. */ company: Company; } ``` ### Company * id Company ID. ```ts string ``` ```ts export interface Company { /** * Company ID. */ id: string; } ``` ### Extension Meta information about an extension target. * apiVersion The API version that was set in the extension config file. ```ts ApiVersion ``` * capabilities The allowed capabilities of the extension, defined in your \[shopify.ui.extension.toml]\(/docs/api/checkout-ui-extensions/configuration) file. \* \[\`api\_access\`]\(/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API. \* \[\`network\_access\`]\(/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls. \* \[\`block\_progress\`]\(/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a buyer's progress and the merchant has allowed this blocking behavior. ```ts StatefulRemoteSubscribable ``` * editor Information about the editor where the extension is being rendered. The value is undefined if the extension is not rendering in an editor. ```ts Editor ``` * rendered Whether your extension is currently rendered to the screen. Shopify might render your extension before it's visible in the UI, typically to pre-render extensions that will appear on a later step of the checkout. Your extension might also continue to run after the buyer has navigated away from where it was rendered. The extension continues running so that your extension is immediately available to render if the buyer navigates back. ```ts StatefulRemoteSubscribable ``` * scriptUrl The URL to the script that started the extension target. ```ts string ``` * target The identifier that specifies where in Shopify’s UI your code is being injected. This will be one of the targets you have included in your extension’s configuration file. ```ts Target ``` * version The published version of the running extension target. For unpublished extensions, the value is \`undefined\`. ```ts string ``` ```ts export interface Extension { /** * The API version that was set in the extension config file. * * @example '2023-04', '2023-07' */ apiVersion: ApiVersion; /** * The allowed capabilities of the extension, defined * in your [shopify.ui.extension.toml](/docs/api/checkout-ui-extensions/configuration) file. * * * [`api_access`](/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API. * * * [`network_access`](/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls. * * * [`block_progress`](/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a buyer's progress and the merchant has allowed this blocking behavior. */ capabilities: StatefulRemoteSubscribable; /** * Information about the editor where the extension is being rendered. * * The value is undefined if the extension is not rendering in an editor. */ editor?: Editor; /** * Whether your extension is currently rendered to the screen. * * Shopify might render your extension before it's visible in the UI, * typically to pre-render extensions that will appear on a later step of the * checkout. * * Your extension might also continue to run after the buyer has navigated away * from where it was rendered. The extension continues running so that * your extension is immediately available to render if the buyer navigates back. */ rendered: StatefulRemoteSubscribable; /** * The URL to the script that started the extension target. */ scriptUrl: string; /** * The identifier that specifies where in Shopify’s UI your code is being * injected. This will be one of the targets you have included in your * extension’s configuration file. * * @example 'customer-account.order-status.block.render' * @see /docs/api/checkout-ui-extensions/unstable/extension-targets-overview * @see /docs/apps/app-extensions/configuration#targets */ target: Target; /** * The published version of the running extension target. * * For unpublished extensions, the value is `undefined`. * * @example 3.0.10 */ version?: string; } ``` ### ApiVersion Union of supported API versions ```ts '2023-04' | '2023-07' | '2023-10' | '2024-01' | '2024-04' | '2024-07' | '2024-10' | '2025-01' | 'unstable' ``` ### Capability The capabilities an extension has access to. \* \[\`api\_access\`]\(/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API. \* \[\`network\_access\`]\(/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls. \* \[\`block\_progress\`]\(/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a buyer's progress and the merchant has allowed this blocking behavior. \* \[\`collect\_buyer\_consent.sms\_marketing\`]\(/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can collect buyer consent for SMS marketing. \* \[\`collect\_buyer\_consent.customer\_privacy\`]\(/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can register buyer consent decisions that will be honored on Shopify-managed services. \* \[\`iframe.sources\`]\(/docs/api/checkout-ui-extensions/configuration#iframe): the extension can embed an external URL in an iframe. ```ts 'api_access' | 'network_access' | 'block_progress' | 'collect_buyer_consent.sms_marketing' | 'collect_buyer_consent.customer_privacy' | 'iframe.sources' ``` ### Editor * type Indicates whether the extension is rendering in the checkout editor. ```ts "checkout" ``` ```ts export interface Editor { /** * Indicates whether the extension is rendering in the checkout editor. */ type: 'checkout'; } ``` ### 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. ```ts (number: number | bigint, options?: { inExtensionLocale?: boolean; } & NumberFormatOptions) => string ``` * 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. ```ts (date: Date, options?: { inExtensionLocale?: boolean; } & DateTimeFormatOptions) => string ``` * 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. ```ts (number: number | bigint, options?: { inExtensionLocale?: boolean; } & NumberFormatOptions) => string ``` * 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. ```ts I18nTranslate ``` ```ts export interface I18n { /** * 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. * * @param options.inExtensionLocale - if true, use the extension's locale */ formatNumber: ( number: number | bigint, options?: {inExtensionLocale?: boolean} & Intl.NumberFormatOptions, ) => string; /** * 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. * * @param options.inExtensionLocale - if true, use the extension's locale */ formatCurrency: ( number: number | bigint, options?: {inExtensionLocale?: boolean} & Intl.NumberFormatOptions, ) => string; /** * 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. * * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat0 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat#using_options * * @param options.inExtensionLocale - if true, use the extension's locale */ formatDate: ( date: Date, options?: {inExtensionLocale?: boolean} & Intl.DateTimeFormatOptions, ) => string; /** * 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. */ translate: I18nTranslate; } ``` ### I18nTranslate This defines the i18n.translate() signature. ```ts export interface I18nTranslate { /** * This returns a translated string matching a key in a locale file. * * @example translate("banner.title") */ ( key: string, options?: {[placeholderKey: string]: ReplacementType | string | number}, ): ReplacementType extends string | number ? string : (string | ReplacementType)[]; } ``` ### Localization * extensionLanguage This is the buyer's language, as supported by the extension. If the buyer's actual language is not supported by the extension, this is the fallback locale used for translations. For example, if the buyer's language is 'fr-CA' but your extension only supports translations for 'fr', then the \`isoCode\` for this language is 'fr'. If your extension does not provide french translations at all, this value is the default locale for your extension (that is, the one matching your .default.json file). ```ts StatefulRemoteSubscribable ``` * language The language the buyer sees in the customer account hub. ```ts StatefulRemoteSubscribable ``` ```ts export interface Localization { /** * The language the buyer sees in the customer account hub. */ language: StatefulRemoteSubscribable; /** * This is the buyer's language, as supported by the extension. * If the buyer's actual language is not supported by the extension, * this is the fallback locale used for translations. * * For example, if the buyer's language is 'fr-CA' but your extension * only supports translations for 'fr', then the `isoCode` for this * language is 'fr'. If your extension does not provide french * translations at all, this value is the default locale for your * extension (that is, the one matching your .default.json file). */ extensionLanguage: StatefulRemoteSubscribable; } ``` ### Language * isoCode The BCP-47 language tag. It may contain a dash followed by an ISO 3166-1 alpha-2 region code. ```ts string ``` ```ts export interface Language { /** * The BCP-47 language tag. It may contain a dash followed by an ISO 3166-1 alpha-2 region code. * * @example 'en' for English, or 'en-US' for English local to United States. * @see https://en.wikipedia.org/wiki/IETF_language_tag * @see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 */ isoCode: string; } ``` ### StandardExtensionNavigation * navigate The navigate() method navigates to a specific URL, updating any provided state in the history entries list. ```ts NavigateFunction ``` ```ts export interface StandardExtensionNavigation { /** * The navigate() method navigates to a specific URL, updating any provided state in the history entries list. */ navigate: NavigateFunction; } ``` ### NavigateFunction ```ts export interface NavigateFunction { /** * Navigates to a specific URL, updating any provided state in the history entries list. * @param url The destination URL to navigate to. */ (url: string, options?: NavigationOptions): void; } ``` ### StorefrontApiVersion Union of supported storefront API versions ```ts '2022-04' | '2022-07' | '2022-10' | '2023-01' | '2023-04' | '2023-07' | '2024-01' | '2024-04' | '2024-07' | '2024-10' | '2025-01' | 'unstable' ``` ### GraphQLError GraphQL error returned by the Shopify Storefront APIs. * extensions ```ts { requestId: string; code: string; } ``` * message ```ts string ``` ```ts export interface GraphQLError { message: string; extensions: { requestId: string; code: string; }; } ``` ### SessionToken * get Requests a session token that hasn't expired. You should call this method every time you need to make a request to your backend in order to get a valid token. This method will return cached tokens when possible, so you don’t need to worry about storing these tokens yourself. ```ts () => Promise ``` ```ts export interface SessionToken { /** * Requests a session token that hasn't expired. You should call this method every * time you need to make a request to your backend in order to get a valid token. * This method will return cached tokens when possible, so you don’t need to worry * about storing these tokens yourself. */ get(): Promise; } ``` ### ExtensionSettings The merchant-defined setting values for the extension. * \[key: string] ```ts string | number | boolean | undefined ``` ```ts export interface ExtensionSettings { [key: string]: string | number | boolean | undefined; } ``` ### Storage A key-value storage object for extension targets. Stored data is only available to this specific app but can be shared across multiple extension targets. The storage backend is implemented with \`localStorage\` and should persist for ... days However, data persistence isn't guaranteed. * delete Delete stored data by key. ```ts (key: string) => Promise ``` * read Read and return a stored value by key. The stored data is deserialized from JSON and returned as its original primitive. Returns \`null\` if no stored data exists. ```ts (key: string) => Promise ``` * write Write stored data for this key. The data must be serializable to JSON. ```ts (key: string, data: any) => Promise ``` ```ts export interface Storage { /** * Read and return a stored value by key. * * The stored data is deserialized from JSON and returned as * its original primitive. * * Returns `null` if no stored data exists. */ read(key: string): Promise; /** * Write stored data for this key. * * The data must be serializable to JSON. */ write(key: string, data: any): Promise; /** * Delete stored data by key. */ delete(key: string): Promise; } ``` ### Ui * forceDataRefresh Refresh data so the surrounding information on the page is updated. The \`content\` string will appear in a toast message after refresh, to confirm the action was successful. To request access to this API: 1. Go to your partner dashboard and click \*\*Apps\*\*. 2. Select the app you need to request access for. 3. Click \*\*API access\*\*. 4. Under \*\*Access force data refresh\*\*, click \*\*Request access\*\*. ```ts (content: string) => Promise ``` * overlay An overlay is a contextual element on top of the main interface that provides additional information or functionality. ```ts { close(overlayId: string): void; } ``` * toast The Toast API displays a non-disruptive message that displays at the bottom of the interface to provide quick, at-a-glance feedback on the outcome of an action. How to use: - Use toasts to confirm successful actions. - Aim for two words. - Use noun + past tense verb format. For example, \\\`Changes saved\\\`. For errors, or information that needs to persist on the page, use a \[banner]\(/docs/api/checkout-ui-extensions/unstable/components/feedback/banner) component. ```ts { show(content: string): void; } ``` ```ts export interface Ui { /** * An overlay is a contextual element on top of the main interface that provides additional information or functionality. */ overlay: { close(overlayId: string): void; }; /** * The Toast API displays a non-disruptive message that displays at the bottom * of the interface to provide quick, at-a-glance feedback on the outcome * of an action. * * How to use: * * - Use toasts to confirm successful actions. * * - Aim for two words. * * - Use noun + past tense verb format. For example, \`Changes saved\`. * * For errors, or information that needs to persist on the page, use a [banner](/docs/api/checkout-ui-extensions/unstable/components/feedback/banner) component. */ toast: { show(content: string): void; }; /** * Refresh data so the surrounding information on the page is updated. The `content` string will appear in a toast message after refresh, to confirm the action was successful. * * To request access to this API: * * 1. Go to your partner dashboard and click **Apps**. * * 2. Select the app you need to request access for. * * 3. Click **API access**. * * 4. Under **Access force data refresh**, click **Request access**. */ forceDataRefresh(content: string): Promise; } ``` ## ButtonProps Supported props for Buttons used in order actions.\ \ `children` only support text.\ \ Omit `onPress` and `to` to trigger the `customer-account.order.action.render` extension target on press. * to string required Destination URL to link to. E.g. `extension:/` to navigate to the Full-page extension. * accessibilityLabel string A label used for buyers using assistive technologies. When set, any `children` supplied to this component will not be announced to screen reader users. * disabled boolean Default: false Disables the button, disallowing any interaction. * loading boolean Default: false Replaces content with a loading indicator. * loadingLabel string Accessible label for the loading indicator when user prefers reduced motion. This value is only used if `loading` is true. * onPress () => void Callback that is run when the button is pressed. ### Examples * #### Customer account order menu item extension example ##### React ```jsx import React from "react"; import { Button, reactExtension, useApi, } from "@shopify/ui-extensions-react/customer-account"; export default reactExtension( "customer-account.order.action.menu-item.render", () => ); function MenuActionItemExtension() { const {i18n} = useApi<"customer-account.order.action.menu-item.render">() return ; } ``` ##### Javascript ```js import {Button, extension} from '@shopify/ui-extensions/customer-account'; export default extension( 'customer-account.order.action.menu-item.render', (root) => { root.appendChild( root.createComponent( Button, undefined, 'Edit Order' ), ); }, ); ``` ## Examples Additional examples for menu item extensions. Loading your data before rendering the menu item ### Examples * #### Loading your data before rendering the menu item ##### React ```jsx import React from "react"; import { Button, reactExtension, useApi, } from "@shopify/ui-extensions-react/customer-account"; export default reactExtension( "customer-account.order.action.menu-item.render", async () => { const data = await fetchMenuItems(); return } ); interface Props { data: any; } function MenuActionItemExtension(props: Props) { return ; } function fetchMenuItems() { throw new Error("Function not implemented."); } ``` ## Related [Limitations - Order status page](https://shopify.dev/docs/apps/customer-accounts/order-status-page#pre-authenticated-order-status-page)