--- title: Authenticated Account API description: >- The Authenticated Account API provides read-only access to the signed-in customer's ID and B2B purchasing company details. Use this API to identify the current customer, determine whether they're a B2B buyer, and personalize your extension based on their account context. 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/account-apis/authenticated-account-api md: >- https://shopify.dev/docs/api/customer-account-ui-extensions/latest/target-apis/account-apis/authenticated-account-api.md --- # Authenticated Account API The Authenticated Account API provides read-only access to the signed-in customer's ID and B2B purchasing company details. Use this API to identify the current customer, determine whether they're a B2B buyer, and personalize your extension based on their account context. For more detailed customer data such as email, name, or phone, use the [Customer Account API](https://shopify.dev/docs/api/customer-account-ui-extensions/latest/target-apis/account-apis/customer-account-api) to query for additional details. ### Use cases * **Personalize the experience**: Display a personalized greeting or tailored content based on the authenticated customer's identity. * **Detect B2B customers**: Determine if the buyer is a B2B customer and show company-specific UI. * **Gate features by authentication**: Only render certain features when the customer is signed in. ### Support Targets (24) ### Supported targets * [customer-account.​footer.​render-after](https://shopify.dev/docs/api/customer-account-ui-extensions/2026-04/targets/footer#footer-render-after-) * [customer-account.​order-index.​announcement.​render](https://shopify.dev/docs/api/customer-account-ui-extensions/2026-04/targets/order-actions#order-index-announcement-) * [customer-account.​order-index.​block.​render](https://shopify.dev/docs/api/customer-account-ui-extensions/2026-04/targets/order-actions#order-index-block-) * [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.​action.​menu-item.​render](https://shopify.dev/docs/api/customer-account-ui-extensions/2026-04/targets/order-actions#order-action-menu-item-) * [customer-account.​order.​action.​render](https://shopify.dev/docs/api/customer-account-ui-extensions/2026-04/targets/order-actions#order-action-) * [customer-account.​order.​page.​render](https://shopify.dev/docs/api/customer-account-ui-extensions/2026-04/targets/full-page#order-specific-full-page-) * [customer-account.​page.​render](https://shopify.dev/docs/api/customer-account-ui-extensions/2026-04/targets/full-page#customer-account-full-page-) * [customer-account.​profile.​addresses.​render-after](https://shopify.dev/docs/api/customer-account-ui-extensions/2026-04/targets/profile-page-default#profile-page-default-targets-) * [customer-account.​profile.​announcement.​render](https://shopify.dev/docs/api/customer-account-ui-extensions/2026-04/targets/profile-page-default#profile-announcement-) * [customer-account.​profile.​block.​render](https://shopify.dev/docs/api/customer-account-ui-extensions/2026-04/targets/profile-page-default#profile-block-) * [customer-account.​profile.​company-details.​render-after](https://shopify.dev/docs/api/customer-account-ui-extensions/2026-04/targets/profile-page-b2b#profile-page-b2b-targets-) * [customer-account.​profile.​company-location-addresses.​render-after](https://shopify.dev/docs/api/customer-account-ui-extensions/2026-04/targets/profile-page-b2b#company-location-addresses-render-after-) * [customer-account.​profile.​company-location-payment.​render-after](https://shopify.dev/docs/api/customer-account-ui-extensions/2026-04/targets/profile-page-b2b#company-location-payment-render-after-) * [customer-account.​profile.​company-location-staff.​render-after](https://shopify.dev/docs/api/customer-account-ui-extensions/2026-04/targets/profile-page-b2b#company-location-staff-render-after-) * customer-account.​profile.​payment.​render-after ### Properties The [`shopify` global object](https://shopify.dev/docs/api/customer-account-ui-extensions/latest#target-apis-define-what-your-extension-does) provides the authenticated account data. Access the following properties on `shopify` to read the customer's account and company details. * **authenticatedAccount** **AuthenticatedAccount** **required** The logged-in customer's account information, including their customer ID and B2B company details. Use this to personalize your extension based on who is viewing the page. ### AuthenticatedAccount * customer The authenticated customer's account information. The value is \`undefined\` if the customer isn't logged in. ```ts SubscribableSignalLike ``` * purchasingCompany The company that the authenticated B2B customer belongs to, including the company ID and location. The value is \`undefined\` if the customer isn't authenticated or isn't a B2B customer. ```ts SubscribableSignalLike ``` ### SubscribableSignalLike Represents a reactive signal interface that provides both immediate value access and subscription-based updates. Enables real-time synchronization with changing data through the observer pattern. This interface extends \`ReadonlySignalLike\` with deprecated fields that are still supported for backwards compatibility. * current The current value of the signal. Equivalent to \`.value\`, accessing this property subscribes to changes when used in a reactive context. ```ts T ``` * destroy Cleans up the subscription and releases any resources held by this signal. After calling \`destroy()\`, the signal stops receiving updates from the main thread. ```ts () => Promise ``` * subscribe Subscribes to value changes and calls the provided function whenever the value updates. Returns an unsubscribe function to clean up the subscription. Use to automatically react to changes in the signal's value. ```ts (fn: (value: T) => void) => () => void ``` * value The current value of the signal. This property provides immediate access to the current value without requiring subscription setup. Use for one-time value checks or initial setup. ```ts T ``` ### Customer Information about a customer who has previously purchased from this shop. {% include /apps/checkout/privacy-icon.md %} Requires access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). * acceptsEmailMarketing Whether the customer has opted in to email marketing. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). ```ts boolean ``` * acceptsMarketing Whether the customer has opted in to receiving marketing communications from the merchant, such as email campaigns and promotional offers. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). > Caution: This field is deprecated and will be removed in a future version. Use \`acceptsEmailMarketing\` or \`acceptsSmsMarketing\` instead. ```ts boolean ``` * acceptsSmsMarketing Whether the customer has opted in to SMS marketing. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). ```ts boolean ``` * email The email address associated with the customer's account. The value is \`undefined\` if the app doesn't have the required access level. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). ```ts string ``` * firstName The customer's first name. The value is \`undefined\` if the app doesn't have the required access level. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). ```ts string ``` * fullName The customer's full name, typically a combination of first and last name. The value is \`undefined\` if the app doesn't have the required access level. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). ```ts string ``` * id An identifier for the customer in the format \`gid://shopify/Customer/\\`. This value is unique per shop. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). ```ts string ``` * image The customer's profile image, such as a Gravatar avatar. Use this to personalize the extension UI for the logged-in buyer. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). ```ts ImageDetails ``` * lastName The customer's last name. The value is \`undefined\` if the app doesn't have the required access level. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). ```ts string ``` * ordersCount The number of orders the customer has previously placed with this shop. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). ```ts number ``` * phone The phone number associated with the customer's account. The value is \`undefined\` if no phone number is on file or the app doesn't have the required access level. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). ```ts string ``` * storeCreditAccounts The store credit accounts owned by this customer that can be used as payment during checkout. Each account has a balance representing available store credit. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). ```ts StoreCreditAccount[] ``` ### ImageDetails * altText The alternative text for the image, used for accessibility. The value is \`undefined\` if the merchant hasn't provided alt text. ```ts string ``` * url The fully-qualified URL of the image. Use this to render the product or variant image in your extension. ```ts string ``` ### PurchasingCompany The company and location that the \[B2B]\(/docs/apps/build/b2b) customer is purchasing on behalf of. This is present only when the buyer is logged in as a business customer. * company The company the B2B customer belongs to. {% include /apps/checkout/privacy-icon.md %} Requires access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). ```ts Company ``` * location The specific company location associated with this B2B purchase. {% include /apps/checkout/privacy-icon.md %} Requires access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). ```ts CompanyLocation ``` ### Company * externalId A merchant-defined external identifier for the company. The value is \`undefined\` if the merchant hasn't set one. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). ```ts string ``` * id A globally-unique identifier for the company in the format \`gid://shopify/Company/\\`. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). ```ts string ``` * name The company's display name. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). ```ts string ``` ### CompanyLocation * externalId A merchant-defined external identifier for the company location. The value is \`undefined\` if the merchant hasn't set one. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). ```ts string ``` * id A globally-unique identifier for the company location in the format \`gid://shopify/CompanyLocation/\\`. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). ```ts string ``` * name The display name of the company location. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). ```ts string ``` Examples ### Examples * #### ##### Description Display a personalized greeting using the authenticated customer's identity. This example reads \`shopify.authenticatedAccount.customer\` to retrieve the customer ID 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 customer = shopify.authenticatedAccount.customer.value; if (!customer) { return null; } return ( Welcome back! Customer ID: {customer.id} ); } ``` * #### ##### Description Check whether the buyer is associated with a B2B company account. This example reads \`shopify.authenticatedAccount.purchasingCompany\` and conditionally displays the company ID and location ID when present. ##### jsx ```jsx import '@shopify/ui-extensions/preact'; import {render} from 'preact'; export default async () => { render(, document.body); }; function Extension() { const purchasingCompany = shopify.authenticatedAccount.purchasingCompany .value; if (!purchasingCompany) { return ( Shopping as an individual customer. ); } const {company, location} = purchasingCompany; return ( B2B Account Company: {company.id} Location: {location?.id} ); } ``` * #### ##### Description Only render certain features when the customer is signed in. This example checks whether \`shopify.authenticatedAccount.customer\` is defined and conditionally shows a loyalty rewards section. ##### jsx ```jsx import '@shopify/ui-extensions/preact'; import {render} from 'preact'; export default async () => { render(, document.body); }; function Extension() { const customer = shopify.authenticatedAccount.customer.value; if (!customer) { return ( Sign in to access loyalty rewards and order tracking features. ); } return ( Loyalty Rewards You have earned 1,250 points on this order. View rewards ); } ``` *** ## Best practices * **Use the customer ID as a stable key**: The `customer.id` is a globally unique GID that persists across sessions. Use it as a key for storing and retrieving app-specific data for the customer. The ID is unique to the shop. ***