授权:此流程用于确定经过身份验证的用户或应用可以使用 Merchant Center 账号执行哪些操作。它会根据 Merchant Center 账号中授予经过身份验证的用户的角色和权限,回答“您能做什么?”这个问题。例如,用户可能获授权读取产品数据,但未获授权修改账号设置。
注册:对于 Merchant API,这是一次性设置流程,可让 Google 向您发送有关您管理的商家账号的重要服务公告。注册会将您的开发者电子邮件地址添加到您的主要 Merchant Center 账号,并将其与您用于身份验证的 Google Cloud 项目 ID 相关联。通过这种关联,您的应用可以接收您管理的所有商家账号的服务公告。如需了解详情,请参阅创建 Google Cloud 项目。
注册
注册流程对于使您的应用能够使用 Merchant API 至关重要。以下是您需要知晓的相关信息:
前提条件
如需注册使用 Merchant API,您需要满足以下条件:
Merchant Center 账号:您需要拥有现有的 Merchant Center 账号。
管理员访问权限:您用于发起注册调用的 Google 用户账号必须对您要注册的 Merchant Center 账号拥有管理员权限。
Google Cloud 项目:您的应用必须与 Google Cloud 项目相关联。此项目会为您的应用提供必要的凭据(例如 OAuth 2.0 客户端 ID)以进行身份验证。
无法注册共享 Google Cloud 项目的原因
Google OAuth Playground 和 APIs Explorer 等工具使用共享的 Google Cloud 项目(归 Google 所有)。您无法通过共享项目注册,原因如下:
它们仅用于测试和探索,不适用于生产应用身份。
注册这些工具意味着共享工具与您的特定 Merchant Center 数据之间存在关联,可能会导致您收到不必要的通信。
您的应用需要有自己的专用 Google Cloud 项目,这样 Google 发送给您的 Merchant API 通信才能与您的实际使用情况保持相关。
不过,您可以使用 OAuth Playground 和 API Explorer Web 应用来使用 Merchant API 进行实验和非生产用例。
查找您的 Google Cloud 项目 ID
您可以在 Google Cloud 控制台中找到项目 ID 和项目编号。如需了解详情,请参阅查找项目名称、编号和 ID。
拨打注册电话
使用 Accounts 子 API 中的 registerGcp 方法进行注册。此调用会将您的 Google Cloud 项目编号与 Merchant Center 账号相关联。
在此过程中,您应提供与您用于调用 API 的个人用户相关联的电子邮件地址。此电子邮件地址的所有者必须是拥有 Merchant Center 账号管理员访问权限的用户。
电子邮件字段简介
有效的沟通至关重要。Google 会发送重要动态资讯、强制性服务通告 (MSA)、开发者调查问卷以及与 Merchant API 相关的其他机会。妥善管理联系人可确保这些信息能够触达合适的人员。
用途:Google 会使用此电子邮件地址作为 API 相关通信的主要联系方式。
电子邮件地址的所有者:此电子邮件地址应为负责 API 集成的个人开发者或主要技术联系人的电子邮件地址。
最佳实践:
建议:使用个人的公司电子邮件地址。
请勿:使用一般群组别名或服务账号电子邮件地址。我们希望将通信内容发送给人类收件人。
用于联系人管理的 users 资源
虽然注册调用中的电子邮件地址会设置初始联系人,但管理联系人和权限的更可靠方式是使用 Merchant API accounts.users 资源或 Merchant Center 界面中的用户管理设置。如需详细了解如何使用 Merchant Center,请参阅管理账号中的用户。
您可以按如下方式利用这些功能:
添加所有开发者:将负责 API 集成的开发者添加为 Merchant Center 账号的用户。
分配 API_DEVELOPER 角色:除了标准角色(管理员、标准)之外,您还可以为用户分配 API_DEVELOPER 角色。具体而言,应向需要接收 API 相关通信的用户分配此角色。您可以将其与其他角色结合使用。
优势:
清晰分离:将 API 联系人管理与一次性注册分离。
灵活性:随着团队成员的变动,及时更新联系人。
有针对性的沟通:确保 API 特定的新闻发送给相关人员。
即使您在注册时提供了电子邮件地址,我们仍强烈建议您通过添加具有 API_DEVELOPER 角色的用户来管理 API 联系人。
[null,null,["最后更新时间 (UTC):2025-09-12。"],[],[],null,["To effectively use Merchant API, it's important to understand the concepts of\n**registration, authentication,** and **authorization**. They serve distinct\npurposes in ensuring secure and correct access to Merchant Center data.\n\nTerminology\n\nRegistration, authentication and authorization are related, but each has a\ndistinct meaning and purpose.\n\n- **Authentication** : In this process the service verifies the identity of the user or application making an API request. Merchant API uses standard Google mechanisms like [OAuth\n 2.0](/identity/protocols/oauth2). For more information, see [Authenticate\n requests](/merchant/api/guides/authorization/access-client-accounts) and [Authenticate as your own\n account](/merchant/api/guides/authorization/access-your-account).\n- **Authorization**: This process determines what actions the authenticated user or application is permitted to perform using a Merchant Center account. It answers the question: \"What can you do?\" based on the roles and permissions granted to the authenticated user within the Merchant Center account. For example, a user might be authorized to read product data, but not to modify account settings.\n- **Registration** : With respect to Merchant API, this is a one-time setup process that lets Google send you important service announcements for the merchant accounts you manage. Registration adds your developer email addresses to your main Merchant Center account and links it to the Google Cloud Project ID(s) you use for authentication. This linkage lets your application, receive service announcements for all the merchant accounts you manage. For more information, see [Create a Google Cloud\n Project](/workspace/guides/create-project).\n\nRegistration\n\nThe registration process is crucial for enabling your application to use the\nMerchant API. Here's what you need to know:\n\nPrerequisites\n\nRegistering to use Merchant API requires the following:\n\n- **Merchant Center Account**: You need an existing Merchant Center account.\n- **Admin Access:** The Google user account you use to initiate the registration call must have Admin privileges on the Merchant Center account you are registering.\n- **Google Cloud Project**: Your application must be associated with a Google Cloud Project. This project provides the necessary credentials (like OAuth 2.0 Client IDs) for your application to authenticate.\n\nWhy you can't register a shared Google Cloud project\n\nTools like the Google OAuth Playground and APIs Explorer use shared,\nGoogle-owned Google Cloud projects. You cannot register with shared projects\nbecause:\n\n- They are meant for testing and exploration, not for production application identity.\n- Registering them would imply a link between the shared tool and your specific Merchant Center data and may result in unwanted communication.\n\nYour application needs its own dedicated Google Cloud project so the Merchant\nAPI communications Google sends to you remain relevant for your actual usage.\n\nNevertheless, you can use the OAuth Playground and API Explorer webapps to use\nthe Merchant API for experimentation and non-production use cases.\n\nFind your Google Cloud Project ID\n\nYou can find your **Project ID** and **Project Number** in the Google Cloud\nConsole. For details, see [Find the project name, number, and\nID](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects).\n| **Tip:** The Project ID is a unique string, and the Project Number is a unique integer. The registration process typically uses the Project Number.\n\nMake the registration call\n\nRegister using the\n[`registerGcp`](/merchant/api/reference/rest/accounts_v1/accounts.developerRegistration/registerGcp)\nmethod within the `Accounts` sub-API. This call associates your Google Cloud\nProject Number with the Merchant Center account.\n\nDuring the process, you should provide an email address associated with an\nindividual user that you use to call the API. This email must belong to a user\nwith Admin access to the Merchant Center account.\n\nAbout the email field\n\nEffective communication is key. Google sends important updates, Mandatory\nService Announcements (MSAs), developer surveys, and other opportunities related\nto the Merchant API. Proper contact management ensures that these reach the\nright people.\n\n- **Purpose**: Google uses this email address as a primary contact for API-related communications.\n- **Whose email**: This should be the email address of an individual developer or a key technical contact who is responsible for the API integration.\n- **Best Practices** :\n - **DO**: Use an individual's corporate email address.\n - **DO NOT**: Use general group aliases or service account emails. We intend communications for human recipients.\n\nThe `users` resource for contact management\n\nWhile the email address in the registration call sets an initial contact, the\nmore robust way to manage contacts and permissions is using the Merchant API\n[`accounts.users`](/merchant/api/reference/rest/accounts_v1/accounts.users)\nresource or the user management settings in the Merchant Center UI. For more\ninformation on using Merchant Center, see [Manage people on your\naccount](https://support.google.com/merchants/answer/12160472?#manageusers).\n\nTake advantage of these features as follows:\n\n1. **Add all developers**: Add developers working on the API integration as users of the Merchant Center account.\n2. **Assign the `API_DEVELOPER` role** : Besides standard roles (**Admin** , **Standard** ), you can assign users the `API_DEVELOPER` role. In particular, assign this role to users who should receive API-related communications. You can combine it with other roles.\n3. **Benefits** :\n - **Clear separation**: Decouples API contact management from the one-time registration.\n - **Flexibility**: Update contacts as team members change.\n - **Targeted communication**: Ensures API-specific news goes to the relevant people.\n\nEven if you provided an email address during registration, we strongly recommend\nmanaging API contacts by adding users with the `API_DEVELOPER` role.\n\nReferences\n\nFor more information, see the following:\n\n- [Quickstart guide](/merchant/api/guides/quickstart)\n- [`DeveloperRegistration`](/merchant/api/reference/rest/accounts_v1/accounts.developerRegistration) methods"]]