Skip to main content

Customer Account API

The Customer Account API lets you query the GraphQL Customer Account API directly from your extension using the global fetch() function. Use this API to access detailed customer data, including profile information, order history, and saved addresses.

Unlike other target APIs that expose typed properties on the shopify global object, this API provides direct access to the full GraphQL schema through fetch('shopify://customer-account/api/2026-04/graphql.json'). Authentication is handled automatically, so you don't need a session token.

The data available depends on the buyer's authentication state and your app's access scopes.

  • Fetch order history: Query the customer's past orders to display a purchase history or recommend related products.
  • Access customer profile: Retrieve the customer's name, email, and saved addresses for a personalized experience.
  • Write customer data: Update customer records, create metafields, or modify order information directly through GraphQL mutations.
Support
Targets (24)

  • Specify an API version: Always include a specific API version in the request URL rather than using unstable, to ensure consistent behavior across deployments.
  • Handle errors gracefully: The fetch() call can fail due to network issues or authentication problems. Always check the response status and handle errors appropriately.

Was this page helpful?