Step 4. Setup for using Customer Account API (/account route)

Setup for using Customer Account API (/account section)

Requirements

  • You have Apps and channels permissions on the Shopify store that you're working with.

  • You have installed the Headless or Hydrogen sales channel from the Shopify App Store.

Step 1: Enable Customer Account API access

To use the Customer Account API, you first need to enable it and get your access credentials.

  1. From your Shopify admin, under Sales channels, click Headless or Hydrogen.

  2. Select your storefront.

  3. Complete one of the following steps:

    • If you selected Headless, then navigate to Customer Account API settings.

    • If you selected, Hydrogen, then navigate to Storefront settings.

  4. Optional: Modify the client type.

    • Public clients: For applications that are strictly client-side, or that don't have a server-side session where to store the refresh token safely (for example, SPA, mobile applications, or Hydrogen).

    • Confidential clients: For applications that have a back-end to perform the authorization request and a server-side session to hold the refresh token (for example, Express.js, ASP.NET, or Rails).

  5. From the Credentials section, copy the client ID (and client secret, if applicable) to use in your requests.

Step 2: Enable the new customer account experience

Shopify's new customer account experience is required to use the Customer Account API. New customer accounts allow you to seamlessly persist customer logins across online store, Hydrogen, and checkout.

  1. From your Shopify admin, click Settings.

  2. Click Customer accounts

  3. Under Accounts in online store and checkout section, click on Edit

  4. Choose New customer accounts

  5. Click Save.

Last updated