Skip to main content

Buyer Identity API

Requires level 2 access to protected customer data.

The Buyer Identity API provides access to the buyer's identity information during checkout, including customer details and B2B purchasing company data. Use this API to identify returning customers, personalize the checkout experience, and detect B2B sessions.

The Buyer Identity API is read-only. There are no methods to update the buyer's identity from a checkout extension.

The customer property is undefined when the buyer isn't a known customer or hasn't logged in.

  • Display buyer details: Greet returning buyers by name and show their contact information during checkout.
  • Identify B2B sessions: Determine if the buyer is purchasing on behalf of a company and display company-specific details.
  • Personalize the checkout: Use the buyer's email, phone, or customer ID to tailor the checkout experience.
Support
Targets (31)

The shopify global object provides buyer identity data for the current checkout. Access the following properties on shopify to read customer details and B2B purchasing company information. Available to purchase extension targets.

Anchor to buyerIdentity
buyerIdentity

Information about the buyer that's interacting with the checkout. The property is available only if the extension has access to protected customer data.

Requires access to protected customer data.


  • For multi-shop apps, key records on shop and customer.id together: customer.id is unique per shop. If your app is installed on multiple shops and keys records only on customer.id, then it can't reliably correlate a buyer across shops.
  • Check marketing consent before using contact details: The Customer object includes acceptsEmailMarketing and acceptsSmsMarketing flags. Respect these preferences when using the buyer's email or phone for marketing purposes.

Was this page helpful?