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
。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-13 (世界標準時間)。
[null,null,["上次更新時間: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."]]