[在PHP中使用UPS Rate API时如何捕获交货日期?

问题描述 投票:0回答:2

我正在使用此端点请求估计费率https://wwwcie.ups.com/webservices/Rate

我注意到XML响应不包含任何交付日期。我确实看到了BusinessDaysInTransit。但是,我不确定是否要由人工负责确定交付日期是什么。我在他们的api文档中找不到任何内容。

php shipping fedex ups
2个回答
0
投票

您必须使用Time In Transit API。 Rate API未提供预计的交付日期。

“在此处输入图像描述”


0
投票

我知道这很旧,但是要在费率通话中获得此权限,您需要将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开发人员指南》,您将需要结合Web服务指南中的信息,以了解由于JSON文档不佳而缺少哪些容器。

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.