連結商家檔案

如要向 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