词元之母TOK.MOM - 平台充值汇率 1:1 即 1 人民币充值到账 1 美元,支持一个 Key 调用近 600+ 海内外模型,限时特价模型低至 1 折,欢迎上岸!
| 来源 | 可选 — 通过 hermes skills install official/productivity/shopify 安装 |
| 路径 | optional-skills/productivity/shopify |
| 版本 | 1.0.0 |
| 作者 | community |
| 许可证 | MIT |
| 平台 | linux, macos, windows |
| 标签 | Shopify, E-commerce, Commerce, API, GraphQL |
| 相关 skill | airtable, xurl |
curl 直接操作 Shopify 店铺:列出商品、管理库存、拉取订单、更新客户、读取 metafield。无需 SDK,无需应用框架——只需 GraphQL 端点和自定义应用访问令牌。shpat_ 开头。~/.hermes/.env:SHOPIFY_ACCESS_TOKEN=shpat_xxxxxxxxxxxxxxxxxxxx
SHOPIFY_STORE_DOMAIN=my-store.myshopify.com
SHOPIFY_API_VERSION=2026-01注意: 自 2026 年 1 月 1 日起,在 Shopify 管理后台新建"旧版自定义应用"的功能已停用。新配置应使用 Dev Dashboard( shopify.dev/docs/apps/build/dev-dashboard)。已有的管理后台创建的应用继续有效。如果用户的店铺没有现有自定义应用且时间在 2026-01-01 之后,请引导其使用 Dev Dashboard 而非管理后台流程。
read_products、write_productsread_inventory、write_inventory、read_locationsread_orders、write_orders(不含 read_all_orders 时仅返回最近 30 条)read_customers、write_customersread_draft_orders、write_draft_ordersread_fulfillments、write_fulfillmentshttps://$SHOPIFY_STORE_DOMAIN/admin/api/$SHOPIFY_API_VERSION/graphql.jsonX-Shopify-Access-Token: $SHOPIFY_ACCESS_TOKEN(不是 Authorization: Bearer)POST,始终使用 Content-Type: application/json,请求体为 {"query": "...", "variables": {...}}errors 数组和各字段的 userErrors 中返回错误。两者都需检查。gid://shopify/Product/10079467700516、gid://shopify/Variant/...、gid://shopify/Order/...。原样传入——不要去掉前缀。extensions.cost 包含 requestedQueryCost、actualQueryCost、throttleStatus.{currentlyAvailable, maximumAvailable, restoreRate}。当 currentlyAvailable 低于下一次查询消耗时退避。标准店铺 = 100 点桶,50/s 恢复;Plus = 1000/100。jq 以获得可读输出。-sS 保留错误可见性同时隐藏进度条。title:、sku:、vendor:、product_type:、status:active、tag:、created_at:>2025-01-01。完整语法:https://shopify.dev/docs/api/usage/search-syntaxread_all_orders 时默认最多 30 条)financial_status:paid|pending|refunded、fulfillment_status:unfulfilled|fulfilled、created_at:>2025-01-01、tag:gift、email:foo@example.com。inventoryAdjustQuantities:inventorySetQuantities:https://$SHOPIFY_STORE_DOMAIN/api/$SHOPIFY_API_VERSION/graphql.jsonX-Shopify-Storefront-Access-Token: <public token> — 可嵌入浏览器Shopify-Storefront-Private-Token: <private token> — 仅限服务端__parentId。如有需要,在客户端重新组装。/admin/api/.../products.json 编写新集成,请使用 GraphQL。shpat_ 开头,Storefront 公开令牌以 shpua_ 开头。若令牌正确但请求头错误,每次请求都会返回 401 且无有效错误信息。{"errors":[{"message":"Access denied for ..."}]}。在应用上重新配置 Admin API scope,然后重新安装以重新生成令牌。userErrors 为空 ≠ 成功。 还需检查 data.<mutation>.<resource> 是否非空。某些失败两者均不填充——请检查完整响应。gid://shopify/Product/<numeric>。products(first: 250) 可能消耗 1000+ 点,在标准套餐店铺上立即触发限流。从小范围开始,读取 extensions.cost,再做调整。products(first: N, reverse: true) 按 id DESC 排序,而非 created_at。若需"最新优先",请使用 sortKey: CREATED_AT, reverse: true。read_all_orders。 不含此 scope 时,orders(...) 会静默限制在 60 天窗口内。不会报错,只是结果比预期少。对于订单量大的 Shopify Plus 商户,请通过应用的受保护数据设置申请此 scope。"49.00" 而非 49.0 返回。若关心零填充,不要盲目使用 jq tonumber。shopMoney(店铺货币)和 presentmentMoney(客户货币)。请保持一致地选择其中一个。productDelete、orderCancel、refundCreate 或任何批量 mutation 之前:请明确说明变更内容、所在店铺,并与用户确认。除非用户有独立的开发店铺,否则不存在生产数据的暂存副本。