验证您的帐号与 Merchant API 的关联
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
如果您已有 Merchant Center 账号,可以使用参考文档中的 Google API Explorer 验证您的账号是否已准备好与 Merchant API 搭配使用。
- 将
accounts/
和 merchantId
串联起来,即可找到您账号的资源名称。您可以在 Google Merchant Center 的顶部找到 merchantId
。
- 在
accounts.products.list
方法的 API Explorer 中,执行以下操作:
- 在
parent
字段中输入您账号的资源名称。
- 在凭据部分中,选择 Google OAuth 2.0 和 API 密钥。
- 点击执行。
- 如果系统提示,请使用与您的 Google Merchant Center 账号关联的 Google 账号登录。
如果您的 Merchant Center 账号设置正确,请求会成功并返回 HTTP 响应代码 200
。如果您刚刚创建了新账号,accounts.products.list
方法将不会返回任何商品。
接下来,尝试使用客户端库请求访问其他 Merchant Center 账号。客户端库支持用户授权,可向应用授予访问和管理 Merchant Center 账号数据的权限。
您还可以使用服务账号向 API 授予对您自己账号的访问权限。服务账号是一种特殊类型的账号,属于应用(而不是某个最终用户)。如需了解详情,请参阅服务账号概览。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-08。
[null,null,["最后更新时间 (UTC):2025-08-08。"],[[["\u003cp\u003eExisting merchant account holders can use the API explorer to verify their account's compatibility with the Merchant API.\u003c/p\u003e\n"],["\u003cp\u003eAccount verification involves locating your \u003ccode\u003emerchantId\u003c/code\u003e, constructing the resource name, and executing the \u003ccode\u003eaccounts.products.list\u003c/code\u003e method within the API Explorer using your credentials.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful verification is indicated by an HTTP response code \u003ccode\u003e200\u003c/code\u003e, although new accounts may not return any product data.\u003c/p\u003e\n"],["\u003cp\u003eAfter verification, users can proceed to utilize client libraries for accessing other merchant accounts or employ service accounts for authorizing API access to their own account.\u003c/p\u003e\n"]]],["To verify a merchant account for API use, locate your `merchantId` in Google Merchant Center and construct the account's resource name. In the API Explorer, use the `accounts.products.list` method, input the resource name in the `parent` field, and select Google OAuth 2.0 and API key credentials. Executing the request should return an HTTP 200 code, confirming successful setup. For new accounts, the product list will be empty. Further access can be configured via client libraries or service accounts.\n"],null,["# Verify your account's connection to Merchant API\n\nIf you have an existing Merchant Center account, you can use [Google APIs\nExplorer](https://developers.google.com/apis-explorer) in the [reference documentation](/merchant/api/reference/rest) to verify\nthat your account is ready to use with the Merchant API.\n\n1. Find the resource name of your account by concatenating `accounts/` and your `merchantId`. You can find your `merchantId` in the top of [Google Merchant Center](//merchants.google.com/).\n2. In the API Explorer for the [`accounts.products.list`](/merchant/api/reference/rest/products_v1/accounts.products/list) method, do the following:\n 1. Enter the resource name of your account in the `parent` field.\n 2. In the **Credentials** section, select **Google OAuth 2.0** and **API\n key**.\n 3. Click **Execute**.\n 4. If prompted, sign in with the Google Account associated with your Google Merchant Center account.\n\nIf your Merchant Center account is set up correctly, the request succeeds and\nreturns an HTTP response code `200`. If you just created a new account, the\n`accounts.products.list` method doesn't return any products.\n\nNext, try [using a client library](/merchant/api/client-libraries) to request\naccess to other Merchant Center accounts. Client libraries support user\nauthorization, which grants an application permission to access and manage\nMerchant Center account data.\n\nYou can also [use a service\naccount](/merchant/api/guides/authorization/access-your-account) to authorize\nAPI access to your own account. A service account is a special type of account\nthat belongs to an application instead of an individual end user. For more\ninformation, see [Service accounts overview](https://cloud.google.com/iam/docs/service-account-overview)."]]