Shopify: generate an Admin token and let the agent make changes
Shopify connects at three levels. The store domain alone unlocks anonymous catalog, product and cart tools. Adding an Admin API access token (or custom-app client credentials, or the OAuth app) unlocks read-only orders, products, customers and a server-side sales summary. With write scopes on that token, the agent can also change the store — product, price, inventory and collection mutations — and every one of those pauses at the approval gate before it runs.
The three connection tiers
Pick the tier by what you want the agent to do. You can start at tier 1 and upgrade later — adding a token to an existing store never breaks the storefront tools.
| Tier | What you provide | What the agent can do |
|---|---|---|
| 1 — Storefront | Store domain only | Search the public catalog, read product details, build a cart and get a checkout link, search store policies and FAQs. No credentials at all. |
| 2 — Admin read | Admin API access token, or custom-app client ID + secret, or the OAuth app | Everything above, plus orders, admin-side products (including DRAFT/ARCHIVED and live inventory), customers, shop info, and an aggregated sales summary. |
| 3 — Admin write | The same token, with write scopes granted | Everything above, plus Admin GraphQL mutations — create/update/delete products, change prices, adjust inventory, manage collections. Every mutation is approval-gated. |
Generate a Shopify Admin API access token
This is the custom-app path — the fastest way to get a token, and the one that supports writes today. You need to be the store owner or a staff account with the “Develop apps” permission.
- 1In Shopify admin, go to Settings → Apps and sales channels → Develop apps.
- 2Click “Allow custom app development” if you haven't already (one-time, store owner only), then “Create an app” and give it a name (e.g. “Agent Planners”).
- 3Open Configuration → Admin API integration → Configure, and tick the scopes you want (see the scope table below).
- 4Save, then go to the API credentials tab and click “Install app”.
- 5Reveal the Admin API access token — it starts with `shpat_`. Shopify shows it once, so copy it now.
- 6In Agent Planners, open Integrations → Shopify → Connect store, enter your store domain, choose “+ Admin token”, paste the token, and click “Validate + connect”.
Which scopes to grant
Grant only what you actually want the agent to reach. A missing scope isn't a crash — Shopify answers with an ACCESS_DENIED message naming the scope, so you can add it and retry.
| You want | Scope to tick |
|---|---|
| Orders, revenue and the sales summary | read_orders |
| Admin product list, inventory counts, draft/archived products | read_products |
| Customer list and lifetime spend | read_customers |
| Inventory levels | read_inventory |
| The agent to create or edit products and prices | write_products |
| The agent to adjust inventory | write_inventory |
The other two ways to connect
- Client credentials — paste the custom app's client ID and client secret instead of a token. Agent Planners exchanges them for a short-lived Bearer automatically and refreshes it before expiry, so there's no long-lived token sitting in storage.
- Shopify app (OAuth) — enter your `your-store.myshopify.com` domain and authorize in Shopify. No custom app to build and no token to copy, but this path grants a fixed read-only scope set (`read_products`, `read_orders`, `read_customers`, `read_inventory`), so use a custom-app token if you want writes.
What the agent can read
| Capability | What comes back |
|---|---|
| Sales summary | Server-side aggregation over the window: order count, revenue, average order value, revenue by day, orders by financial status, and top products by units. The totals are computed in code, so the model never re-adds order rows by hand. |
| Orders | Recent orders with name, date, financial and fulfilment status, total and line items — in the shop's own currency, with the date window anchored to the shop's timezone. |
| Products (admin view) | Title, status, vendor, product type, live inventory and price range — including DRAFT and ARCHIVED products the public storefront never shows. |
| Customers | Display name, order count and lifetime spend. |
| Shop info | Name, currency, timezone, myshopify and primary domain. |
| Admin GraphQL query | A generic read gateway for anything the wrappers don't cover. Mutation documents are rejected outright on this tool. |
| Storefront catalog / cart / policies | Public product search, product details, cart building with a checkout URL, and policy/FAQ search — available with no credentials. |
How the agent makes changes to your store
Store changes run through one Admin GraphQL mutation gateway, so anything your token is scoped for is reachable — product create/update/delete, variant and price updates, inventory adjustments, collection management, and so on. You describe the change in plain language; the agent writes the mutation and shows it to you before it runs.
- 1Write the goal in the Workspace, e.g. “Mark every product with zero inventory as draft.”
- 2The agent reads the store first to find exactly which products match — you see the list before anything changes.
- 3Each mutation stops at the approval gate showing the exact GraphQL document and variables it will send.
- 4Approve (in-app or by email magic-link) and it runs once. Reject and that step is skipped without aborting the rest of the run.
- 5The result is verified and written to the audit log with before/after detail.
Write safety
- Always approval-gated. Shopify mutations are force-gated at the registry level — a plan cannot mark one as pre-approved to skip the gate.
- Never retried. A mutation is attempted exactly once. A retry after an ambiguous send would double-apply the change.
- Honest failure. Shopify answers HTTP 200 even when a write fails, tucking the reason into `userErrors`. Every mutation must select `userErrors { field message }` up front, and any non-empty result is reported as a failure — never as a silent success.
- Read-only stays read-only. The query gateway rejects mutation documents, and the mutation gateway rejects query documents, so neither can be used to sneak past the other's rules.
Use cases
These are goals you'd type into the Workspace with a Shopify store selected in the context picker. The read-only ones run immediately; the write ones plan the change and pause for your approval.
| Goal you'd type | What the agent does |
|---|---|
| "Give me the last 30 days of Shopify sales — daily revenue, AOV and top products." | Runs the aggregated sales summary and writes it up as a report, with the numbers computed server-side rather than re-added by the model. |
| "Join last month's Google Ads cost with Shopify order revenue and give me true ROAS per campaign." | Pulls Google Ads cost and Shopify revenue in the same run and reports blended ROAS off your real order data instead of platform-reported conversions. |
| "Which products sold nothing in 60 days but still have inventory?" | Cross-references the sales summary's top-products data with the admin product list and its live inventory counts. |
| "Find products missing a vendor or product type and list them." | Reads the admin product list — including drafts — and reports the gaps in your catalog metadata. |
| "Mark every out-of-stock product as draft." | Finds the matching products, then proposes one `productUpdate` mutation per product, each waiting for your approval. |
| "Raise the price of everything in the Summer collection by 10%." | Reads the collection, computes the new prices, and shows you the exact variant price mutations before any of them run. |
| "Who are my top 20 customers by lifetime spend?" | Reads the customer list sorted by amount spent (needs the `read_customers` scope). |
| "Email me a Shopify sales report every Monday morning." | Turn the goal into a schedule — each fire re-reads live data, so the report is never stale. |
| "Build a cart with these three products and send me the checkout link." | Uses the anonymous storefront tools — no credentials needed — and returns a checkout URL for a human to complete. |
Troubleshooting
| Symptom | Fix |
|---|---|
| "This Shopify connection is storefront-only" | You connected with the domain alone. Add an Admin token or client credentials on the Integrations page to unlock orders and admin data. |
| HTTP 401 / 403 from the Admin API | The token is invalid, revoked, or missing the scope for what you asked. Check the scope table above, add it in the custom app, reinstall, and reconnect. |
| ACCESS_DENIED naming a scope | Shopify is telling you exactly which scope to tick — add it in the custom app's Admin API configuration and reinstall the app. |
| "Admin token expired" | Paste a fresh token on the Integrations page. Client-credentials connections refresh themselves and shouldn't hit this. |
| OAuth rejects your domain | The OAuth path needs the canonical `your-store.myshopify.com` domain, not a custom storefront domain. |
| A mutation was refused before it ran | The mutation document must select `userErrors { field message }`. The agent re-writes it and retries automatically when this happens. |
Frequently asked questions
- How do I generate a Shopify Admin API access token?
- In Shopify admin go to Settings → Apps and sales channels → Develop apps, create an app, configure the Admin API scopes you want (e.g. read_orders, read_products, write_products), save, then Install app and reveal the Admin API access token — it starts with shpat_. Paste it into the Shopify card on the Integrations page with your store domain.
- What scopes does Agent Planners need for Shopify?
- read_orders for orders and the sales summary, read_products for the admin product list and inventory, read_customers for customers, and read_inventory for stock levels. Add write_products / write_inventory only if you want the agent to change the store — reads alone keep it strictly read-only.
- Can the agent actually change my Shopify store?
- Yes, if your token carries write scopes. It reaches the Admin GraphQL mutation surface — create and update products, change prices, adjust inventory, manage collections — but every mutation is force-gated: you see the exact document and variables and approve it before it runs, it's attempted only once, and a Shopify-side rejection is reported as a failure rather than a silent success.
- Do I need a token at all?
- No. The store domain alone connects the anonymous Storefront tier — catalog search, product details, cart building with a checkout link, and store policy search. Add a token later when you want orders, admin data or writes.
- Can the agent place an order or take payment?
- No. Cart building returns a checkout URL and a human completes payment in their own browser. Money never moves through the agent.
- Should I use a token, client credentials or OAuth?
- Use a custom-app Admin token if you want writes — it's the only path with configurable write scopes. Use client credentials if you'd rather not store a long-lived token (they're exchanged for a short-lived Bearer that refreshes itself). Use the OAuth app for the fastest read-only setup, with no custom app to build.
- Can I use my custom domain?
- For the token and client-credentials paths, yes — enter either your custom domain or the myshopify.com one. The OAuth path works only on the canonical your-store.myshopify.com domain.