Time In Transit / Service Availability¶
UPS¶
Example¶
Here is a simple Time in Transit request, make sure you specify a pickupDate into the future:
<?php
$t = new \RocketShipIt\TimeInTransit('ups');
$t->setParameter('toCode','59715');
$t->setParameter('pickupDate','20160308');
$response = $t->getTimeInTransit();
Here is a Time in Transit request specifying more detail:
<?php
$t = new \RocketShipIt\TimeInTransit('ups');
$t->setParameter('toCity','Bozeman');
$t->setParameter('toState','MT');
$t->setParameter('toCode','59715');
$t->setParameter('weight','23');
$t->setParameter('pickupDate','20160308');
$response = $t->getTimeInTransit();
Here is an international example:
<?php
$t = new \RocketShipIt\TimeInTransit('UPS');
$t->setParameter('toCountry', 'CA');
$t->setParameter('toCode', 'N2M3X2');
$t->setParameter('weight', '10');
$t->setParameter('monetaryValue', '10'); // required
$t->setParameter('pickupDate', '20160414');
$response = $t->getSimpleTimeInTransit();
Output¶
Output would look like this:
Array
(
[TimeInTransitResponse] => Array
(
[Response] => Array
(
[TransactionReference] => Array
(
[CustomerContext] => Array
(
[VALUE] => RocketShipIt
)
)
[ResponseStatusCode] => Array
(
[VALUE] => 1
)
[ResponseStatusDescription] => Array
(
[VALUE] => Success
)
)
[TransitResponse] => Array
(
[PickupDate] => Array
(
[VALUE] => 2010-03-08
)
[TransitFrom] => Array
(
[AddressArtifactFormat] => Array
(
[PoliticalDivision2] => Array
(
[VALUE] => WHITEHALL
)
[PoliticalDivision1] => Array
(
[VALUE] => MT
)
[Country] => Array
(
[VALUE] => UNITED STATES
)
[CountryCode] => Array
(
[VALUE] => US
)
[PostcodePrimaryLow] => Array
(
[VALUE] => 59759
)
)
)
[TransitTo] => Array
(
[AddressArtifactFormat] => Array
(
[PoliticalDivision2] => Array
(
[VALUE] => BOZEMAN
)
[PoliticalDivision1] => Array
(
[VALUE] => MT
)
[Country] => Array
(
[VALUE] => UNITED STATES
)
[CountryCode] => Array
(
[VALUE] => US
)
[PostcodePrimaryLow] => Array
(
[VALUE] => 59715
)
)
)
[ShipmentWeight] => Array
(
[UnitOfMeasurement] => Array
(
[Code] => Array
(
[VALUE] => LBS
)
)
[Weight] => Array
(
[VALUE] => 23.0
)
)
[Disclaimer] => Array
(
[VALUE] => Services listed as guaranteed are backed by a money-back guarantee for transportation charges only. UPS guarantees the day of delivery for every ground package you ship to any address within all 50 states and Puerto Rico. See Terms and Conditions in the Service Guide for details.
)
[ServiceSummary] => Array
(
[0] => Array
(
[Service] => Array
(
[Code] => Array
(
[VALUE] => 1DA
)
[Description] => Array
(
[VALUE] => UPS Next Day Air
)
)
[Guaranteed] => Array
(
[Code] => Array
(
[VALUE] => Y
)
)
[EstimatedArrival] => Array
(
[BusinessTransitDays] => Array
(
[VALUE] => 1
)
[Time] => Array
(
[VALUE] => 23:00:00
)
[PickupDate] => Array
(
[VALUE] => 2010-03-08
)
[PickupTime] => Array
(
[VALUE] => 19:00:00
)
[Date] => Array
(
[VALUE] => 2010-03-09
)
[DayOfWeek] => Array
(
[VALUE] => TUE
)
[CustomerCenterCutoff] => Array
(
[VALUE] => 18:00:00
)
)
)
[1] => Array
(
[Service] => Array
(
[Code] => Array
(
[VALUE] => GND
)
[Description] => Array
(
[VALUE] => UPS Ground
)
)
[Guaranteed] => Array
(
[Code] => Array
(
[VALUE] => Y
)
)
[EstimatedArrival] => Array
(
[BusinessTransitDays] => Array
(
[VALUE] => 1
)
[Time] => Array
(
[VALUE] => 23:00:00
)
[PickupDate] => Array
(
[VALUE] => 2010-03-08
)
[PickupTime] => Array
(
[VALUE] => 19:00:00
)
[Date] => Array
(
[VALUE] => 2010-03-09
)
[DayOfWeek] => Array
(
[VALUE] => TUE
)
[CustomerCenterCutoff] => Array
(
[VALUE] => 18:00:00
)
)
)
)
[MaximumListSize] => Array
(
[VALUE] => 35
)
)
)
)
UPS Time in Transit Service Types¶
Code | Description | Category | Routing |
---|---|---|---|
1DM | UPS Next Day Air® Early A.M. SM | United States Domestic Shipments | All |
1DA  | UPS Next Day Air® | United States Domestic Shipments | All |
1DP | UPS Next Day Air Saver®  | United States Domestic Shipments | All |
2DM | UPS Second Day Air A.M.® | United States Domestic Shipments | All |
2DA  | UPS Second Day Air® | United States Domestic Shipments | All |
3DS  | UPS Three-Day Select® | United States Domestic Shipments | All |
GND | UPS Ground  | United States Domestic Shipments | All |
1DMS | UPS Next Day Air® Early A.M. Saturday Delivery | United States Domestic Shipments | All |
1DAS | UPS Next Day Air Saturday Delivery | United States Domestic Shipments | All |
2DAS | UPS Second Day Air Saturday Delivery | United States Domestic Shipments | All |
21  | UPS Worldwide Express PlusSM  | Other Shipments Originating in United States  | All |
01 | UPS Worldwide ExpressSM | Other Shipments Originating in United States | All |
28  | UPS Worldwide Saver | Other Shipments Originating in United States  | All |
05  | UPS Worldwide ExpeditedSM  | Other Shipments Originating in United States  | All |
03 | UPS Standard  | Other Shipments Originating in United States | All |
01 | UPS Second Day Air Intra  | Shipments Originating in Puerto Rico | Puerto Rico Domestic |
21 | UPS Next Day Air® Early A.M. SM  | Shipments Originating in Puerto Rico | Puerto Rico to United States |
01 | UPS Next Day Air® | Shipments Originating in Puerto Rico | Puerto Rico to United States |
02  | UPS Second Day Air® Shipments | Originating in Puerto Rico Puerto | Rico to United States |
G | UPS Ground Shipments | Originating in Puerto Rico to United State and Shipment Originating from United State to Puerto Rico | Puerto Rico to United States and United States to Puerto Rico |
21 | UPS Worldwide Express PlusSM | Shipments Originating in Puerto Rico | Other Shipments Originating in Puerto Rico |
01 | UPS Worldwide ExpressSM | Shipments Originating in Puerto Rico | Other Shipments Originating in Puerto Rico |
28 | UPS Worldwide Saver | Shipments Originating in Puerto Rico  | Other Shipments Originating in Puerto Rico |
05  | UPS Worldwide ExpeditedSM | Shipments Originating in Puerto Rico  | Other Shipments Originating in Puerto Rico |
23  | UPS Express Early A.M. SM | Shipments Originating in Canada  | Canada Domestic |
24  | UPS Express | Shipments Originating in Canada  | Canada Domestic |
20  | UPS Express Saver | Shipments Originating in Canada  | Canada Domestic |
19  | UPS Expedited | Shipments Originating in Canada  | Canada Domestic |
25 | UPS Standard  | Shipments Originating in Canada  | Canada Domestic  |
21 | UPS Express Early A.M. SM | Shipments Originating in Canada | Canada to the United States |
01  | UPS Worldwide ExpressSM | Shipments Originating in Canada  | Canada to the United States |
28  | UPS Express Saver  | Shipments Originating in Canada  | Canada to the United States |
05 | UPS Worldwide ExpeditedSM | Shipments Originating in Canada | Canada to the United States  |
33 | UPS Three-Day Select® | Shipments Originating in Canada | Canada to the United States |
03  | UPS Standard | Shipments Originating in Canada | Canada to the United States |
21 | UPS Worldwide Express PlusSM | Shipments Originating in Canada | Other Shipments Originating in Canada |
01  | UPS Worldwide ExpressSM | Shipments Originating in Canada | Other Shipments Originating in Canada |
28 | UPS Express Saver | Shipments Originating in Canada | Other Shipments Originating in Canada |
05  | UPS Worldwide ExpeditedSM | Shipments Originating in Canada  | Other Shipments Originating in Canada |
24  | UPS National Express | Shipments Originating in Mexico  | All |
21  | UPS Express Plus  | Shipments Originating in Mexico  | All  |
01 | UPS Express | Shipments Originating in Mexico | All |
28  | UPS Express Saver | Shipments Originating in Mexico  | All |
05  | UPS Expedited | Shipments Originating in Mexico  | All |
23 | UPS Express Plus | Polish Domestic Shipments | All |
24  | UPS Express  | Polish Domestic Shipments  | All  |
26 | UPS Express Saver | Polish Domestic Shipments | All |
25 | UPS Standard  | Polish Domestic Shipments  | All  |
34 | UPS Today Standard | Polish Domestic Shipments | All |
35  | UPS Today Dedicated Courier | Polish Domestic Shipments  | All |
36  | UPS Today Intercity  | Polish Domestic Shipments  | All  |
37 | UPS Today Express | Polish Domestic Shipments | All |
38  | UPS Today Express Saver  | Polish Domestic Shipments  | All  |
23 | UPS Express PlusSM | Shipments Originating in the European Union | Destination Within the Origin Country |
24 | UPS Express  | Shipments Originating in the European Union | Destination Within the Origin Country  |
26 | UPS Express Saver | Shipments Originating in the European Union | Destination Within the Origin Country |
25  | UPS Standard | Shipments Originating in the European Union | Destination Within the Origin Country |
22 | UPS Express PlusSM | Shipments Originating in the European Union | Destination Within the European Union |
10 | UPS Express | Shipments Originating in the European Union | Destination Within the European Union |
18  | UPS Express Saver | Shipments Originating in the European Union | Destination Within the European Union |
08 | UPS Standard  | Shipments Originating in the European Union | Destination Within the European Union  |
11 | UPS Express NA 1 | Shipments Originating in the European Union | Destination Outside the European Union |
21 | UPS Worldwide Express PlusSM  | Shipments Originating in the European Union | Destination Outside the European Union  |
01 | UPS Express | Shipments Originating in the European Union | Destination Outside the European Union |
28 | UPS Express Saver  | Shipments Originating in the European Union | Destination Outside the European Union  |
05 | UPS ExpeditedSM | Shipments Originating in the European Union | Destination Outside the European Union |
68 | UPS Standard | Shipments Originating in the European Union | Destination Outside the European Union |
21 | UPS Worldwide Express PlusSM | Shipments Originating in Other Countries  | All |
28 | UPS Express Saver | Shipments Originating in Other Countries  | All |
05 | UPS Worldwide ExpeditedSM  | Shipments Originating in Other Countries  | All  |
68 | UPS Standard | Shipments Originating in Other Countries | All |
09 | UPS Worldwide Express  | Shipments Originating in Other Countries  | All |
FedEx¶
Important
FedEx does not return ground services in their time in transit API. Please use the getAllRates(), getRate, or getSimpleRates() calls for estimated ground delivery times.
Example¶
A sample fedex availablity request:
<?php
$t = new \RocketShipIt\TimeInTransit('fedex');
$t->setParameter('toCode','90210');
$t->setParameter('pickupDate','2010-02-22');
$response = $t->getTimeInTransit();
Output¶
The response will look like:
Array
(
[v4:ServiceAvailabilityReply] => Array
(
[xmlns:xsi] => http://www.w3.org/2001/XMLSchema-instance
[xmlns:soapenv] => http://schemas.xmlsoap.org/soap/envelope/
[xmlns:v4] => http://fedex.com/ws/packagemovementinformationservice/v4
[v4:HighestSeverity] => Array
(
[VALUE] => SUCCESS
)
[v4:Notifications] => Array
(
[v4:Severity] => Array
(
[VALUE] => SUCCESS
)
[v4:Source] => Array
(
[VALUE] => pmis
)
[v4:Code] => Array
(
[VALUE] => 000
)
[v4:Message] => Array
(
[VALUE] => SUCCESS
)
[v4:LocalizedMessage] => Array
(
[VALUE] => SUCCESS
)
)
[ns:Version] => Array
(
[xmlns:ns] => http://fedex.com/ws/packagemovementinformationservice/v4
[ns:ServiceId] => Array
(
[VALUE] => pmis
)
[ns:Major] => Array
(
[VALUE] => 4
)
[ns:Intermediate] => Array
(
[VALUE] => 0
)
[ns:Minor] => Array
(
[VALUE] => 0
)
)
[v4:Options] => Array
(
[0] => Array
(
[v4:Service] => Array
(
[VALUE] => FIRST_OVERNIGHT
)
[v4:DeliveryDate] => Array
(
[VALUE] => 2010-02-23
)
[v4:DeliveryDay] => Array
(
[VALUE] => TUE
)
[v4:DestinationStationId] => Array
(
[VALUE] => CCDA
)
[v4:DestinationAirportId] => Array
(
[VALUE] => LAX
)
)
[1] => Array
(
[v4:Service] => Array
(
[VALUE] => PRIORITY_OVERNIGHT
)
[v4:DeliveryDate] => Array
(
[VALUE] => 2010-02-23
)
[v4:DeliveryDay] => Array
(
[VALUE] => TUE
)
[v4:DestinationStationId] => Array
(
[VALUE] => CCDA
)
[v4:DestinationAirportId] => Array
(
[VALUE] => LAX
)
)
[2] => Array
(
[v4:Service] => Array
(
[VALUE] => STANDARD_OVERNIGHT
)
[v4:DeliveryDate] => Array
(
[VALUE] => 2010-02-23
)
[v4:DeliveryDay] => Array
(
[VALUE] => TUE
)
[v4:DestinationStationId] => Array
(
[VALUE] => CCDA
)
[v4:DestinationAirportId] => Array
(
[VALUE] => LAX
)
)
[3] => Array
(
[v4:Service] => Array
(
[VALUE] => FEDEX_2_DAY
)
[v4:DeliveryDate] => Array
(
[VALUE] => 2010-02-24
)
[v4:DeliveryDay] => Array
(
[VALUE] => WED
)
[v4:DestinationStationId] => Array
(
[VALUE] => CCDA
)
[v4:DestinationAirportId] => Array
(
[VALUE] => LAX
)
)
[4] => Array
(
[v4:Service] => Array
(
[VALUE] => FEDEX_EXPRESS_SAVER
)
[v4:DeliveryDate] => Array
(
[VALUE] => 2010-02-25
)
[v4:DeliveryDay] => Array
(
[VALUE] => THU
)
[v4:DestinationStationId] => Array
(
[VALUE] => CCDA
)
[v4:DestinationAirportId] => Array
(
[VALUE] => LAX
)
)
[5] => Array
(
[v4:Service] => Array
(
[VALUE] => FEDEX_1_DAY_FREIGHT
)
[v4:DeliveryDate] => Array
(
[VALUE] => 2010-02-23
)
[v4:DeliveryDay] => Array
(
[VALUE] => TUE
)
[v4:DestinationStationId] => Array
(
[VALUE] => LAXRT
)
[v4:DestinationAirportId] => Array
(
[VALUE] => LAX
)
)
[6] => Array
(
[v4:Service] => Array
(
[VALUE] => FEDEX_2_DAY_FREIGHT
)
[v4:DeliveryDate] => Array
(
[VALUE] => 2010-02-24
)
[v4:DeliveryDay] => Array
(
[VALUE] => WED
)
[v4:DestinationStationId] => Array
(
[VALUE] => LAXRT
)
[v4:DestinationAirportId] => Array
(
[VALUE] => LAX
)
)
[7] => Array
(
[v4:Service] => Array
(
[VALUE] => FEDEX_3_DAY_FREIGHT
)
[v4:DeliveryDate] => Array
(
[VALUE] => 2010-02-25
)
[v4:DeliveryDay] => Array
(
[VALUE] => THU
)
[v4:DestinationStationId] => Array
(
[VALUE] => LAXRT
)
[v4:DestinationAirportId] => Array
(
[VALUE] => LAX
)
)
[8] => Array
(
[v4:Service] => Array
(
[VALUE] => FEDEX_GROUND
)
)
[9] => Array
(
[v4:Service] => Array
(
[VALUE] => GROUND_HOME_DELIVERY
)
)
)
)
)
USPS¶
Example:
<?php
$t = new \RocketShipIt\TimeInTransit('USPS');
$t->setParameter('toCode','90210');
$t->setParameter('pickupDate', '01-28-2011');
$response = $t->getTimeInTransit();
DHL¶
Example:
<?php
$t = new \RocketShipIt\TimeInTransit('dhl');
$t->setParameter('shipCode', '90210');
$t->setParameter('toCode', '59715');
$t->setParameter('pickupDate', '20140308');
$t->setParameter('length', '5');
$t->setParameter('width', '5');
$t->setParameter('height', '5');
$t->setParameter('weight', '5');
$response = $t->getTimeInTransit();
Output¶
The response will look like:
Array
(
[DCTResponse] => Array
(
[xmlns:res] => http://www.dhl.com
[xmlns:xsi] => http://www.w3.org/2001/XMLSchema-instance
[xsi:schemaLocation] => http://www.dhl.com DCT-Response.xsd
[GetCapabilityResponse] => Array
(
[Response] => Array
(
[ServiceHeader] => Array
(
[MessageTime] => 2014-07-21T05:02:46.295+01:00
[MessageReference] => eAWK03SAxCXm04jXLzjvHmBk8zy0mstS
[SiteID] => XXXXXXXX
)
)
[BkgDetails] => Array
(
[OriginServiceArea] => Array
(
[FacilityCode] => ELA
[ServiceAreaCode] => ELA
)
[DestinationServiceArea] => Array
(
[FacilityCode] => COS
[ServiceAreaCode] => DEN
)
[QtdShp] => Array
(
[GlobalProductCode] => N
[LocalProductCode] => N
[ProductShortName] => DOMESTIC EXPRESS
[LocalProductName] => DOMESTIC EXPRESS
[NetworkTypeCode] => TD
[POfferedCustAgreement] => Y
[TransInd] => N
[PickupDate] => 2014-07-21
[PickupCutoffTime] => PT16H
[BookingTime] => PT15H
[TotalTransitDays] => 3
[PickupPostalLocAddDays] => 0
[DeliveryPostalLocAddDays] => 2
[PickupNonDHLCourierCode] =>
[DeliveryNonDHLCourierCode] =>
[DeliveryDate] => 2014-07-24
[DeliveryTime] => PT23H59M
[DimensionalWeight] => 5.000
[WeightUnit] => LB
[PickupDayOfWeekNum] => 1
[DestinationDayOfWeekNum] => 4
)
)
[Srvs] => Array
(
[Srv] => Array
(
[GlobalProductCode] => N
[MrkSrv] => Array
(
[LocalProductCode] => N
[ProductShortName] => DOMESTIC EXPRESS
[LocalProductName] => DOMESTIC EXPRESS
[NetworkTypeCode] => TD
[POfferedCustAgreement] => Y
[TransInd] => N
)
)
)
)
)
)
Simple Time In Transit¶
Example:
<?php
$t = new \RocketShipIt\TimeInTransit('ups');
$t->setParameter('toCode','59715');
$t->setParameter('pickupDate','20100308');
$response = $t->getSimpleTimeInTransit();
Which would produce an array like this:
Array
(
[0] => Array
(
[desc] => UPS Next Day Air
[service_code] => 1DA
[is_guaranteed] => 1
[eta] => 1389765600
[formatted_eta] => Tue January 14 by 11:00 pm
)
[1] => Array
(
[desc] => UPS Ground
[service_code] => GND
[is_guaranteed] => 1
[eta] => 1389765600
[formatted_eta] => Tue January 14 by 11:00 pm
)
)
Note
For international time in transit you may need to set the monetaryValue parameter.