GetShippingTime Method
Provides the average estimated time to ship a package from an origin to a destination address.
Syntax
upsratescontrol.GetShippingTimeRemarks
This method call issues a Time in Transit request to the UPS Server and parses the response.
The following can be set when this method is called:
- SenderAddress (required: the SenderCity is required for requests outside the US if the SenderZipCode is not used in the origin country; the SenderState is optional; the SenderCountryCode is required; the SenderZipCode is required if the SenderCountryCode supports postal code system. If not provided, a candidate list will be returned for the user to enter a valid Postal Code for the specified SenderCity.
- RecipientAddress (required: the RecipientCity is required for requests outside the US if the RecipientZipCode is not used in the destination country; the RecipientState is optional; the RecipientCountryCode is required; the RecipientZipCode is required if the RecipientCountryCode supports postal code system. If not provided, a candidate list will be returned for the user to enter a valid Postal Code for the specified RecipientCity.
- SenderTown is optional, applicable to non-US addresses, and used to make the origin address more precise;
- RecipientTown is optional, applicable to non-US addresses, and used to make the destination address more precise;
- ShipDate (required)
- TotalWeight (conditional)
- WeightUnit (conditional - applicable when the TotalWeight is provided in the request)
- Documents (optional)
- TotalValue (conditional - required for Document shipments when the origin or destination is Canada or non-document shipments outside the US)
- CurrencyCode (conditional - applicable when the TotalValue is provided in the request)
The minimum information returned in the response include a summary of the user's input as well as:
- Disclaimer (when applicable)
- SenderCountryName
- RecipientCountryName
If the SenderAddress and RecipientAddress addresses provided in the request are found in UPS system exactly as entered, then the Services is filled upon server's response.
Otherwise, if those do not match any data located in UPS system, then the server returns a list of candidates for the origin and/or destination addresses, which will be stored as strings (formatted as XML) in SenderCandidateAggregate (for origin) and RecipientCandidateAggregate (for destination).
To read an address, set the Aggregate property of an UPSAddress control to this value, and read the values of the desired fields for each candidate from 0 to UPSAddress's MatchCount - 1 .
The returned candidate list will be ordered according to a level of confidence. The first candidate returned has the highest level of confidence based on the information provided in the request. You can choose the correct address and resubmit the Time-in-Transit request (by calling the GetShippingTime method again) using any of these candidates as the origin and/or destination addresses to get service specific values. You can then resubmit the Time-in-Transit request using any of these candidates as the origin and/or destination addresses (when calling the GetShippingTime method).
So, after submitting the request, you will either receive a successful response containing time-in-transit information (as described above), or an error if error conditions were found.