UPS – How to Get Estimated Delivery Date Using API

delivery-dateshipping-methodsups

i need my shipping methods from UPS to say an estimated delivery date (or range) do i need to extend Magento's core UPS API functionality or is this information already being retrieved and i just need to display it? my store is magento 1.9.3

UPS shipping rates

Best Answer

You will need to extend it, but the information is provided in the UPS response for some of the shipping methods. One notable exception seems to be UPS Ground, although that might be a configuration setting for the webservices account or in the request.

You can turn on the DEBUG option in Admin > System > Configuration > Shipping Methods > UPS... this allows you to see the response XML that comes back from the request.

Here is part of the response for method "UPS Next Day Air Saver":

<RatedShipment>
  <Service>
     <Code>13</Code>
  </Service>
  <RatedShipmentWarning>Your invoice may vary from the displayed reference rates</RatedShipmentWarning>
  <BillingWeight>
     <UnitOfMeasurement>
        <Code>LBS</Code>
     </UnitOfMeasurement>
     <Weight>2.0</Weight>
  </BillingWeight>
  <TransportationCharges>
     <CurrencyCode>USD</CurrencyCode>
     <MonetaryValue>56.09</MonetaryValue>
  </TransportationCharges>
  <ServiceOptionsCharges>
     <CurrencyCode>USD</CurrencyCode>
     <MonetaryValue>0.00</MonetaryValue>
  </ServiceOptionsCharges>
  <TotalCharges>
     <CurrencyCode>USD</CurrencyCode>
     <MonetaryValue>56.09</MonetaryValue>
  </TotalCharges>
  <GuaranteedDaysToDelivery>1</GuaranteedDaysToDelivery>
  <ScheduledDeliveryTime>4:30 P.M.</ScheduledDeliveryTime>
  <RatedPackage>
     <TransportationCharges>
        <CurrencyCode>USD</CurrencyCode>
        <MonetaryValue>56.09</MonetaryValue>
     </TransportationCharges>
     <ServiceOptionsCharges>
        <CurrencyCode>USD</CurrencyCode>
        <MonetaryValue>0.00</MonetaryValue>
     </ServiceOptionsCharges>
     <TotalCharges>
        <CurrencyCode>USD</CurrencyCode>
        <MonetaryValue>56.09</MonetaryValue>
     </TotalCharges>
     <Weight>1.1</Weight>
     <BillingWeight>
        <UnitOfMeasurement>
           <Code>LBS</Code>
        </UnitOfMeasurement>
        <Weight>2.0</Weight>
     </BillingWeight>
  </RatedPackage>

It may be that this is actually generic info and does not represent the actual transit time (only the guaranteed arrival). This MIGHT be enough for you... but if it is not and you need further detail, there is actually a separate Time in Transit API. Take a look at the UPS API documents:

https://www.ups.com/content/us/en/resources/techsupport/developercenter.html

Regardless, some customization will be required.

Related Topic