Search code examples
phpapisoapups

UPS API LTL Rate giving Missing or invalid Country Code (9360702)


I'm making an API call to UPS LTL FreightRate to check on the prices for a shipping from the US to EN (England).

But the SOAP call returns with an error 9360702 saying:

Missing or invalid Country Code(s) provided in request.

I've actually looked through the API PDF and the country code is correct as EN.

Any ideas why this is the case?

Heres my actual request:

   (
        [Request] = Array
            (
                [RequestOption] = 1
                [SubVersion] = 1601
            )

        [Service] = Array
            (
                [Code] = 308
            )

        [ShipFrom] = Array
            (
                [Name] = 
                [Address] = Array
                    (
                        [AddressLine] = 11552 Kingsmill Place
                        [City] = Odessa
                        [StateProvinceCode] = FL
                        [PostalCode] = 
                        [CountryCode] = US
                    )

            )

        [ShipTo] = Array
            (
                [Name] = 
                [Address] = Array
                    (
                        [AddressLine] = 
                        [City] = 
                        [StateProvinceCode] = 
                        [PostalCode] = E1 4LJ
                        [CountryCode] = EN
                    )

            )

        [PaymentInformation] = Array
            (
                [Payer] = Array
                    (
                        [Name] = MY ADDRESS
                        [Address] = Array
                            (
                                [AddressLine] = 11552 500
                                [City] = Odessa
                                [StateProvinceCode] = FL
                                [PostalCode] = 33556
                                [CountryCode] = US
                            )

                    )

                [ShipmentBillingOption] = Array
                    (
                        [Code] = 10
                    )

            )

        [HandlingUnitOne] = Array
            (
                [Quantity] = 1
                [Type] = Array
                    (
                        [Code] = PLT
                    )

            )

        [Commodity] = Array
            (
                [CommodityID] = 
                [Description] = No Description
                [Weight] = Array
                    (
                        [UnitOfMeasurement] = Array
                            (
                                [Code] = LBS
                            )

                        [Value] = 65
                    )

                [NumberOfPieces] = 2
                [PackagingType] = Array
                    (
                        [Code] = BOX
                    )

                [Dimensions] = Array
                    (
                        [UnitOfMeasurement] = Array
                            (
                                [Code] = IN
                            )

                        [Length] = 11.02
                        [Width] = 14.17
                        [Height] = 5.91
                    )

                [FreightClass] = 70
            )

        [ShipmentServiceOptions] = Array
            (
                [PickupOptions] = Array
                    (
                        [ResidentialPickupIndicator] = 
                        [LiftGateRequiredIndicator] = 
                    )

            )

    )

### UPDATE ###

Reproduce this error by using the following information and XML using SOAP UI.

Request URL: https://onlinetools.ups.com/webservices/FreightRate

Please remember to add your own Username, Password, License Number and Shipper Number.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://www.ups.com/XMLSchema/XOLTWS/UPSS/v1.0" xmlns:v11="http://www.ups.com/XMLSchema/XOLTWS/FreightRate/v1.0" xmlns:v12="http://www.ups.com/XMLSchema/XOLTWS/Common/v1.0">
   <soapenv:Header>
      <v1:UPSSecurity>
         <v1:UsernameToken>
            <v1:Username>YOUR USERNAME</v1:Username>
            <v1:Password>YOUR PASSWORK</v1:Password>
         </v1:UsernameToken>
         <v1:ServiceAccessToken>
            <v1:AccessLicenseNumber>YOUR LICENSE NUMBER</v1:AccessLicenseNumber>
         </v1:ServiceAccessToken>
      </v1:UPSSecurity>
   </soapenv:Header>
   <soapenv:Body>
      <v11:FreightRateRequest>
         <v12:Request>
            <!--Zero or more repetitions:-->
            <v12:RequestOption>1</v12:RequestOption>
            <!--Optional:-->
            <v12:SubVersion>1601</v12:SubVersion>
         </v12:Request>
         <v11:ShipFrom>
            <v11:Name></v11:Name>
            <v11:Address>
               <!--1 to 3 repetitions:-->
               <v11:AddressLine>11552 Kingsmill PLace</v11:AddressLine>
               <v11:City>Odessa</v11:City>
               <!--Optional:-->
               <v11:StateProvinceCode>FL</v11:StateProvinceCode>
               <!--Optional:-->
               <v11:Town></v11:Town>
               <!--Optional:-->
               <v11:PostalCode>33556</v11:PostalCode>
               <v11:CountryCode>US</v11:CountryCode>
            </v11:Address>
         </v11:ShipFrom>
         <v11:ShipTo>
            <v11:Name/>
            <v11:Address>
               <!--1 to 3 repetitions:-->
               <v11:AddressLine>266 mile end road</v11:AddressLine>
               <v11:City>London</v11:City>
               <!--Optional:-->
               <v11:StateProvinceCode></v11:StateProvinceCode>
               <!--Optional:-->
               <v11:Town/>
               <!--Optional:-->
               <v11:PostalCode>E1 4LJ</v11:PostalCode>
               <v11:CountryCode>GB</v11:CountryCode>
            </v11:Address>
         </v11:ShipTo>
         <v11:PaymentInformation>
            <v11:Payer>
               <v11:Name></v11:Name>
               <v11:Address>
                  <!--1 to 3 repetitions:-->
                  <v11:AddressLine>11552 Kingsmill Place</v11:AddressLine>
                  <v11:City>Odessa</v11:City>
                  <!--Optional:-->
                  <v11:StateProvinceCode>FL</v11:StateProvinceCode>                 
                  <!--Optional:-->
                  <v11:PostalCode>33556</v11:PostalCode>
                  <v11:CountryCode>US</v11:CountryCode>
               </v11:Address>
               <!--Optional:-->
               <v11:ShipperNumber>YOUR SHIPPER NUMBER</v11:ShipperNumber>
               <!--Optional:-->
               <v11:AttentionName/>
            </v11:Payer>
            <v11:ShipmentBillingOption>
               <v11:Code>10</v11:Code>
               <!--Optional:-->
               <v11:Description/>
            </v11:ShipmentBillingOption>
         </v11:PaymentInformation>
         <v11:Service>
            <v11:Code>308</v11:Code>
            <!--Optional:-->
            <v11:Description/>
         </v11:Service>
         <v11:HandlingUnitOne>
            <v11:Quantity>1</v11:Quantity>
            <v11:Type>
               <v11:Code>PLT</v11:Code>
               <!--Optional:-->
               <v11:Description/>
            </v11:Type>
         </v11:HandlingUnitOne>         
         <!--1 or more repetitions:-->
         <v11:Commodity>
            <!--Optional:-->
            <v11:CommodityID/>
            <v11:Description>No Description</v11:Description>
            <v11:Weight>
               <v11:Value>65</v11:Value>
               <v11:UnitOfMeasurement>
                  <v11:Code>LBS</v11:Code>
                  <!--Optional:-->
                  <v11:Description/>
               </v11:UnitOfMeasurement>
            </v11:Weight>
            <!--Optional:-->
            <v11:Dimensions>
               <v11:UnitOfMeasurement>
                  <v11:Code>IN</v11:Code>
                  <!--Optional:-->
                  <v11:Description/>
               </v11:UnitOfMeasurement>
               <v11:Length>11.02</v11:Length>
               <v11:Width>14.17</v11:Width>
               <v11:Height>5.91</v11:Height>
            </v11:Dimensions>
            <v11:NumberOfPieces>2</v11:NumberOfPieces>
            <v11:PackagingType>
               <v11:Code>BOX</v11:Code>
               <!--Optional:-->
               <v11:Description/>
            </v11:PackagingType>
            <!--Optional:-->
            <v11:FreightClass>70</v11:FreightClass>
         </v11:Commodity>
      </v11:FreightRateRequest>
   </soapenv:Body>
</soapenv:Envelope>

Solution

  • I contacted UPS twice and finally got a response.

    Turns out that LTL Freight Rating is NOT available for GB/UK/EN. This is the reason for the Country Code error.