Shopify 凭据(Shopify credentials)#
你可以使用以下凭据通过 Shopify 验证以下节点。
🌐 You can use these credentials to authenticate the following nodes with Shopify.
支持的身份验证方法(Supported authentication methods)#
- 访问令牌(推荐):用于私有应用/单存储使用。可以由普通管理员创建。
- OAuth2:适用于公开应用。必须由合作伙伴账户创建。
- API 密钥:已弃用。
相关资源(Related resources)#
有关该服务的更多信息,请参阅 Shopify 的身份验证文档。
🌐 Refer to Shopify's authentication documentation for more information about the service.
使用访问令牌(Using access token)#
要配置此凭证,你需要一个 Shopify 管理员账户以及:
🌐 To configure this credential, you'll need a Shopify admin account and:
- 您的店铺子域名
- 一个 访问令牌:在你创建自定义应用时生成。
- 一个 应用密钥:在创建自定义应用时生成。
要创建并安装自定义应用来设置凭据:
🌐 To set up the credential, you'll need to create and install a custom app:
- 请输入你的商店子域名。
- 您的子域名位于 URL 中:
https://<subdomain>.myshopify.com。例如,如果完整的 URL 是https://n8n.myshopify.com,则商店子域名是n8n。
- 您的子域名位于 URL 中:
- 在 Shopify 中,转到 管理员 > 设置 > 应用和销售渠道。
- 选择 开发应用。
-
选择 创建自定义应用。
看不到此选项吗?
如果你看不到此选项,可能是因为你的商店尚未启用自定义应用开发。有关更多信息,请参阅 启用自定义应用开发。
-
在模态窗口中,输入应用名称。
- 选择一个应用开发者。应用开发者可以是商店所有者,也可以是任何拥有开发应用权限的账户。
- 选择 创建应用。
- 选择 选择范围。在 管理员 API 访问范围 部分,选择你希望应用使用的 API 范围。
- 要使用 Shopify 节点的所有功能,请添加
read_orders、write_orders、read_products和write_products权限范围。 - 有关可用权限的更多信息,请参阅 Shopify API 访问权限范围。
- 要使用 Shopify 节点的所有功能,请添加
- 选择 保存。10. 选择 安装应用。11. 在弹出窗口中,选择 安装应用。12. 打开应用的 API 凭证 部分。13. 复制 管理员 API 访问令牌。在你的 n8n 凭证中将其输入为 访问令牌。14. 复制 API 密钥。在你的 n8n 凭证中将其输入为 应用密钥。
有关这些步骤的更多信息,请参阅创建自定义应用和在 Shopify 管理后台生成自定义应用的访问令牌。
🌐 Refer to Creating a custom app and Generate access tokens for custom apps in the Shopify admin for more information on these steps.
使用 OAuth2(Using OAuth2)#
要配置此凭证,你需要一个 Shopify 合作伙伴 账户以及:
🌐 To configure this credential, you'll need a Shopify partner account and:
- A 客户端 ID:在你创建自定义应用时生成。
- 一个 客户端密钥:在你创建自定义应用时生成。
- 您的店铺子域名
要创建并安装自定义应用来设置凭据:
🌐 To set up the credential, you'll need to create and install a custom app:
定制应用开发
Shopify 提供用于创建新应用的模板。下面的说明仅涵盖设置 n8n 凭据所需的要素。有关构建应用和使用应用模板的更多信息,请参阅 Shopify 的 开发文档。
- 打开你的Shopify 合作伙伴仪表板。
- 从左侧导航选择应用。
- 选择 创建应用。
- 在 使用 Shopify 合作伙伴 部分,输入 应用名称。
- 选择 创建应用。
- 当应用详情打开时,复制 客户端 ID。将其输入到你的 n8n 凭据中。
- 复制 客户端密钥。在你的 n8n 凭证中输入此密钥。
- 在左侧菜单中,选择 Configuration。10. 在 n8n 中,复制 OAuth Redirect URL 并将其粘贴到 URLs 部分的 Allowed redirection URL(s) 中。10. 在 URLs 部分,为你的应用输入 App URL。这里输入的主机需要与 Allowed redirection URL(s) 的主机匹配,例如你的 n8n 实例的基础 URL。
- 选择 保存并发布。
- 从左侧菜单中选择 概览。此时,你可以选择通过将应用安装到你的某个商店来 测试你的应用,或者选择 选择分发方式 以公开分发应用。
- 在 n8n 中,输入你安装了应用的商店的 商店子域名,无论是作为测试还是分发。
- 您的子域名位于 URL 中:
https://<subdomain>.myshopify.com。例如,如果完整的 URL 是https://n8n.myshopify.com,则商店子域名是n8n。
- 您的子域名位于 URL 中:
使用 API 密钥(Using API key)#
方法已弃用
Shopify 不再生成带有密码的 API 密钥。请改用 访问令牌 方法。
要配置此凭据,你需要:
🌐 To configure this credential, you'll need:
- 一个 API 密钥
- 密码
- 您的 商店子域名:您的子域名在 URL 中:
https://<subdomain>.myshopify.com。例如,如果完整的 URL 是https://n8n.myshopify.com,则商店子域名是n8n。 - 可选: 共享密钥
常见问题(Common issues)#
以下是设置 Shopify 凭据时的一些常见问题,以及解决或故障排除步骤。
🌐 Here are some common issues setting up the Shopify credential and steps to resolve or troubleshoot them.
启用自定义应用开发(Enable custom app development)#
如果你看不到创建自定义应用选项,说明还没有人为你的商店启用自定义应用开发。
🌐 If you don't see the option to Create a custom app, no one's enabled custom app development for your store.
要启用自定义应用开发,你必须以商店所有者身份登录,或以具有启用应用开发权限的用户身份登录:
🌐 To enable custom app development, you must log in either as a store owner or as a user with the Enable app development permission:
- 在 Shopify 中,转到 管理员 > 设置 > 应用和销售渠道。
- 选择 开发应用。
- 选择 允许自定义应用开发。
- 阅读提供的警告和信息,然后选择 允许自定义应用开发。
禁止访问凭证错误(Forbidden credentials error)#
If you get a Couldn't connect with these settings / Forbidden - perhaps check your credentials warning when you test the credentials, this may be due to your app's access scope dependencies. For example, the read_orders scope also requires read_products scope. Review the scopes you have assigned and the action you're trying to complete.