遷移帳戶連結

帳戶關係的管理方式已從 Content API for Shopping 的單一 link 方法,演變為 Merchant API 中更精細且明確的系統。新版 API 會使用 AccountRelationshipAccountService 等專屬資源,定義一個帳戶提供給另一個帳戶的特定服務。詳情請參閱「帳戶之間的關係」。

主要差異

  • 關係和服務專屬資源:在 Merchant API 中,AccountRelationship 資源會定義服務供應商和商家之間的連結,而 AccountService 資源則會指定提供的確切服務 (例如 accountAggregation)。這會取代 Shopping Content API 中的一般 linkTypeservices 欄位。
  • 明確的動作方法:Merchant API 使用不同的方法來管理服務,例如 proposeapprovereject,而不是使用單一的 link 方法搭配 action 參數。
  • 專屬的 Google 商家檔案連結:連結至 Google 商家檔案 (先前是透過設定 googleMyBusinessLink 欄位處理),現在有專屬方法 gbpAccounts.linkGbpAccount
  • 以服務形式建立客戶帳戶:在進階帳戶下建立客戶帳戶,現在視為使用 accounts.createAndConfigure 方法提議 accountAggregation 服務。如要進一步瞭解帳戶,請參閱「Merchant Accounts API」頁面。由於使用者可以存取進階帳戶和客戶帳戶,因此不需要握手。

要求

Merchant API 提供特定端點,用於管理不同類型的帳戶連結和服務:

商家 API 要求網址

  • 建議新服務POST https://merchantapi.googleapis.com/accounts/v1/ {parent=accounts/*}/services:propose
  • 核准服務POST https://merchantapi.googleapis.com/accounts/v1/ {name=accounts/*/services/*}:approve
  • 拒絕服務POST https://merchantapi.googleapis.com/accounts/v1/ {name=accounts/*/services/*}:reject
  • 連結至 Google 商家檔案POST https://merchantapi.googleapis.com/accounts/v1/ {parent=accounts/*}/gbpAccounts:linkGbpAccount
  • 建立客戶帳戶 (帳戶匯總連結)POST https://merchantapi.googleapis.com/accounts/v1/ accounts:createAndConfigure

要求比較網址

要求說明 Content API for Shopping Merchant API
連結帳戶 (例如第三方平台) POST .../v2.1/{merchantId}/accounts/{accountId}/link POST .../v1/{parent=accounts/*}/services:propose
連結至 Google 商家檔案 PUT .../v2.1/{merchantId}/accounts/{accountId} (含 googleMyBusinessLink 欄位) POST .../v1/{parent=accounts/*}/gbpAccounts:linkGbpAccount
建立客戶帳戶 POST .../v2.1/{merchantId}/accounts POST .../v1/accounts:createAndConfigure

方法

Content API for Shopping 方法 Merchant API 方法 適用情形和注意事項
accounts.link accountServices.propose 使用這個方法,以其他帳戶啟動新服務。
accounts.link (含 action: "approve") accountServices.approve 使用這個方法核准待處理的服務提案。
accounts.link (含 action: "remove") accountServices.reject 使用這個方法拒絕待處理或已建立的服務。
accounts.insert (適用於客戶帳戶) accounts.createAndConfigure 使用 accountAggregation 服務,在進階帳戶下建立新的客戶帳戶。
accounts.update (含 googleMyBusinessLink) gbpAccounts.linkGbpAccount 請使用這個專屬方法,將 Merchant Center 帳戶連結至 Google 商家檔案。
accounts.update (含 adsLinks) AccountRelationship 項資源 連結至 Google Ads 的作業是在 Google Ads 使用者介面中管理。產生的連結在 Merchant API 中會以 AccountRelationship 表示,可供查看但無法直接建立。

詳細欄位變更

Content API for Shopping Merchant API 說明
AccountsLinkRequest.action proposeapprovereject 方法 單一 action 欄位會替換為專屬 API 方法,用於服務生命週期的各項狀態變更。
AccountsLinkRequest.linkType AccountService.service_type 一般 linkType 字串會替換為 AccountService 資源中的結構化 service_type oneof 欄位,例如 productsManagementaccountAggregation
AccountsLinkRequest.services AccountService.service_type 現在,字串型服務清單會以 AccountService 資源中選擇的特定 service_type 表示。
AccountsLinkRequest.linkedAccountId ProposeAccountServiceRequest.provider 提供服務的帳戶 ID 現在已在 propose 要求的 provider 欄位中指定。
Account.googleMyBusinessLink LinkGbpAccountRequest 含有 Google 商家檔案連結詳細資料的物件,會由 linkGbpAccount 方法的專屬要求訊息取代。
Account.adsLinks AccountRelationship Google Ads 連結會以 AccountRelationship 資源表示,其中 providerproviders/GOOGLE_ADS。這類關係通常是在 Google Ads 使用者介面中管理。