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.