Skip to content

Shopify 凭据(Shopify credentials)#

你可以使用以下凭据通过 Shopify 验证以下节点。

🌐 You can use these credentials to authenticate the following nodes with Shopify.

支持的身份验证方法(Supported authentication methods)#

  • 访问令牌(推荐):用于私有应用/单存储使用。可以由普通管理员创建。
  • OAuth2:适用于公开应用。必须由合作伙伴账户创建。
  • API 密钥:已弃用。

有关该服务的更多信息,请参阅 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:

  1. 请输入你的商店子域名
    • 您的子域名位于 URL 中:https://<subdomain>.myshopify.com。例如,如果完整的 URL 是 https://n8n.myshopify.com,则商店子域名是 n8n
  2. 在 Shopify 中,转到 管理员 > 设置 > 应用和销售渠道
  3. 选择 开发应用
  4. 选择 创建自定义应用

    看不到此选项吗?

    如果你看不到此选项,可能是因为你的商店尚未启用自定义应用开发。有关更多信息,请参阅 启用自定义应用开发

  5. 在模态窗口中,输入应用名称

  6. 选择一个应用开发者。应用开发者可以是商店所有者,也可以是任何拥有开发应用权限的账户。
  7. 选择 创建应用
  8. 选择 选择范围。在 管理员 API 访问范围 部分,选择你希望应用使用的 API 范围。
    • 要使用 Shopify 节点的所有功能,请添加 read_orderswrite_ordersread_productswrite_products 权限范围。
    • 有关可用权限的更多信息,请参阅 Shopify API 访问权限范围
  9. 选择 保存。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 的 开发文档

  1. 打开你的Shopify 合作伙伴仪表板
  2. 从左侧导航选择应用
  3. 选择 创建应用
  4. 使用 Shopify 合作伙伴 部分,输入 应用名称
  5. 选择 创建应用
  6. 当应用详情打开时,复制 客户端 ID。将其输入到你的 n8n 凭据中。
  7. 复制 客户端密钥。在你的 n8n 凭证中输入此密钥。
  8. 在左侧菜单中,选择 Configuration。10. 在 n8n 中,复制 OAuth Redirect URL 并将其粘贴到 URLs 部分的 Allowed redirection URL(s) 中。10. 在 URLs 部分,为你的应用输入 App URL。这里输入的主机需要与 Allowed redirection URL(s) 的主机匹配,例如你的 n8n 实例的基础 URL。
  9. 选择 保存并发布
  10. 从左侧菜单中选择 概览。此时,你可以选择通过将应用安装到你的某个商店来 测试你的应用,或者选择 选择分发方式 以公开分发应用。
  11. 在 n8n 中,输入你安装了应用的商店的 商店子域名,无论是作为测试还是分发。
    • 您的子域名位于 URL 中:https://<subdomain>.myshopify.com。例如,如果完整的 URL 是 https://n8n.myshopify.com,则商店子域名是 n8n

使用 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:

  1. 在 Shopify 中,转到 管理员 > 设置 > 应用和销售渠道
  2. 选择 开发应用
  3. 选择 允许自定义应用开发
  4. 阅读提供的警告和信息,然后选择 允许自定义应用开发

禁止访问凭证错误(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.