【发布时间】:2014-10-12 00:31:29
【问题描述】:
我正在使用此端点请求估计费率 https://wwwcie.ups.com/webservices/Rate
我注意到 XML 响应不包含任何交货日期。我确实看到了 BusinessDaysInTransit。但是,我不确定是否有责任进行手动编码以确定交货日期。我在他们的 api 文档中找不到任何东西。
【问题讨论】:
-
我能弄明白。
我正在使用此端点请求估计费率 https://wwwcie.ups.com/webservices/Rate
我注意到 XML 响应不包含任何交货日期。我确实看到了 BusinessDaysInTransit。但是,我不确定是否有责任进行手动编码以确定交货日期。我在他们的 api 文档中找不到任何东西。
【问题讨论】:
您必须改用 Time In Transit API。 Rate API 不提供预计送达日期。
【讨论】:
我知道这是旧的,但要在费率调用中获得它,您需要将 RequestOption 更改为“RateTimeInTransit”,将 DeliveryTimeInformation 容器添加到请求中:
{
"UPSSecurity":{
"UsernameToken":{
"Username":"removed",
"Password":"removed"
},
"ServiceAccessToken":{
"AccessLicenseNumber":"removed"
}
},
"RateRequest":{
"Request":{
"RequestOption":"RateTimeInTransit",
"TransactionReference":{
"CustomerContext":"ORDER123"
}
},
"Shipment":{
"Shipper":{
"Name":"ShipperName",
"ShipperNumber":"removed",
"Address":{
"AddressLine":[
"123 Sesame St"
],
"City":"Nibley",
"StateProvinceCode":"UT",
"PostalCode":"84321",
"CountryCode":"US"
}
},
"ShipTo":{
"Name":null,
"AttentionName":"Ship to Name",
"Address":{
"AddressLine":[
"123 RealAddress ST"
],
"City":"Hyrum",
"StateProvinceCode":"UT",
"PostalCode":"84319",
"CountryCode":"US",
"ResidentialAddressIndicator":"Y"
}
},
"ShipFrom":{
"Name":"Ima Shipper",
"Address":{
"AddressLine":[
"123 Sesame St"
],
"City":"Nibley",
"StateProvinceCode":"UT",
"PostalCode":"84321",
"CountryCode":"US"
}
},
"Service":{
"Code":"03"
},
"Package":{
"PackagingType":{
"Code":"02"
},
"Dimensions":{
"UnitOfMeasurement":{
"Code":"IN",
"Description":"inches"
},
"Length":"5",
"Width":"4",
"Height":"3"
},
"PackageWeight":{
"UnitOfMeasurement":{
"Code":"Lbs",
"Description":"pounds"
},
"Weight":"1"
}
},
"ShipmentRatingOptions":{
"NegotiatedRatesIndicator":"Y",
"RateChartIndicator":"Y"
},
"DeliveryTimeInformation":{
"PackageBillType": "03",
"Pickup":{
"Date":"20191224"
}
}
}
}
如果使用 UPS JSON 开发人员指南,您需要结合 WebServices 指南中的信息来了解您缺少哪些容器,因为 JSON 文档很差。
【讨论】: