從 Content API for Shopping 遷移運送設定

ShippingSettings 資源可讓您擷取及更新帳戶和所有相關聯子帳戶的運送設定。如要進一步瞭解如何新增或管理帳戶的運送設定,請參閱「運送設定總覽」。

如要使用 Merchant API 讀取運送設定資訊,請使用下列要求:

GET https://merchantapi.googleapis.com/accounts/v1/accounts/{ACCOUNT_ID}/shippingSettings

將 {ACCOUNT_ID} 替換為 Merchant Center 帳戶的專屬 ID。

如要使用 Merchant API 更新運送設定資訊,請使用下列要求:

POST https://merchantapi.googleapis.com/accounts/v1/accounts/{ACCOUNT_ID}/shippingSettings:insert

詳情請參閱「方法:accounts.shippingSettings.insert」。

Content API for Shopping 和 Merchant API 比較

以下是 Content API for Shopping 與 Accounts 子 API 中 Shipping settings 資源的比較範例:

Content API Merchant API
網址 https://shoppingcontent.googleapis.com/content/v2.1/{MERCHANT_ID}/shippingsettings/{ACCOUNT_ID} https://merchantapi.googleapis.com/accounts/v1/accounts/{ACCOUNT_ID}/shippingSettings:insert
ID {MERCHANT_ID}/shippingsettings/{ACCOUNT_ID} {NAME}

與 Content API for Shopping 相比,Accounts 子 API 的運送設定資源有以下主要更新:

  1. Merchant API 使用者必須在 {NAME} 欄位中輸入 accounts/{ACCOUNT_ID}/shippingSettings,才能達到相同效果。
  2. Merchant API 不支援對自訂區域 (例如地區群組) 執行讀取和寫入作業。自訂區域 (例如地區群組) 只能使用區域服務讀取或寫入。
  3. Merchant API 中的一項服務可支援多個運送國家/地區。
  4. Merchant API 不提供運送設定的清單方法,這與 Content API 中的 shippingsettings.list 方法不同。

新支援欄位

與 Content API for Shopping 相比,Accounts 子 API 中的運送設定資源支援下列新欄位:

  1. warehouses:提供出貨倉庫的相關資訊,用於儲存及處理商品目錄。
  2. 會員方案:Merchant API 使用者可在運送設定中輸入會員方案資訊。
  3. Etag: Etag 旨在解決非同步問題,當不同使用者嘗試同時使用 Merchant API 和 Merchant Center UI 更新運送設定時,就會發生這種問題。

重新命名的欄位

Accounts 子 API 的運送設定資源中,下列欄位已重新命名:

Content API for Shopping 運送設定資源 說明
service services 單一運送服務。
service.name services.serviceName 服務的任意形式名稱,在 Merchant Center 帳戶中不得重複。
service.deliveryCountry services.deliveryCountries 適用運送服務的國家/地區 CLDR 地域代碼。
service.currency services.currencyCode 這項服務適用的貨幣 CLDR 代碼。
service.deliveryTime.minTransitTimeInDays services.deliveryTime.minTransitDays 訂單運送所需的最短工作天數。舉例來說,0 表示當天到貨,1 表示次日到貨。
service.deliveryTime.maxTransitTimeInDays services.deliveryTime.maxTransitDays 訂單運送所需的最長工作天數。
service.deliveryTime.minHandlingTimeInDays services.deliveryTime.minHandlingDays 訂單出貨前所需的最少工作天數。
service.deliveryTime.maxHandlingTimeInDays services.deliveryTime.maxHandlingDays 訂單出貨前的最長工作天數。
service.deliveryTime.cutoffTime.timezone services.deliveryTime.cutoffTime.timeZone 截止時間的時區 ID。
service.deliveryTime.transitTimeTable.postalCodeGroupName services.deliveryTime.transitTimeTable.postalCodeGroupNames 郵遞區號群組的名稱。
service.deliveryTime.transitTimeTable.transitTimeLabel services.deliveryTime.transitTimeTable.transitTimeLabel 產品的運送時間標籤。
service.rate_group services.rateGroups 運送費率群組定義。
service.rate_group.subtable services.rateGroups.subtables 子表格清單。
service.rate_group.carrier_rate services.rateGroups.carrierRates 貨運公司費率清單。
service.minimumOrderValueTable.storeCodeSetWithMovs services.minimumOrderValueTable.storeCodeSetWithMovs 共用相同訂單最低金額的商店代碼組合清單。

已移除的方法

您無法使用 shippingsettings.custombatch 在單一要求中擷取及更新多個帳戶的運送設定。

已移除的欄位

Merchant API 已移除 Content API for Shopping 的下列欄位。Merchant API 不提供這些欄位的替代方案。

  • postal_code_group
  • service
    • Pickup_service
    • Eligibility
    • Scheduling_channel
    • Delivery_time
      • Holiday_cutoff

    • Rate_group
      • single_value_alternative_list

方法

以下是 Content API for Shopping 和 Shipping settings 資源中的方法比較:

方法 Content API for Shopping Merchant API
customBatch 是 否
get 是 是
update 是 否
insert 否 是
list 是 否
getSupportedCarrier 是 否
getSupportedHolidays 是 否