检索和更新客户的帐号信息
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
如需使用 Reseller API 检索和更新客户的信息,您可以通过以下两种方式之一查找客户:
- 客户的唯一标识符 - 例如,
C0123456
- 客户的域名,例如
example.com
如需检索客户的账号信息,请使用以下 GET
请求,并添加授权令牌:
GET https://reseller.googleapis.com/apps/reseller/v1/customers/CUSTOMER_ID
将 CUSTOMER_ID
替换为客户的唯一标识符或域名。
返回响应
检索客户的账号信息时,您可能会收到以下某种响应:
返回完整的客户设置。客户是您的现有客户。使用 Reseller API,您可以管理此客户的账号和订阅设置。
返回最少的客户账号信息。如果响应仅返回 customerId
、customerDomain
和 customerType
,则表示客户由 Google 或其他转销商管理。您无法为该客户创建其他经过电子邮件验证的客户。如需管理此客户,请按以下步骤操作:
- 检索客户的所有可转移订阅,以了解订阅是否可以转移以及转移所需的最低用户席位数。
- 转移订阅。
返回 Multiple teams exist on this domain
。此网域关联了一个或多个团队客户。如需向此网域添加其他团队,请按以下步骤操作:
- 订购客户账号。
- 如需为该网域创建已通过网域验证的客户,请让客户通过 Google 购买直接订阅并验证其网域,接管现有团队,然后将订阅转移到您的账号。
返回 HTTP 404
错误。客户是 Google 新用户,没有账号。如需管理此客户,请按以下步骤操作:
- 确认您的客户记录不包含以下旧客户数据:客户的主域名与唯一的 Google 客户标识符可能不匹配。恢复之前删除的 Google 账号后,系统会将其视为新账号,并为其分配新的
customerId
值,即使该账号可能保留相同的 customerDomain
值也是如此。
- 为新客户订购账号。
- 为这个新客户账号创建订阅。
更新客户的设置
使用 Reseller API 时,您无法更新 customerType
,但可以验证 team
客户的网域并成为 domain
客户。
如需更新客户的设置,请使用以下 PUT
请求并添加客户的唯一标识符:
PUT https://reseller.googleapis.com/apps/reseller/v1/customers/CUSTOMER_ID
JSON 请求正文会更新以下客户设置:
{
"customerId": "C0CUSTOMER_ID123456",
"customerDomain": "DOMAIN_NAME",
"postalAddress": {
"contactName": "NAME",
"organizationName": "ORGANIZATION_NAME",
"postalCode": "POSTAL_CODE",
"countryCode": "COUNTRY_CODE"
},
"alternateEmail": "EMAIL_ADDRESS"
}
替换以下内容:
DOMAIN_NAME
:客户的网域,例如 example.com
NAME
:客户的名称,例如 Alex Cruz
。
ORGANIZATION_NAME
:客户的组织名称,例如 Example Organization
。
POSTAL_CODE
:客户的邮政编码,例如 94043
。
COUNTRY_CODE
:客户的 2 个字符的 ISO 国家/地区代码。
EMAIL_ADDRESS
:客户的电子邮件地址,例如 cruz@example.com
。
成功的 JSON 响应会返回 HTTP 200
状态代码和更新后的客户设置:
{
"kind": "reseller#customer",
"customerId": "CUSTOMER_ID",
"customerDomain": "DOMAIN_NAME",
"postalAddress": {
"kind": "customers#address",
"contactName": "NAME",
"organizationName": "ORGANIZATION_NAME",
"postalCode": "POSTAL_CODE",
"countryCode": "COUNTRY_CODE",
},
"alternateEmail": "EMAIL_ADDRESS"
}
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-29。
[null,null,["最后更新时间 (UTC):2025-08-29。"],[],[],null,["# Retrieve & update a customer's account information\n\nTo retrieve and update a customer's information by using the Reseller API,\nyou have one of two ways to look up your customer:\n\n- Customer's unique identifier---for example, `C0123456`\n- Customer's domain name---for example, `example.com`\n\nRetrieve a customer's account information\n-----------------------------------------\n\nTo retrieve a customer's account information, use the following `GET` request\nand include the authorization token: \n\n```\nGET https://reseller.googleapis.com/apps/reseller/v1/customers/CUSTOMER_ID\n```\n\nReplace the \u003cvar translate=\"no\"\u003eCUSTOMER_ID\u003c/var\u003e with your customer's unique\nidentifier or domain name.\n\n### Response returns\n\nWhen you retrieve a customer's account information, you might receive one of the\nfollowing responses:\n\n- **Returns the full customer settings.** The customer is one of your\n existing customers. Using the Reseller API, you can manage this\n customer's account and subscription settings.\n\n- **Returns the minimal customer account information.** If the response only\n returns the `customerId`, `customerDomain` and `customerType`, either\n Google or another reseller manages the customer. You can't create another\n email-verified customer for the customer. To manage this customer,\n follow these steps:\n\n 1. [Retrieve all transferable subscriptions for the customer](/workspace/admin/reseller/v1/how-tos/manage_subscriptions) to understand whether the subscription can be transferred and the minimum number of user seats for the transfer.\n 2. [Transfer the subscription](/workspace/admin/reseller/v1/how-tos/manage_subscriptions).\n- **Returns `Multiple teams exist on this domain`**. This domain\n has one or multiple team customers associated with it. To add another team\n to this domain, follow these steps:\n\n 1. [Order a customer account](/workspace/admin/reseller/v1/how-tos/manage_subscriptions).\n 2. To create a domain-verified customer for the domain, ask the customer to [purchase a direct subscription via Google and verify their domain, takeover existing teams](https://support.google.com/a/answer/9122284) and then [transfer the subscription to your account](/workspace/admin/reseller/v1/how-tos/(/workspace/admin/reseller/v1/how-tos/manage_subscriptions)).\n- **Returns an HTTP `404` error.** The customer is new to Google and doesn't\n have an account. To manage this customer, follow these steps:\n\n 1. Confirm that your customer records don't hold old customer data with a potential mismatch of a customer's primary domain name and the unique Google customer identifier. When a previously deleted Google account is reinstated, it's treated as a new account and has a new `customerId` value even though the account may retain the same `customerDomain` value.\n 2. [Order a new customer account](/workspace/admin/reseller/v1/how-tos/manage_customers).\n 3. [Create a subscription](/workspace/admin/reseller/v1/how-tos/manage_subscriptions) for this new customer account.\n\nUpdate a customer's settings\n----------------------------\n\nUsing the Reseller API, you can't update the `customerType` but you can\nverify a `team` customer's domain and become a `domain` customer.\n\nTo update a customer's settings, use the following `PUT` request and include\nthe unique identifier for your customer: \n\n```\nPUT https://reseller.googleapis.com/apps/reseller/v1/customers/CUSTOMER_ID\n```\n\nThe JSON request body updates the following customer settings: \n\n```\n{\n \"customerId\": \"C0CUSTOMER_ID123456\",\n \"customerDomain\": \"DOMAIN_NAME\",\n \"postalAddress\": {\n \"contactName\": \"NAME\",\n \"organizationName\": \"ORGANIZATION_NAME\",\n \"postalCode\": \"POSTAL_CODE\",\n \"countryCode\": \"COUNTRY_CODE\"\n },\n \"alternateEmail\": \"EMAIL_ADDRESS\"\n}\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eDOMAIN_NAME\u003c/var\u003e: your customer's domain---for example, `example.com`\n- \u003cvar translate=\"no\"\u003eNAME\u003c/var\u003e: your customer's name---for example, `Alex Cruz`.\n- \u003cvar translate=\"no\"\u003eORGANIZATION_NAME\u003c/var\u003e: your customer's organization name---for example, `Example Organization`.\n- \u003cvar translate=\"no\"\u003ePOSTAL_CODE\u003c/var\u003e: your customer's ZIP or postal code---for example, `94043`.\n- \u003cvar translate=\"no\"\u003eCOUNTRY_CODE\u003c/var\u003e: your customer's 2 character [ISO country code](https://countrycode.org/).\n- \u003cvar translate=\"no\"\u003eEMAIL_ADDRESS\u003c/var\u003e: your customer's email address---for example, `cruz@example.com`.\n\nA successful JSON response returns an HTTP `200` status code and the updated\ncustomer settings: \n\n```\n{\n \"kind\": \"reseller#customer\",\n \"customerId\": \"CUSTOMER_ID\",\n \"customerDomain\": \"DOMAIN_NAME\",\n \"postalAddress\": {\n \"kind\": \"customers#address\",\n \"contactName\": \"NAME\",\n \"organizationName\": \"ORGANIZATION_NAME\",\n \"postalCode\": \"POSTAL_CODE\",\n \"countryCode\": \"COUNTRY_CODE\",\n },\n \"alternateEmail\": \"EMAIL_ADDRESS\"\n}\n```"]]