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.
- In the Dev Dashboard, create an app (Apps → Create app → Start from Dev Dashboard) and name it.
- Configure the Admin API access scopes the app needs on the app itself — the client credentials request sends no
scopeparameter, so the granted scopes are whatever the app is configured for. - Install the app on your own store (the store must belong to your organization).
- 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.”
- Request a token:
POST https://{shop}.myshopify.com/admin/oauth/access_token(Content-Type: application/x-www-form-urlencoded) with bodyclient_id,client_secret, andgrant_type=client_credentials(which “must always be set toclient_credentials”). - The JSON response contains
access_token,scope, andexpires_in—expires_in“is always set to 86399 (24 hours)”. No refresh token is issued. - When the token expires (or a request returns 401), repeat step 5 with the same client credentials to mint a fresh token.
- Call the API:
POST https://{shop}.myshopify.com/admin/api/{version}/graphql.jsonwith the headerX-Shopify-Access-Token: <access_token>(the bare token).{version}is a date-based value such as2026-07.
Connect it to Publicus
Section titled “Connect it to Publicus”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.