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)

pokemon-colorscripts compatible for mac

Pokemon colorscripts some scripts to print out images of pokemons to terminal. Inspired by DT's colorscripts compilation Description Prints out colore

43 Jan 06, 2023
An API wrapper around Discord API.

NeoCord This project is work in progress not for production use. An asynchronous API wrapper around Discord API written in Python. Features Modern API

Izhar Ahmad 14 Jan 03, 2022
Desktop Backup Client for Borg

Vorta Backup Client Vorta is a backup client for macOS and Linux desktops. It integrates the mighty BorgBackup with your desktop environment to protec

BorgBase.com 1.5k Jan 03, 2023
This is an implementation example of a bot that periodically sends predictions to the alphasea-agent.

alphasea-example-model alphasea-example-modelは、 alphasea-agent に対して毎ラウンド、予測を投稿するプログラムです。 Numeraiのexample modelに相当します。 準備 alphasea-example-modelの動作には、

AlphaSea 11 Jul 28, 2022
ARKHAM X GOD MULTISPAM BOT

ARKHAM-X-GOD-MULTISPAM-BOT 𝗗𝗘𝗣𝗟𝗢𝗬 𝗨𝗣𝗧𝗢 30 𝗕𝗢𝗧𝗦 𝗜𝗡 𝗔 𝗦𝗜𝗡𝗚𝗟?

ArkhamXGod 2 Jan 08, 2022
Official API documentation for Highrise

Highrise API The Highrise API is implemented as vanilla XML over HTTP using all four verbs (GET/POST/PUT/DELETE). Every resource, like Person, Deal, o

Basecamp 128 Dec 06, 2022
To dynamically change the split direction in I3/Sway so as to split new windows automatically based on the width and height of the focused window

To dynamically change the split direction in I3/Sway so as to split new windows automatically based on the width and height of the focused window Insp

Ritin George 6 Mar 11, 2022
Automate and Manage Telegram Channels

Channel Automation Bot @ChannelAutomateBot A star ⭐ from you means a lot to us! Telegram bot to automate and manage channels. Usage Deploy to Heroku T

Stark Bots 61 Dec 29, 2022
My Advent of Code solutions. I also upload videos of my solves: https://www.youtube.com/channel/UCuWLIm0l4sDpEe28t41WITA

My solutions to adventofcode.com puzzles. I post videos of me solving the puzzles in real-time at https://www.youtube.com/channel/UCuWLIm0l4sDpEe28t41

195 Jan 04, 2023
Using Streamlit to build a simple UI on top of the OpenSea API

OpenSea API Explorer Using Streamlit to build a simple UI on top of the OpenSea API. 🤝 Contributing Contributions, issues and feature requests are we

Gavin Capriola 1 Jan 04, 2022
Gdrive-python: A wrapping module in python of gdrive

gdrive-python gdrive-python is a wrapping module in python of gdrive made by @pr

Vittorio Pippi 3 Feb 19, 2022
AminoLab Library For AminoApps using aminoapps.com/api

AminoLab AminoLab Api For AminoApps using aminoapps.com/api Installing pip install AminoLab Example #Login import AminoLab client = AminoLab.Client()

10 Sep 26, 2022
AirDrive lets you store unlimited files to cloud for free. Upload & download files from your personal drive at any time using its super-fast API.

AirDrive lets you store unlimited files to cloud for free. Upload & download files from your personal drive at any time using its super-fast API.

Sougata 4 Jul 12, 2022
Module to use some statistics from Spotify API

statify Module to use some statistics from Spotify API To use it you have to import the functions into your own project. You have also to authenticate

Miguel Cózar 2 Jun 02, 2022
A Discord bot written in Python to help with guild administration

forgotten-hydra A Discord bot written in Python to help with guild administration. External libraries Pycord-Development/pycord 1.7.3 djc/couchdb-pyth

1 May 14, 2022
Cloudkeeper is “housekeeping for clouds” - find leaky resources, manage quota limits, detect drift and clean up.

Cloudkeeper Housekeeping for Clouds! Table of contents Overview Docker based quick start Cloning this repository Component list Contact License Overvi

Some Engineering 1.2k Jan 03, 2023
Create CDK projects with projen

The Projenator: I'll be back! Description This is a CDKv2 project that takes the grind out of setting up new cdk projects/implementations by using aut

Andrew 2 Dec 11, 2021
A script to automatically update bot status at GitHub as well as in Telegram channel.

Support BotStatus ~ A simple & short repository to show your bot's status in your GitHub README.md file as well as in you channel. ⚠️ This repo should

Jainam Oswal 55 Dec 13, 2022
Advance Anonymous Sender bot with Caption Editor

AnonyMous Sender 👨‍💻 Advanced Anonymous Sender with Caption Editor Join @DaisySupport_Official 🎵 for help Features Get forwarded messages without f

Inuka Asith 13 Oct 09, 2022
Simulación con el método de Montecarlo para verificar ganancias con márgenes negativos.

Apliación del método Monte Carlo a un ejemplo que incluye márgenes negativos. Por Marco A. de la Cruz Importante La información contenida en este ejem

1 Jan 17, 2022