gpt4 book ai didi

php - UPS Time in Transit 服务代码到 Rating API

转载 作者:可可西里 更新时间:2023-11-01 13:32:01 25 4
gpt4 key购买 nike

我正在开发一个系统,该系统使用 UPS 作为我们打包订单的主要 express 公司。

我在使用 UPS API 时发现了一个奇怪的问题。我将所有请求提交给 Time In Transit,然后选择客户喜欢的最佳服务。

但是,当我从 Time in Transit API 返回的服务列表中选择一项服务并将该服务代码传递给 Rating API 时,我一直收到此错误:

Error Code: 111209 - Invalid Service Type

我查看了传输时间和评级 XML 开发人员指南中的附录 E - 服务代码部分,但它们似乎都映射不正确...

这是发送的传输时间请求:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TimeInTransitRequest xml:lang="en-GB">
<Request>
<RequestAction>TimeInTransit</RequestAction>
<TransactionReference>
<CustomerContext></CustomerContext>
</TransactionReference>
</Request>
<ShipmentWeight>
<UnitOfMeasurement>
<Code>KGS</Code>
</UnitOfMeasurement>
<Weight>1</Weight>
</ShipmentWeight>
<TransitFrom>
<AddressArtifactFormat>
<PoliticalDivision2>Elham</PoliticalDivision2>
<PoliticalDivision1></PoliticalDivision1>
<PostcodePrimaryLow>CT46NE</PostcodePrimaryLow>
<CountryCode>GB</CountryCode>
</AddressArtifactFormat>
</TransitFrom>
<TransitTo>
<AddressArtifactFormat>
<PoliticalDivision2></PoliticalDivision2>
<PoliticalDivision1>CA</PoliticalDivision1>
<PostcodePrimaryLow>92614</PostcodePrimaryLow>
<CountryCode>US</CountryCode>
</AddressArtifactFormat>
</TransitTo>
<PickupDate>20141024</PickupDate>
<TotalPackagesInShipment>1</TotalPackagesInShipment>
<InvoiceLineTotal>
<MonetaryValue>255</MonetaryValue>
<CurrencyCode>GBP</CurrencyCode>
</InvoiceLineTotal>
</TimeInTransitRequest>

这是从 API 返回的内容:

<?xml version="1.0"?>
<TimeInTransitResponse>
<Response>
<TransactionReference></TransactionReference>
<ResponseStatusCode>1</ResponseStatusCode>
<ResponseStatusDescription>Success</ResponseStatusDescription>
</Response>
<TransitResponse>
<PickupDate>2014-10-24</PickupDate>
<TransitFrom>
<AddressArtifactFormat>
<PoliticalDivision2>ELHAM</PoliticalDivision2>
<PoliticalDivision1>KENT</PoliticalDivision1>
<Country>UNITED KINGDOM</Country>
<CountryCode>GB</CountryCode>
<PostcodePrimaryLow>CT046</PostcodePrimaryLow>
</AddressArtifactFormat>
</TransitFrom>
<TransitTo>
<AddressArtifactFormat>
<PoliticalDivision2>IRVINE</PoliticalDivision2>
<PoliticalDivision1>CA</PoliticalDivision1>
<Country>UNITED STATES</Country>
<CountryCode>US</CountryCode>
<PostcodePrimaryLow>92614</PostcodePrimaryLow>
</AddressArtifactFormat>
</TransitTo>
<AutoDutyCode>01</AutoDutyCode>
<ShipmentWeight>
<UnitOfMeasurement>
<Code>KGS</Code>
</UnitOfMeasurement>
<Weight>1.0</Weight>
</ShipmentWeight>
<InvoiceLineTotal>
<CurrencyCode>GBP</CurrencyCode>
<MonetaryValue>255.00</MonetaryValue>
</InvoiceLineTotal>
<Disclaimer>All services are guaranteed if shipment is paid for in full by a payee in the United States. Services listed as guaranteed are backed by a money-back guarantee for transportation charges only. See Terms and Conditions in the Service Guide for details. Certain commodities and high value shipments may require additional transit time for customs clearance.</Disclaimer>
<ServiceSummary>
<Service>
<Code>21</Code>
<Description>UPS Express Plus</Description>
</Service>
<Guaranteed>
<Code>Y</Code>
</Guaranteed>
<EstimatedArrival>
<BusinessTransitDays>1</BusinessTransitDays>
<Time>08:00:00</Time>
<PickupDate>2014-10-24</PickupDate>
<PickupTime>13:00:00</PickupTime>
<HolidayCount>0</HolidayCount>
<DelayCount>0</DelayCount>
<Date>2014-10-27</Date>
<DayOfWeek>MON</DayOfWeek>
<TotalTransitDays>3</TotalTransitDays>
<CustomerCenterCutoff>10:30:00</CustomerCenterCutoff>
<RestDays>2</RestDays>
</EstimatedArrival>
</ServiceSummary>
<ServiceSummary>
<Service>
<Code>01</Code>
<Description>UPS Express</Description>
</Service>
<Guaranteed>
<Code>Y</Code>
</Guaranteed>
<EstimatedArrival>
<BusinessTransitDays>1</BusinessTransitDays>
<Time>10:30:00</Time>
<PickupDate>2014-10-24</PickupDate>
<PickupTime>13:00:00</PickupTime>
<HolidayCount>0</HolidayCount>
<DelayCount>0</DelayCount>
<Date>2014-10-27</Date>
<DayOfWeek>MON</DayOfWeek>
<TotalTransitDays>3</TotalTransitDays>
<CustomerCenterCutoff>10:30:00</CustomerCenterCutoff>
<RestDays>2</RestDays>
</EstimatedArrival>
</ServiceSummary>
<ServiceSummary>
<Service>
<Code>28</Code>
<Description>UPS Express Saver</Description>
</Service>
<Guaranteed>
<Code>Y</Code>
</Guaranteed>
<EstimatedArrival>
<BusinessTransitDays>1</BusinessTransitDays>
<Time>23:30:00</Time>
<PickupDate>2014-10-24</PickupDate>
<PickupTime>13:00:00</PickupTime>
<HolidayCount>0</HolidayCount>
<DelayCount>0</DelayCount>
<Date>2014-10-27</Date>
<DayOfWeek>MON</DayOfWeek>
<TotalTransitDays>3</TotalTransitDays>
<CustomerCenterCutoff>10:30:00</CustomerCenterCutoff>
<RestDays>2</RestDays>
</EstimatedArrival>
</ServiceSummary>
<ServiceSummary>
<Service>
<Code>29</Code>
<Description>UPS Worldwide Express Freight</Description>
</Service>
<Guaranteed>
<Code>Y</Code>
</Guaranteed>
<EstimatedArrival>
<BusinessTransitDays>2</BusinessTransitDays>
<Time>23:30:00</Time>
<PickupDate>2014-10-24</PickupDate>
<PickupTime>13:00:00</PickupTime>
<HolidayCount>0</HolidayCount>
<DelayCount>0</DelayCount>
<Date>2014-10-28</Date>
<DayOfWeek>TUE</DayOfWeek>
<TotalTransitDays>4</TotalTransitDays>
<CustomerCenterCutoff>10:30:00</CustomerCenterCutoff>
<RestDays>2</RestDays>
</EstimatedArrival>
</ServiceSummary>
<ServiceSummary>
<Service>
<Code>05</Code>
<Description>UPS Expedited</Description>
</Service>
<Guaranteed>
<Code>N</Code>
</Guaranteed>
<EstimatedArrival>
<BusinessTransitDays>4</BusinessTransitDays>
<Time>23:30:00</Time>
<PickupDate>2014-10-24</PickupDate>
<PickupTime>13:00:00</PickupTime>
<HolidayCount>0</HolidayCount>
<DelayCount>0</DelayCount>
<Date>2014-10-30</Date>
<DayOfWeek>THU</DayOfWeek>
<TotalTransitDays>6</TotalTransitDays>
<CustomerCenterCutoff>10:30:00</CustomerCenterCutoff>
<RestDays>2</RestDays>
</EstimatedArrival>
</ServiceSummary>
<MaximumListSize>35</MaximumListSize>
</TransitResponse>
</TimeInTransitResponse>

例如,我选择了 UPS Express Plus 服务。服务代码是 21,我将其传递到 Rate API 请求中,但出现与上述相同的错误。服务代码附加在 RatingServiceSelectionRequest/Shipment/Service/Code 路径中,如下所示:

<Service>
<Code>21</Code>
</Service>

我在这里做错了什么吗?我们所有的订单都可以发送到世界各地,但始终从英国发货。

最佳答案

UPS 似乎没有服务代码 21。请查看此文档并尝试使用他们发布的代码之一。

http://www.yourecommerce.com/media/UPS_Rates_XML_SDK.pdf

关于php - UPS Time in Transit 服务代码到 Rating API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26543558/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com