0

I am working with UPS API and having a problem with the result return by UPS API. I am getting the result ,which look like this :

Array
(
    [1] => Array
        (
            [value] => 9.90
            [code] => 03
            [delivery_day] => -1
            [delivery_time] => -1
            [currency_code] => USD
            [old_currency_code] => USD
        )

    [2] => Array
        (
            [value] => 12.70
            [code] => 12
            [delivery_day] => 3
            [delivery_time] => -1
            [currency_code] => USD
            [old_currency_code] => USD
        )
)

Which is perfect , But when you see in first array, delivery day and time show the value "-1". In the second array delivery day value is 3 and time is "-1" . I need to know what does it means? It is really confusing. Please help.

4

2 回答 2

0

答案将取决于您使用的 API:

运输和评级业务流程

  • 地址验证 API
  • 地址验证街道级 API
  • 定位器 API
  • 取件 API
  • 评级 API
  • 运输 API
  • 运输时间 API 可见性业务流程
  • UPS Quantum View® API
  • 追踪 API
  • UPS Signature Tracking® API

国际贸易业务流程

  • UPS TradeAbility® API

您最好参考UPS 开发者网站和相关文档,从他们的“开发者工具包 — 用户指南”的 PDF 开始

于 2013-07-24T09:10:54.100 回答
0

由于您的阵列显示多种服务,我猜您正在运行费率,而不是出货量。此外,正在发生一些其他转换,这会导致您看到的奇怪值,因为您的代码必须将费率响应与运输响应合并,以便提供成本和运输时间。

以下是来自 UPS 的费率响应 XML:

<RatedShipment>
<Service>
<Code>03</Code></Service>
<BillingWeight>
<UnitOfMeasurement><Code>KGS</Code></UnitOfMeasurement>
<Weight>23.0</Weight>
</BillingWeight>
<TransportationCharges>
<CurrencyCode>UKL</CurrencyCode>
<MonetaryValue>73.65</MonetaryValue>
</TransportationCharges>
<ServiceOptionsCharges>
<CurrencyCode>UKL</CurrencyCode>
<MonetaryValue>0.00</MonetaryValue>
</ServiceOptionsCharges>
<TotalCharges>
<CurrencyCode>UKL</CurrencyCode>
<MonetaryValue>73.65</MonetaryValue>
</TotalCharges>
<GuaranteedDaysToDelivery>0</GuaranteedDaysToDelivery>
<RatedPackage>
<TransportationCharges>
<CurrencyCode>UKL</CurrencyCode>
<MonetaryValue>0.00</MonetaryValue>
</TransportationCharges>
<ServiceOptionsCharges>
<CurrencyCode>UKL</CurrencyCode>
<MonetaryValue>0.00</MonetaryValue>
</ServiceOptionsCharges>
<TotalCharges>
<CurrencyCode>UKL</CurrencyCode>
<MonetaryValue>0.00</MonetaryValue>
</TotalCharges>
<Weight>23.0</Weight>
<BillingWeight>
<UnitOfMeasurement>
<Code>KGS</Code>
</UnitOfMeasurement>
<Weight>0.0</Weight>
</BillingWeight>
</RatedPackage>
</RatedShipment>

这是公交响应的部分片段:

<EstimatedArrival>
<BusinessTransitDays>1</BusinessTransitDays>
<Time>23:30:00</Time>
<PickupDate>2001-06-08</PickupDate>
<PickupTime>19:00:00</PickupTime>
<HolidayCount>0</HolidayCount>
<DelayCount>0</DelayCount>
<Date>2001-06-11</Date>
<DayOfWeek>MON</DayOfWeek>
<TotalTransitDays>2</TotalTransitDays>
<CustomerCenterCutoff>18:30:00</CustomerCenterCutoff>
<RestDays>1</RestDays>
</EstimatedArrival>
于 2013-09-17T22:06:21.120 回答