Skip to main content

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 (24)

The shopify global object provides the authenticated account data. Access the following properties on shopify to read the customer's account and company details.

Anchor to 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.


  • 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.

Was this page helpful?