| [ Web Proxy ] |
| Viewing: https://shopify.dev/docs/api/usage/authentication | [Back] [Original] |
To call a Shopify API, your code sends an access token in a request header to authenticate the identity that token represents (your app or a buyer) and authorize what that identity can access. How you obtain the token and which header carries it vary by API.
This page explains the shared model behind Shopify API authentication: how a request is authenticated, and where to go to set it up for each API.
Every authenticated Shopify API request follows the same shape:
Authentication proves which identity is making a request, and authorization determines what that identity is allowed to do. The access token does both: it identifies your app or a buyer, and its access scopes determine what it can access.
Some flows authenticate a user first. For example, embedded apps validate an ID token, then exchange it for an access token.
Which token you use depends on whose data you're working with. Most Shopify APIs, including the GraphQL Admin API, Storefront API, and Partner API, authenticate your app acting on behalf of a merchant or organization. The token represents your app and the access a merchant granted it.
The Customer Account API is the exception. It authenticates a buyer accessing their own account data, such as their orders and addresses. After the buyer signs in and consents, your app receives an access token scoped to that buyer and calls the API on their behalf. For how this flow works, see Customer Account API authentication.
The following table shows what each API authenticates, how you get the token, and the header it uses:
| API | Authenticates | How you get the token | Header |
|---|---|---|---|
| GraphQL Admin API | Your app, on behalf of a merchant | OAuth, usually token exchange | X-Shopify-Access-Token |
| Storefront API | Your app (public or private) | Create public or private tokens, or go tokenless for basic data | X-Shopify-Storefront-Access-Token or Shopify-Storefront-Private-Token |
| Partner API | Your app, scoped to your Partner organization | Create a client token in the Partner Dashboard | X-Shopify-Access-Token |
| Customer Account API | A buyer, on their own behalf | Buyer signs in with OAuth 2.0 and PKCE | Authorization |
The table covers the most commonly used APIs. For a complete list, see the Shopify API reference.
Set up authentication for:
Learn more:
| Web Proxy Viewer | New URL | Original Page |