運送設定

shippingsettings敬上 資源可讓您擷取及更新多重用戶端的運送設定 帳戶 (MCA) 及所有相關聯的子帳戶。

整合商、集結網站或管道合作夥伴通常使用 MCA 為多個商家管理網路商店和 API 服務。如果商家 多個在個別網站上銷售的網路商店或品牌 則選擇將子帳戶納入同一個 MCA 之下。

Google 可以自動更新部分產品的預估送達時間。 請參閱啟用自動 改善內容

shippingsettings.list

shippingsettings.list 呼叫會傳回 一個帳戶或所有子帳戶 (如果與 MCA 帳戶合作)。

shippingsettings.list 方法的網址範例:

GET https://shoppingcontent.googleapis.com/content/v2.1/merchantId/shippingsettings

以下是 JSON 回應範例,顯示 MCA 帳戶的子帳戶 11112222

{
 
"kind": "content#shippingsettingsListResponse",
 
"resources": [
 
{
   
"accountId": "1111",
   
"services": [
   
{
     
"name": "Standard Shipping",
     
"active": true,
     
"deliveryCountry": "US",
     
"currency": "USD",
     
"deliveryTime": {
     
"minHandlingTimeInDays": 0,
     
"maxHandlingTimeInDays": 1,
     
"transitTimeTable": {
       
"postalCodeGroupNames": [
       
"Region1",
       
"Region2",
       
"all other locations"
       
],
       
"transitTimeLabels": [
       
"all other labels"
       
],
       
"rows": [
       
{
         
"values": [
         
{
           
"minTransitTimeInDays": 1,
           
"maxTransitTimeInDays": 2
         
}
         
]
       
},
       
{
         
"values": [
         
{
           
"minTransitTimeInDays": 2,
           
"maxTransitTimeInDays": 3
         
}
         
]
       
},
       
{
         
"values": [
         
{
           
"minTransitTimeInDays": 3,
           
"maxTransitTimeInDays": 5
         
}
         
]
       
}
       
]
     
}
     
},
     
"rateGroups": [
     
{
       
"singleValue": {
       
"flatRate": {
         
"value": "0",
         
"currency": "USD"
       
}
       
},
       
"name": "Standard Shipping"
     
}
     
],
     
"eligibility": "All scenarios"
   
},
   
{
     
"name": "Expedited",
     
"active": true,
     
"deliveryCountry": "US",
     
"currency": "USD",
     
"deliveryTime": {
     
"minTransitTimeInDays": 2,
     
"maxTransitTimeInDays": 2,
     
"minHandlingTimeInDays": 0,
     
"maxHandlingTimeInDays": 1
     
},
     
"rateGroups": [
     
{
       
"singleValue": {
       
"flatRate": {
         
"value": "9.99",
         
"currency": "USD"
       
}
       
},
       
"name": "Expedited"
     
}
     
],
     
"eligibility": "All scenarios"
   
}
   
],
   
"postalCodeGroups": [
   
{
     
"name": "Region1",
     
"country": "US",
     
"postalCodeRanges": [
     
{
       
"postalCodeRangeBegin": "94035",
       
"postalCodeRangeEnd": "94070"
     
}
     
]
   
},
   
{
     
"name": "Region2",
     
"country": "US",
     
"postalCodeRanges": [
     
{
       
"postalCodeRangeBegin": "94071",
       
"postalCodeRangeEnd": "94082"
     
}
     
]
   
}
   
]
 
},
 
{
   
"accountId": "2222",
   
"services": [
   
{
     
"name": "FedEx",
     
"active": true,
     
"deliveryCountry": "US",
     
"currency": "USD",
     
"deliveryTime": {
     
"minTransitTimeInDays": 4,
     
"maxTransitTimeInDays": 6,
     
"minHandlingTimeInDays": 0,
     
"maxHandlingTimeInDays": 0
     
},
     
"rateGroups": [
     
{
       
"singleValue": {
       
"flatRate": {
         
"value": "5.99",
         
"currency": "USD"
       
}
       
},
       
"name": "All products"
     
}
     
],
     
"eligibility": "All scenarios except Shopping Actions"
   
},
   
{
     
"name": "GSA Shipping - Free Ship Over $49.99",
     
"active": true,
     
"deliveryCountry": "US",
     
"currency": "USD",
     
"deliveryTime": {
     
"minTransitTimeInDays": 3,
     
"maxTransitTimeInDays": 7,
     
"minHandlingTimeInDays": 1,
     
"maxHandlingTimeInDays": 2
     
},
     
"rateGroups": [
     
{
       
"mainTable": {
       
"rowHeaders": {
         
"prices": [
         
{
           
"value": "49.99",
           
"currency": "USD"
         
},
         
{
           
"value": "infinity",
           
"currency": "USD"
         
}
         
]
       
},
       
"rows": [
         
{
         
"cells": [
           
{
           
"flatRate": {
             
"value": "6.99",
             
"currency": "USD"
           
}
           
}
         
]
         
},
         
{
         
"cells": [
           
{
           
"flatRate": {
             
"value": "0",
             
"currency": "USD"
           
}
           
}
         
]
         
}
       
]
       
},
       
"name": "Free Ship Over $49.99"
     
}
     
],
     
"eligibility": "Shopping Actions"
   
}
   
]
 
}
 
]
}

shippingsettings.get

shippingsettings.get 呼叫可讓 MCA 帳戶享有運送服務 單一子帳戶或獨立帳戶的設定資訊 各自的帳戶狀態資訊

請使用以下呼叫取得運送設定 資訊,merchantId 是 MCA 帳號,accountId 是子帳戶如果 Merchant Center 帳戶不是多重客戶帳戶, shippingsettings.get仍可傳回運送設定資訊。在本 在此例中,「merchantId」和「 accountId 參數。

GET https://shoppingcontent.googleapis.com/content/v2.1/merchantId/shippingsettings/accountId

以下是含有 Standard 的子帳戶 JSON 回應範例 和 Expedited運送服務是透過要用於 list 呼叫:

{
 
"accountId": "1111",
 
"services": [
 
{
   
"name": "Standard Shipping",
   
"active": true,
   
"deliveryCountry": "US",
   
"currency": "USD",
   
"deliveryTime": {
   
"minHandlingTimeInDays": 0,
   
"maxHandlingTimeInDays": 1,
   
"transitTimeTable": {
     
"postalCodeGroupNames": [
     
"Region1",
     
"Region2",
     
"all other locations"
     
],
     
"transitTimeLabels": [
     
"all other labels"
     
],
     
"rows": [
     
{
       
"values": [
       
{
         
"minTransitTimeInDays": 1,
         
"maxTransitTimeInDays": 2
       
}
       
]
     
},
     
{
       
"values": [
       
{
         
"minTransitTimeInDays": 2,
         
"maxTransitTimeInDays": 3
       
}
       
]
     
},
     
{
       
"values": [
       
{
         
"minTransitTimeInDays": 3,
         
"maxTransitTimeInDays": 5
       
}
       
]
     
}
     
]
   
}
   
},
   
"rateGroups": [
   
{
     
"singleValue": {
     
"flatRate": {
       
"value": "0",
       
"currency": "USD"
     
}
     
},
     
"name": "Standard Shipping"
   
}
   
],
   
"eligibility": "All scenarios"
 
},
 
{
   
"name": "Expedited",
   
"active": true,
   
"deliveryCountry": "US",
   
"currency": "USD",
   
"deliveryTime": {
   
"minTransitTimeInDays": 2,
   
"maxTransitTimeInDays": 2,
   
"minHandlingTimeInDays": 0,
   
"maxHandlingTimeInDays": 1
   
},
   
"rateGroups": [
   
{
     
"singleValue": {
     
"flatRate": {
       
"value": "9.99",
       
"currency": "USD"
     
}
     
},
     
"name": "Expedited"
   
}
   
],
   
"eligibility": "All scenarios"
 
}
 
],
 
"postalCodeGroups": [
 
{
   
"name": "Region1",
   
"country": "US",
   
"postalCodeRanges": [
   
{
     
"postalCodeRangeBegin": "94035",
     
"postalCodeRangeEnd": "94070"
   
}
   
]
 
},
 
{
   
"name": "Region2",
   
"country": "US",
   
"postalCodeRanges": [
   
{
     
"postalCodeRangeBegin": "94071",
     
"postalCodeRangeEnd": "94082"
   
}
   
]
 
}
 
]
}

shippingsettings.update

shippingsettings.update 呼叫可讓 MCA 帳戶更新 單一子帳戶或獨立帳戶的運送設定資訊。

PUT https://shoppingcontent.googleapis.com/content/v2.1/merchantId/shippingsettings/accountId

以下是更新 maxTransitTimeInDays 的 JSON 要求主體範例 到7的運送服務:GSA Shipping - Free Ship Over $49.99 子帳戶 (帳戶 ID 為 2222) 的 MCA 商品 ID 為 10

{
...
   
"services": [
     
{
       
"name": "FedEx",
       
"active": true,
       
"deliveryCountry": "US",
       
"currency": "USD",
       
"deliveryTime": {
         
"minTransitTimeInDays": 4,
         
"maxTransitTimeInDays": 6,
         
"minHandlingTimeInDays": 0,
         
"maxHandlingTimeInDays": 0
       
},
       
"rateGroups": [
         
{
           
"singleValue": {
             
"flatRate": {
               
"value": "5.99",
               
"currency": "USD"
             
}
           
},
           
"name": "All products"
         
}
       
],
       
"eligibility": "All scenarios except Shopping Actions"
     
},
     
{
       
"name": "GSA Shipping - Free Ship Over $49.99",
       
"active": true,
       
"deliveryCountry": "US",
       
"currency": "USD",
       
"deliveryTime": {
         
"minTransitTimeInDays": 3,
         
"maxTransitTimeInDays": 7,
         
"minHandlingTimeInDays": 1,
         
"maxHandlingTimeInDays": 2
       
},
       
"rateGroups": [
         
{
           
"mainTable": {
             
"rowHeaders": {
               
"prices": [
                 
{
                   
"value": "49.99",
                   
"currency": "USD"
                 
},
                 
{
                   
"value": "infinity",
                   
"currency": "USD"
                 
}
               
]
             
},
             
"rows": [
               
{
                 
"cells": [
                   
{
                     
"flatRate": {
                       
"value": "6.99",
                       
"currency": "USD"
                     
}
                   
}
                 
]
               
},
               
{
                 
"cells": [
                   
{
                     
"flatRate": {
                       
"value": "0",
                       
"currency": "USD"
                     
}
                   
}
                 
]
               
}
             
]
           
},
           
"name": "Free Ship Over $49.99"
         
}
       
],
       
"eligibility": "Shopping Actions"
     
}
   
]
 
}
}

以下是 JSON 回應主體的範例:

{
 
"accountId": "2222",
 
"services": [
 
{
   
"name": "FedEx",
   
"active": true,
   
"deliveryCountry": "US",
   
"currency": "USD",
   
"deliveryTime": {
   
"minTransitTimeInDays": 4,
   
"maxTransitTimeInDays": 6,
   
"minHandlingTimeInDays": 0,
   
"maxHandlingTimeInDays": 0
   
},
   
"rateGroups": [
   
{
     
"singleValue": {
     
"flatRate": {
       
"value": "5.99",
       
"currency": "USD"
     
}
     
},
     
"name": "All products"
   
}
   
],
   
"eligibility": "All scenarios except Shopping Actions"
 
},
 
{
   
"name": "GSA Shipping - Free Ship Over $49.99",
   
"active": true,
   
"deliveryCountry": "US",
   
"currency": "USD",
   
"deliveryTime": {
   
"minTransitTimeInDays": 3,
   
"maxTransitTimeInDays": 7,
   
"minHandlingTimeInDays": 1,
   
"maxHandlingTimeInDays": 2
   
},
   
"rateGroups": [
   
{
     
"mainTable": {
     
"rowHeaders": {
       
"prices": [
       
{
         
"value": "49.99",
         
"currency": "USD"
       
},
       
{
         
"value": "infinity",
         
"currency": "USD"
       
}
       
]
     
},
     
"rows": [
       
{
       
"cells": [
         
{
         
"flatRate": {
           
"value": "6.99",
           
"currency": "USD"
         
}
         
}
       
]
       
},
       
{
       
"cells": [
         
{
         
"flatRate": {
           
"value": "0",
           
"currency": "USD"
         
}
         
}
       
]
       
}
     
]
     
},
     
"name": "Free Ship Over $49.99"
   
}
   
],
   
"eligibility": "Shopping Actions"
 
}
 
]
}

shippingsettings.custombatch

shippingsettings.custombatch 呼叫會擷取或更新運送設定 多重客戶帳戶的多個子帳戶的資訊。

JSON 要求會包含 MCA 帳號的 merchantId, 子帳戶的 accountId、不重複 batchId,以及將 method 設為 get 擷取運送設定,update 來修改運送設定 可以管理叢集設定,像是節點 資源調度、安全性和其他預先設定項目

POST https://shoppingcontent.googleapis.com/content/v2.1/shippingsettings/batch

以下 JSON 要求主體範例分為兩個部分:

  1. batchId=1 用於擷取帳戶 ID 1111 的運送設定。
  2. batchId=2,可用於將以下項目的 maxTransitTimeInDays 更新為 8: 運送服務:GSA Shipping - Free Ship Over $49.99。(這項設定之前為 先前回應主體中顯示的帳戶 ID 2222 原本為 7 shippingsettings.update 範例)。
{
 
"entries": [
   
{
     
"accountId": 1111,
     
"merchantId": 10,
     
"method": "get",
     
"batchId": 1
   
},
   
{
     
"accountId": 2222,
     
"merchantId": 10,
     
"method": "update",
     
"batchId": 2,
     
"shippingSettings": {
       
"services": [
         
{
           
"name": "FedEx",
           
"active": true,
           
"deliveryCountry": "US",
           
"currency": "USD",
           
"deliveryTime": {
             
"minTransitTimeInDays": 4,
             
"maxTransitTimeInDays": 5,
             
"minHandlingTimeInDays": 0,
             
"maxHandlingTimeInDays": 0
           
},
           
"rateGroups": [
             
{
               
"singleValue": {
                 
"flatRate": {
                   
"value": "5.99",
                   
"currency": "USD"
                 
}
               
},
               
"name": "All products"
             
}
           
],
           
"eligibility": "All scenarios except Shopping Actions"
         
},
         
{
           
"name": "GSA Shipping - Free Ship Over $49.99",
           
"active": true,
           
"deliveryCountry": "US",
           
"currency": "USD",
           
"deliveryTime": {
             
"minTransitTimeInDays": 3,
             
"maxTransitTimeInDays": 8,
             
"minHandlingTimeInDays": 1,
             
"maxHandlingTimeInDays": 2
           
},
           
"rateGroups": [
             
{
               
"mainTable": {
                 
"rowHeaders": {
                   
"prices": [
                     
{
                       
"value": "49.99",
                       
"currency": "USD"
                     
},
                     
{
                       
"value": "infinity",
                       
"currency": "USD"
                     
}
                   
]
                 
},
                 
"rows": [
                   
{
                     
"cells": [
                       
{
                         
"flatRate": {
                           
"value": "6.99",
                           
"currency": "USD"
                         
}
                       
}
                     
]
                   
},
                   
{
                     
"cells": [
                       
{
                         
"flatRate": {
                           
"value": "0",
                           
"currency": "USD"
                         
}
                       
}
                     
]
                   
}
                 
]
               
},
               
"name": "Free Ship Over $49.99"
             
}
           
],
           
"eligibility": "Shopping Actions"
         
}
       
]
     
}
   
}
 
]
}

以下是 JSON 回應主體的範例:

{
 
"kind": "content#shippingsettingsCustomBatchResponse",
 
"entries": [
 
{
   
"kind": "content#shippingsettingsCustomBatchResponseEntry",
   
"batchId": 1,
   
"shippingSettings": {
   
"accountId": "1111",
   
"services": [
     
{
     
"name": "Standard Shipping",
     
"active": true,
     
"deliveryCountry": "US",
     
"currency": "USD",
     
"deliveryTime": {
       
"minHandlingTimeInDays": 0,
       
"maxHandlingTimeInDays": 1,
       
"transitTimeTable": {
       
"postalCodeGroupNames": [
         
"Region1",
         
"Region2",
         
"all other locations"
       
],
       
"transitTimeLabels": [
         
"all other labels"
       
],
       
"rows": [
         
{
         
"values": [
           
{
           
"minTransitTimeInDays": 1,
           
"maxTransitTimeInDays": 2
           
}
         
]
         
},
         
{
         
"values": [
           
{
           
"minTransitTimeInDays": 2,
           
"maxTransitTimeInDays": 3
           
}
         
]
         
},
         
{
         
"values": [
           
{
           
"minTransitTimeInDays": 3,
           
"maxTransitTimeInDays": 5
           
}
         
]
         
}
       
]
       
}
     
},
     
"rateGroups": [
       
{
       
"singleValue": {
         
"flatRate": {
         
"value": "0",
         
"currency": "USD"
         
}
       
},
       
"name": "Standard Shipping"
       
}
     
],
     
"eligibility": "All scenarios"
     
},
     
{
     
"name": "Expedited",
     
"active": true,
     
"deliveryCountry": "US",
     
"currency": "USD",
     
"deliveryTime": {
       
"minTransitTimeInDays": 2,
       
"maxTransitTimeInDays": 2,
       
"minHandlingTimeInDays": 0,
       
"maxHandlingTimeInDays": 1
     
},
     
"rateGroups": [
       
{
       
"singleValue": {
         
"flatRate": {
         
"value": "9.99",
         
"currency": "USD"
         
}
       
},
       
"name": "Expedited"
       
}
     
],
     
"eligibility": "All scenarios"
     
}
   
],
   
"postalCodeGroups": [
     
{
     
"name": "Region1",
     
"country": "US",
     
"postalCodeRanges": [
       
{
       
"postalCodeRangeBegin": "94035",
       
"postalCodeRangeEnd": "94070"
       
}
     
]
     
},
     
{
     
"name": "Region2",
     
"country": "US",
     
"postalCodeRanges": [
       
{
       
"postalCodeRangeBegin": "94071",
       
"postalCodeRangeEnd": "94082"
       
}
     
]
     
}
   
]
   
}
 
},
 
{
   
"kind": "content#shippingsettingsCustomBatchResponseEntry",
   
"batchId": 2,
   
"shippingSettings": {
   
"accountId": "2222",
   
"services": [
     
{
     
"name": "FedEx",
     
"active": true,
     
"deliveryCountry": "US",
     
"currency": "USD",
     
"deliveryTime": {
       
"minTransitTimeInDays": 4,
       
"maxTransitTimeInDays": 5,
       
"minHandlingTimeInDays": 0,
       
"maxHandlingTimeInDays": 0
     
},
     
"rateGroups": [
       
{
       
"singleValue": {
         
"flatRate": {
         
"value": "5.99",
         
"currency": "USD"
         
}
       
},
       
"name": "All products"
       
}
     
],
     
"eligibility": "All scenarios except Shopping Actions"
     
},
     
{
     
"name": "GSA Shipping - Free Ship Over $49.99",
     
"active": true,
     
"deliveryCountry": "US",
     
"currency": "USD",
     
"deliveryTime": {
       
"minTransitTimeInDays": 3,
       
"maxTransitTimeInDays": 8,
       
"minHandlingTimeInDays": 1,
       
"maxHandlingTimeInDays": 2
     
},
     
"rateGroups": [
       
{
       
"mainTable": {
         
"rowHeaders": {
         
"prices": [
           
{
           
"value": "49.99",
           
"currency": "USD"
           
},
           
{
           
"value": "infinity",
           
"currency": "USD"
           
}
         
]
         
},
         
"rows": [
         
{
           
"cells": [
           
{
             
"flatRate": {
             
"value": "6.99",
             
"currency": "USD"
             
}
           
}
           
]
         
},
         
{
           
"cells": [
           
{
             
"flatRate": {
             
"value": "0",
             
"currency": "USD"
             
}
           
}
           
]
         
}
         
]
       
},
       
"name": "Free Ship Over $49.99"
       
}
     
],
     
"eligibility": "Shopping Actions"
     
}
   
]
   
}
 
}
 
]
}

shippingsettings.getsupportedcarriers

shippingsettings.getsupportedcarriers 呼叫允許 MCA 帳戶 或透過獨立帳戶下載支援電信業者的服務

GET https://shoppingcontent.googleapis.com/content/v2.1/merchantId/supportedCarriers

以下是 JSON 回應主體的範例:

{
 
"kind": "content#shippingsettingsGetSupportedCarriersResponse",
 
"carriers": [
 
{
   
"name": "FedEx",
   
"country": "US",
   
"services": [
   
"Ground",
   
"Home Delivery",
   
"Express Saver",
   
"First Overnight",
   
"Priority Overnight",
   
"Standard Overnight",
   
"2Day"
   
]
 
},
 
{
   
"name": "UPS",
   
"country": "US",
   
"services": [
   
"2nd Day Air",
   
"2nd Day Air AM",
   
"3 Day Select",
   
"Ground",
   
"Next Day Air",
   
"Next Day Air Early AM",
   
"Next Day Air Saver"
   
]
 
},
 
{
   
"name": "USPS",
   
"country": "US",
   
"services": [
   
"Priority Mail Express",
   
"Media Mail",
   
"Retail Ground",
   
"Priority Mail",
   
"First Class Package Service Retail",
   
"First Class Package Service Commercial Base"
   
]
 
},
 
{
   
"name": "Australia Post",
   
"country": "AU",
   
"services": [
   
"Regular Parcel",
   
"Express Post"
   
]
 
},
 
{
   
"name": "TNT",
   
"country": "AU",
   
"services": [
   
"Road Express",
   
"Overnight Express"
   
]
 
},
 
{
   
"name": "TOLL",
   
"country": "AU",
   
"services": [
   
"Road Delivery",
   
"Overnight Priority"
   
]
 
},
 
{
   
"name": "DHL",
   
"country": "DE",
   
"services": [
   
"Paket",
   
"Päckchen"
   
]
 
},
 
{
   
"name": "DPD",
   
"country": "DE",
   
"services": [
   
"Express 12",
   
"Express",
   
"Classic Parcel"
   
]
 
},
 
{
   
"name": "Hermes",
   
"country": "DE",
   
"services": [
   
"Päckchen",
   
"Paketklasse S",
   
"Paketklasse M",
   
"Paketklasse L"
   
]
 
},
 
{
   
"name": "UPS",
   
"country": "DE",
   
"services": [
   
"Express",
   
"Express Saver",
   
"Standard"
   
]
 
},
 
{
   
"name": "DHL UK",
   
"country": "GB",
   
"services": [
   
"Express",
   
"Express 12"
   
]
 
},
 
{
   
"name": "DPD UK",
   
"country": "GB",
   
"services": [
   
"Express 12",
   
"Express Next Day",
   
"Standard Parcel 12",
   
"Standard Parcel Next Day",
   
"Standard Parcel Two Day"
   
]
 
},
 
{
   
"name": "RMG",
   
"country": "GB",
   
"services": [
   
"1st Class Small Parcel",
   
"1st Class Medium Parcel",
   
"2nd Class Small Parcel",
   
"2nd Class Medium Parcel"
   
]
 
},
 
{
   
"name": "TNT UK",
   
"country": "GB",
   
"services": [
   
"Express",
   
"Express 10",
   
"Express 12"
   
]
 
},
 
{
   
"name": "UPS UK",
   
"country": "GB",
   
"services": [
   
"Express",
   
"Express Saver",
   
"Standard"
   
]
 
},
 
{
   
"name": "Yodel",
   
"country": "GB",
   
"services": [
   
"B2C 48HR",
   
"B2C 72HR",
   
"B2C Packet"
   
]
 
}
 
]
}

shippingsettings.getsupportedholidays

shippingsettings.getsupportedholidays 呼叫允許 MCA 帳戶 也可使用獨立帳戶擷取支援的假日。

GET https://shoppingcontent.googleapis.com/content/v2.1/merchantId/supportedHolidays

以下是 JSON 回應範例:

{
 
"kind": "content#shippingsettingsGetSupportedHolidaysResponse",
 
"holidays": [
 
{
   
"id": "FR_Christmas_2019-12-25",
   
"countryCode": "FR",
   
"type": "Christmas",
   
"date": "2019-12-25",
   
"deliveryGuaranteeDate": "2019-12-24",
   
"deliveryGuaranteeHour": "18"
 
},
 
{
   
"id": "US_Easter_2019-04-21",
   
"countryCode": "US",
   
"type": "Easter",
   
"date": "2019-04-21",
   
"deliveryGuaranteeDate": "2019-04-20",
   
"deliveryGuaranteeHour": "18"
 
},
 
{
   
"id": "US_Mother's Day_2019-05-12",
   
"countryCode": "US",
   
"type": "Mother's Day",
   
"date": "2019-05-12",
   
"deliveryGuaranteeDate": "2019-05-11",
   
"deliveryGuaranteeHour": "18"
 
},
 
{
   
"id": "US_Father's Day_2019-06-16",
   
"countryCode": "US",
   
"type": "Father's Day",
   
"date": "2019-06-16",
   
"deliveryGuaranteeDate": "2019-06-15",
   
"deliveryGuaranteeHour": "18"
 
},
 
{
   
"id": "US_Independence Day (USA)_2019-07-04",
   
"countryCode": "US",
   
"type": "Independence Day (USA)",
   
"date": "2019-07-04",
   
"deliveryGuaranteeDate": "2019-07-03",
   
"deliveryGuaranteeHour": "18"
 
},
 
{
   
"id": "US_Halloween_2019-10-31",
   
"countryCode": "US",
   
"type": "Halloween",
   
"date": "2019-10-31",
   
"deliveryGuaranteeDate": "2019-10-30",
   
"deliveryGuaranteeHour": "18"
 
},
 
{
   
"id": "US_Thanksgiving_2019-11-28",
   
"countryCode": "US",
   
"type": "Thanksgiving",
   
"date": "2019-11-28",
   
"deliveryGuaranteeDate": "2019-11-27",
   
"deliveryGuaranteeHour": "18"
 
},
 
{
   
"id": "US_Christmas_2019-12-25",
   
"countryCode": "US",
   
"type": "Christmas",
   
"date": "2019-12-25",
   
"deliveryGuaranteeDate": "2019-12-24",
   
"deliveryGuaranteeHour": "18"
 
}
 
]
}

設定郵遞區號群組

雖然在 Merchant Center 中建立區域很方便,但你可以使用 Content API ,維護經常變更區域的帳戶。

運送設定服務 可讓你設定、取得及更新運送設定和區域。在 API 中 區域稱為 postalCodeGroups

"postalCodeGroups": [
 
{
   
"name": "string,
   
"country": string,
   
"postalCodeRanges": [
     
{
       
"postalCodeRangeBegin": string,
       
"postalCodeRangeEnd": string
     
}
   
]
 
}
]

與在 UI 中一樣,postalCodeGroups 是簡單的郵遞區號清單、郵遞區號清單 範圍、郵遞區號前置字元或前置字串範圍

擷取區域資料並搭配運送設定,因此只有 填滿 postalCodeGroups 中的 運送設定 資源 刪除運送服務。

透過 API 設定區域的正確方式如下:

  1. 發出 get 呼叫來擷取所有運送服務和 postalCodeGroups (區域)。
  2. get 呼叫中的運送服務複製到 update 呼叫。
  3. 如果您並未使用大眾運輸工具,請從要求主體中移除下列項目 運送服務中的時間標籤:

    "transitTimeLabels": [
       
    "all other labels"
    ],
  4. 填入 update 呼叫 postalCodeGroups 區段中的區域。

  5. 透過運送服務和 postalCodeGroups 進行 update 通話 區段。

以下是第一個 get 範例的 update 呼叫要求主體範例 上述用途 (地區 1 的 postalCodeGroups) 已從 94035 更新為 94036

{
 
"services": [
   
{
     
"name": "Standard Shipping",
     
"active": true,
     
"deliveryCountry": "US",
     
"currency": "USD",
     
"deliveryTime": {
       
"minHandlingTimeInDays": 0,
       
"maxHandlingTimeInDays": 1,
       
"transitTimeTable": {
         
"postalCodeGroupNames": [
           
"Region1",
           
"Region2",
           
"all other locations"
         
],
         
"rows": [
           
{
             
"values": [
               
{
                 
"minTransitTimeInDays": 1,
                 
"maxTransitTimeInDays": 2
               
}
             
]
           
},
           
{
             
"values": [
               
{
                 
"minTransitTimeInDays": 2,
                 
"maxTransitTimeInDays": 3
               
}
             
]
           
},
           
{
             
"values": [
               
{
                 
"minTransitTimeInDays": 3,
                 
"maxTransitTimeInDays": 5
               
}
             
]
           
}
         
]
       
}
     
},
     
"rateGroups": [
       
{
         
"singleValue": {
           
"flatRate": {
             
"value": "0",
             
"currency": "USD"
           
}
         
},
         
"name": "Standard Shipping"
       
}
     
],
     
"eligibility": "All scenarios"
   
},
   
{
     
"name": "Expedited",
     
"active": true,
     
"deliveryCountry": "US",
     
"currency": "USD",
     
"deliveryTime": {
       
"minTransitTimeInDays": 2,
       
"maxTransitTimeInDays": 2,
       
"minHandlingTimeInDays": 0,
       
"maxHandlingTimeInDays": 1
     
},
     
"rateGroups": [
       
{
         
"singleValue": {
           
"flatRate": {
             
"value": "9.99",
             
"currency": "USD"
           
}
         
},
         
"name": "Expedited"
       
}
     
],
     
"eligibility": "All scenarios"
   
}
 
],
 
"postalCodeGroups": [
   
{
     
"name": "Region1",
     
"country": "US",
     
"postalCodeRanges": [
       
{
         
"postalCodeRangeBegin": "94036",
         
"postalCodeRangeEnd": "94070"
       
}
     
]
   
},
   
{
     
"name": "Region2",
     
"country": "US",
     
"postalCodeRanges": [
       
{
         
"postalCodeRangeBegin": "94071",
         
"postalCodeRangeEnd": "94082"
       
}
     
]
   
}
 
]
}

以下是 JSON 回應範例:

{
 
"accountId": "1111",
 
"services": [
 
{
   
"name": "Standard Shipping",
   
"active": true,
   
"deliveryCountry": "US",
   
"currency": "USD",
   
"deliveryTime": {
   
"minHandlingTimeInDays": 0,
   
"maxHandlingTimeInDays": 1,
   
"transitTimeTable": {
     
"postalCodeGroupNames": [
     
"Region1",
     
"Region2",
     
"all other locations"
     
],
     
"rows": [
     
{
       
"values": [
       
{
         
"minTransitTimeInDays": 1,
         
"maxTransitTimeInDays": 2
       
}
       
]
     
},
     
{
       
"values": [
       
{
         
"minTransitTimeInDays": 2,
         
"maxTransitTimeInDays": 3
       
}
       
]
     
},
     
{
       
"values": [
       
{
         
"minTransitTimeInDays": 3,
         
"maxTransitTimeInDays": 5
       
}
       
]
     
}
     
]
   
}
   
},
   
"rateGroups": [
   
{
     
"singleValue": {
     
"flatRate": {
       
"value": "0",
       
"currency": "USD"
     
}
     
},
     
"name": "Standard Shipping"
   
}
   
],
   
"eligibility": "All scenarios"
 
},
 
{
   
"name": "Expedited",
   
"active": true,
   
"deliveryCountry": "US",
   
"currency": "USD",
   
"deliveryTime": {
   
"minTransitTimeInDays": 2,
   
"maxTransitTimeInDays": 2,
   
"minHandlingTimeInDays": 0,
   
"maxHandlingTimeInDays": 1
   
},
   
"rateGroups": [
   
{
     
"singleValue": {
     
"flatRate": {
       
"value": "9.99",
       
"currency": "USD"
     
}
     
},
     
"name": "Expedited"
   
}
   
],
   
"eligibility": "All scenarios"
 
}
 
],
 
"postalCodeGroups": [
 
{
   
"name": "Region1",
   
"country": "US",
   
"postalCodeRanges": [
   
{
     
"postalCodeRangeBegin": "94036",
     
"postalCodeRangeEnd": "94070"
   
}
   
]
 
},
 
{
   
"name": "Region2",
   
"country": "US",
   
"postalCodeRanges": [
   
{
     
"postalCodeRangeBegin": "94071",
     
"postalCodeRangeEnd": "94082"
   
}
   
]
 
}
 
]
}

使用上車/取貨地點

進一步瞭解取貨/取貨地點訂單 (包括方式) 與宅配到府訂單不同,以及需要提供哪些自取資訊 請參閱 取貨/取貨地點指南。

當天到貨服務

如果你有本地運送,可以運用 Content API for Shopping 設定當天到貨運送服務, 廣告空間

當天到貨運送服務的 shipmentTypelocal_delivery。目前所有 local_delivery 運送服務都視為當天到貨服務。你無法變更本地配送的deliveryTime資訊。

使用 shippingsettings.update敬上 為店面商品目錄產品設定當天到貨服務。

以下這個要求主體範例為所有商店新增當天到貨服務 帳戶:

請更新下列範例中的所有值,再用於實作中。

{
   
"accountId":"accountId",
   
"services":[
     
{
         
"name": "Local Delivery",
         
"active":true,
         
"shipmentType":"local_delivery",
         
"deliveryCountry":"US",
         
"currency":"USD",
         
"rateGroups":[
           
{
               
"singleValue":{
                 
"flatRate":{
                     
"value":"0",
                     
"currency":"USD"
                 
}
               
}
           
}
         
],
         
"eligibility":"All scenarios",
         
"storeConfig":{
           
"storeServiceType":"all stores",
           
"storeCodes":[
               
           
],
           
"cutoffConfig":{
               
"storeCloseOffsetHours":2,
               
"no_delivery_post_cutoff":true
           
},
           
"serviceRadius":{
               
"value":4,
               
"unit":"Miles"
           
}
         
}
     
}
   
]
}

次日到貨服務

當天到貨截止時間後下單的訂單,已排定在下一次 日到貨。如要關閉次日到貨服務,請設定 no_delivery_post_cutofftrue。如果關閉「次日到貨」服務,您的 運送服務必須在每日截止時間之前顯示。

只有在shipmentTypelocal_delivery時,才能享有次日到貨服務。

測試

由於所有項目都在生產中,因此請小心避免變更 任何與存能項目相關的重要內容,特別是 update() 此方法,因為這是唯一會變更現有值的方法。