--- title: Shop API description: >- The Shop API provides read-only access to the merchant's shop identity, including the shop ID, display name, primary storefront URL, and permanent myshopify.com domain. Use this API to link back to the storefront, identify the shop in backend requests, or display the shop name alongside order information. api_version: 2026-04 api_name: customer-account-ui-extensions source_url: html: >- https://shopify.dev/docs/api/customer-account-ui-extensions/latest/target-apis/order-apis/shop-api md: >- https://shopify.dev/docs/api/customer-account-ui-extensions/latest/target-apis/order-apis/shop-api.md --- # Shop API The Shop API provides read-only access to the merchant's shop identity, including the shop ID, display name, primary storefront URL, and permanent `myshopify.com` domain. Use this API to link back to the storefront, identify the shop in backend requests, or display the shop name alongside order information. ### Use cases * **Link to the storefront**: Create links back to the merchant's online store from your extension. * **Identify the shop**: Use the shop's permanent domain as a stable identifier when communicating with your backend service. * **Display the shop name**: Show the shop name in your extension's UI for context. ### Support Targets (10) ### Supported targets * [customer-account.​order-status.​announcement.​render](https://shopify.dev/docs/api/customer-account-ui-extensions/2026-04/targets/order-status#order-status-announcement-) * [customer-account.​order-status.​block.​render](https://shopify.dev/docs/api/customer-account-ui-extensions/2026-04/targets/order-status#order-status-block-) * [customer-account.​order-status.​cart-line-item.​render-after](https://shopify.dev/docs/api/customer-account-ui-extensions/2026-04/targets/order-status#cart-line-item-render-after-) * [customer-account.​order-status.​cart-line-list.​render-after](https://shopify.dev/docs/api/customer-account-ui-extensions/2026-04/targets/order-status#cart-line-list-render-after-) * [customer-account.​order-status.​customer-information.​render-after](https://shopify.dev/docs/api/customer-account-ui-extensions/2026-04/targets/order-status#customer-information-render-after-) * [customer-account.​order-status.​fulfillment-details.​render-after](https://shopify.dev/docs/api/customer-account-ui-extensions/2026-04/targets/fulfillment-status#fulfillment-status-targets) * [customer-account.​order-status.​payment-details.​render-after](https://shopify.dev/docs/api/customer-account-ui-extensions/2026-04/targets/payments-and-returns#payments-and-returns-targets) * [customer-account.​order-status.​return-details.​render-after](https://shopify.dev/docs/api/customer-account-ui-extensions/2026-04/targets/payments-and-returns#return-details-render-after-) * [customer-account.​order-status.​unfulfilled-items.​render-after](https://shopify.dev/docs/api/customer-account-ui-extensions/2026-04/targets/fulfillment-status#unfulfilled-items-render-after-) * [customer-account.​order.​page.​render](https://shopify.dev/docs/api/customer-account-ui-extensions/2026-04/targets/full-page#order-specific-full-page-) ### Properties The [`shopify` global object](https://shopify.dev/docs/api/customer-account-ui-extensions/latest#target-apis-define-what-your-extension-does) provides information about the shop where the order was placed. Access the following properties on `shopify` to read the shop's identity, name, storefront URL, and `myshopify.com` domain. * **shop** **Shop** **required** The shop where the order was placed. Includes the shop ID, name, primary storefront URL, and myshopify.com domain. ### Shop Metadata about the merchant's store, including its name, storefront URL, \`.myshopify.com\` subdomain, and a globally-unique ID. * id A globally-unique identifier for the shop in the format \`gid://shopify/Shop/\\`. ```ts string ``` * myshopifyDomain The shop's unique \`.myshopify.com\` subdomain, such as \`'example.myshopify.com'\`. This domain is permanent and doesn't change even if the merchant adds a custom domain. ```ts string ``` * name The display name of the shop as configured by the merchant in Shopify admin. ```ts string ``` * storefrontUrl The primary storefront URL for the shop, such as \`'https://example.myshopify.com'\`. Use this to build links back to the merchant's online store. ```ts string ``` Examples ### Examples * #### ##### Description Create a link back to the merchant's online store from your extension. This example reads \`shopify.shop.storefrontUrl\` and renders a "Continue Shopping" button that navigates to the storefront. ##### jsx ```jsx import '@shopify/ui-extensions/preact'; import {render} from 'preact'; export default async () => { render(, document.body); }; function Extension() { const shop = shopify.shop; return ( Continue Shopping Browse more products from {shop.name}. Visit {shop.name} ); } ``` * #### ##### Description Use the shop's permanent domain as a stable identifier when communicating with a backend service. This example reads \`shopify.shop.myshopifyDomain\` and includes it in a POST request to an external API. ##### jsx ```jsx import '@shopify/ui-extensions/preact'; import {render} from 'preact'; import {useState} from 'preact/hooks'; export default async () => { render(, document.body); }; function Extension() { const shop = shopify.shop; const [status, setStatus] = useState('idle'); async function syncWithBackend() { setStatus('syncing'); try { await fetch('https://my-app.example.com/api/sync', { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({shop: shop.myshopifyDomain}), }); setStatus('synced'); } catch { setStatus('error'); } } return ( Loyalty Program Store: {shop.myshopifyDomain} {status === 'syncing' ? 'Syncing…' : status === 'synced' ? 'Synced ✓' : 'Sync Account'} {status === 'error' && ( Sync failed. Please try again. )} ); } ``` * #### ##### Description Show the shop name in your extension's UI for context. This example reads \`shopify.shop.name\` and renders a welcome message. ##### jsx ```jsx import '@shopify/ui-extensions/preact'; import {render} from 'preact'; export default async () => { render(, document.body); }; function Extension() { const shop = shopify.shop; return ( Welcome to {shop.name} Thank you for shopping with us. We appreciate your business! ); } ``` *** ## Best practices * **Use `myshopifyDomain` for reliable identification**: The `myshopifyDomain` is a stable identifier for the shop, while the `storefrontUrl` can change if the merchant updates their custom domain. * **Use `storefrontUrl` for customer-facing links**: When linking to the storefront from your extension, use the `storefrontUrl` property to ensure links point to the merchant's primary domain. *** ## Limitations * The Shop API provides only basic shop identification. For detailed shop settings such as currency, timezone, or plan information, use the [GraphQL Admin API](https://shopify.dev/docs/api/admin-graphql) through a backend service. ***