從 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 中運送設定資源的比較範例:

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}

下列清單列出 Accounts 子 API 中運送設定資源的主要更新,與 Content API for Shopping 相比:

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

新支援的欄位

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

  1. warehouses:提供有關出貨倉庫的資訊,該倉庫會儲存及處理商品目錄。
  2. 會員方案:商家 API 使用者可以在運送設定中輸入會員方案資訊。
  3. Etag: 如果不同使用者嘗試同時使用 Merchant API 和 Merchant Center 使用者介面更新運送設定,Etag 可解決非同步問題。

已重新命名的欄位

在 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 和運送設定資源中的方法:

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