我正在使用 UPS Rates API(基于 JSON,带有选项 Shoptimeintransit)来获取所提供的发货日期的可用交货日期。
https://www.ups.com/upsdeveloperkit/downloadresource?loc=en_CA
在 DeliveryTimeInformation 中,我正在设置取货信息。
{
"Security": {
"UsernameToken": {
"Username": "xxxxxxx",
"Password": "xxxxxxx"
},
"UPSServiceAccessToken": {
"AccessLicenseNumber": "xxxxxxxxxxx"
}
},
"RateRequest": {
"Request": {
"RequestOption": "Shoptimeintransit",
"TransactionReference": {
"CustomerContext": "Your Customer Context"
}
},
"CustomerClassification": {
"Code": "00"
},
"PickupType": {
"Code": "06"
},
"Shipment": {
"DeliveryTimeInformation": {
"PackageBillType": "07",
"Pickup": {
"Date": "20170925",
"Time": "1140"
}
},
"Shipper": {
"ShipperNumber": "xxxxxxx",
"Address": {
"City": "Kansas City",
"StateProvinceCode": "MO",
"CountryCode": "US",
"PostalCode": "xxxx"
}
},
"ShipTo": {
"Address": {
"City": "Redwood",
"StateProvinceCode": "CA",
"CountryCode": "US",
"PostalCode": "xxxx"
}
},
"ShipFrom": {
"Address": {
"City": "Kansas City",
"StateProvinceCode": "MO",
"CountryCode": "US",
"PostalCode": "xxxx"
}
},
"Package": {
"PackagingType": {
"Code": "02"
},
"Dimensions": {
"UnitOfMeasurement": {
"Code": "IN"
},
"Length": "5",
"Width": "4",
"Height": "3"
},
"PackageWeight": {
"UnitOfMeasurement": {
"Code": "LBS"
},
"Weight": "1"
}
},
"NumOfPieces": "3",
"ShipmentRatingOptions": {
"NegotiatedRatesIndicator": ""
}
}
}
}
问题是,我需要接下来 N 个发货日期的可用发货日期,但 API 仅采用 DeliveryTimeInformation > Pickup 部分中的单个发货日期。
因此,一种可能是调用 API N 次并合并结果,这似乎不是一个好主意。
任何人都知道任何相关的 API,用于将提货日期作为列表并返回所有可能的交货日期、所提供数据的服务代码。
最佳答案
文档状态 Max Allowed: 1
对于 DeliveryTimeInformation
,所以不。
您可以通过客户服务请求下一次 API 更新(每年 1 月和 7 月),但您必须 N
请求到那时为止。
关于json - 多个发货日期的 UPS Rates API 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46410030/