Skip to content
Docs

Getting a Shopify access token with the client credentials grant

This guide is part of the Publicus connection catalog. Once you have the credentials, connect the service and Publicus stores them for you.

Distilled from Shopify’s own documentation: Using the client credentials grant, Get API access tokens for Dev Dashboard apps, and About client credentials. Retrieved 2026-07-03.

The client credentials grant is a two-legged, server-to-server flow with no user redirect and no refresh token. It is “only available for apps developed by your own organization and installed in stores that you own” — use it for first-party automation against your own store, not for merchant-facing distribution.

  1. In the Dev Dashboard, create an app (Apps → Create app → Start from Dev Dashboard) and name it.
  2. Configure the Admin API access scopes the app needs on the app itself — the client credentials request sends no scope parameter, so the granted scopes are whatever the app is configured for.
  3. Install the app on your own store (the store must belong to your organization).
  4. Open the app’s Settings and copy its Client ID and Client secret. There is no token shown in the admin — “you request tokens programmatically when you need them.”
  5. Request a token: POST https://{shop}.myshopify.com/admin/oauth/access_token (Content-Type: application/x-www-form-urlencoded) with body client_id, client_secret, and grant_type=client_credentials (which “must always be set to client_credentials”).
  6. The JSON response contains access_token, scope, and expires_in — expires_in “is always set to 86399 (24 hours)”. No refresh token is issued.
  7. When the token expires (or a request returns 401), repeat step 5 with the same client credentials to mint a fresh token.
  8. Call the API: POST https://{shop}.myshopify.com/admin/api/{version}/graphql.json with the header X-Shopify-Access-Token: <access_token> (the bare token). {version} is a date-based value such as 2026-07.

Open Connections under Credentials, choose Shopify, and pick Shopify client credentials (own-organization apps). Publicus asks for exactly the fields listed above and keeps them in your workspace’s secret storage.

See also: Shopify in the catalog.

This guide is maintained by Publicus and published under CC BY 4.0.