Shopify Admin
/install shopify-admin-sop
Shopify Admin API SOP
Overview
Shopify has two distinct APIs — know which one to use:
| API | Purpose | Auth |
|---|---|---|
Storefront API / MCP (/api/mcp) |
Read product catalog, cart (read-only) | None required |
| Admin API (GraphQL/REST) | Write products, tags, inventory, etc. | X-Shopify-Access-Token |
The Storefront MCP is read-only. For any write operation, use the Admin API directly via the
httptool.
Credentials
Stored as skill secrets (injected at runtime):
SHOPIFY_STORE_DOMAIN— e.g.your-store.myshopify.comSHOPIFY_ACCESS_TOKEN—shpat_xxxtoken from a Custom App with required scopes
How to Call the Admin API
Use the http tool with X-Shopify-Access-Token header.
GraphQL (recommended)
POST https://{SHOPIFY_STORE_DOMAIN}/admin/api/2024-01/graphql.json
Headers:
Content-Type: application/json
X-Shopify-Access-Token: {SHOPIFY_ACCESS_TOKEN}
REST
GET/PUT https://{SHOPIFY_STORE_DOMAIN}/admin/api/2024-01/products/{id}.json
Headers:
X-Shopify-Access-Token: {SHOPIFY_ACCESS_TOKEN}
Common Operations
Add / update product tags (full overwrite — include all existing tags)
mutation {
productUpdate(input: {
id: "gid://shopify/Product/{PRODUCT_ID}",
tags: ["existing-tag1", "existing-tag2", "new-tag"]
}) {
product { id title tags }
userErrors { field message }
}
}
⚠️ tags is a full replacement. Always fetch current tags first, then merge.
Read product tags
{ product(id: "gid://shopify/Product/{PRODUCT_ID}") { id title tags } }
ID formats
- Numeric:
15501243941233 - GraphQL GID:
gid://shopify/Product/15501243941233
Token Scopes
For full product management, the token needs:
read_products, write_products
For broader operations add:
read_orders, read_inventory, write_inventory, read_themes, write_themes
Getting a Token (Custom App)
- Shopify Admin → Settings → Apps → Develop apps
- Create or open a Custom App → Configure → Admin API scopes
- Install the app → API credentials tab → copy the
shpat_xxxtoken (shown once) - Store it via:
PUT /skills/shopify-admin/secrets{"SHOPIFY_ACCESS_TOKEN": "shpat_xxx", "SHOPIFY_STORE_DOMAIN": "your-store.myshopify.com"}
If you use a Dev Dashboard app (Partner App), the token is obtained via OAuth. See the OAuth Refresh SOP below.
OAuth Token Refresh SOP (Dev Dashboard apps)
When a token expires (401) or needs new scopes:
Step 1 — Verify redirect URL is configured
In shopify.app.toml:
[auth]
redirect_urls = [ "https://example.com" ]
If empty, add it and run: shopify app deploy --force
Step 2 — Open the authorization URL
https://{SHOPIFY_STORE_DOMAIN}/admin/oauth/authorize?client_id={CLIENT_ID}&scope={SCOPES}&redirect_uri=https://example.com&state=refresh
Step 3 — Extract the code from the redirect URL
Browser redirects to https://example.com/?code=XXXXXX&...
Extract the code value (valid for ~60 seconds).
Step 4 — Exchange code for token
POST https://{SHOPIFY_STORE_DOMAIN}/admin/oauth/access_token
Body: {"client_id": "{CLIENT_ID}", "client_secret": "{CLIENT_SECRET}", "code": "{code}"}
Response contains the new access_token.
Gotchas
shopify app devtriggers APP_UNINSTALLED webhook — avoid for production stores. Useshopify app deployto update config only.- Existing token scopes don't auto-update after Dev Dashboard scope changes — must re-run OAuth.
- Storefront MCP (
/api/mcp) is already configured in Kocoro for product search. Admin write ops bypass MCP entirely.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install shopify-admin-sop - 安装完成后,直接呼叫该 Skill 的名称或使用
/shopify-admin-sop触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Shopify Admin 是什么?
Shopify Admin API SOP — product tags, inventory, and other write operations via GraphQL/REST. Works with any Shopify store using a Custom App access token. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 79 次。
如何安装 Shopify Admin?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install shopify-admin-sop」即可一键安装,无需额外配置。
Shopify Admin 是免费的吗?
是的,Shopify Admin 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Shopify Admin 支持哪些平台?
Shopify Admin 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Shopify Admin?
由 HAPPYNOCYOHEI(@happynocyohei)开发并维护,当前版本 v1.0.0。