ทรัพยากร
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 ส่วน
batchId=1ใช้เพื่อดึงข้อมูลการตั้งค่าการจัดส่งสำหรับรหัสบัญชี1111batchId=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
}
]
}
]
เช่นเดียวกับใน UI postalCodeGroups เป็นเพียงรายการรหัสไปรษณีย์ ช่วงรหัสไปรษณีย์ ตัวเลขขึ้นต้นของรหัสไปรษณีย์ หรือช่วงตัวเลขขึ้นต้น
เนื่องจากระบบจะดึงข้อมูลและตั้งค่าภูมิภาคร่วมกับการตั้งค่าการจัดส่ง การกรอกข้อมูลเฉพาะ
postalCodeGroups ผ่านทรัพยากร
การตั้งค่าการจัดส่ง
ที่มีอยู่
จะลบบริการจัดส่ง
วิธีที่ถูกต้องในการตั้งค่าภูมิภาคผ่าน API มีดังนี้
- ทำการเรียก
getเพื่อดึงข้อมูลบริการจัดส่งและpostalCodeGroups(ภูมิภาค) ทั้งหมด - คัดลอกบริการจัดส่งจากการเรียก
getไปยังการเรียกupdate นำรายการต่อไปนี้ออกจากเนื้อหาคำขอหากคุณไม่ได้ใช้ป้ายกำกับเวลาขนส่งในบริการจัดส่ง
"transitTimeLabels": [ "all other labels" ],ป้อนข้อมูลภูมิภาคในส่วน
postalCodeGroupsสำหรับการเรียกupdateทำการเรียก
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() เนื่องจากเป็นเมธอดเดียวที่เปลี่ยนค่าที่มีอยู่