Skip to content

Shopify 凭据#

¥Shopify credentials

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

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

¥Shopify Trigger

支持的身份验证方法#

¥Supported authentication methods

  • 访问令牌(推荐):适用于私有应用/单个应用商店。可由普通管理员创建。

¥Access token (recommended): For private apps/single store use. Can be created by regular admins.

  • OAuth2:对于公共应用。必须由合作伙伴账户创建。

¥OAuth2: For public apps. Must be created by partner accounts.

  • API 密钥:已弃用。

¥API key: Deprecated.

相关资源#

¥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:

  • 你的商店子域名

¥Your Shop Subdomain

  • 访问令牌:创建自定义应用时生成。

¥An Access Token: Generated when you create a custom app.

  • 应用密钥密钥:创建自定义应用时生成。

¥An APP Secret Key: Generated when you create a custom app.

要创建并安装自定义应用来设置凭据:

¥To set up the credential, you'll need to create and install a custom app:

  1. 请输入你的 Shop 子域名。

¥Enter your Shop Subdomain.

  • 你的子域名位于以下 URL 中:https://<subdomain>.myshopify.com。例如,如果完整 URL 为 https://n8n.myshopify.com,则 Shop 子域名为 n8n

    ¥Your subdomain is within the URL: https://<subdomain>.myshopify.com. For example, if the full URL is https://n8n.myshopify.com, the Shop Subdomain is n8n.

  1. 在 Shopify 中,转到“管理”>“设置”>“应用和销售渠道”。

¥In Shopify, go to Admin > Settings > Apps and sales channels.

  1. 选择“开发应用”。

¥Select Develop apps.

  1. 选择“创建自定义应用”。

¥Select Create a custom app.

Don't see this option?

1
If you don't see this option, your store probably doesn't have custom app development enabled. Refer to [Enable custom app development](#enable-custom-app-development) for more information.
  1. 在模态窗口中,输入应用名称。

¥In the modal window, enter the App name. 6. 选择应用开发者。应用开发者可以是商店所有者或任何拥有“开发应用”权限的账户。

¥Select an App developer. The app developer can be the store owner or any account with the Develop apps permission. 7. 选择“创建应用”。

¥Select Create app. 8. 选择“选择范围”。在“管理 API 访问范围”部分,选择你希望应用使用的 API 范围。

¥Select Select scopes. In the Admin API access scopes section, select the API scopes you want for your app.

  • 要使用 Shopify 节点中的所有功能,请添加 read_orderswrite_ordersread_productswrite_products 范围。

    ¥To use all functionality in the Shopify node, add the read_orders, write_orders, read_products, and write_products scopes.

  • 有关可用作用域的更多信息,请参阅 Shopify API 访问范围

    ¥Refer to Shopify API Access Scopes for more information on the available scopes. 9. 选择“保存”。

¥Select Save. 10. 选择“安装应用”。

1
¥Select **Install app**.
  1. 在模态窗口中,选择“安装应用”。

    ¥In the modal window, select Install app. 12. 打开应用的 API 凭据部分。

    ¥Open the app's API Credentials section. 13. 复制管理员 API 密钥,并将其用作 Ghost 管理员 n8n 凭据中的 API 密钥。将此作为客户端密钥输入到你的 n8n 凭据中。

    ¥Copy the Admin API Access Token. Enter this in your n8n credential as the Access Token. 14. 复制 API 令牌并将其输入到你的 n8n 凭据中。将此作为访问令牌输入到你的 n8n 凭据中。

    ¥Copy the API Secret Key. Enter this in your n8n credential as the APP Secret Key.

有关这些步骤的更多信息,请参阅 创建自定义应用在 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:

  • 客户端 ID:创建自定义应用时生成。

¥A Client ID: Generated when you create a custom app.

  • 客户端密钥:创建自定义应用时生成。

¥A Client Secret: Generated when you create a custom app.

  • 你的商店子域名

¥Your Shop Subdomain

要创建并安装自定义应用来设置凭据:

¥To set up the credential, you'll need to create and install a custom app:

Custom app development

Shopify 提供用于创建新应用的模板。以下说明仅涵盖设置 n8n 凭据所需的要素。有关构建应用和使用应用模板的更多信息,请参阅 Shopify 的 构建开发文档 文档。

¥Shopify provides templates for creating new apps. The instructions below only cover the elements necessary to set up your n8n credential. Refer to Shopify's Build dev docs for more information on building apps and working with app templates.

  1. 打开 Shopify 合作伙伴控制面板

¥Open your Shopify Partner dashboard. 2. 从左侧导航栏选择“应用”。

¥Select Apps from the left navigation. 3. 选择“创建应用”。

¥Select Create app. 4. 在“使用 Shopify 合作伙伴”部分,输入应用名称。

¥In the Use Shopify Partners section, enter an App name. 5. 选择“创建应用”。

¥Select Create app. 6. 打开应用详情后,复制客户端 ID。请将以下内容输入到你的 n8n 凭据中。

¥When the app details open, copy the Client ID. Enter this in your n8n credential. 7. 复制客户端密钥。请将以下内容输入到你的 n8n 凭据中。

¥Copy the Client Secret. Enter this in your n8n credential. 8. 在左侧菜单中,选择“配置”。

¥In the left menu, select Configuration. 9. 在 n8n 中,复制 OAuth 重定向 URL 并将其粘贴到 URL 部分的“允许的重定向 URL”中。

¥In n8n, copy the OAuth Redirect URL and paste it into the Allowed redirection URL(s) in the URLs section. 10. 在“URL”部分,输入你的应用 URL。此处输入的主机必须与允许的重定向 URL 的主机匹配,例如你的 n8n 实例的基本 URL。

1
¥In the **URLs** section, enter an **App URL** for your app. The host entered here needs to match the host for the **Allowed redirection URL(s)**, like the base URL for your n8n instance.
  1. 选择“保存并释放”。

    ¥Select Save and release. 12. 从左侧菜单中选择“概览”。此时,你可以选择将应用安装到你的应用商店之一进行测试,或者选择“发布”进行公开发布。

    ¥Select Overview from the left menu. At this point, you can choose to Test your app by installing it to one of your stores, or Choose distribution to distribute it publicly. 13. 在 n8n 中,输入你安装应用的商店子域名,无论是作为测试应用还是正式发布应用。

    ¥In n8n, enter the Shop Subdomain of the store you installed the app to, either as a test or as a distribution.

    • 你的子域名位于以下 URL 中:https://<subdomain>.myshopify.com。例如,如果完整 URL 为 https://n8n.myshopify.com,则 Shop 子域名为 n8n

    ¥Your subdomain is within the URL: https://<subdomain>.myshopify.com. For example, if the full URL is https://n8n.myshopify.com, the Shop Subdomain is n8n.

使用 API 密钥#

¥Using API key

Method deprecated

Shopify 不再生成带有密码的 API 密钥。改用 访问令牌 方法。

¥Shopify no longer generates API keys with passwords. Use the Access token method instead.

要配置此凭据,你需要:

¥To configure this credential, you'll need:

  • API 密钥

¥An API Key

  • 密码:

¥A Password

  • 你的商店子域名:你的子域名位于以下 URL 中:https://<subdomain>.myshopify.com。例如,如果完整 URL 为 https://n8n.myshopify.com,则 Shop 子域名为 n8n

¥Your Shop Subdomain: Your subdomain is within the URL: https://<subdomain>.myshopify.com. For example, if the full URL is https://n8n.myshopify.com, the Shop Subdomain is n8n.

  • 可选的:共享秘密密钥

¥Optional: A Shared Secret

常见问题#

¥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 中,转到“管理”>“设置”>“应用和销售渠道”。

¥In Shopify, go to Admin > Settings > Apps and sales channels. 2. 选择“开发应用”。

¥Select Develop apps. 3. 选择“允许自定义应用开发”。

¥Select Allow custom app development. 4. 阅读警告和提供的信息,然后选择“允许自定义应用开发”。

¥Read the warning and information provided and select Allow custom app development.

禁止访问凭证错误#

¥Forbidden credentials error

如果你收到“无法使用这些设置连接/禁止访问”的错误信息 - 测试凭据时,请检查凭据警告,这可能是由于你的应用的 访问范围 依赖导致的。例如,read_orders 作用域也需要 read_products 作用域。检查你已分配的范围以及你尝试完成的操作。

¥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.