Implemented Services

python-fedex implements various FedEx Web Services. These services along with the implemented functionality is described below.

Ship Service

Generates (FedEx Waybill) and deletes shipments.

class fedex.services.ship_service.FedexProcessShipmentRequest(config_obj, *args, **kwargs)[source]

Bases: fedex.base_service.FedexBaseService

This class allows you to process (create) a new FedEx shipment. You will need to populate the data structures in self.RequestedShipment, then send the request. Label printing is supported and very configurable, returning an ASCII representation with the response as well.

The optional keyword args detailed on L{FedexBaseService} apply here as well.

@type config_obj: L{FedexConfig} @param config_obj: A valid FedexConfig object.

add_package(package_item)[source]

Adds a package to the ship request.

@type package_item: WSDL object, type of RequestedPackageLineItem
WSDL object.
@keyword package_item: A RequestedPackageLineItem, created by
calling create_wsdl_object_of_type(‘RequestedPackageLineItem’) on this ShipmentRequest object. See examples/create_shipment.py for more details.
create_wsdl_object_of_type(type_name)

Creates and returns a WSDL object of the specified type. :param type_name: specifies the object’s type name from WSDL.

send_request(send_function=None)

Sends the assembled request on the child object. @type send_function: function reference @keyword send_function: A function reference (passed without the

parenthesis) to a function that will send the request. This allows for overriding the default function in cases such as validation requests.
send_validation_request()[source]

This is very similar to just sending the shipment via the typical send_request() function, but this doesn’t create a shipment. It is used to make sure “good” values are given by the user or the application using the library.

RequestedShipment = None

@ivar: Holds the RequestedShipment WSDL object.

class fedex.services.ship_service.FedexDeleteShipmentRequest(config_obj, *args, **kwargs)[source]

Bases: fedex.base_service.FedexBaseService

This class allows you to delete a shipment, given a tracking number.

Deletes a shipment via a tracking number.

create_wsdl_object_of_type(type_name)

Creates and returns a WSDL object of the specified type. :param type_name: specifies the object’s type name from WSDL.

send_request(send_function=None)

Sends the assembled request on the child object. @type send_function: function reference @keyword send_function: A function reference (passed without the

parenthesis) to a function that will send the request. This allows for overriding the default function in cases such as validation requests.
DeletionControlType = None

@ivar: Holds the DeletrionControlType WSDL object.

TrackingId = None

@ivar: Holds the TrackingId WSDL object.

Rate Service

Calculates the cost of a shipment.

class fedex.services.rate_service.FedexRateServiceRequest(config_obj, *args, **kwargs)[source]

Bases: fedex.base_service.FedexBaseService

This class allows you to get the shipping charges for a particular address. You will need to populate the data structures in self.RequestedShipment, then send the request.

The optional keyword args detailed on L{FedexBaseService} apply here as well.

@type config_obj: L{FedexConfig} @param config_obj: A valid FedexConfig object.

add_package(package_item)[source]

Adds a package to the ship request.

@type package_item: WSDL object, type of RequestedPackageLineItem
WSDL object.
@keyword package_item: A RequestedPackageLineItem, created by
calling create_wsdl_object_of_type(‘RequestedPackageLineItem’) on this ShipmentRequest object. See examples/create_shipment.py for more details.
create_wsdl_object_of_type(type_name)

Creates and returns a WSDL object of the specified type. :param type_name: specifies the object’s type name from WSDL.

send_request(send_function=None)

Sends the assembled request on the child object. @type send_function: function reference @keyword send_function: A function reference (passed without the

parenthesis) to a function that will send the request. This allows for overriding the default function in cases such as validation requests.
RequestedShipment = None

@ivar: Holds the RequestedShipment WSDL object including the shipper, recipient and shipt time.

Validation Availability And Commitment Service

Calculates the estimated arrival time of a shipment.

class fedex.services.availability_commitment_service.FedexAvailabilityCommitmentRequest(config_obj, *args, **kwargs)[source]

Bases: fedex.base_service.FedexBaseService

This class allows you validate service availability

@type config_obj: L{FedexConfig} @param config_obj: A valid FedexConfig object.

create_wsdl_object_of_type(type_name)

Creates and returns a WSDL object of the specified type. :param type_name: specifies the object’s type name from WSDL.

send_request(send_function=None)

Sends the assembled request on the child object. @type send_function: function reference @keyword send_function: A function reference (passed without the

parenthesis) to a function that will send the request. This allows for overriding the default function in cases such as validation requests.
CarrierCode = None

@ivar: Carrier Code Default to Fedex (FDXE), or can bbe FDXG.

Destination = None

@ivar: Holds Destination Address WSDL object.

Origin = None

@ivar: Holds Origin Address WSDL object.

Packaging = None

@ivar: Type of packaging to narrow down available shipping options or defaults to YOUR_PACKAGING.

Service = None

@ivar: Service type, if set to None will get all available service information.

ShipDate = None

@ivar: Ship Date date WSDL object.

Track Service

Returns tracking information for a given tracking number.

class fedex.services.track_service.FedexTrackRequest(config_obj, *args, **kwargs)[source]

Bases: fedex.base_service.FedexBaseService

This class allows you to track shipments by providing a tracking number or other identifying features. By default, you can simply pass a tracking number to the constructor. If you would like to query shipments based on something other than tracking number, you will want to read the documentation for the L{__init__} method. Particularly, the tracking_value and package_identifier arguments.

Sends a shipment tracking request. The optional keyword args detailed on L{FedexBaseService} apply here as well.

@type config_obj: L{FedexConfig} @param config_obj: A valid FedexConfig object.

create_wsdl_object_of_type(type_name)

Creates and returns a WSDL object of the specified type. :param type_name: specifies the object’s type name from WSDL.

send_request(send_function=None)

Sends the assembled request on the child object. @type send_function: function reference @keyword send_function: A function reference (passed without the

parenthesis) to a function that will send the request. This allows for overriding the default function in cases such as validation requests.
ProcessingOptions = None

@ivar: Holds the TrackRequestProcessingOptionType WSDL object that defaults no None.

SelectionDetails = None

@ivar: Holds the SelectionDetails WSDL object that includes tracking type and value.

Address Validation Service

Validates and cleans a given address.

class fedex.services.address_validation_service.FedexAddressValidationRequest(config_obj, *args, **kwargs)[source]

Bases: fedex.base_service.FedexBaseService

This class allows you validate anywhere from one to a hundred addresses in one go. Create AddressToValidate WSDL objects and add them to each instance of this request using add_address().

@type config_obj: L{FedexConfig} @param config_obj: A valid FedexConfig object.

add_address(address_item)[source]

Adds an address to self.AddressesToValidate.

@type address_item: WSDL object, type of AddressToValidate WSDL object. @keyword address_item: A AddressToValidate, created by

calling create_wsdl_object_of_type(‘AddressToValidate’) on this FedexAddressValidationRequest object. See examples/create_shipment.py for more details.
create_wsdl_object_of_type(type_name)

Creates and returns a WSDL object of the specified type. :param type_name: specifies the object’s type name from WSDL.

send_request(send_function=None)

Sends the assembled request on the child object. @type send_function: function reference @keyword send_function: A function reference (passed without the

parenthesis) to a function that will send the request. This allows for overriding the default function in cases such as validation requests.
AddressesToValidate = None

@ivar: Holds the AddressToValidate WSDL object.

Location Service

Returns FedEx store locations based on a given location query.

class fedex.services.location_service.FedexSearchLocationRequest(config_obj, *args, **kwargs)[source]

Bases: fedex.base_service.FedexBaseService

This class allows you to figure out a FedEx location closest to a specified location criteria, based on location type. The response includes location details like operating times, directions and a map link and more.

@type config_obj: L{FedexConfig} @param config_obj: A valid FedexConfig object.

create_wsdl_object_of_type(type_name)

Creates and returns a WSDL object of the specified type. :param type_name: specifies the object’s type name from WSDL.

send_request(send_function=None)

Sends the assembled request on the child object. @type send_function: function reference @keyword send_function: A function reference (passed without the

parenthesis) to a function that will send the request. This allows for overriding the default function in cases such as validation requests.
Address = None

@ivar: Holds the Address WSDL object.

Constraints = None

@ivar: Holds a list of SearchLocationConstraints WSDL objects.

LocationsSearchCriterion = None

@ivar: Holds the LocationsSearchCriteriaType WSDL object.

MultipleMatchesAction = None

@ivar: Holds the MultipleMatchesActionType WSDL object.

PhoneNumber = None

@ivar: Holds the PhoneNumber string object.

SortDetail = None

@ivar: Holds the LocationSortDetail WSDL object.

Country Service

Validates the postal codes for a given address.

class fedex.services.country_service.FedexValidatePostalRequest(config_obj, *args, **kwargs)[source]

Bases: fedex.base_service.FedexBaseService

This class allows you validate an address. https://www.fedex.com/us/developer/WebHelp/ws/2015/html/WebServicesHelp/WSDVG/47_Country_Service.htm

@type config_obj: L{FedexConfig} @param config_obj: A valid FedexConfig object.

create_wsdl_object_of_type(type_name)

Creates and returns a WSDL object of the specified type. :param type_name: specifies the object’s type name from WSDL.

send_request(send_function=None)

Sends the assembled request on the child object. @type send_function: function reference @keyword send_function: A function reference (passed without the

parenthesis) to a function that will send the request. This allows for overriding the default function in cases such as validation requests.
Address = None

@ivar: Holds Address WSDL objects.

CarrierCode = None

@ivar: Carrier Code Default to Fedex (FDXE), or can bbe FDXG.

CheckForMismatch = None

@ivar: Holds the CheckForMismatch boolean objects.

RoutingCode = None

@ivar: Routing Code Default to FDSD.

ShipDateTime = None

@ivar: Holds the ShipDateTime date time objects.

Pickup Service

Creates a fedex pickup request.

class fedex.services.pickup_service.FedexCreatePickupRequest(config_obj, *args, **kwargs)[source]

Bases: fedex.base_service.FedexBaseService

create_wsdl_object_of_type(type_name)

Creates and returns a WSDL object of the specified type. :param type_name: specifies the object’s type name from WSDL.

send_request(send_function=None)

Sends the assembled request on the child object. @type send_function: function reference @keyword send_function: A function reference (passed without the

parenthesis) to a function that will send the request. This allows for overriding the default function in cases such as validation requests.

Package Movement Service

DEPRECATED service that was used to validate postal codes and calculate shipment arrival times. Replaced with two distinct services: Validation Availability And Commitment Service, and Country Service.

class fedex.services.country_service.FedexValidatePostalRequest(config_obj, *args, **kwargs)[source]

Bases: fedex.base_service.FedexBaseService

This class allows you validate an address. https://www.fedex.com/us/developer/WebHelp/ws/2015/html/WebServicesHelp/WSDVG/47_Country_Service.htm

@type config_obj: L{FedexConfig} @param config_obj: A valid FedexConfig object.

create_wsdl_object_of_type(type_name)

Creates and returns a WSDL object of the specified type. :param type_name: specifies the object’s type name from WSDL.

send_request(send_function=None)

Sends the assembled request on the child object. @type send_function: function reference @keyword send_function: A function reference (passed without the

parenthesis) to a function that will send the request. This allows for overriding the default function in cases such as validation requests.
Address = None

@ivar: Holds Address WSDL objects.

CarrierCode = None

@ivar: Carrier Code Default to Fedex (FDXE), or can bbe FDXG.

CheckForMismatch = None

@ivar: Holds the CheckForMismatch boolean objects.

RoutingCode = None

@ivar: Routing Code Default to FDSD.

ShipDateTime = None

@ivar: Holds the ShipDateTime date time objects.