--- title: Authenticated Account description: >- The API for interacting with an account in which the customer is fully authenticated. api_version: 2025-07 api_name: customer-account-ui-extensions source_url: html: >- https://shopify.dev/docs/api/customer-account-ui-extensions/2025-07/apis/authenticated-account md: >- https://shopify.dev/docs/api/customer-account-ui-extensions/2025-07/apis/authenticated-account.md --- # Authenticated Account The API for interacting with an account in which the customer is fully authenticated. ## StandardApi The base API object provided to this and other `customer-account` extension targets. * authenticatedAccount AuthenticatedAccount required Information about the authenticated account. ### 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 ``` * location Include information of the company location of the logged in business customer. ```ts CompanyLocation ``` ```ts export interface PurchasingCompany { /** * Include information of the company of the logged in business customer. */ company: Company; /** * Include information of the company location of the logged in business customer. */ location?: CompanyLocation; } ``` ### Company * id Company ID. ```ts string ``` ```ts export interface Company { /** * Company ID. */ id: string; } ``` ### CompanyLocation * id Company location ID. ```ts string ``` ```ts export interface CompanyLocation { /** * Company location ID. */ id: string; } ``` ## use​Authenticated​Account​Customer() Returns the current authenticated `Customer`. The value is `undefined` if the customer isn't authenticated. ### Returns * Customer | undefined ### 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; } ``` ## use​Authenticated​Account​Purchasing​Company() Provides information about the company of the authenticated business customer. The value is `undefined` if a business customer isn't authenticated. ### Returns * PurchasingCompany | undefined ### PurchasingCompany * company Include information of the company of the logged in business customer. ```ts Company ``` * location Include information of the company location of the logged in business customer. ```ts CompanyLocation ``` ```ts export interface PurchasingCompany { /** * Include information of the company of the logged in business customer. */ company: Company; /** * Include information of the company location of the logged in business customer. */ location?: CompanyLocation; } ``` ### Company * id Company ID. ```ts string ``` ```ts export interface Company { /** * Company ID. */ id: string; } ``` ### CompanyLocation * id Company location ID. ```ts string ``` ```ts export interface CompanyLocation { /** * Company location ID. */ id: string; } ``` Examples ### Examples * #### Show Loyalty Banner ##### React ```jsx /* See the locales/en.default.json tab for the translation keys and values for this example */ import { useAuthenticatedAccountCustomer, useCustomer, useI18n, reactExtension, } from '@shopify/ui-extensions-react/customer-account'; import { Banner, Link, } from '@shopify/ui-extensions/customer-account'; export default reactExtension( 'customer-account.order-status.block.render', () => , ); function Extension() { const i18n = useI18n(); const authenticatedCustomer = useAuthenticatedAccountCustomer(); const orderStatusCustomer = useCustomer(); if ( authenticatedCustomer?.id && orderStatusCustomer?.id?.endsWith( authenticatedCustomer?.id, ) ) { return ( {i18n.translate('manageLoyaltyPoints')} ); } return null; } ``` ##### JavaScript ```js /* See the locales/en.default.json tab for the translation keys and values for this example */ import { Banner, Link, extension, } from '@shopify/ui-extensions/customer-account'; export default extension( 'customer-account.order-status.block.render', ( root, {i18n, authenticatedAccount, buyerIdentity}, ) => { const orderStatusCustomerId = buyerIdentity?.customer?.current?.id; const authenticatedCustomerId = authenticatedAccount?.customer?.current?.id; if ( authenticatedCustomerId && orderStatusCustomerId?.endsWith( authenticatedCustomerId, ) ) { const link = root.createComponent( Link, { to: 'extension:manageLoyaltyPoints/', }, i18n.translate('manageLoyaltyPoints'), ); const app = root.createComponent( Banner, {}, link, ); root.appendChild(app); } }, ); ``` ##### locales/en.default.json ```json { "manageLoyaltyPoints": "Manage Loyalty Points" } ``` * #### Getting the company and location of the customer ##### Description You can access the company and location of the authenticated business customer to implement location specific logic. ##### React ```jsx /* See the locales/en.default.json tab for the translation keys and values for this example */ import { Banner, extension, } from '@shopify/ui-extensions/customer-account'; export default reactExtension( 'customer-account.order-index.block.render', () => , ); function Extension() { const i18n = useI18n(); const purchasingCompany = useAuthenticatedAccountPurchasingCompany(); const companyLocationId = purchasingCompany?.location?.id; if ( companyLocationId && isLocationClosed(companyLocationId) ) { return ( ); } return null; } function isLocationClosed(locationId: string) { return true; } ``` ##### JavaScript ```js /* See the locales/en.default.json tab for the translation keys and values for this example */ import { Banner, extension, } from '@shopify/ui-extensions/customer-account'; export default extension( 'customer-account.order-index.block.render', (root, {i18n, authenticatedAccount}) => { const companyLocationId = authenticatedAccount?.purchasingCompany ?.current?.location?.id; if ( companyLocationId && isLocationClosed(companyLocationId) ) { const app = root.createComponent(Banner, { title: i18n.translate( 'closedLocationMessage', ), }); root.appendChild(app); } }, ); function isLocationClosed(locationId: string) { return true; } ``` ##### locales/en.default.json ```json { "closedLocationMessage": "This location is temporarily closed for inventory cleanup." } ```