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)

Report-snapchat - Report Snapchat acc with python

report-snapchat Report Snapchat acc Report users on Snapchat about the tool : 4

17 Dec 01, 2022
Bagas Mirror&Leech Bot is a multipurpose Telegram Bot written in Python for mirroring files on the Internet to our beloved Google Drive. Based on python-aria-mirror-bot

- [ MAYBE UPDATE & ADD MORE MODULE ] Bagas Mirror&Leech Bot Bagas Mirror&Leech Bot is a multipurpose Telegram Bot written in Python for mirroring file

4 Nov 23, 2021
Telegram bot to host python bots

Host-Bot Setup the api Upload the flask api on your host #its not important to do #i used it just for simple captcha system + save ids on your host!

Plugin 15 Feb 11, 2022
trackbranch is a tool for developers that can be used to store collections of branches in the form of profiles.

trackbranch trackbranch is a tool for developers that can be used to store collections of branches in the form of profiles. This can be useful for sit

Kevin Morris 1 Oct 21, 2021
Telegram Client and Bot that use Artificial Intelligence to auto-reply to scammers and waste their time

scamminator Blocking a scammer is not enough. It is time to fight back. Wouldn't be great if there was a tool that uses Artificial Intelligence to rep

Federico Galatolo 6 Nov 12, 2022
A Telegram bot to upload files from Telegram or Direct links to Google Drive.

Google Drive Uploader Telegram Bot A Telegram bot to upload files from Telegram or Direct links to Google Drive. Features Telegram files support. Dire

IDNCoderX 21 Dec 05, 2022
DEPRECATED - Official Python Client for the Discogs API

⚠️ DEPRECATED This repository is no longer maintained. You can still use a REST client like Requests or other third-party Python library to access the

Discogs 483 Dec 31, 2022
Automation for grabbing keys from a Linux host. Useful during red team exercises to quickly help assess what access to a Linux host can lead to.

keygrabber Automation for grabbing keys from a Linux host. This can be helpful during red team exercises when you gain access to a Linux host and want

Cedric Owens 14 Sep 27, 2022
The Research PACS on AWS solution facilitates researchers' access medical images stored in the clinical PACS in a secure and seamless manner

Research PACS on AWS Challenge to solve Solution presentation Deploy the solution Further reading Releases License Challenge to solve The rise of new

AWS Samples 23 Sep 09, 2022
Host your Python Discord Bot 24/7 for free. POC

🐉 Pandore 🐉 The easiest and fastest way to host your Python3 Discord Bot 24/7 for free! 📚 Documentation 📚 If you encounter any problem while using

Billy 73 Jan 02, 2023
Trellox Tool is written in Python3 and designed to pull and list Trello boards.

TrelloX Trellox Tool is written in Python3 and designed to list and pull Trello boards. It can be used by penetration testers/bug bounty hunters to de

Ali Fathi Ali Sawehli 1 Dec 05, 2021
Get Notified about vaccine availability in your location on email & sms ✉️! Vaccinator Octocat tracks & sends personalised vaccine info everday. Go get your shot ! 💉

Vaccinater Get Notified about vaccine availability in your location on email & sms ✉️ ! Vaccinator Octocat tracks & sends personalised vaccine info ev

Mayukh Pankaj 6 Apr 28, 2022
An api, written in Python, for Investopedia's paper trading stock simulator.

investopedia-trading-api An API, written in Python, for Investopedia's paper trading stock simulator. Pull requests welcome. This library is now Pytho

Kirk Thaker 178 Jan 06, 2023
Solves bombcrypto newest captcha

Solves Bombcrypto newest captcha A very compact implementation using just cv2 and ctypes, ready to be deployed to your own project. How does it work I

19 May 06, 2022
Repositório para meu Discord Bot pessoal

BassetinhoBot Escrevi o código usando o Python 3.8.3 e até agora não tive problemas rodando nas versões mais recentes. Repositório para o Discord Bot

Vinícius Bassete 1 Jan 04, 2022
Python client for QIWI payment system

Pyqiwi Lib for QIWI payment system Installation pip install pyqiwi Usage from decimal import Decimal from datetime import datetime, timedelta from p

Andrey 12 Jun 03, 2022
An API which returns random AOT quote everytime it's invoked

An API which returns random AOT quote everytime it's invoked

Nishant Sapkota 1 Feb 07, 2022
Python SDK for the Buycoins API.

This library provides easy access to the Buycoins API using the Python programming language. It provides all the feature of the API so that you don't need to interact with the API directly. This libr

Musa Rasheed 48 May 04, 2022
Python Client for Instagram API

This project is not actively maintained. Proceed at your own risk! python-instagram A Python 2/3 client for the Instagram REST and Search APIs Install

Facebook Archive 2.9k Jan 01, 2023
Scrapping malaysianpaygap & Extracting data from the Instagram posts

Scrapping malaysianpaygap & Extracting data from the posts Recently @malaysianpaygap has gotten quite famous as a platform that enables workers throug

Yudhiesh Ravindranath 65 Nov 09, 2022