rocket
隆重推出
Merchant API - Content API for Shopping 的正式替代方案。
update
获取最新资讯,了解 Merchant API 的新功能、问题修复和更新。
add_alert
注意:Content API for Shopping 将于 2026 年 8 月 18 日停用。
关联您的商家资料
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
要向 Merchant Center 提供本地产品目录,您必须首先指定 Merchant Center 将负责哪些商家。您可以通过 Content API 从商家资料获取可能的商家群组列表,但是您需要首先请求访问商家资料。
请求访问商家资料
如需申请对您的商家资料的访问权限,请使用 liasettings.requestgmbaccess
方法:
POST https://shoppingcontent.googleapis.com/content/v2.1/12345/liasettings/67890/requestgmbaccess?gmbEmail=admin@example.com
如该示例所示,gmbEmail
查询参数指定商家资料管理员的电子邮件地址。
调用此方法后,指定的管理员将收到一封电子邮件,询问他们是接受还是拒绝访问请求。如果管理员未采取任何措施,此请求将在 7 天后过期。
列出可用的商家群组
在被允许访问后,您可以调用 liasettings.getaccessiblegmbaccounts
方法来查看哪些商家可用:
GET https://shoppingcontent.googleapis.com/content/v2.1/12345/liasettings/67890/accessiblegmbaccounts
Response:
200 OK
{
"kind": "content#liasettingsGetAccessibleGmbAccountsResponse",
"accountId": 67890,
"gmbAccounts": [{
"type" : "user",
"email" : "admin@example.com",
"name" : "admin@example.com",
"listingCount": 82
},
{
"type" : "business",
"email" : "california@example.com",
"name" : "Golden-State",
"listingCount" : 20
},
{
"type" : "business",
"email" : "florida@example.com",
"name" : "Sunshine-State",
"listingCount" : 15
},
{
"type" : "business",
"email" : "newyork@example.com",
"name" : "Empire-State",
"listingCount" : 25
}]
}
为 Merchant Center 账号指定商家群组
现在,您已获得可能存在的商家组列表,接下来需要将与 Merchant Center 账号相关联的 Accounts
资源中的 googleMyBusinessLink
字段设置为所需的值。例如,如果 Merchant Center 67890 将包含以加利福尼亚为中心位置的商家的商品,则您可以使用 Accounts.update
设置此信息:
PUT https://shoppingcontent.googleapis.com/content/v2/12345/accounts/67890
{
"googleMyBusinessLink" : {
"gmbEmail": "california@example.com"
}
}
Response:
200 OK
{
"kind": "content#account",
"id": 67890,
"googleMyBusinessLink" : {
"gmbEmail": "california@example.com",
"status" : "active"
}
}
设置 googleMyBusinessLink
字段时不需要任何手动验证,因此链接的状态将会立即反映出来。
提交商品和产品目录数据
现在,Merchant Center 与商家群组相关联,您可以为这些商家提供实体店商品和实体店商品目录数据。
为此,您可以使用与上传在线商品和商品目录数据相同的方法,例如 products.insert
。
对于 products.insert
,您将指定 local
渠道而不是 online
渠道。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-13。
[null,null,["最后更新时间 (UTC):2025-08-13。"],[[["\u003cp\u003eThe Merchant API is the new version of the Content API for Shopping and its future.\u003c/p\u003e\n"],["\u003cp\u003eTo provide local inventory, you must first link your Merchant Center to your Business Profile.\u003c/p\u003e\n"],["\u003cp\u003eAccess to the Business Profile is requested via the \u003ccode\u003eliasettings.requestgmbaccess\u003c/code\u003e method and granted by the Business Profile administrator.\u003c/p\u003e\n"],["\u003cp\u003eAfter access is granted, you can specify the business group for your Merchant Center and submit local product and inventory data.\u003c/p\u003e\n"]]],["The Merchant API beta, a new version of the Content API for Shopping, is introduced. To provide local inventory, first request Business Profile access via the `liasettings.requestgmbaccess` method, specifying the administrator's email. Once granted, use `liasettings.getaccessiblegmbaccounts` to list available business groups. Associate the Merchant Center account with a business group by setting the `googleMyBusinessLink` field via `Accounts.update`. Finally, submit local product and inventory data using methods like `products.insert`, specifying the \"local\" channel.\n"],null,["# Link your Business Profile\n\nTo provide local inventory to the Merchant Center, you must first specify which\nbusinesses the Merchant Center will be responsible for. You can get the list of\npossible business groups from the Business Profile via the Content API, but you'll need\nto request access to the Business Profile first.\n\nRequest access to a Business Profile\n------------------------------------\n\nTo request access to your Business Profile, use the\n[`liasettings.requestgmbaccess`](/shopping-content/reference/rest/v2.1/liasettings/requestgmbaccess)\nmethod: \n\n POST https://shoppingcontent.googleapis.com/content/v2.1/12345/liasettings/67890/requestgmbaccess?gmbEmail=admin@example.com\n\nAs this example shows, the `gmbEmail` query parameter specifies the email\naddress of the administrator for the Business Profile.\n\nAfter you call this method, the specified administrator will receive an email\nasking them to accept or reject the access request. This request expires after\n7 days if no action is taken by the administrator.\n\nList the available business groups\n----------------------------------\n\nOnce access has been permitted, you can see which businesses are available by\ncalling the\n[`liasettings.getaccessiblegmbaccounts`](/shopping-content/reference/rest/v2.1/liasettings/getaccessiblegmbaccounts)\nmethod: \n\n GET https://shoppingcontent.googleapis.com/content/v2.1/12345/liasettings/67890/accessiblegmbaccounts\n\n Response:\n 200 OK\n {\n \"kind\": \"content#liasettingsGetAccessibleGmbAccountsResponse\",\n \"accountId\": 67890,\n \"gmbAccounts\": [{\n \"type\" : \"user\",\n \"email\" : \"admin@example.com\",\n \"name\" : \"admin@example.com\",\n \"listingCount\": 82\n },\n {\n \"type\" : \"business\",\n \"email\" : \"california@example.com\",\n \"name\" : \"Golden-State\",\n \"listingCount\" : 20\n },\n {\n \"type\" : \"business\",\n \"email\" : \"florida@example.com\",\n \"name\" : \"Sunshine-State\",\n \"listingCount\" : 15\n },\n {\n \"type\" : \"business\",\n \"email\" : \"newyork@example.com\",\n \"name\" : \"Empire-State\",\n \"listingCount\" : 25\n }]\n }\n\nSpecify the business group for the Merchant Center account\n----------------------------------------------------------\n\nNow that you have a list of possible business groups, you need to set the\n`googleMyBusinessLink` field in the\n[`Accounts`](/shopping-content/reference/rest/v2.1/accounts) resource associated\nwith the Merchant Center account to the desired one. For example, if Merchant\nCenter 67890 will contain products for California-based businesses, you can use\n[`Accounts.update`](/shopping-content/reference/rest/v2.1/accounts/update) to set that\ninformation: \n\n PUT https://shoppingcontent.googleapis.com/content/v2/12345/accounts/67890\n {\n \"googleMyBusinessLink\" : {\n \"gmbEmail\": \"california@example.com\"\n }\n }\n\n Response:\n 200 OK\n {\n \"kind\": \"content#account\",\n \"id\": 67890,\n \"googleMyBusinessLink\" : {\n \"gmbEmail\": \"california@example.com\",\n \"status\" : \"active\"\n }\n }\n\nSetting the `googleMyBusinessLink` field does not require any manual\nverification, so the status of the link will be reflected immediately.\n\nSubmit product and inventory data\n---------------------------------\n\nNow that the Merchant Center is associated with a business group, you can\nprovide local product and local product inventory data for those businesses.\nFor this, you use the same methods, such as\n[`products.insert`](/shopping-content/reference/rest/v2.1/products/insert) that you\nuse to upload online products and inventory data.\nFor `products.insert`, you'll specify a channel of `local` instead of `online`.\n| **Note:** There are separate requirements for [local product feeds](https://support.google.com/merchants/answer/3061198) and [local product inventory feeds](https://support.google.com/merchants/answer/3061342), so make sure you're providing all the necessary information."]]