แหล่งข้อมูล 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
ใช้เพื่อดึงข้อมูลการตั้งค่าการจัดส่งสำหรับรหัสบัญชี1111
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 มีดังนี้
- โทรออกไปยัง
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()
เนื่องจากนี่เป็นเพียงองค์ประกอบเดียวที่เปลี่ยนค่าที่มีอยู่