Shopify Scripts are powerful automation tools that allow merchants to customize their store's behavior, and when combined with subscription functionality, they unlock advanced customization possibilities. However, to leverage Shopify Scripts with subscription products, you'll need a properly configured Shopify access token with the correct permissions. This comprehensive guide walks you through the entire process of obtaining and configuring a Shopify access token specifically for subscription script automation in 2026.
Whether you're a developer building custom solutions or a Shopify Plus merchant looking to automate subscription workflows, understanding how to generate and use access tokens is essential. Shopify Scripts have evolved significantly, and subscription management has become increasingly sophisticated. This article covers everything you need to know to get started.
| Scope | What It Allows |
|---|---|
| write_products | Create, modify, and delete products and subscription products in your store |
| read_products | View product data including subscription details and pricing information |
| write_orders | Modify order information and create custom order adjustments for subscription orders |
| read_orders | Access subscription order data, payment history, and order line items |
| write_script_tags | Deploy and manage Shopify Scripts that affect subscription checkout behavior |
Step 1: Log in to Your Shopify Admin
Navigate to your Shopify Admin dashboard at https://admin.shopify.com. Sign in with your admin credentials. Make sure your account has the appropriate permissions to create and manage API credentials and custom apps.
Step 2: Access the App Settings
From the admin sidebar, locate and click on "Settings" (usually at the bottom of the menu). Then navigate to "Apps and integrations." This section contains all your app connections and API credentials. In 2026, this interface has been streamlined for easier navigation and better security management.
Step 3: Create a New App or Custom Integration
Click on "Develop apps" or "Create an app" depending on your Shopify plan. Choose "Create an app" and give it a descriptive name like "Subscription Scripts Manager" or "Subscription Automation." This name will help you identify the token's purpose later.
Step 4: Configure Admin API Scopes
Once your app is created, navigate to the "Configuration" tab. Under "Admin API scopes," you'll see a comprehensive list of available permissions. Select the following scopes essential for working with Shopify Scripts and subscriptions:
Step 5: Save and Install the App
After selecting your required scopes, click "Save." Then click "Install app" to confirm the installation. You'll be taken to a confirmation page asking you to authorize the app's access to your store's data. Review the permissions carefully and click "Install" to proceed.
Step 6: Generate Your Access Token
After installation, navigate to the "API credentials" section of your app. Here you'll find your newly generated access token. This token looks like a long string of characters and serves as the authentication key for your API requests.
# Example of using your Shopify access token with a cURL request
# This retrieves subscription product data
curl -X GET "https://your-store.myshopify.com/admin/api/2024-01/products.json?title=subscription" \
-H "X-Shopify-Access-Token: shpat_xxxxxxxxxxxxxxxxxxxxxxxx"
Step 7: Securely Store Your Token
Never hardcode your access token in your scripts or version control systems. Instead, store it in environment variables or a secure secrets manager. For example, in a Node.js environment:
// Store your token in a .env file (never commit this to version control)
SHOPIFY_ACCESS_TOKEN=shpat_xxxxxxxxxxxxxxxxxxxxxxxx
SHOPIFY_STORE_NAME=your-store
// Load it in your application
const accessToken = process.env.SHOPIFY_ACCESS_TOKEN;
const storeName = process.env.SHOPIFY_STORE_NAME;
// Use in API requests
const response = await fetch(
`https://${storeName}.myshopify.com/admin/api/2024-01/graphql.json`,
{
method: 'POST',
headers: {
'X-Shopify-Access-Token': accessToken,
'Content-Type': 'application/json'
},
body: JSON.stringify({
query: `{
products(first: 10, query: "product_type:subscription") {
edges {
node {
id
title
variants {
id
title
}
}
}
}
}`
})
}
);
Step 8: Test Your Token with a Sample Request
Before deploying your scripts, test your token with a simple API request to ensure it's working correctly. This helps identify permission issues early. Use the cURL example above or your preferred API testing tool like Postman.
Step 9: Implement Your Subscription Scripts
With your access token validated, you can now use it to authenticate requests for managing subscription products, creating custom checkout experiences, and automating subscription workflows. Your scripts can now read and write subscription data with the authorized scopes.
Step 10: Monitor and Rotate Tokens Regularly
For security best practices, monitor your token usage in the Shopify Admin. In 2026, Shopify provides detailed analytics about API call volumes and patterns. Rotate your access tokens periodically—at least every 90 days for production environments. If you suspect compromise, regenerate your token immediately.
If you want to streamline the access token generation process without navigating through multiple Shopify admin pages, https://getshopifytoken.com provides an automated solution. This service simplifies the token generation workflow, particularly useful when managing multiple stores or integrations. GetShopifyToken handles the authentication flow securely and provides your token in seconds, making it an excellent choice for developers who frequently need to create and manage Shopify access tokens for different projects and use cases.
Access tokens generated through the Shopify Admin API do not have an expiration date. However, for security best practices, you should rotate them every 90 days in production environments. Additionally, if your token is ever compromised, immediately generate a new one by reinstalling the app, which invalidates the previous token. Regular rotation reduces the risk of unauthorized access to your store's data and subscription information.
No. Each Shopify store requires its own access token. If you manage multiple stores, you need to create a separate app and generate a unique token for each store. This security measure ensures that compromising one token doesn't grant access to all your stores. Many developers use environment variables to manage multiple tokens for different stores efficiently.
Custom app tokens (which you've generated in this guide) are for private use within your own store and are ideal for subscription script automation. Public app tokens are for apps distributed through the Shopify App Store and require OAuth authentication. For managing your own subscription scripts and automation, custom app tokens are the correct choice and provide the necessary security and control.
Make a test API call using your token to retrieve subscription product data. If the request succeeds, your token has the necessary read permissions. For write operations, try creating a test script tag or modifying a non-critical product. If you receive permission errors, return to your app's "Configuration" tab in the Shopify Admin, verify all required scopes are selected, and reinstall the app to apply the new permissions.
Never share your access token directly. Instead, implement proper access control through separate app installations for different team members or developers. Each person or service should have their own token with scoped permissions. This allows you to audit who made which API calls and revoke access individually if needed. For sensitive operations, consider using Shopify's scoped app approach with role-based access controls.