The REST Admin API is a legacy API as of October 1, 2024. All apps and integrations should be built with the GraphQL Admin API. For details and migration steps, visit our migration guide.

You can use the StorefrontAccessToken resource to generate storefront access tokens. Storefront access tokens are used to delegate unauthenticated access scopes to clients that need to access the unautheticated Storefront API. A sales channel can generate a storefront access token and then pass it to a consuming client, such as JavaScript or a mobile application.

Note

Storefront access tokens are allocated on a per shop basis, and an application can have a maximum of 100 active Storefront access tokens per shop.

A storefront access token inherits all of the unauthenticated access scopes from the app that creates it. If the app has not been granted any unauthenticated access scopes, then creating the storefront access token will fail.

Was this section helpful?

Properties

id
read-only
->id
Unique id that identifies a token and is used to perform operations on it.

access_token
read-only
The issued public access token.

access_scope
read-only
An application-dependant, comma separated list of permissions associated with the token.

created_at
read-only
The date and time when the public access token was created. The API returns this value in ISO 8601 format.

title
An arbitrary title for each token determined by the developer/application, used for reference purposes.

Note

No constraint on uniqueness.


Was this section helpful?
{}The StorefrontAccessToken resource
{
  "id": {
    "id": 1053727709
  },
  "access_token": {
    "access_token": "4f12cc6de73079c2c92ef4bef9e3c68a"
  },
  "access_scope": {
    "access_scope": "unauthenticated_read_product_listings"
  },
  "created_at": {
    "created_at": "2016-11-10T15:15:47-05:00"
  },
  "title": {
    "title": "Test"
  }
}

Was this section helpful?
Request body
storefrontaccesstoken
Storefront_access_token resource
Was this section helpful?
post
/admin/api/2024-10/storefront_access_tokens.json
Copy
curl -d '{"storefront_access_token":{"title":"Test"}}' \
-X POST "https://your-development-store.myshopify.com/admin/api/2024-10/storefront_access_tokens.json" \
-H "X-Shopify-Access-Token: {access_token}" \
-H "Content-Type: application/json"
{}Response
JSON
HTTP/1.1 200 OK
{
  "storefront_access_token": {
    "access_token": "a15f3e32a2a6bcc6bbccdbdfdb1364b7",
    "access_scope": "unauthenticated_read_product_listings",
    "created_at": "2024-09-26T15:21:54-04:00",
    "id": 1003304090,
    "admin_graphql_api_id": "gid://shopify/StorefrontAccessToken/1003304090",
    "title": "Test"
  }
}

Retrieves a list of storefront access tokens that have been issued

api_version
string
required

Was this section helpful?
Was this section helpful?
get
/admin/api/2024-10/storefront_access_tokens.json
Copy
curl -X GET "https://your-development-store.myshopify.com/admin/api/2024-10/storefront_access_tokens.json" \
-H "X-Shopify-Access-Token: {access_token}"
{}Response
JSON
HTTP/1.1 200 OK
{
  "storefront_access_tokens": [
    {
      "access_token": "378d95641257a4ab3feff967ee234f4d",
      "access_scope": "unauthenticated_read_product_listings",
      "created_at": "2024-09-26T15:08:21-04:00",
      "id": 755357713,
      "admin_graphql_api_id": "gid://shopify/StorefrontAccessToken/755357713",
      "title": "API Client Extension"
    }
  ]
}

Deletes an existing storefront access token

api_version
string
required

storefront_access_token_id
string
required

Was this section helpful?
Path parameters
storefrontaccesstokenid=755357713
string
required
Was this section helpful?
del
/admin/api/2024-10/storefront_access_tokens/755357713.json
Copy
curl -X DELETE "https://your-development-store.myshopify.com/admin/api/2024-10/storefront_access_tokens/755357713.json" \
-H "X-Shopify-Access-Token: {access_token}"
{}Response
JSON
HTTP/1.1 200 OK