從 Content API for Shopping 遷移運送設定

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

GET https://merchantapi.googleapis.com/accounts/v1beta/accounts/{accountId}/shippingSettings

{accountId} 替換成您 Merchant Center 帳戶的專屬 ID。

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

POST https://merchantapi.googleapis.com/accounts/v1beta/accounts/{accountId}/shippingSettings:insert

比較 Content API for Shopping 和 Merchant API

以下是 Content API for Shopping 與 Merchant shipping settings API 的比較範例:

Content API 商家 API
網址 https://shoppingcontent.googleapis.com/content/v2.1/{accountId}/shippingsettings:insert https://merchantapi.googleapis.com/accounts/v1beta/accounts/{accountId}/shippingSettings:insert
ID {accountId}/shippingsettings/{accountId} {name}

以下清單列出 Merchant Shipping Settings API 與 Content API for Shopping 之間的重大更新:

  1. Merchant API 使用者必須在 {name} 欄位中輸入 accounts/{accountId}/shippingSettings,才能享有相同的行為。
  2. Merchant API 不支援自訂區域 (例如地區群組) 的讀取和寫入作業,地區群組等自訂區域只能使用地區服務讀取或寫入。
  3. Merchant API 和 Content API for Shopping 的設定方式 WarehouseBasedDeliveryTime 不同。如果您使用 Merchant API,必須在 shippingsettings.warehouses 下方定義倉儲資訊。接著,每項運送服務即可透過 warehouseBaseDeliveryTime 下的倉儲名稱參照倉儲名稱。
  4. Merchant API 中的一項服務支援多個運送國家/地區。

新增支援的欄位

相較於 Content API for Shopping,Merchant Shipping settings API 支援下列新欄位:

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

已重新命名欄位

Merchant API 中的下列欄位已重新命名:

Content API for Shopping 商家運送設定 API 說明
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 中的下列欄位已淘汰,請注意,Merchant API 無法為這些欄位提供任何替代項目。

Content API for Shopping 商家 API
postal_code_group region
service
  • Pickup_service
    • Eligibility
    • Scheduling_channel
    • Delivery_time
      • Holiday_cutoff
      • Min_scheduling_time_in_days
      • Max_scheduling_time_in_days
      • Scheduling_business_day_config
    • Rate_group
    • |servicePickup_service - Eligibility - Scheduling_channel - Delivery_time - Holiday_cutoff - Min_scheduling_time_in_days - Max_scheduling_time_in_days - Scheduling_business_day_config - Rate_group - single_value_alternative_list

      方法

      以下比較 Content API for Shopping 和 Merchant shipping settings API 中的方法:

      方法 Content API for Shopping 商家 API
      customBatch
      get
      update
      insert
      getSupportedCarrier
      getSupportedHolidays