Skip to main content

UpsLocator Python SDK 1.0.0

Welcome to the UpsLocator SDK documentation. This guide will help you get started with integrating and using the UpsLocator SDK in your project.

Versions

  • SDK version: 1.0.0

About the API

Search for UPS shipping locations based on type and available services. In order to obtain your bearer token please follow the instructions at https://developer.ups.com/get-started, or use the UPS Authorization API.

Table of Contents

Setup & Configuration

Supported Language Versions

This SDK is compatible with the following versions: Python >= 3.7

Installation

To get started with the SDK, we recommend installing using pip:

pip install ups-locator-client

Authentication

Basic Authentication

The UpsLocator API uses Basic Authentication.

You need to provide your username and password when initializing the SDK.

Setting the Username and Password

When you initialize the SDK, you can set the username and password as follows:

UpsLocator(
username="YOUR_USERNAME",
password="YOUR_PASSWORD"
)

If you need to set or update the username and password after initializing the SDK, you can use:

sdk.set_basic_auth("YOUR_USERNAME", "YOUR_PASSWORD")

Services

The SDK provides various services to interact with the API.

Below is a list of all available services with links to their detailed documentation:

Models

The SDK includes several models that represent the data structures used in API requests and responses. These models help in organizing and managing the data efficiently.

Below is a list of all available models with links to their detailed documentation:
NameDescription
LocatorRequestWrapperN/A
LocatorResponseWrapperN/A
LocatorRequestN/A
LocatorRequestRequestN/A
LocatorRequestOriginAddressContainer for origin address information.
LocatorRequestTranslateContains the locale information for the request.
LocatorRequestUnitOfMeasurementDistance unit of measurement. This is required for location requests (request option 1).
LocatorRequestLocationSearchCriteriaThe Location search criteria container allows the user to further define the basis to which they wish to receive the UPS locations. Only relevant when the user requests a Location search (request option 1).
LocatorRequestSortCriteriaContainer for Sort Criteria
LocatorRequestServiceGeoUnitServiceGeoUnit Container. Required to search for the freight facility information
RequestTransactionReferenceTransactionReference identifies transactions between client and server.
OriginAddressGeocodeGeocode is the latitude and longitude of the origin address.
OriginAddressAddressKeyFormatContains all of the basic information about the origin such as: Address Lines, City, State/Province, Postal Code and Country or Territory Code. The element CountryCode is required.
LocationSearchCriteriaSearchOptionSearchOption contains the information that forms the basis of the location search, It contains the criteria for search by Locations, Retail Locations, Additional Services, or Program Types. There should be one container for each type of search the user may wish to do. The user can specify either search by Locations or Retail Locations, but not both. If this container is missing, the default search would be for The UPS Store, UPS Center, UPS Drop Box, and Authorized Shipping Outlet location types.
LocationSearchCriteriaServiceSearchAllows for users to further define the search criteria. Refer to the rules specified in Service Search section.
LocationSearchCriteriaFreightWillCallSearchFreight Will Call Search Container. Required if SearchOption is '05-Freight Will Call Search'
LocationSearchCriteriaAccessPointSearchApplicable for request option 64 only. This contains inclusion and exclusion criteria for address search. It also contains Account Number and Access Point Public ID search elements.
LocationSearchCriteriaOpenTimeCriteriaContainer to hold open times of the Location.
SearchOptionOptionTypeOptionType is a container that indicates the type of search for locations. There are 5 types of search. They are search by: Location, Retail Location, Additional Services, Program Type, and a Service Level Option. If search criteria by Location or Retail Location is not provided the default search of The UPS Store, UPS Center, UPS Drop Box, and Authorized Shipping Outlet location types will be performed.
SearchOptionOptionCodeOption code contains the information of a particular Location, Retail Location, Additional Service, Program Type or End Point Service Offering depending on the option type. The SearchOptions can contain one or more OptionCodes which forms the criteria for the location search.
SearchOptionRelationThe relation container will contain the relation parameter (And/Or) that has to be used among multiple option codes in the location search. This is only applicable to option type Additional Services and Program Types. If this container is not present for Additional Services and Program Types, the default relation of And is used.
ServiceSearchServiceCodeContainer that contains the service information such as Ground/Air. Required if the customer provides ServiceSearch Time.
ServiceSearchServiceOptionCodeContainer for the optional service information such as Saturday Pick up.
FreightWillCallSearchFacilityAddressFacility Address Container
AccessPointSearchIncludeCriteriaThis contains elements to refine (include) UPS Access point address or geocode Search.
AccessPointSearchExcludeFromResultThis contains elements to exclude from UPS Access Point address or geocode search.
IncludeCriteriaMerchantAccountNumberListThis contains the list of Merchant Account numbers to be used for finding private network access points.
IncludeCriteriaSearchFilterContainer to hold one or more search criteria for UPS Access Points that allow DCR, Shipping and ClickAndCollect access. Only applicable when the UPS access point candidate list is obtained in search by address or geocode search.
IncludeCriteriaServiceOfferingListContainer to hold end point service offering List for UPS Access point. Applicable only when a UPS Access Point candidate list is obtained in search by address or geocode search.
ServiceOfferingListServiceOffering
ExcludeFromResultPostalCodeListContainer to hold a list of postal codes to exclude from the access point address or geocode search.
PostalCodeListPostalCodeContainer to hold the postal code .
LocatorResponseContainer for LocatorResponse.
LocatorResponseResponseContainer for Response.
LocatorResponseGeocodeGeocode is the latitude and longitude of the origin address. The Geocode is provided in the first successful response. Required to be returned when the origin address or phone number is submitted in the request.Will not be returned when the requestoption =64
LocatorResponseSearchResultsContainer for search results.
ResponseTransactionReferenceContainer for customer provided data and the XPCI Version.
ResponseErrorIf an error is encountered during the interchange, the Response contains an error. If the error is present, then the ErrorSeverity and ErrorCode are required.
ErrorErrorLocation
SearchResultsGeocodeCandidate
SearchResultsDropLocation
SearchResultsAvailableLocationAttributes
GeocodeCandidateAddressKeyFormatContains all of the basic information about candidate address.
GeocodeCandidateGeocodeGeocode is the latitude and longitude of the origin candidate.
DropLocationIvrIntegrated Voice Response information. ONLY FOR IVR.
DropLocationGeocodeGeocode is the latitude and longitude of the location address. The Geocode for the location address will be returned when Location is requested in the Request Option.
DropLocationAddressKeyFormatContains all of the basic information about a location, Consignee Name, Building Name, Address Lines, City, State/Province, Postal Code and Country or Terriotry Code.
DropLocationLocationAttributeLocationAttribute is a container that contains the information about the location's Location Type, Retail Location Type, Additional Services, or Program Type.
DropLocationDistanceContainer for the straight line distance from the origin to the UPS location.
DropLocationSpecialInstructions
DropLocationAdditionalCommentsContainer for Additional Comments about Location.Text will be displayed in the Locale requested.
DropLocationOperatingHoursOperating Hours.
DropLocationLocalizedInstruction
DropLocationPromotionInformation
DropLocationSortCodeThis container is only for Freight Will call Search.
DropLocationServiceOfferingListContainer to hold the list of service offerings at the end point.
DropLocationAccessPointInformationContainer for UPS Access Point specific parameters.
DropLocationLocationImageLocation Image container.
LocationAttributeOptionType
LocationAttributeOptionCode
OptionCodeTransportationPickUpScheduleTransportationPickUpSchedule container contains details of Latest Drop Off time/Pickup Time for the transportation services (Ground/Air/Standard/Express/International) of the location.
TransportationPickUpSchedulePickUp
PickUpPickUpDetailsPickUpDetails container contains either pickup time or NoPickupIndicator. Either PickUpTime or NoPickupIndicator
DistanceUnitOfMeasurementThe unit of measurement the user will see for the distance is based on the user input provided in the search request.
AdditionalCommentsCommentType
OperatingHoursStandardHours
StandardHoursDayOfWeek
AccessPointInformationBusinessClassificationListContainer to hold list for business classification.
AccessPointInformationAccessPointStatusContainer for UPS AccessPoint status.
AccessPointInformationPrivateNetworkListContainer to hold the list of private networks.
AccessPointInformationAvailabilityContainer to hold the status of shipping or DRC/DCO availability of a UPS Access Point.
BusinessClassificationListBusinessClassification
PrivateNetworkListPrivateNetwork
AvailabilityShippingAvailabilityHolds status of shipping availability.
AvailabilityDcrAvailabilityHolds status of DCR/DCO availability.
ShippingAvailabilityUnavailableReasonContainer to hold shipping unavailable reason.
DcrAvailabilityUnavailableReasonContainer to hold shipping unavailable reason.
AvailableLocationAttributesOptionTypeOptionType is a container that indicates the type of the location attribute that are available. For example if the Option Type is RetailLocation the list of all available retail locations will be returned in 1 or many corresponding OptionCodes.
AvailableLocationAttributesOptionCodeOption code is a container that contains the information of a particular retail location type or additional service or program type that is available currently. One or more of this container will be returned to give all the available codes for Retail Type or Additional Services or Program Type.
AvailableLocationAttributesOptionCodeTransportationPickUpScheduleContainer to hold information regarding pickup details for each day of the week.
AvailableLocationAttributesTransportationPickUpSchedulePickUp
AvailableLocationAttributesPickUpPickUpDetailsContainer to hold information regarding pickup time and pickup availability indicator.

License

This SDK is licensed under the MIT License.

See the LICENSE file for more details.

Build Your Own SDKs with  liblab

Build developer friendly SDKs in minutes from your APIs

Start for Free →