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)

Simple web-based hcaptcha bypass

Hcaptcha-Bypass !!! If you found this useful, please click the STAR button !!! Simple web-based hcaptcha bypass Just a demonstration right now, and yo

Kieronia 4 Oct 06, 2021
Discord Unverified Token Gen

Discord-Unverified-Token-Gen This is a token gen that was made in an hour and just generates unverified tokens, most will be locked. Usage: in cmd jus

Aran 2 Oct 23, 2022
Add Reactions to your Channel Posts!

• Shaaak - Post Reaction Bot Simple and Minimalistic telegram bot to add Reactions and Comments to your Channel Posts! - What's Unique About it?

Harsh Raj 4 Jan 31, 2022
A Telegram bot to download youtube playlists and upload them to telegram. (may be slow becoz youtube limitations)

YTPlaylistDL 📛 A Telegram bot to download youtube playlists and upload them to telegram. (may be slow becoz youtube limitations) 🎯 Follow me and sta

Anjana Madu 43 Dec 28, 2022
Automate TikTok follower bot, like bot, share bot, view bot and more using selenium

Zefoy TikTok Automator Automate TikTok follower bot, like bot, share bot, view bot and more using selenium. Click here to report bugs. Usage Download

555 Dec 30, 2022
Automate HoYoLAB Genshin Daily Check-In Using Github Actions

Genshin Daily Check-In 🤖 Automate HoYoLAB Daily Check-In Using Github Actions KOR, ENG Instructions Fork the repository Go to Settings - Secrets Cli

Leo Kim 41 Jun 24, 2022
A small package to markdownify Notion blocks.

markdownify-notion A small package to markdownify notion blocks. Installation Install this library using pip: $ pip install markdownify-notion Usage

Sergio Sánchez Zavala 2 Oct 29, 2022
Hydrathallies'in istegi uzerine yapildi :)

Telegram-Doviz-Bot Telegram Döviz Botu, Pyrogram ile yapıldı. Deploy Deploy on Heroku Deploy on local git clone https://github.com/lambda-stock/Telegr

2 Dec 08, 2021
Typed interactions with the GitHub API v3

PyGitHub PyGitHub is a Python library to access the GitHub API v3 and Github Enterprise API v3. This library enables you to manage GitHub resources su

5.7k Jan 06, 2023
Yok bentar lagi update Premium :( DI FOLLOW YA GUYS

SIMBF + PREMIUM PRINTAH PENGINSTALAN ON TERMUX $ pkg update && upgrade $ termux-setup-storage $ pkg install python $ pkg install git $ pip install bs4

Jeeck 21 Jan 14, 2022
The implementation of Learning Instance and Task-Aware Dynamic Kernels for Few Shot Learning

INSTA: Learning Instance and Task-Aware Dynamic Kernels for Few Shot Learning This repository provides the implementation and demo of Learning Instanc

11 Jan 02, 2023
Telegram Bot to store Posts and Documents and it can Access by Special Links.

File-sharing-Bot Telegram Bot to store Posts and Documents and it can Access by Special Links. I Guess This Will Be Usefull For Many People..... 😇 .

Code X Botz 1.2k Jan 08, 2023
Box SDK for Python

Box Python SDK Installing Getting Started Authorization Server-to-Server Auth with JWT Traditional 3-legged OAuth2 Other Auth Options Usage Documentat

Box 371 Dec 29, 2022
discord token grabber using python

Discord Token Grabber A Discord token grabber written in Python 3. This version of the grabber only supports Windows. Features No local caching Transf

1 Oct 28, 2021
This Telegram bot is created to help monitor individual mood. Lean and mean

Mood bot This bot is created to help monitor your mood. Lean and mean. Deployment Install Docker and Docker Compose Populate .env file cp .env.dist .e

Piotr Markielau 1 Dec 05, 2021
An Inline Telegram YouTube Downloader bot with custom, permanent thumbnail support and cancel upload facility. Make your fork now.

Inline-Tube-Mate (YouTube Downloader) An Inline Telegram bot that can download YouTube videos with permanent thumbnail support Bot need to be in Inlin

Renjith Mangal 41 Dec 14, 2022
Python script that extract data via YouTube Api and manipulates it.

UNLIMITED README for the Unlimited game [Mining game] Explore the docs » View Demo · Report Bug · Request Feature Table of Contents About The Project

Serban Chisca 1 Dec 12, 2021
A httpx token generator for discord [ hcaptcha bypass ]

Discord-Token-Generator-Yazato A httpx token generator for discord This generator was developed by Aced#0001, Dreamy Tos Follower#0001, Scripted#0131

23 Oct 26, 2021
Draw your telegram bot in draw.io and generate its code

README Contents: Draw your bot Install requirements Registering a telegram bot Draw bot Start point Message block Single choice block Functions block

DENIS TSITKO 23 Nov 09, 2022
Autofilterv5 With Same more Features

Autofilterv5 With Same more Features ✨ Imbd + Index +.....

Selfie SD 8 Oct 21, 2022