6

I'm working on a system that uses UPS as the main courier for our packaged orders.

I've dsicovered a little weird issue using the UPS API. I take all the requests to the Time In Transit then select the best service the client prefers to take.

However, when selecting a service from the list of services that the Time in Transit API returned and I pass that service code to the Rating API, and I keep getting this error all the time:

Error Code: 111209 - Invalid Service Type

I've looked in the Appendix E - Service Codes section in the Time in Transit and Rating XML developers guide, but they all seem to map incorrectly...

This is the Time in Transit request that was sent:

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

This is what was returned from the 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>

For example, I select the UPS Express Plus service. The service code is 21, I pass that into the Rate API request, but the same error comes up as above. The service code is appended in the RatingServiceSelectionRequest/Shipment/Service/Code path, like so:

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

Is there anything I am doing wrong here? All of our orders can be sent worldwide but is always shipped from the UK.

MacMac
  • 34,294
  • 55
  • 151
  • 222
  • IIRC, you need the service codes given to your account. I would contact your account manager at UPS. – ʰᵈˑ Oct 27 '14 at 09:17
  • I also get same result as you receive in . You have to specify service code 21 in not in Rate API. But no idea how to specify service code . – Pabitra Dash Mar 23 '17 at 09:30

2 Answers2

0

UPS does not appear to have a service code of 21. Please check this document and try one of their published codes.

http://www.yourecommerce.com/media/UPS_Rates_XML_SDK.pdf
Len_D
  • 1,422
  • 1
  • 12
  • 21
0

1.

You are using "Time in Transit" request. Response on this request do not contain "estimated shipping cost".

You should use "Rate" request. Can you post sample of your Rate request?

See more information about "Rate" request on UPS web site: https://www.ups.com/upsdeveloperkit/downloadresource?loc=en_US

2.

According to UPS documentation from 04/Jan/2016 service code 21 are refer to:

Description / Category / Routing

  1. UPS Worldwide Express PlusSM / Other Shipments Originating in United States / All

  2. UPS Next Day Air® Early / Shipments Originating in Puerto Rico / Puerto Rico to United States

  3. UPS Worldwide Express PlusSM / Shipments Originating in Puerto Rico / Other Shipments Originating in Puerto Rico

  4. UPS Express® Early / Shipments Originating in Canada / Canada to the United States

  5. UPS Worldwide Express PlusSM / Shipments Originating in Canada / Other Shipments Originating in Canada

  6. UPS Express Plus / Shipments Originating in Mexico / All

  7. UPS Worldwide Express PlusSM / Shipments Originating in the European Union / Destination Outside the European Union

  8. UPS Worldwide Express PlusSM / Shipments Originating in Other Countries / All

Zam
  • 2,880
  • 1
  • 18
  • 33
  • 2
    Rate API will support the return of time in transit information when new RequestOptions “shoptimeintransit” and “ratetimeintransit” are passed, along with the new DeliveryTimeInformation container. For example, 1.0 Rate Shoptimeintransit – Pabitra Dash Mar 23 '17 at 09:33