> For the complete documentation index, see [llms.txt](https://doc.duaer.com/zh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.duaer.com/zh/troubleshooting/shopify-401-invalid-access-token.md).

# 在 Duaer 里解决 Shopify 401 Invalid API key or access token

Duaer 的 Shopify 节点报 401，是 Shopify 不认这个令牌：填错了值、店铺子域名不对，或应用重装后令牌变了。
## Duaer 里这个报错长什么样

[API] Invalid API key or access token (unrecognized login or wrong password)，HTTP 401。

## 在 Duaer 里逐项检查

1. Access Token 填对了吗：Admin API 访问令牌以 shpat_ 开头。API key 和 API secret key 都不是它。
2. Shop Subdomain 只填 xxx.myshopify.com 前面的 xxx，不要填自定义域名，也不要带 https://。
3. 应用卸载重装、或令牌被轮换后，旧令牌失效。拿新令牌更新 Duaer 的 [Shopify 凭证](/zh/integrations/builtin/credentials/shopify.md)。
4. 保存凭证时 Duaer 会测试连接，通过后回到节点点执行此步骤。

## 是 403 不是 401 时

403 表示令牌有效但缺权限，例如读订单要 read_orders。在 Shopify 应用的 Admin API 权限里勾上，重新安装应用，再把新令牌填进 Duaer。Shopify Trigger 收得到推送却验证失败时，检查凭证里的 APP Secret Key。
## Questions

### Duaer 的 Shopify 凭证要填哪个令牌？

Duaer 的 Shopify Access Token 凭证填以 shpat_ 开头的 Admin API 访问令牌，Shop Subdomain 只填 myshopify.com 前面的部分。

### Duaer 里 Shopify 原来好好的，突然 401 了？

多半是应用被重装或令牌被轮换，旧令牌失效。在 Duaer 凭证里换成新令牌。

## 相关

- [在 Duaer 里配置 Shopify 凭证](https://doc.duaer.com/zh/integrations/builtin/credentials/shopify.md)
- [在 Duaer 里把 Shopify 新订单自动写进 Google Sheets](https://doc.duaer.com/zh/recipes/shopify-orders-to-google-sheets.md)
- [在 Duaer 里解决 Google 凭证 invalid_grant 和 7 天失效](https://doc.duaer.com/zh/troubleshooting/google-oauth-invalid-grant.md)

