WooCommerce 凭证#
¥WooCommerce credentials
你可以使用以下凭据验证以下节点:
¥You can use these credentials to authenticate the following nodes:
先决条件#
¥Prerequisites
- 在你的 WordPress 网站上安装 WooCommerce 插件。
¥Install the WooCommerce plugin on your WordPress website.
- 在 WordPress 中,转到“设置”>“固定链接”,并将 WordPress 固定链接设置为除“纯文本”之外的其他格式。
¥In WordPress, go to Settings > Permalinks and set your WordPress permalinks to use something other than Plain.
支持的身份验证方法#
¥Supported authentication methods
- API 密钥
¥API key
相关资源#
¥Related resources
有关服务的更多信息,请参阅 WooCommerce REST API 文档。
¥Refer to WooCommerce's REST API documentation for more information about the service.
使用 API 密钥#
¥Using API key
要配置此凭据,你需要:
¥To configure this credential, you'll need:
- 消费者密钥:在生成 API 密钥时创建。
¥A Consumer Key: Created when you generate an API key.
- 消费者密钥:在生成 API 密钥时创建。
¥A Consumer Secret: Created when you generate an API key.
- WooCommerce URL
生成 API 密钥并设置你的凭据:
¥To generate an API key and set up your credential:
- 前往 WooCommerce >“设置”>“高级”>“REST API”>“添加密钥”。
¥Go to WooCommerce > Settings > Advanced > Rest API > Add key. 2. 从“权限”下拉列表中选择“读/写”。
¥Select Read/Write from the Permissions dropdown. 3. 复制生成的消费者密钥和消费者密钥,并将其输入到你的 n8n 凭据中。
¥Copy the generated Consumer Key and Consumer Secret and enter them into your n8n credentials. 4. 请将你的 WordPress 网站 URL 输入为 WooCommerce URL。
¥Enter your WordPress site URL as the WooCommerce URL. 5. 默认情况下,n8n 会在 Authorization 标头中传递你的凭据详细信息。如果需要将它们作为查询字符串参数传递,请启用“在查询中包含凭据”选项。
¥By default, n8n passes your credential details in the Authorization header. If you need to pass them as query string parameters instead, turn on Include Credentials in Query.
有关更多信息,请参阅 生成密钥。
¥Refer to Generate Keys for more information.
解决 "缺少消费者键" 错误#
¥Resolve "Consumer key is missing" error
当你尝试连接凭据时,可能会收到如下错误:Consumer key is missing。
¥When you try to connect your credentials, you may receive an error like this: Consumer key is missing.
当服务器无法解析通过 SSL 进行身份验证时的 Authorization 标头详细信息时,会发生此错误。
¥This occurs when the server can't parse the Authorization header details when authenticating over SSL.
要解决此问题,请启用“在查询中包含凭据”开关,将消费者密钥/密钥作为查询字符串参数传递,然后重试凭据。
¥To resolve it, turn on the Include Credentials in Query toggle to pass the consumer key/secret as query string parameters instead and retry the credential.