【问题标题】:How to capture delivery date when using UPS Rate API in php?在 php 中使用 UPS Rate API 时如何捕获交货日期?
【发布时间】:2014-10-12 00:31:29
【问题描述】:

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

我注意到 XML 响应不包含任何交货日期。我确实看到了 BusinessDaysInTransit。但是,我不确定是否有责任进行手动编码以确定交货日期。我在他们的 api 文档中找不到任何东西。

【问题讨论】:

  • 我能弄明白。

标签: php shipping fedex ups


【解决方案1】:

您必须改用 Time In Transit API。 Rate API 不提供预计送达日期。

【讨论】:

  • Rate API 将支持在传递新的 RequestOptions “shoptimeintransit” 和 “ratetimeintransit” 以及新的 DeliveryTimeInformation 容器时返回运输时间信息。例如,1.0RateShoptimeintransit
【解决方案2】:

我知道这是旧的,但要在费率调用中获得它,您需要将 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 文档很差。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-07-20
    • 1970-01-01
    • 1970-01-01
    • 2012-07-18
    • 2015-11-04
    • 2014-07-17
    • 1970-01-01
    • 2015-10-11
    相关资源
    最近更新 更多