Search code examples
ups

UPS surepost API


I am trying to integrate UPS SurePost API in PHP to get the Rates for SurePost services. I have no idea where to get the API from and how to integrate it.

Any help would be greatly appreciated.

Thanks


Solution

  • Service Code 93 Is for Surepost

    <AccessLicenseNumber>xxxx</AccessLicenseNumber>
                 <UserId>xxxx</UserId>
                 <Password>xxxx</Password>
             </AccessRequest>
                 <RatingServiceSelectionRequest>
                     <Request>
                        <TransactionReference>
                             <CustomerContext>Bare Bones Rate Request</CustomerContext>
                             <XpciVersion>1.0001</XpciVersion>
                         </TransactionReference>
                        <RequestAction>Rate</RequestAction>
                        <RequestOption>Rate</RequestOption>
                    </Request>
                     <PickupType>
                         <Code>02</Code>
                     </PickupType>
                     <Shipment>
                         <Shipper>
                             <Address>
                                 <PostalCode>123456</PostalCode>
                                 <CountryCode>US</CountryCode>
                             </Address>
                             <ShipperNumber>123456</ShipperNumber>
                         </Shipper>             
                         <ShipTo>
                             <Address>
                                 <PostalCode>123123</PostalCode>
                                 <StateProvinceCode>AL</StateProvinceCode> 
                                 <CountryCode>US</CountryCode>                           
                             </Address>
                         </ShipTo>              
                         <ShipFrom>
                             <Address>
                                 <PostalCode>123123</PostalCode>
                                 <StateProvinceCode>123</StateProvinceCode>
                                 <CountryCode>US</CountryCode>
                             </Address>
                         </ShipFrom>                
                         <Service>
                             <Code>93</Code>
                         </Service>
                         <Package>
                            <PackagingType>
                             <Code>02</Code>
                         </PackagingType>
                         <Description>Rate Shopping</Description>
    <Dimensions><UnitOfMeasurement><Code>IN</Code></UnitOfMeasurement><Length>20</Length><Width>10</Width><Height>10</Height></Dimensions>
    <PackageWeight><UnitOfMeasurement>
                             <Code>LBS</Code>
                         </UnitOfMeasurement>
                         <Weight>20.20</Weight>
                     </PackageWeight>
                    </Package>              
                 <RateInformation><NegotiatedRatesIndicator/></RateInformation></Shipment></RatingServiceSelectionRequest>