Skip to main content
Migrate to Polaris

Version 2025-07 is the last API version to support React-based UI components. Later versions use web components, native UI elements with built-in accessibility, better performance, and consistent styling with Shopify's design system. Check out the migration guide to upgrade your extension.

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 to query for additional details.

  • 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 (25)

The Authenticated Account API object provides the authenticated customer's account information. Access the following properties on the API object to read account data.

Anchor to authenticatedAccount
authenticatedAccount
required

The authenticated customer's account information, including their customer ID and B2B company details.


  • Handle undefined customer: The customer property is undefined when the buyer isn't authenticated. Always check before accessing customer fields.
  • Use purchasing company for B2B logic: The purchasingCompany provides the company and location for B2B customers. Use it to implement location-specific pricing or catalog restrictions.

Was this page helpful?