Git Product home page Git Product logo

python-fedex's People

Contributors

alertedsnake avatar cnpryer avatar danielatdattrixdotcom avatar ethancastillo avatar fengsi avatar foxxyz avatar fpgadeveloper avatar gtaylor avatar jcartmell avatar linekio avatar ndobbs avatar prakashkumar163 avatar radzhome avatar talktobrent avatar timgates42 avatar topwebmaster avatar vatsalshah1990 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-fedex's Issues

tools package

tools package is not packaged in the pypi distribution.
As a result, importing methods inside the conversion module doesn't work.

Getting the raw XML or Soap/XML message/responses?

I am trying to get the XML response for the Fedex technical support to clarify some rate differences between the API and their web calculator. However, I am not exactly sure how to capture the XML message/response. Thus, any assistance in such matter would be nice.

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?

Just checking in

Hello @radzhome and friends. I just wanted to check in and make sure you've got everything you need at this point. I don't want to be holding you up in any way, it looks like things are going well.

RequestedShipment: suds build error

I don't know what went wrong but I got everything working last night and now I receive this weird suds build error:

    An error occured while building a instance of (RequestedShipment).  As a result
    the object you requested could not be constructed.  It is recommended
    that you construct the type manually using a Suds object.
    Please open a ticket with a description of this error.
    Reason: Type not found: '(CommercfDutiesPaymentialInvoiceDetail, http://fedex.com/ws/rate/v16, )'

I've tried to reinstall the fedex library but still no luck.
Does anyone know how to solve this error?

Can't get multiple services

It seems that ServiceType shouldn't be included when trying to get all services.
Dropping this option triggers an error.
I tried to removed all entries of such element in the relevant wdsi file but no avail.

Rate Request Sample not working on Windows

I registered for a developer account from FedEx and plugged all of my account information in to the config. I created a virtualenv with the latest version of fedex and suds installed via pip. I'm using Python 2.7.1 32-bit on Windows 7. When running the rate request sample, I'm getting an error:

Traceback (most recent call last):
File "rate_request.py", line 20, in
rate_request = FedexRateServiceRequest(CONFIG_OBJ)
File "C:\Users\brandon\Desktop\gtaylor-python-fedex-e5a26cc\fedex\services\rate_service.py", line 36, in init
_args, *_kwargs)
File "C:\Users\brandon\Desktop\gtaylor-python-fedex-e5a26cc\fedex\base_service.py", line 84, in init
self.client = Client('file://%s' % self.wsdl_path)
File "C:\Users\brandon\python_virtualenvs\fedex_test\lib\site-packages\suds\client.py", line 112, in init
self.wsdl = reader.open(url)
File "C:\Users\brandon\python_virtualenvs\fedex_test\lib\site-packages\suds\reader.py", line 152, in open
d = self.fn(url, self.options)
File "C:\Users\brandon\python_virtualenvs\fedex_test\lib\site-packages\suds\wsdl.py", line 136, in init
d = reader.open(url)
File "C:\Users\brandon\python_virtualenvs\fedex_test\lib\site-packages\suds\reader.py", line 79, in open
d = self.download(url)
File "C:\Users\brandon\python_virtualenvs\fedex_test\lib\site-packages\suds\reader.py", line 95, in download
fp = self.options.transport.open(Request(url))
File "C:\Users\brandon\python_virtualenvs\fedex_test\lib\site-packages\suds\transport\https.py", line 60, in open
return HttpTransport.open(self, request)
File "C:\Users\brandon\python_virtualenvs\fedex_test\lib\site-packages\suds\transport\http.py", line 62, in open
return self.u2open(u2request)
File "C:\Users\brandon\python_virtualenvs\fedex_test\lib\site-packages\suds\transport\http.py", line 118, in u2open
return url.open(u2request, timeout=tm)
File "C:\Python27\Lib\urllib2.py", line 394, in open
response = self._open(req, data)
File "C:\Python27\Lib\urllib2.py", line 412, in _open
'_open', req)
File "C:\Python27\Lib\urllib2.py", line 372, in _call_chain
result = func(*args)
File "C:\Python27\Lib\urllib2.py", line 1302, in file_open
return self.open_local_file(req)
File "C:\Python27\Lib\urllib2.py", line 1342, in open_local_file
raise URLError(msg)
urllib2.URLError: <urlopen error [Error 3] The system cannot find the path specified: ''>

Any ideas on what could be the matter?

Thanks,
Brandon

need to update pypi version

I have to download using sudo pip install -U git+https://[email protected]/gtaylor/python-fedex.git

sudo pip install fedex gives me a version where I get this error while authenticating:

./generate_label.py
INFO:fedex:Using test server.
Traceback (most recent call last):
  File "./generate_label.py", line 22, in <module>
    shipment = FedexProcessShipmentRequest(CONFIG_OBJ)
  File "./lib/fedex/services/ship_service.py", line 37, in __init__
    *args, **kwargs)
  File "./lib/fedex/base_service.py", line 88, in __init__
    self.client = Client('file:///%s' % self.wsdl_path.lstrip('/'))
  File "./lib/suds/client.py", line 109, in __init__
    options.cache = ObjectCache(days=1)
  File "./lib/suds/properties.py", line 475, in __setattr__
    self.__pts__.set(name, value)
  File "./lib/suds/properties.py", line 284, in set
    self.provider(name).__set(name, value)
  File "./lib/suds/properties.py", line 424, in __set
    d.validate(value)
  File "./lib/suds/properties.py", line 184, in validate
    raise AttributeError,msg
AttributeError: "cache" must be: (<class suds.cache.Cache at 0x7fcd48ab2a78>,)
vagrant@ubuntu-vagrant-devbox:~/projects/gwt_fedex$ vim generate_label.py
vagrant@ubuntu-vagrant-devbox:~/projects/gwt_fedex$ ./generate_label.py
Traceback (most recent call last):
  File "./generate_label.py", line 14, in <module>
    from fedex_settings import CONFIG_OBJ
  File "/home/vagrant/projects/gwt_fedex/fedex_settings.py", line 24, in <module>
    freight_account_number='X10XXX02X', use_test_server=True)
TypeError: __init__() got an unexpected keyword argument 'freight_account_number'

Rate service error.

Hi.. i have been trying to test the rate service, but keep getting errors. Currently it is an authentication error, but i have also received the following error.
account number and associates address is required for service type code 988
THe latest error was obtained after changing the account numbers to my ltl account info sent when i signed up for a developer key. Any insights you can provide would be appreciated.

Rob

Delivered package result does not return full path detail

I just realized that when tracking a delivered package, all you get is the last event, not the full details of each event in the path. I noticed other services (as well as FedEx's website) provide this info, but I don't see how to enable it. With UPS, you have to specifically request a detailed/full result - so I suspect that's the case here as well.

Seems like IncludeDetailedScans might be it, but it doesn't seem to have any effect.

Anyone managed to do this?

How to handle india shipment ?

I am try to changing the shipper address, Like this way,

Shipper's address

rate_request.RequestedShipment.Shipper.Address.PostalCode = '533212'
rate_request.RequestedShipment.Shipper.Address.CountryCode = 'IN'
rate_request.RequestedShipment.Shipper.Address.City="Kakinada"

But I am getting below error,

FedexError: Airbill is not allowed for Origin Country. (Error code: 879)

What is the above. How to solve the above error ?

Thanks..

URLError: "ftp error: no host given" trying to open local WSDL file.

Re: The change introduced by this commit: fde7f04

  •    self.client = Client('file://%s' % self.wsdl_path)
    
  •    self.client = Client('file:///%s' % self.wsdl_path)
    

This breaks things for me. I start getting a URLError ("ftp error: no host given"). For example, trying to do a rate request, the url to the wsdl file (using the default wsdl base directory) becomes "file:////absolute/path/to/fedex/wsdl/RateService_v8.wsdl" (with four slashes), and urllib2 (which suds uses to open wsdl files, even local ones) fails with that cryptic message because it no longer understands that this should be "file" protocol.

I'm not sure why adding the slash would fix the examples (as noted in that commit message), but it seems to me that maybe the examples should be fixed rather than this line in base_service.py.

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)
sandford@Compy686:~/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)
sandford@Compy686:~/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

can't get trackdetails

Hello,I use track service simply to get track details with tracknumber.
But in examples,I view track.response,there is no trackdetails,there is only "process success" info,but I need more detailed info(time,status and so on).Thanks for answer.

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.

FedexValidatePostalRequest service issue

i wanted to validate postal code of US
and used service >> FedexValidatePostalRequest
but it seems it doesn't conside country code and check for provided country only
i am getting success results for other postal codes too!!
any suggestion related to this issue ?

after CONFIG and ShipDate details setting this two values,

  1. avc_request.Address.CountryCode = 'US'
  2. avc_request.Address.PostalCode = '12346'

Asking for wsdl v15 of ProcessShipmentRequest

Hello, we are creating international shipment labels, but it seems that the wsdl V13 is not supported in the new version of the API.

According to the docs we should be filling something like

RequestedShipment.CustomsClearanceDetail.CommercialInvoice.TermsOfSale

But in the library we have V13 and not the V15 they expect we to use, do you know how we can get the new wsdl file? Thank you for any pointer

P.D: we already sent a request to [email protected] , and did not find anything.

New maintainer available

Hi,

On behalf of FanXchange.com (github.com/fanxchange), I would like to propose us to be the new maintainer for your package.

Cheers, Rad

How to test a new WSDL ?

Hi there, I'm having issues using ShipService_v13.wsdl and I want to test the v15. I did replaced the content in these files:

  • fedex/wsdl/ShipService_v13.wsdl
  • fedex/wsdl/test_server_wsdl/ShipService_v13.wsdl

But is not taking any changes I make, how can I test a different WSDL file ?

This lib not support MPS , so how can we manage it

Well friends i an using it, and facing a scenario/problem
A customer XYZ want to make purchase from my e-commerce site
his cart have 3 different item (weight of 60,70 and 70 lb lb)
Now as FedEx have some weight restriction like 150 lb is the max weight for a package

So how can i deliver him 200 lb
Now i need to use MPS
https://www.fedex.com/us/developer/WebHelp/ws/2014/dvg/WS_DVG_WebHelp/14_4_1_Multiple_Piece_Shipment_Request_Elements.htm

Please help me,
waiting for your response!

ReturnShipment Detail

Hi,
Is there any way to print return Label Detail in COD. As I can not find any details in create_shipment.py.

ProcessTag

Need an example how to processTag Request..

Tracking South American Shipments

Does the API work with tracking shipments from NA to SA? I have no trouble seeing shipments from SA to NA tracking info, but anything from NA to SA sends me back an error instead of success/

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']

'Authentication Failed' (Error code: 1000)

I have used your api with fedex test credentails & it gives me no error while generating tracking number. But now when i am using 'Production Crerentails' it gives me error while generating tracking number 'Authentication Failed' (Error code: 1000).

and one more thing the rate which this API gives me does not match with FedEx current rate when i clarify with fedex site.
Please help me out..

Raw response from Fedex

Hey,

Is there anyway I can get the raw response from Fedex out of the FedexTrackRequest object after the send_request call runs successfully? I poked around but couldn't find a way how.

Thanks a lot

fedex logging

unicode error thrown in base_service.py when request / reply contain non-ascii characters that are valid utf-8 chars.

UnicodeEncodeError 'ascii' codec can't encode character u'\u030a' in position 8: ordinal not in range(128)

solution unicode(value, 'utf-8') ?

is unicodedata.normalize required?

Issue with Rate Request Service PurposeofShipmentType is not defined

Hi,
I am trying to implement this awesome fedex wrapper in my application but I am getting this error when I am trying to make a Rate Request, this is primarily because the PurposeofShipmentType is not defined in the rate request and this is the error I am getting when I fire the rate request from the system.

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 62, in application
    response = frappe.handler.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 22, in handle
    data = execute_cmd(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 53, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 939, in call
    return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 81, in runserverobj
    frappe.desk.form.run_method.runserverobj(method, docs=docs, dt=dt, dn=dn, arg=arg, args=args)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/run_method.py", line 36, in runserverobj
    r = doc.run_method(method)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 755, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1029, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1012, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 749, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/rigpl_erpnext/rigpl_erpnext/rigpl_erpnext/doctype/book_shipment/book_shipment.py", line 26, in get_rates
    self.rate_service(credentials, from_address_doc, to_address_doc, from_country_doc, to_country_doc, transporter_doc)
  File "/home/frappe/frappe-bench/apps/rigpl_erpnext/rigpl_erpnext/rigpl_erpnext/doctype/book_shipment/book_shipment.py", line 151, in rate_service
    rate_request.send_request()
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/fedex/base_service.py", line 331, in send_request
    self._check_response_for_request_errors()
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/fedex/base_service.py", line 265, in _check_response_for_request_errors
    notification.Message)
FedexError: The PurposeOfShipmentType is null, empty or invalid. (Error code: 691)

The surprising part is that I am unable to get the error code 691 in the API documentation.

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

rate_request returning urllib.error.URLError & ssl.SSLCertVerificationError

After updating example_config.py with my credentials, running python3 rate_request.py returns ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1051).---- During handling of the above exception, another exception occurred: ---- urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1051)>

Do I need to add any more changes to other files? I could only think that my credentials are incorrect. I did not change any other files.

The full log output here: https://gist.github.com/iguzmanl/6a5385262b036dfe906bf5642f84b1ee

Error generating tracking no

Hi,

I am integrating API in OpenERP and I am using test account.
I am getting shipping quotes but not able to generate tracking no using FedexProcessShipmentRequest.

Error : "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)"

Here's my code:

    shippingfedex_ptr = self.fedex_connection(cr,uid,ids)

    account_no = shippingfedex_ptr.account_number
    key = shippingfedex_ptr.key
    password = shippingfedex_ptr.password
    meter_no = shippingfedex_ptr.meter_number
    is_test = shippingfedex_ptr.is_test
    CONFIG_OBJ = FedexConfig(key=key, password=password, account_number=account_no,             meter_number=meter_no, use_test_server=is_test)

    for rec in self.browse(cr,uid,ids):
        shipping_rec = rec
        merchant_rec = rec.partner_id
        if (not merchant_rec.zip) or (not merchant_rec.country_id) or (not merchant_rec.city) or \
                  (not merchant_rec.state_id):
               raise osv.except_osv(('Invalid Address!'),('Please check the Merchant address.')) 

    for company in self.pool.get('res.users').browse(cr,uid,[uid]):
        company_rec = company.company_id
        if (not company_rec.zip) or (not company_rec.country_id) or (not company_rec.city) \
                           or (not company_rec.state_id):
               raise osv.except_osv(('Invalid Address!'),('Please check the Shipper address.')) 

    if company_rec.street and company_rec.street2:
        shipper_address = company_rec.street + ', ' + company_rec.street2
    elif company_rec.street and not company_rec.street2:
        shipper_address = company_rec.street
    elif company_rec.street2 and not company_rec.street:
        shipper_address = company_rec.street2
    else:
        raise osv.except_osv(('Invalid Address'),('Please check the Shipper Address.'))

    if merchant_rec.street and merchant_rec.street2:
        merchant_address = merchant_rec.street + ', ' + merchant_rec.street2
    elif merchant_rec.street and not merchant_rec.street2:
        merchant_address = merchant_rec.street
    elif merchant_rec.street2 and not merchant_rec.street:
        merchant_address = merchant_rec.street2
    else:
        raise osv.except_osv(('Invalid Address'),('Please check the Merchant Address.'))

    #GET TRACKING NO
    # This is the object that will be handling our tracking request.
    shipment = FedexProcessShipmentRequest(CONFIG_OBJ)

    shipment.RequestedShipment.DropoffType = shipping_rec.dropoff_type_fedex 
    shipment.RequestedShipment.ServiceType = shipping_rec.service_type_fedex                
    shipment.RequestedShipment.PackagingType = shipping_rec.packaging_type_fedex 
    shipment.RequestedShipment.PackageDetail = shipping_rec.package_detail_fedex

    shipment.RequestedShipment.RateRequestTypes = ["ACCOUNT"]
    shipment.RequestedShipment.ShippingChargesPayment.PaymentType = shipping_rec.payment_type_fedex 
    shipment.RequestedShipment.ShippingChargesPayment.Payor.AccountNumber = CONFIG_OBJ.account_number

shipment.RequestedShipment.Shipper.Contact.PersonName = company_rec.name #'Sender Name'
shipment.RequestedShipment.Shipper.Contact.CompanyName = company_rec.name #'Some Company'
shipment.RequestedShipment.Shipper.Contact.PhoneNumber = company_rec.phone #'9012638716'

    # Shipper address.
    shipment.RequestedShipment.Shipper.Address.StreetLines = [shipper_address] #['Address Line 1']
    shipment.RequestedShipment.Shipper.Address.City = company_rec.city #'Herndon'
    shipment.RequestedShipment.Shipper.Address.StateOrProvinceCode = company_rec.state_id.code #'VA'
    shipment.RequestedShipment.Shipper.Address.PostalCode = company_rec.zip #'20171'
    shipment.RequestedShipment.Shipper.Address.CountryCode = company_rec.country_id.code #'US'
    shipment.RequestedShipment.Shipper.Address.Residential = False

    # Recipient contact info.
    shipment.RequestedShipment.Recipient.Contact.PersonName = merchant_rec.name #'Recipient Name'
    shipment.RequestedShipment.Recipient.Contact.CompanyName = merchant_rec.name #'Recipient Company'
    shipment.RequestedShipment.Recipient.Contact.PhoneNumber = merchant_rec.phone #'9012637906'

    # Recipient address
    shipment.RequestedShipment.Recipient.Address.StreetLines = [merchant_address] #['Address Line 1']
    shipment.RequestedShipment.Recipient.Address.City = merchant_rec.city #'Herndon'
    shipment.RequestedShipment.Recipient.Address.StateOrProvinceCode = merchant_rec.state_id.code
    shipment.RequestedShipment.Recipient.Address.PostalCode = merchant_rec.zip #'20171'
    shipment.RequestedShipment.Recipient.Address.CountryCode = merchant_rec.country_id.code #'US'
    shipment.RequestedShipment.Recipient.Address.Residential = False

    shipment.RequestedShipment.ShippingChargesPayment.PaymentType = shipping_rec.payment_type_fedex
    shipment.RequestedShipment.LabelSpecification.LabelFormatType = 'COMMON2D'
    shipment.RequestedShipment.LabelSpecification.ImageType = 'PNG'
    shipment.RequestedShipment.LabelSpecification.LabelStockType = 'PAPER_4X6'
    shipment.RequestedShipment.LabelSpecification.LabelPrintingOrientation = 'BOTTOM_EDGE_OF_TEXT_FIRST'

    package1_weight = shipment.create_wsdl_object_of_type('Weight')
    package1_weight.Value = shipping_rec.weight_package #1.0
    package1_weight.Units = "LB"

    package1 = shipment.create_wsdl_object_of_type('RequestedPackageLineItem')
    package1.Weight = package1_weight

    shipment.add_package(package1)
    print "DOCS\n",shipment.client
    print"SHIPMENT REQUEST\n",shipment.RequestedShipment
    shipment.send_request()

Thanks in advance.

CustomsValue

Is it possible to set the CustomsValue attributes?
I would like to add contents value and currency to get the declared_value surcharge rate.

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

Pickup request docs

Hi,

A request for pickup of shipment by a Fedex agent - no documentation is given on RTD.
Is pickup implemented in this app? Currently, here I cannot find it:
http://python-fedex.readthedocs.io/en/latest/services.html

Shipping order creation, tracking, etc are given. But pickup is not mentioned anywhere. I've also seen a PR of pickup service, but it's not mentioned anywhere on how to use it. Also, there's not example for pickups in https://github.com/python-fedex-devs/python-fedex/tree/master/examples.

But I did find a pickup service unittest:
https://github.com/python-fedex-devs/python-fedex/blob/master/tests/test_pickup_service.py

So, does the code written in above test: This is the stuff to get a Fedex agent to come and pickup the shipment package, right? If so, I can test that out and this issue can be closed. Thanks.

Integrate cod

how can i post sender cod details for fedex in countries like india

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.