การตั้งค่าการจัดส่ง

shippingsettings แหล่งข้อมูลช่วยให้คุณดึงข้อมูลและอัปเดตการตั้งค่าการจัดส่งของลูกค้าหลายรายได้ (MCA) และบัญชีย่อยทั้งหมดที่เชื่อมโยงกับบัญชีดังกล่าว

โดยปกติ MCA จะใช้โดยผู้ผสานรวม ผู้รวบรวมข้อมูล และพาร์ทเนอร์ช่องทางที่ จัดการร้านค้าออนไลน์และบริการ API สำหรับผู้ขายหลายราย ผู้ขายที่มี ร้านค้าออนไลน์หรือแบรนด์หลายแห่งที่ขายในเว็บไซต์แยกต่างหากอาจ เลือกให้มีบัญชีย่อยภายใต้ MCA เดียว

Google สามารถอัปเดตเวลานำส่งโดยประมาณสำหรับผลิตภัณฑ์บางรายการได้โดยอัตโนมัติ โปรดดูเปิดใช้อัตโนมัติ เพิ่มเติม

shippingsettings.list

การเรียก shippingsettings.list ส่งคืนข้อมูลทรัพยากรการจัดส่งทั้งหมดของ บัญชีหนึ่งหรือบัญชีย่อยทั้งหมดหากเกี่ยวข้องกับบัญชี MCA

ตัวอย่าง URL สำหรับเมธอด shippingsettings.list

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

ต่อไปนี้คือตัวอย่างการตอบสนองของ JSON ที่แสดงการตั้งค่าการจัดส่งสำหรับ บัญชีย่อย 1111 และ 2222 ของบัญชี MCA

{
 
"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 ยังคงส่งข้อมูลการตั้งค่าการจัดส่งได้ ด้วยวิธีนี้ ให้ใช้หมายเลขบัญชี Merchant Center เดียวกันสำหรับทั้ง merchantId และ accountId พารามิเตอร์

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

ต่อไปนี้คือตัวอย่างการตอบกลับ JSON สำหรับบัญชีย่อยที่มี Standard และบริการจัดส่ง Expedited ที่กำหนดค่าจากบัญชี MCA ที่ใช้สำหรับ 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

ตัวอย่างเนื้อหาคำขอ JSON เพื่ออัปเดต maxTransitTimeInDays มีดังนี้ ไปยัง 7 สำหรับบริการจัดส่ง GSA Shipping - Free Ship Over $49.99 สำหรับ บัญชีย่อยที่มีรหัสบัญชี 2222 ภายในรหัสสินค้าของ MCA ของ 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 ประกอบด้วย merchantId ของหมายเลขบัญชี MCA ซึ่ง accountId ของบัญชีย่อย batchId ที่ไม่ซ้ำกัน และ method ได้รับการตั้งค่าเป็น getเพื่อดึงข้อมูลการตั้งค่าการจัดส่งและupdateเพื่อแก้ไขการจัดส่ง การตั้งค่า

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

ตัวอย่างเนื้อหาคำขอ JSON ต่อไปนี้มี 2 ส่วน

  1. batchId=1 ใช้เพื่อดึงข้อมูลการตั้งค่าการจัดส่งสำหรับรหัสบัญชี 1111
  2. batchId=2 ใช้เพื่ออัปเดต maxTransitTimeInDays เป็น 8 สำหรับ บริการจัดส่ง GSA Shipping - Free Ship Over $49.99 (การตั้งค่านี้เดิมคือ เปลี่ยนจาก 7 สำหรับรหัสบัญชี 2222 ที่แสดงในเนื้อหาการตอบกลับก่อนหน้า ตัวอย่างสำหรับ 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
     
}
   
]
 
}
]

postalCodeGroups คือรายการรหัสไปรษณีย์แบบง่ายๆ เหมือนกับใน UI ช่วง คำนำหน้ารหัสไปรษณีย์ หรือช่วงคำนำหน้า

เนื่องจากเราดึงข้อมูลภูมิภาคและตั้งค่าการจัดส่งร่วมกับการตั้งค่าการจัดส่งแล้วเท่านั้น กรอก postalCodeGroups ด้วย การตั้งค่าการจัดส่ง ทรัพยากร ลบบริการจัดส่ง

วิธีที่เหมาะสมในการตั้งค่าภูมิภาคผ่าน API มีดังนี้

  1. โทรออกไปยัง get เพื่อเรียกข้อมูลบริการจัดส่งทั้งหมดและ postalCodeGroups (ภูมิภาค)
  2. คัดลอกบริการจัดส่งจากการโทร get ไปยังการโทร update
  3. นำรายการต่อไปนี้ออกจากเนื้อหาคำขอหากคุณไม่ได้ใช้ขนส่งสาธารณะ ป้ายกำกับเวลาในบริการจัดส่ง

    "transitTimeLabels": [
       
    "all other labels"
    ],
  4. ป้อนข้อมูลภูมิภาคในส่วนpostalCodeGroupsสำหรับการโทร update

  5. โทรออกไปยัง update กับทั้งบริการจัดส่งและ postalCodeGroups เติมข้อมูลในส่วนต่างๆ แล้ว

ต่อไปนี้เป็นตัวอย่างเนื้อหาคำขอติดต่อ update จากตัวอย่าง get รายการแรก ที่ใช้ข้างต้นกับ postalCodeGroups สำหรับภูมิภาค 1 อัปเดตจาก 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 เพื่อกำหนดค่าบริการจัดส่งวันเดียวกันได้หากมีคำสั่งซื้อในท้องถิ่น พื้นที่โฆษณา

บริการจัดส่งวันเดียวกันมี local_delivery เป็น shipmentType ขณะนี้บริการจัดส่งของ 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_cutoff ไปยัง true หากคุณปิดการนำส่งในวันถัดไป ระบบจะแสดงบริการจัดส่งก่อนเวลาปิดรับคำสั่งซื้อของแต่ละวันเท่านั้น

การจัดส่งในวันถัดไปจะใช้ได้เฉพาะเมื่อ shipmentType เป็นวันที่ local_delivery

การทดสอบ

เนื่องจากสินค้าทั้งหมดอยู่ในระหว่างการใช้งานจริง ควรตรวจสอบเพื่อหลีกเลี่ยงการเปลี่ยนแปลง ข้อมูลสำคัญเกี่ยวกับรายการที่เผยแพร่อยู่ โดยเฉพาะเมื่อมี update() เนื่องจากนี่เป็นเพียงวิธีเดียวที่เปลี่ยนค่าที่มีอยู่