DEV Community

Cover image for How to Create a Shopify Storefront API Access Token
Prashant Ardeshana
Prashant Ardeshana

Posted on

How to Create a Shopify Storefront API Access Token

To use the Shopify Storefront API, you need to create a Storefront API access token. This token allows you to access specific data (like products, collections, and checkout) via Shopify's GraphQL API.

Here’s a step-by-step guide on how to create the Storefront API access token:


1. Log into Shopify Admin

Go to your Shopify admin dashboard and log in with your credentials.


2. Go to "settings"

In your Shopify admin, navigate to:

settings > Apps and sales channels

Then, click on Develop apps at the top right of the page. This will bring you to the app development section where you can create private apps or custom apps.


3. Create a New Custom App

  • Click the Create an app the top right corner.
  • A dialog will appear asking for the app name and a contact email for any app-related inquiries.
  • Give the app a name (e.g., "Storefront API Access") and provide a valid email address. Then, click Create app.

4. Configure API Access for the App

After creating the app, you will be taken to the app's configuration page.

  1. Click on "Configure Storefront API scopes" under the API credentials tab.

    Here, you will see a list of API scopes (permissions). These define what kind of data your app can access.

  2. Enable the necessary permissions:

    • If you want to access products, collections, checkout, etc., you'll need to check the appropriate boxes for the following scopes:
      • unauthenticated_read_product_listings (for accessing product information)
      • unauthenticated_read_product_inventory (for inventory data)
      • unauthenticated_write_checkouts (for checkout actions)
      • unauthenticated_read_checkouts (for reading checkouts)
  3. Once you've selected the necessary permissions, click Save.


5. Get the Storefront API Access Token

After saving the permissions:

  1. Go back to the API credentials tab in the app.
  2. Scroll down to the Storefront API access token section.
  3. Click Reveal token once to view the access token.
    • Important: Store this token securely because once you reveal it, Shopify won't show it again. If you lose it, you'll need to generate a new token.

This token is now ready to be used for authenticating requests to Shopify’s Storefront API.

Top comments (0)