A light wrapper around FedEx's SOAP API.

Overview

Python FedEx SOAP API Module

https://travis-ci.org/python-fedex-devs/python-fedex.svg?branch=master Requirements Status Documentation Status
Author: Greg Taylor, Radek Wojcik
Maintainer: Python FedEx Developers
License: BSD
Status: Stable

What is it?

A light wrapper around FedEx's Webservice Soap API. We don't do much of any validation, but we'll help you sort through the pile of SOAP objects FedEx uses.

Installation

The easiest way is via pip or easy_install:

pip install fedex

Quick Start

  • Clone this repository.
  • Edit the example_config.py file in See examples/ with your fedex credentials and run any of the provided examples.

Documentation

Refer to the documentation for more details on the project. Latest doc builds are found in docs and doc build scripts in doc_source. Sphinx documentation is in doc_src.

There are also a lot of useful examples under the examples directory within this directory.

Support

Issues & Questions: https://github.com/gtaylor/python-fedex/issues

Most problems are going to require investigation or a submitted pull request by someone from the Python FedEx Developers organization. To contribute a new feature or service, feel free to create a pull request. We are always looking for new contributors to help maintain the project.

Fedex Support and Documentation

Fedex Support Email: [email protected]

Developer Portal: http://www.fedex.com/us/developer/

Updates To Services: https://www.fedex.com/us/developer/web-services/process.html (FedEx Web Services Announcements)

Related Projects

Todos

  • Increase service specific request validation
  • Remove deprecated services (package movement service)
  • Pickup service unit tests

Legal

Copyright (C) 2008-2015 Greg Taylor

Copyright (C) 2015-2016 Python FedEx Developers

This software is licensed under the BSD License.

python-fedex is not authored by, endorsed by, or in any way affiliated with FedEx.

Comments
  • FedEx may have moved their web services test API

    FedEx may have moved their web services test API

    I just signed up to get started, and I am quite excited about the software you put together.

    But I am unable to get a successful response from FedEx. I copied & pasted examples/create_shipment.py and examples/example_config.py and filled in my own values. I then tried to run the example using my test key/password/etc and got this error message:

    Traceback (most recent call last): File "testfedex.py", line 113, in shipment.send_validation_request() File "/usr/local/lib/python2.6/dist-packages/fedex/services/ship_service.py", line 102, in send_validation_request self.send_request(send_function=self._assemble_and_send_validation_request) File "/usr/local/lib/python2.6/dist-packages/fedex/base_service.py", line 226, in send_request self._check_response_for_request_errors() File "/usr/local/lib/python2.6/dist-packages/fedex/base_service.py", line 188, in _check_response_for_request_errors notification.Message) fedex.base_service.FedexError: Authentication Failed (Error code: 1000) [email protected]:~/workspace/labels/fedex$

    I thought that the problem might be related to the validation I was asking it to do (I uncommented the "validate this request" line). So I removed the validation, and was greeted with this:

    Traceback (most recent call last): File "testfedex.py", line 116, in shipment.send_request() File "/usr/local/lib/python2.6/dist-packages/fedex/base_service.py", line 219, in send_request raise SchemaValidationError() fedex.base_service.SchemaValidationError: "suds encountered an error validating your data against this service's WSDL schema. Please double-check for missing or invalid values, filling all required fields." (Error code: -1) [email protected]:~/workspace/labels/fedex$

    That's not so good, since I was hoping to use the example to get started.

    I went back to the previous error (authentication failed) and did a little digging. The WSDL files show the URL being something like https://gatewaybeta.fedex.com:443/web-services but in an email FedEx sent me with my test account information they list https://wsbeta.fedex.com:443/web-services. I can't help but wonder if that cased the authentication problem I first noted.

    In the interests of figuring out what the problem was with the create_shipment request (sans validation) I found this on SO (http://stackoverflow.com/questions/2388046/can-you-help-me-solve-this-suds-soap-issue) and cranked logging up to DEBUG. I found this: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><ns1:Header xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="http://fedex.com/ws/ship/v7" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/><ns1:Body xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="http://fedex.com/ws/ship/v7" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">soapenv:Faultsoapenv:ServerSchema validation failed for request.<con:fault xmlns:con="http://www.bea.com/wli/sb/context">con:errorCode5/con:errorCodecon:reasonSchema validation failed for request./con:reasoncon:details<con1:ValidationFailureDetail xmlns:con1="http://www.bea.com/wli/sb/stages/transform/config">con1:messagestring value '' is not a valid enumeration value for EdtRequestType in namespace http://fedex.com/ws/ship/v7/con1:messagecon1:xmlLocationns0:EdtRequestType//con1:xmlLocationcon1:messagestring value '' is not a valid enumeration value for PhysicalPackagingType in namespace http://fedex.com/ws/ship/v7/con1:messagecon1:xmlLocationns0:PhysicalPackaging//con1:xmlLocation/con1:ValidationFailureDetail/con:details/con:fault/soapenv:Fault/ns1:Body/soapenv:Envelope The important bit there seems to be this: string value '' is not a valid enumeration value for EdtRequestType in namespace http://fedex.com/ws/ship/v7

    Then I go to http://www.fedex.com/ws/ship/v7 and FedEx gives me a 404 error.

    I am basically out of ideas on how to debug these issues at this point. Any help you can give me would be greatly appreciated.

    Thanks! Mike

    opened by MikeSandford 11
  • Recipient phone numbers required?

    Recipient phone numbers required?

    I work at a place that ships stuff using the Fedex Shipping Manager software. It does not seem to need a recipient phone number, but this module does. Am I doing something wrong? Should I give a number like "###-###-####" or "000-000-0000" or something?

    opened by nathanielstenzel 10
  • Next release date?

    Next release date?

    Hey folks, first of all, thank you for maintaining this library.

    The currently released version is quite old and some features don't work on the released WSDLs like the direct signature requirement. Is there a planned release date on pypi for the next release?

    opened by sharoonthomas 8
  • Find fedex tracking id by sender reference

    Find fedex tracking id by sender reference

    Hi

    Is there a way with this library to find tracking numbers from our account / reference number ?

    We have several places of label creation etc (some online) and would like to recover the tracking ID's to our back office system.

    Is this possible ?

    Thanks

    Alex

    opened by Bobspadger 8
  • TrackingRequest incorrectly constructed from v10 WSDL

    TrackingRequest incorrectly constructed from v10 WSDL

    Was trying to track a package by reference number today. Found it to be impossible.

    I need to send country in this field along with the account number: track.SelectionDetails.Destination

    It should accept Address objects. It incorrectly expects a string. Adding the proper type causes a SchemaValidationError. Sending anything else to Fedex produces a failure in their system.

    opened by mmangione 7
  • 'Meter number is not registered (Error code: 8001)' in production

    'Meter number is not registered (Error code: 8001)' in production

    Hello, i am triying go to production, with use_test_server=False and date productions for meter number and more, but fedex create_shipment display: 'Meter number is not registered (Error code: 8001)'.

    Help me please, thank you

    opened by ma1onso 7
  • Update dependency to support suds-community

    Update dependency to support suds-community

    This PR attempts to resolve issue #158

    While building with the latest version of fedex our ci/cd process breaks while attempting to install the dependency suds-jurko.

    ERROR: Command errored out with exit status 1:
         command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-i40r_jb8/suds-jurko/setup.py'"'"'; __file__='"'"'/tmp/pip-install-i40r_jb8/suds-jurko/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-i40r_jb8/suds-jurko/pip-egg-info
             cwd: /tmp/pip-install-i40r_jb8/suds-jurko/
        Complete output (1 lines):
        error in suds-jurko setup command: use_2to3 is invalid.
    

    Upon further examination it turns out that python's setuptools drops support for 2to3 in version v.58.0.0. In order to correct this it is recommended to switch to the new and actively maintained package suds-community which already has resolved this problem HERE.

    Closes #158

    I have also opted to pin this dependency for future cases where the project can be more intentional with the versions expected.

    opened by ndobbs 6
  • Switch project required dependency to suds-community.

    Switch project required dependency to suds-community.

    PR #159 attempts to resolve this issue.

    While building with the latest version of fedex our ci/cd process breaks while attempting to install the dependency suds-jurko.

    ERROR: Command errored out with exit status 1:
         command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-i40r_jb8/suds-jurko/setup.py'"'"'; __file__='"'"'/tmp/pip-install-i40r_jb8/suds-jurko/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-i40r_jb8/suds-jurko/pip-egg-info
             cwd: /tmp/pip-install-i40r_jb8/suds-jurko/
        Complete output (1 lines):
        error in suds-jurko setup command: use_2to3 is invalid.
    

    Upon further examination it turns out that python's setuptools drops support for 2to3 in version v.58.0.0. In order to correct this it is recommended to switch to the new and actively maintained package suds-community which already has resolved this problem HERE.

    I have also opted to pin this dependency for future cases where the project can be more intentional with the versions expected.

    opened by ndobbs 6
  • calling shipment.add_package more than once results in

    calling shipment.add_package more than once results in "Invalid package count or invalid package sequence number. (Error code: 2021)"

    When I call shipment.add_package more than once, it appears that the api is sent <ns0:PackageCount>0</ns0:PackageCount>, and the response includes <Code>2021</Code><Message>Invalid package count or invalid package sequence number.</Message>.

    opened by preston-wagner 6
  • Install problem

    Install problem

    I installed with easy_install. Seemed to work but the module is empty.

    $ python Python 2.7.1 (r271:86832, Mar 4 2011, 16:49:28) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information.

    import fedex dir(fedex) ['VERSION', 'builtins', 'doc', 'file', 'name', 'package', 'path']

    opened by johnmudd 6
  • This tracking number cannot be found. (Error Code: 9040)

    This tracking number cannot be found. (Error Code: 9040)

    Hello, I was using track service with right tracking_number.Request was successfully processed.But I got an error code :9040; And the DeliveryOptionEligibilityDetails in response is like this:

    (DeliveryOptionEligibilityDetail){
       Option = "REDIRECT_TO_HOLD_AT_LOCATION"
       Eligibility = "INELIGIBLE"
    

    Is it mean that some problems in my CONFIG_OBJ? Thanks a lot

    opened by flyysoul 5
  • FedEx RESTful API

    FedEx RESTful API

    Hello, Thank you for your help. I received the following email from FedEx.

    "Migrate to the FedEx RESTful API by February 28, 2024 before FedEx Web Services is retired."

    Do you have any plans to release a FedEx RESTful API version?

    opened by zesriver 0
  • Cannot install with setuptools>=58.0.2

    Cannot install with setuptools>=58.0.2

    Setuptools 58.0.2 fails fast when installing packages that want 2to3. https://github.com/pypa/setuptools/issues/2769

    $ /var/app/venv/staging-LQM1lest/bin/pip list setuptools
    Package    Version
    ---------- -------
    gunicorn   20.1.0
    pip        22.2.1
    setuptools 63.2.0
    wheel      0.37.1
    
    $ /var/app/venv/staging-LQM1lest/bin/pip install fedex==2.4.1
    Collecting fedex==2.4.1
      Using cached fedex-2.4.1.tar.gz (280 kB)
      Preparing metadata (setup.py) ... done
    Collecting suds-jurko
      Using cached suds-jurko-0.6.zip (255 kB)
      Preparing metadata (setup.py) ... error
      error: subprocess-exited-with-error
    
      × python setup.py egg_info did not run successfully.
      │ exit code: 1
      ╰─> [1 lines of output]
          error in suds-jurko setup command: use_2to3 is invalid.
          [end of output]
    
      note: This error originates from a subprocess, and is likely not a problem with pip.
    error: metadata-generation-failed
    
    × Encountered error while generating package metadata.
    ╰─> See above for output.
    
    note: This is an issue with the package mentioned above, not pip.
    hint: See above for details.
    
    opened by KJSanchez 2
  • Regression: rate_request.RequestedShipment.FreightShipmentDetail is None

    Regression: rate_request.RequestedShipment.FreightShipmentDetail is None

    I have an app that has been using this package for years without problems.

    Now I need to make a change, I created a new environment installing from git (see https://github.com/python-fedex-devs/python-fedex/issues/163), I ran a test which has the first part identical to freight_rate_request.py, but it fails at line 30 complaining that FreightShipmentDetail is None https://github.com/python-fedex-devs/python-fedex/blob/a3c5b7d0f03eaa883f91197d037a7af2e940da57/examples/freight_rate_request.py#L30

    Comparing the execution of the test on the old computer with fedex 2.4.0 installed with from pypi a few years ago to the execution on the new computer with fedex 2.4.1 installed from git today, it looks like the difference is on line 53 of rate_service.py: https://github.com/python-fedex-devs/python-fedex/blob/a3c5b7d0f03eaa883f91197d037a7af2e940da57/fedex/services/rate_service.py#L53

    After executing that line on the old computer the self.RequestedShipment has many members, and the value of most members is not None.

    After executing that line on the new computer the self.RequestedShipment has many members, and the value of most members is None.

    opened by stenci 1
  • Installation

    Installation

    How can I install this module using suds in lieu of suds-jurko? suds-jurko is very outdated and I can't get it to install on modern python but I can get suds to install. When suds-jurko fails the entire fedex package fails.

    opened by jerodg 1
  • Authentication Failed using use_test_server=True

    Authentication Failed using use_test_server=True

    Hello, hope it is not too silly to ask this question -

    I got the "Authentication Failed" when I run this FedexAddressValidationRequest module with the setting of "use_test_server=True" in FedexConfig, along with Test Key and Secret.

    I don't think it is Key and Secret issue as I'm able to use the same Key and Secret to get token by calling against test server https://apis-sandbox.fedex.com/oauth/token (see https://developer.fedex.com/api/en-us/catalog/authorization/v1/docs.html),

    So what do I need to do to run FedexAddressValidationRequest against test sever?

    ================================================== FedexError Traceback (most recent call last) in 9 avs_request.add_address(address1) 10 ---> 11 avs_request.send_request()

    ~\anaconda3\lib\site-packages\fedex\base_service.py in send_request(self, send_function) 329 # Check the response for errors specific to the particular request. 330 # This method can be overridden by a method on the child class object. --> 331 self._check_response_for_request_errors() 332 333 # Check the response for errors specific to the particular request.

    ~\anaconda3\lib\site-packages\fedex\base_service.py in _check_response_for_request_errors(self) 262 for notification in self.response.Notifications: 263 if notification.Severity == "ERROR": --> 264 raise FedexError(notification.Code, 265 notification.Message) 266

    FedexError: Authentication Failed (Error code: 1000)

    opened by randyhao-us 0
Releases(2.4.1)
  • 2.4.1(Feb 20, 2020)

  • 2.4.0(Oct 6, 2016)

    • Pickup Service usingv11 WSDL (hornedbull)
    • Added documentation and unit tests for Pickup Service. (radzhome)
    • Update package data to include tools (noodlebreak)
    Source code(tar.gz)
    Source code(zip)
  • 2.3.1(Jan 31, 2016)

    • Set fedex logging to INFO for tests. (radzhome)
    • Sphinx documentation (hosted on read the docs). (radzhome)
    • Update Ship Service test to allow warnings. (radzhome)
    • Added log warning for requests that yield a WARNING. (radzhome)
    Source code(tar.gz)
    Source code(zip)
  • 2.3.0(Jan 29, 2016)

    • Added Location Service using v3 WSDL. (radzhome)
    • Added examples and unit tests for Location Service. (radzhome)
    • Updated certification process scripts to work with latest WSDLs. (radzhome)
    • Added warning logging for requests that come back with warning notes. (radzhome)
    • Added PyPI, Travis, requires.io integration/badges. (radzhome)
    • Organization change from gtaylor to python-fedex-devs. (gtaylor)
    • Added deprecation message for movement service. (radzhome)
    • Added conversion tools to convert suds xml object into python dict. (radzhome)
    • Redirect logging to stdout for examples and tests when not ran via nose. (radzhome)
    Source code(tar.gz)
    Source code(zip)
  • 2.2.0(Jan 16, 2016)

    • Added Country Service / Postal Code Validation service. (radzhome)
    • Added CountryService_v4.wsdl for Postal Code Validation. (radzhome)
    • Added unit tests and examples for Country service. (radzhome)
    • Added Signature Option to ship example. (radzhome)
    • Fix base service logging request and response. (radzhome)
    Source code(tar.gz)
    Source code(zip)
  • 2.1.0(Jan 6, 2016)

    • Added Validation, Availability and Commitment (AVC) service. (radzhome)
    • Added [Validation]AvailabilityAndCommitmentService_v4.wsdl for AVC service. (radzhome)
    • Added examples and unit tests for AVC service.
    • Refactored examples and documentation. (radzhome)
    • A quick PEP8 pass using pycharm on most of the codebase (radzhome)
    • Add travis yml (radzhome)
    Source code(tar.gz)
    Source code(zip)
  • 2.0.0(Jan 6, 2016)

    • Bump ShipService WSDL to v17 for create and delete shipment. (radzhome)
    • Bump AddressValidation WSDL to v4. (radzhome)
    • Bump RateService WSDL to v18. (radzhome)
    • Bump TrackService WSDL to v10. (radzhome)
    • General improvements to base class. (radzhome)
    • Refactoring and updates to examples. (radzhome)
    • Added test classes. (radzhome)
    • Remove old and unused WSDLs. (radzhome)
    • Change dependency to suds-jurko to include python 3 support. (radzhome)
    Source code(tar.gz)
    Source code(zip)
  • 1.1.1(Mar 3, 2015)

  • 1.1.0(Feb 6, 2015)

    • A quick PEP8 pass on most of the codebase. Yucky. (gtaylor)
    • Changing recommended install method to use pip + PyPi. (radzhome)
    • Updated rate_request and freight_rate_request examples for WSDL v16 compatibility. (foxxyz)
    • Updated rate service WSDL from v8 to v16. (foxxyz)
    • Added a freight rate request example (mwcbrent)
    • Bump ShipService WSDL to v13. (mwcbrent)
    • Update rate example to show multiple ServiceTypes. (danielatdattrixdotcom)
    Source code(tar.gz)
    Source code(zip)
  • 1.0.14(Feb 6, 2015)

  • 1.0.12(Feb 6, 2015)

  • 1.0.11(Feb 6, 2015)

  • 1.0.10(Feb 6, 2015)

  • 1.0.9(Feb 6, 2015)

  • 1.0.8(Feb 6, 2015)

A Telegram bot for combining emojis.

combimoji combimoji is a Telegram bot for combining emojis. How can I use it? You can find combimoji at @combimoji_bot, however it is not up (as of No

Yarema Mishchenko 2 Dec 02, 2021
This is a cryptocurrency trading bot that analyses Reddit sentiment and places trades on Binance based on reddit post and comment sentiment. If you like this project please consider donating via brave. Thanks.

This is a cryptocurrency trading bot that analyses Reddit sentiment and places trades on Binance based on reddit post and comment sentiment. The bot f

Andrei 157 Dec 15, 2022
Adds a new git subcommand named "ranch".

Git Ranch This script adds ranch, a new subcommand for git that makes it easier to order 1 Gallon of Kraft Ranch Salad Dressing from Amazon. Installat

Austin T Schaffer 8 Jul 06, 2022
Discord Mass Report script that uses multiple tokens

Discord-Mass-Report Discord Mass Report script that uses multiple tokens, full credits to https://github.com/hoki0/Discord-mass-report who made it in

cChimney 4 Jun 08, 2022
Bootstrapping your personal Web3 info hub from more than 500 RSS Feeds.

RSS Aggregator for Web3 (or 🥩 RAW for short) Bootstrapping your personal Web3 info hub from more than 500 RSS Feeds. What is RSS or Reader Services?

ChainFeeds 1.8k Dec 29, 2022
Working TikTok Username Auto-Claimer/Sniper/Swapper which will autoclaim username if it´s available

TikTok-AutoClaimer Working TikTok Username Auto-Claimer/Sniper/Swapper which will autoclaim username if it´s available Usage Python 3.6 or above is re

Kevin 18 Dec 08, 2022
PyDottie is a version of Dottie.js written in Python 3.

PyDottie is a version of Dottie.js written in Python 3.

Jose Noriega 2 Nov 21, 2021
A discord bot that moderates your server!

Staff Bot para Discord O que é? É um bot que modera o seu servidor no Discord, apagando mensagens indesejadas que os usuários mandem! Como usar Primei

Isac Gonçalves Cunha 3 Oct 07, 2021
Check AWS S3 instances for read/write/delete access

s3sec Test AWS S3 buckets for read/write/delete access This tool was developed to quickly test a list of s3 buckets for public read, write and delete

0xmoot 114 Dec 06, 2022
A wrapper for the Discord Python Pixels API.

DPYPX A simple wrapper around Python Discord Pixels. Requires Python 3.7+ (3.x where x = 7). Requires pillow and aiohttp from pip. Example import dpy

Artemis 3 Oct 01, 2022
A Telegram Bot Plays With Words!!!

TheWordzBot ➠ I Can Turn Text Into Audio ➠ I Can Get Results From Dictionary ➠ I Can Make Google Search For You ➠ I Can Suggest Strong Passwords For Y

RAVEEN KUMAR 8 Feb 28, 2022
a translator bot for discord

TranslatorBOT it is a simple and powerful discord bot, it been used for translating includes more than 100 language, it has a lot of integrated comman

Mear. 2 Feb 03, 2022
Using multiple API sources, create an app that allows users to filter through random locations based on their temperature range choices.

World_weather_analysis Overview Using multiple API sources, create an app that allows users to filter through random locations based on their temperat

Jason Boyer 2 Sep 16, 2022
A simple fun discord bot using discord.py that can post memes

A simple fun discord bot using discord.py * * Commands $commands - to see all commands $meme - for a random meme from the internet $cry - to make the

Dice Flip 2 Dec 20, 2021
Algofi Python SDK is useful for developers who want to programatically interact with the Algofi lending protocol

algofi-py-sdk Algofi Python SDK Documentation https://algofi-py-sdk.readthedocs.

Algofi 41 Dec 15, 2022
Declarative assertions for AWS

AWSsert AWSsert is a Python library providing declarative assertions about AWS resources to your tests. Installation Use the package manager pip to in

19 Jan 04, 2022
The gPodder podcast client.

___ _ _ ____ __ _| _ \___ __| |__| |___ _ _ |__ / / _` | _/ _ \/ _` / _` / -_) '_| |_ \ \__, |_| \___/\__,_\__,_\___|_| |_

gPodder and related projects 1.1k Jan 04, 2023
A robust, low-level connector for the Discord API

Bauxite Bauxite is a robust, low-level connector for the Discord API. What is Bauxite for? Bauxite is made for two main purposes: Creating higher-leve

1 Dec 04, 2021
discord token grabber scam - eductional purposes only!

Discord-QR-Scam תופס אסימון תמונה של Discord על אודות סקריפט Python שיוצר אוטומטית קוד QR הונאה של Nitro ותופס את אסימון הדיסקורד בעת סריקה. כלי זה מד

Amit Pinchasi 0 May 22, 2022
Hellomotoot - PSTN Mastodon Client using Mastodon.py and the Twilio API

Hello MoToot PSTN Mastodon Client using Mastodon.py and the Twilio API. Allows f

Lorenz Diener 9 Nov 22, 2022