将UPS运输时间服务代码转换为RatingAPI

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

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

我已经使用 UPS API 解决了一个有点奇怪的问题。我将所有请求发送到 Time In Transit,然后选择客户端喜欢的最佳服务。

但是,当从运输时间 API 返回的服务列表中选择一个服务时,我将该服务代码传递给 Rating API,并且我一直收到此错误:

错误代码:111209-服务类型无效

我看过附录 E-服务代码部分在运输时间和评级 XML 开发人员指南,但他们似乎都映射不正确...

这是发送的“在途时间”请求:

<?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>

我们所有的订单都可以发送到世界各地,但总是从英国发货。

0

UPS 的服务代码似乎不是 21。请检查此文档并尝试其发布的代码之一。

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

1.

您正在使用“运输中的时间”请求。对此请求的响应不包含“估计的运输成本”。

您应该使用“费率”请求。您可以发布您的费率请求的样本吗?

在 UPS 网站上查看有关“费率”请求的更多信息:https://www.ups.com/upsdeveloperkit/downloadresource?loc=en_US

2.

根据 04 / Jan / 2016 的 UPS 文档,服务代码21指的是:

说明 / 类别 / 路由

UPS Worldwide Express PlusSM / 其他源自美国的货物 / 全部

UPS Next Day Air ® Early / 发运自波多黎各 / 波多黎各至美国

UPS Worldwide Express PlusSM / 源自波多黎各的货物 / 源自波多黎各的其他货物

UPS Express ® 早期 / 从加拿大 / 加拿大发运至美国

UPS Worldwide Express PlusSM / 源自加拿大的货物 / 源自加拿大的其他货物

UPS Express Plus / 来自墨西哥的货物 / 全部

UPS Worldwide Express PlusSM / 源自欧盟的货物 / 欧盟以外的目的地

UPS Worldwide Express PlusSM / 来自其他国家的货物 / 全部

本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处

(163)
AzureKeyVault限制
上一篇
如何删除.htaccess文件与权限0444
下一篇

相关推荐

发表评论

登录 后才能评论

评论列表(14条)