Skip to main content

Compare delivery services and shipping rates to determine the best option.

Project description

UpsRating Python SDK 1.0.0

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

Versions

  • SDK version: 1.0.0

About the API

Compare delivery services and shipping rates to determine the best option. 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-rating

Authentication

Access Token Authentication

The UpsRating API uses an Access Token for authentication.

This token must be provided to authenticate your requests to the API.

Setting the Access Token

When you initialize the SDK, you can set the access token as follows:

UpsRating(
    access_token="YOUR_ACCESS_TOKEN"
)

If you need to set or update the access token after initializing the SDK, you can use:

sdk.set_access_token("YOUR_ACCESS_TOKEN")

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:
Name
VersionService
DeprecatedVersionService

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:
Name Description
RateRequestWrapper N/A
RateResponseWrapper N/A
RateRequest Rate Request container.
RateRequestRequest Request container. N/A
RateRequestPickupType Pickup Type container tag.
RateRequestCustomerClassification Customer classification container. Valid if ShipFrom country or territory is "US"
RateRequestShipment Container for Shipment Information.
RequestTransactionReference TransactionReference identifies transactions between client and server.
ShipmentShipper Shipper container. Information associated with the UPS account number.
ShipmentShipTo Ship To Container
ShipmentShipFrom Ship From Container.
ShipmentAlternateDeliveryAddress Alternate Delivery Address container. Applies for deliveries to UPS Access Point™ locations. Required for the following ShipmentIndicationType values: - 01 - Hold for Pickup at UPS Access Point™ - 02 - UPS Access Point™ Delivery
ShipmentShipmentIndicationType Container to hold shipment indication type.
ShipmentPaymentDetails Payment details container for detailed shipment charges. The two shipment charges that are available for specification are Transportation charges and Duties and Taxes. This container is used for Who Pays What functionality.
ShipmentFrsPaymentInformation UPS Ground Freight Pricing (GFP) Payment Information container. Required only for GFP and when the FRSIndicator is present.
ShipmentFreightShipmentInformation Container to hold Freight Shipment information.
ShipmentService Service Container. Only valid with RequestOption = Rate for both Small package and GFP Rating requests.
ShipmentShipmentTotalWeight Shipment Total Weight Container. This container is only applicable for "ratetimeintransit" and "shoptimeintransit" request options. Required for all international shipments when retreiving time in transit information, including letters and documents shipments.
ShipmentPackage Package Container. Only one Package allowed for Simple Rate
ShipmentShipmentServiceOptions Shipment level Accessorials are included in this container.
ShipmentShipmentRatingOptions Shipment Rating Options container.
ShipmentInvoiceLineTotal Container to hold InvoiceLineTotal Information. Required if the shipment is from US/PR Outbound to non US/PR destination with the PackagingType of UPS PAK(04).Required for international shipments when using request option "ratetimeintransit" or "shoptimeintransit".
ShipmentPromotionalDiscountInformation PromotionalDiscountInformation container. This container contains discount information that the customer wants to request each time while placing a shipment.
ShipmentDeliveryTimeInformation Container for requesting Time In Transit Information. Required to view time in transit information. Required to view any time in transit information.
ShipperAddress Address Container. If the ShipFrom container is not present then this address will be used as the ShipFrom. If this address is used as the ShipFrom, the shipment will be rated from this origin address.
ShipToAddress Address Container.
ShipFromAddress Address container for Ship From. Address Container
AlternateDeliveryAddressAddress Address container for Alternate Delivery Address.
PaymentDetailsShipmentCharge Shipment charge container. If Duty and Tax charges are applicable to a shipment and a payer is not specified, the default payer of Duty and Tax charges is Bill to Receiver. There will be no default payer of Duty and Tax charges for DDU and DDP service.
ShipmentChargeBillShipper Container for the BillShipper billing option. This element or its sibling element, BillReceiver, BillThirdParty or ConsigneeBilledIndicator, must be present but no more than one can be present.
ShipmentChargeBillReceiver Container for the BillReceiver billing option. This element or its sibling element, BillShipper, BillThirdParty or Consignee Billed, must be present but no more than one can be present. For a return shipment, Bill Receiver is invalid for Transportation charges.
ShipmentChargeBillThirdParty Container for the third party billing option. This element or its sibling element, BillShipper, BillReceiver or Consignee Billed, must be present but no more than one can be present.
BillReceiverAddress Container for additional information for the bill receiver's UPS accounts address.
BillThirdPartyAddress Container for additional information for the third party UPS accounts address.
FrsPaymentInformationType GFP Payment Information Type container. GFP only.
FrsPaymentInformationAddress Payer Address Container. Address container may be present for FRS Payment Information type = 02 and required when the FRS Payment Information type = 03.
FreightShipmentInformationFreightDensityInfo Freight Density Info container. Required if DensityEligibleIndicator is present.
FreightDensityInfoAdjustedHeight Container to hold Adjusted Height information. Required if AdjustedHeightIndicator is present.
FreightDensityInfoHandlingUnits Handling Unit for Density based rating container.
AdjustedHeightUnitOfMeasurement Unit of Measurement container for the Adjusted height.
HandlingUnitsType Handling Unit Type for Density based rating.
HandlingUnitsDimensions Dimension of the HandlingUnit container for density based pricing.
HandlingUnitsUnitOfMeasurement UnitOfMeasurement container.
ShipmentTotalWeightUnitOfMeasurement UnitOfMeasurement Container.
PackagePackagingType Packaging Type Container.
PackageDimensions Dimensions Container. This container is not applicable for GFP Rating request. Required for Heavy Goods service. Package Dimension will be ignored for Simple Rate
PackageDimWeight Package Dimensional Weight container. Values in this container are ignored when package dimensions are provided. Please visit ups.com for instructions on calculating this value. Only used for non-US/CA/PR shipments.
PackagePackageWeight Package Weight Container. Required for an GFP Rating request. Otherwise optional. Required for Heavy Goods service. Package Weight will be ignored for Simple Rate
PackageCommodity Commodity Container. Required only for GFP rating when FRSShipmentIndicator is requested.
PackagePackageServiceOptions PackageServiceOptions container.
PackageSimpleRate SimpleRate Container
PackageUpsPremier UPS Premier
DimensionsUnitOfMeasurement UnitOfMeasurement container.
DimWeightUnitOfMeasurement UnitOfMeasurement Container.
PackageWeightUnitOfMeasurement UnitOfMeasurement Container.
CommodityNmfc NMFC Commodity container. For GFP Only.
PackageServiceOptionsDeliveryConfirmation Delivery Confirmation Container. For a list of valid origin/destination countries or territories please refer to appendix. DeliveryConfirmation and COD are mutually exclusive.
PackageServiceOptionsAccessPointCod Access Point COD indicates Package COD is requested for a shipment. Valid only for : 01 - Hold For Pickup At UPS Access Point, Shipment Indication type. Package Access Point COD is valid only for shipment without return service from US/PR to US/PR and CA to CA. Not valid with (Package) COD.
PackageServiceOptionsCod COD Container. Indicates COD is requested. Valid for the following country or territory combinations: US/PR to US/PRCA to CACA to USNot allowed for CA to US for packages that are designated as Letters or Envelopes.
PackageServiceOptionsDeclaredValue Declared Value Container.
PackageServiceOptionsShipperDeclaredValue Shipper Paid Declared Value Charge at Package level. Valid for UPS World Wide Express Freight shipments.
PackageServiceOptionsInsurance Insurance Accesorial. Only one type of insurance can exist at a time on the shipment. Valid for UPS World Wide Express Freight shipments.
PackageServiceOptionsHazMat Container to hold HazMat information. Applies only if SubVersion is greater than or equal to 1701.
PackageServiceOptionsDryIce Container to hold Dry Ice information. Lane check will happen based on postal code/ city.
CodCodAmount CODAmount Container.
InsuranceBasicFlexibleParcelIndicator Container to hold Basic Flexible Parcel Indicator information. Valid for UPS World Wide Express Freight shipments.
InsuranceExtendedFlexibleParcelIndicator Container for Extended Flexible Parcel Indicator Valid for UPS World Wide Express Freight shipments.
InsuranceTimeInTransitFlexibleParcelIndicator Container to hold Time In Transit Flexible Parcel Indicator information. Valid for UPS World Wide Express Freight shipments.
HazMatHazMatChemicalRecord Container to hold HazMat Chemical Records.
DryIceDryIceWeight Container for Weight information for Dry Ice.
DryIceWeightUnitOfMeasurement Container for Unit Of Measurement for Dry Ice.
ShipmentServiceOptionsAccessPointCod Access Point COD indicates Shipment level Access Point COD is requested for a shipment. Valid only for "01 - Hold For Pickup At UPS Access Point" Shipment Indication type. Shipment Access Point COD is valid only for countries or territories within E.U. Not valid with (Shipment) COD. Not available to shipment with return service.
ShipmentServiceOptionsCod If present, indicates C.O.D. is requested for the shipment. Shipment level C.O.D. is only available for EU origin countries or territories.C.O.D. shipments are only available for Shippers with Daily Pickup and Drop Shipping accounts.
ShipmentServiceOptionsDeliveryConfirmation Delivery Confirmation Container. DeliveryConfirmation and C.O.D. are mutually exclusive. Refer to the Appendix for a list of valid origin-destination country or territory pairs associated with each confirmation type.
ShipmentServiceOptionsPickupOptions Shipment Service Pickup Options Container. Valid for UPS Worldwide Express Freight and UPS Worldwide Express Freight Midday shipments.
ShipmentServiceOptionsDeliveryOptions Shipment Service Delivery Options Container. Valid for UPS Worldwide Express Freight and UPS Worldwide Express Freight Midday shipments.
ShipmentServiceOptionsRestrictedArticles Restricted Articles container. Valid for UPS World Wide Express Freight shipments.
ShipmentServiceOptionsImportControl Container for type of Import Control shipments.
ShipmentServiceOptionsReturnService Container for type of Return Services.
ShipmentServiceOptionsCodCodAmount CODAmount Container. UPS does not support all international currency codes. Refer to the appendix for a list of valid codes.
DeliveryTimeInformationPickup Pickup container.
DeliveryTimeInformationReturnContractServices Return contract services container
RateResponse Rate Response Container.
RateResponseResponse Response Container.
RateResponseRatedShipment
ResponseResponseStatus Response Status Container.
ResponseAlert Alert container. There can be zero to many alert containers with code and description.
ResponseAlertDetail
ResponseTransactionReference Transaction Reference Container.
AlertDetailElementLevelInformation Provides more information about the element that represents the alert.
ElementLevelInformationElementIdentifier
RatedShipmentDisclaimer
RatedShipmentService Service Container.
RatedShipmentRatedShipmentAlert
RatedShipmentBillingWeight Billing Weight Container.
RatedShipmentTransportationCharges Transportation Charges Container.
RatedShipmentBaseServiceCharge Base Service Charge Container. These charges would be returned only when subversion is greater than or equal to 1701
RatedShipmentItemizedCharges
RatedShipmentFrsShipmentData FRSShipmentData container. Only returned when the FRSShipmentIIndicator is used. UPS Ground Freight Pricing Only.
RatedShipmentServiceOptionsCharges Service Options Charges Container.
RatedShipmentTaxCharges
RatedShipmentTotalCharges Total Charges Container.
RatedShipmentTotalChargesWithTaxes TotalChargesWithTaxes container would be returned only if TaxInformationIndicator is present in request and when Negotiated Rates are not applicable. TotalChargesWithTaxes contains total charges including total taxes applied to a shipment.
RatedShipmentNegotiatedRateCharges Negotiated Rate Charges Container. For tiered rates and promotional discounts, if a particular shipment based on zone, origin, destination or even shipment size doesn't qualify for the existing discount then no negotiated rates container will be returned. Published rates will be the applicable rate.
RatedShipmentRatedPackage
RatedShipmentTimeInTransit Container for returned Time in Transit information. Will only be returned if request option was either "ratetimeintransit" or "shoptimeintransit" and DeliveryTimeInformation container was present in request.
BillingWeightUnitOfMeasurement Unit Of Measurement Container.
FrsShipmentDataTransportationCharges Transportation Charges Container
FrsShipmentDataFreightDensityRate FreightDensityRate container for Density based rating.
FrsShipmentDataHandlingUnits
TransportationChargesGrossCharge Gross Transportation Charges Container
TransportationChargesDiscountAmount Discount Container
TransportationChargesNetCharge Net Transportation Rate Container
HandlingUnitsAdjustedHeight Container to hold Adjusted Height information.
NegotiatedRateChargesItemizedCharges
NegotiatedRateChargesTaxCharges
NegotiatedRateChargesTotalCharge Total Charges Container.
NegotiatedRateChargesTotalChargesWithTaxes TotalChargesWithTaxes container would be returned only if TaxInformationIndicator is present in request. TotalChargesWithTaxes contains total charges including total taxes applied to a shipment.
RatedPackageBaseServiceCharge Base Service Charge Container. These charges would be returned only when subversion is greater than or equal to 1701
RatedPackageTransportationCharges Transportation Charges Container.
RatedPackageServiceOptionsCharges Service Options Charges Container.
RatedPackageTotalCharges Total Charges Container.
RatedPackageBillingWeight Billing Weight Container.
RatedPackageAccessorial
RatedPackageItemizedCharges
RatedPackageNegotiatedCharges Negotiated Rates container. These charges would be returned only when -1) subversion is greater than or equal to 16072) if negotiated rates were requested for GFP shipments and account number is eligible to receive negotiated rates.
RatedPackageSimpleRate SimpleRate will be returned if Simple Rate present in request
RatedPackageRateModifier
RatedPackageBillingWeightUnitOfMeasurement Unit Of Measurement Container.
NegotiatedChargesItemizedCharges
TimeInTransitServiceSummary Container for all available service information.
ServiceSummaryService Container for the the UPS service selected for a shipment.
ServiceSummaryEstimatedArrival Container for the Time-In-Transit arrival information by service
EstimatedArrivalArrival Container for the Time-In-Transit arrival information by service. This is the most accurate delivery information available via the Rating API and will reflect changes in delivery schedules due to peak business seasons or holidays.
EstimatedArrivalPickup The date and pick up time container.

License

This SDK is licensed under the MIT License.

See the LICENSE file for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ups-rating-1.0.0.tar.gz (77.0 kB view hashes)

Uploaded Source

Built Distribution

ups_rating-1.0.0-py3-none-any.whl (144.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page