Forums / Addon Shipping Modules / FedEx Shipping using REST API

FedEx Shipping using REST API

Sticky

Views: 34,276

Results 21 to 40 of 100
27 Aug 2023, 8:35 PM
#21
cloud9 avatar

cloud9

New Zenner

Join Date:
Jan 2014
Location:
United States
Posts:
12
Plugin Contributions:
0

FedEx Shipping using REST API

I've configured this module as follows:
Shipping from address is located in the United States (Ohio).
Ship From address is residential - False
Ship To address is residential - True
Pickup type - 1 or 3 - Doesn't matter
Enable International Priority - True
Enable International Economy - True
Enable International Ground - True
Enable Saturday Delivery - True
International Ground Handling Fee - Doesn't matter
International Express Handling Fee - Doesn't matter
No tax class
Signature Option -1
Insurance -1
FedEx Rates - Account
Show Estimated Transit Time - False
Shipping zone - None
Sort Order - 0

I'm experiencing the following issues with this module. (Testing this on a Sunday):

  1. International Priority rates do not show to Canada even though they are enabled. Economy and Ground show fine.
  2. Shipping to Australia - No options show.
  3. I've also noticed if I "Show Estimated Transit Time" as true no shipping methods show to Canada or Australia today. United States rates show fine.

For Australia I'm testing with: Sippy Downs QLD 4556
For Canada I'm testing with: Kenora, ON P9N 2X9 and CALGARY, AB T3K1L5

FedEx Web Services is still working properly when installed side by side. All rates are showing with postal codes.

28 Aug 2023, 9:18 AM
#22
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,729
Plugin Contributions:
56

Re: FedEx Shipping using REST API

I haven't done any international testing - will check.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

28 Aug 2023, 3:35 PM
#23
njcyx avatar

njcyx

Zen Follower

Join Date:
Apr 2019
Posts:
376
Plugin Contributions:
0

Re: FedEx Shipping using REST API

cloud9:

I've configured this module as follows:
Shipping from address is located in the United States (Ohio).
Ship From address is residential - False
Ship To address is residential - True
Pickup type - 1 or 3 - Doesn't matter
Enable International Priority - True
Enable International Economy - True
Enable International Ground - True
Enable Saturday Delivery - True
International Ground Handling Fee - Doesn't matter
International Express Handling Fee - Doesn't matter
No tax class
Signature Option -1
Insurance -1
FedEx Rates - Account
Show Estimated Transit Time - False
Shipping zone - None
Sort Order - 0

I'm experiencing the following issues with this module. (Testing this on a Sunday):

  1. International Priority rates do not show to Canada even though they are enabled. Economy and Ground show fine.
  2. Shipping to Australia - No options show.
  3. I've also noticed if I "Show Estimated Transit Time" as true no shipping methods show to Canada or Australia today. United States rates show fine.

For Australia I'm testing with: Sippy Downs QLD 4556
For Canada I'm testing with: Kenora, ON P9N 2X9 and CALGARY, AB T3K1L5

FedEx Web Services is still working properly when installed side by side. All rates are showing with postal codes.

I just tested it according to @cloud9. My result is worse. I cannot get an intl/priority quote from Australia and Canada. I don't use Intl ground so I disabled it.

  1. No shipping quote to Sippy Downs QLD 4556. I tried several different addresses in Australia. No quote neither.

  2. Kenora, ON P9N 2X9. No quote. Moncton, NB E1A 6W3. No quote.

13 Sep 2023, 3:04 AM
#24
bubbadood avatar

bubbadood

New Zenner

Join Date:
Mar 2012
Location:
NJ
Posts:
49
Plugin Contributions:
0

Re: FedEx Shipping using REST API

Using ZenCart 1.5.7d and the latest release. Initially the module was working and customers were getting FedEx options however a few hours later and I see the following error in the logs:

--> PHP Warning: Undefined variable $timeout in /includes/modules/shipping/fedexrest.php on line 424.

Not sure if this is what is causing FedEx to not display any results. Any help would be appreciated.

I was a shy, quiet kid. I was happiest playing by myself with my toys, rather than hanging around people.
-- Christian Slater

13 Sep 2023, 3:13 AM
#25
bubbadood avatar

bubbadood

New Zenner

Join Date:
Mar 2012
Location:
NJ
Posts:
49
Plugin Contributions:
0

Re: FedEx Shipping using REST API

I think I may have found the issue. When I originally tested I used a product that did not trigger the signature option which I had set for $300 USD. Once I added a product that was over $300 which triggered the signature option, the module failed to post a FedEx shipping option. For not I have set the signature option to -1 which has resolved my issue.

Let me know if you need any additional information to test this.

I was a shy, quiet kid. I was happiest playing by myself with my toys, rather than hanging around people.
-- Christian Slater

13 Sep 2023, 9:46 AM
#26
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,729
Plugin Contributions:
56

Re: FedEx Shipping using REST API

includes/modules/shipping/fedexrest.php line 292 (just before the call to curl_init) do

$timeout = 15;

that solves the log. I will test to figure out the other issue. Thanks for reporting.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

15 Sep 2023, 5:28 PM
#27
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,729
Plugin Contributions:
56

Re: FedEx Shipping using REST API

The signature required issue is fixed in the latest version.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

18 Sep 2023, 4:26 PM
#28
bubbadood avatar

bubbadood

New Zenner

Join Date:
Mar 2012
Location:
NJ
Posts:
49
Plugin Contributions:
0

Re: FedEx Shipping using REST API

swguy:

The signature required issue is fixed in the latest version.

Most appreciated for all your work!

I was a shy, quiet kid. I was happiest playing by myself with my toys, rather than hanging around people.
-- Christian Slater

24 Sep 2023, 8:37 PM
#29
bubbadood avatar

bubbadood

New Zenner

Join Date:
Mar 2012
Location:
NJ
Posts:
49
Plugin Contributions:
0

Re: FedEx Shipping using REST API

[24-Sep-2023 13:26:16 America/New_York] Request URI: /index.php?main_page=shopping_cart, IP address: 189.169.117.105, Language id 1#0 /includes/modules/shipping/fedexrest.php(303): zen_debug_error_handler()
#1 /includes/modules/shipping/fedexrest.php(213): fedexrest->getRates()
#2 /includes/classes/shipping.php(201): fedexrest->quote()
#3 /includes/modules/shipping_estimator.php(151): shipping->quote()
#4 /includes/templates/responsive_classic/templates/tpl_shopping_cart_default.php(204): require('/homepages/46/d...')
#5 /includes/templates/responsive_classic/common/tpl_main_page.php(178): require('/homepages/46/d...')
#6 /index.php(94): require('/homepages/46/d...')
--> PHP Warning: Undefined array key "street_address" in /includes/modules/shipping/fedexrest.php on line 303.


[24-Sep-2023 13:26:16 America/New_York] Request URI: /index.php?main_page=shopping_cart, IP address: 189.169.117.105, Language id 1
#0 /includes/modules/shipping/fedexrest.php(304): zen_debug_error_handler()
#1 /includes/modules/shipping/fedexrest.php(213): fedexrest->getRates()
#2 /includes/classes/shipping.php(201): fedexrest->quote()
#3 /includes/modules/shipping_estimator.php(151): shipping->quote()
#4 /includes/templates/responsive_classic/templates/tpl_shopping_cart_default.php(204): require('/homepages/46/d...')
#5 /includes/templates/responsive_classic/common/tpl_main_page.php(178): require('/homepages/46/d...')
#6 /index.php(94): require('/homepages/46/d...')
--> PHP Warning: Undefined array key "suburb" in /includes/modules/shipping/fedexrest.php on line 304.


[24-Sep-2023 13:26:16 America/New_York] Request URI: /index.php?main_page=shopping_cart, IP address: 189.169.117.105, Language id 1
#0 /includes/modules/shipping/fedexrest.php(305): zen_debug_error_handler()
#1 /includes/modules/shipping/fedexrest.php(213): fedexrest->getRates()
#2 /includes/classes/shipping.php(201): fedexrest->quote()
#3 /includes/modules/shipping_estimator.php(151): shipping->quote()
#4 /includes/templates/responsive_classic/templates/tpl_shopping_cart_default.php(204): require('/homepages/46/d...')
#5 /includes/templates/responsive_classic/common/tpl_main_page.php(178): require('/homepages/46/d...')
#6 /index.php(94): require('/homepages/46/d...')
--> PHP Warning: Undefined array key "city" in /includes/modules/shipping/fedexrest.php on line 305.


[24-Sep-2023 13:26:16 America/New_York] Request URI: /index.php?main_page=shopping_cart, IP address: 189.169.117.105, Language id 1
#0 /includes/modules/shipping/fedexrest.php(313): zen_debug_error_handler()
#1 /includes/modules/shipping/fedexrest.php(213): fedexrest->getRates()
#2 /includes/classes/shipping.php(201): fedexrest->quote()
#3 /includes/modules/shipping_estimator.php(151): shipping->quote()
#4 /includes/templates/responsive_classic/templates/tpl_shopping_cart_default.php(204): require('/homepages/46/d...')
#5 /includes/templates/responsive_classic/common/tpl_main_page.php(178): require('/homepages/46/d...')
#6 /index.php(94): require('/homepages/46/d...')
--> PHP Warning: Undefined array key "postcode" in /includes/modules/shipping/fedexrest.php on line 313.

Are these issues due to the version of PHP (8.1.23) I'm using or is there an actual issue?

I was a shy, quiet kid. I was happiest playing by myself with my toys, rather than hanging around people.
-- Christian Slater

4 Oct 2023, 4:46 PM
#30
jjw2009 avatar

jjw2009

New Zenner

Join Date:
Oct 2023
Posts:
1
Plugin Contributions:
0

Re: FedEx Shipping using REST API

@swguy thanks for doing that.

@cloud9 @njcyx Were you able to figure out the international shipping errors? I am experiencing the same thing.

Store details:
Version = 1.5.8a (new install from scratch)
PHP = 8.0.30
Fedex Rest API 1.0

Fedex Rest API settings
Shipping from address is located in - Canada.
Ship From address is residential - False
Ship To address is residential - True
Pickup type - 3
Enable Express Saver - False
Enable Standard Overnight - False
Enable First Overnight - True
Enable Priority Overnight - False
Enable 2 Day - True
Enable International Priority - False
Enable International Economy - True
Enable Ground - True
Enable Saturday Delivery - False
International Ground Handling Fee - Doesn't matter
International Express Handling Fee - Doesn't matter
No tax class
Signature Option -1
Insurance -1
FedEx Rates - Account
Show Estimated Transit Time - True
Shipping zone - None
Sort Order - 0

I am running into the same problem. I'm located in Canada, the Fedex REST API is able to give shipping costs for addresses I use within Canada. However, no international shipping quotes are able to be given including to the US and/or Australia. I believe the reason is listed below.

2023-10-01 23:39:18: Rate Response: Array
(
    [transactionId] => //redacted//
    [errors] => Array
        (
            [0] => Array
                (
                    code => RATE.CUSTOMCLEARANCEDETAIL.INVALID
                    [message] => Customs clearance detail cannot be null.
                )

        )

)

The logs state this.

// I removed the full paths for security. //

[01-Oct-2023 23:34:09 UTC] Request URI: /index.php?cmd=modules&set=shipping&module=fedexrest&action=edit, IP address: XXX.XXX.XXX.XXXX, Language id 1
#1  fedexrest->setTypes() called at /includes/modules/shipping/fedexrest.php:142]
#2  fedexrest->__construct() called at /modules.php:187]
#3  require(/modules.php) called at [/index.php:11]
--> PHP Warning: Trying to access array offset on value of type null in /includes/modules/shipping/fedexrest.php on line 188.

The error line in log above does seem to jump around for the line item, not sure why but that's what the logs states.

I believe there is either some fields missing from the fedex Rest API 1.0 shipping module to handle required international customs fields that is in the API. That is why it's giving the error about custom clearance detail = null. I'm assuming because the fedex rest api shipping module isn't passing that through it's being flagged.

I may be wrong, but is there any way to test this and if so, update the fedex rest api shipping module? I'm really hoping to use fedex to ship the store's packages. Thanks.

4 Oct 2023, 6:34 PM
#31
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,729
Plugin Contributions:
56

Re: FedEx Shipping using REST API

I will investigate.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

4 Oct 2023, 6:41 PM
#32
IDEASLady avatar

IDEASLady

Totally Zenned

Join Date:
Aug 2005
Location:
Trujillo Alto, Puerto Rico
Posts:
1,449
Plugin Contributions:
3

Re: FedEx Shipping using REST API

Zen Cart v1.5.8a (upgrade)
PHP: 8.1.23

I'm having following issues:

  • after configuring module the bubble stays yellow (not green). I've revised it few times and everything is entered correctly;
  • there's no shipping quotes on frontend, it's like nothing is installed;
  • there's no errors in the log;
  • when I turn on the debug it give's an error in the log that says:
(
    [transactionId] => 60d11ca6-ebdd-4085-bf27-2b6e267fc131
    [errors] => Array
        (
            [0] => Array
                (
                    [code] => FORBIDDEN.ERROR
                    [message] => Sandbox credentials not allowed in this environment. Please check your permissions and try again.
                )

        )

)

IDEASLady
IDEAS Creative Studio

Your image... our business!

4 Oct 2023, 7:44 PM
#33
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,729
Plugin Contributions:
56

Re: FedEx Shipping using REST API

On the Project Overview page you need to click "Production Key."

https://github.com/scottcwilson/zencart_fedexrest/wiki/Installation-Instructions

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

4 Oct 2023, 7:55 PM
#34
IDEASLady avatar

IDEASLady

Totally Zenned

Join Date:
Aug 2005
Location:
Trujillo Alto, Puerto Rico
Posts:
1,449
Plugin Contributions:
3

Re: FedEx Shipping using REST API

I sent those instructions to the customer for him to follow, I guess he didn't follow ALL instructions. I guess I'll have to hold his hand through the process. I'll see when he can get to it.

Yes, that's what it is, I see his screenshot. I'll ask him to resend.

IDEASLady
IDEAS Creative Studio

Your image... our business!

4 Oct 2023, 8:50 PM
#35
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,729
Plugin Contributions:
56

Re: FedEx Shipping using REST API

I sent those instructions to the customer for him to follow ....

Developers and contractors: Don't do this for the newer modules (Square WebPay, UPS Oauth, Fedex REST API). There are just too many steps for a non-technical person.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

26 Oct 2023, 3:42 PM
#36
njcyx avatar

njcyx

Zen Follower

Join Date:
Apr 2019
Posts:
376
Plugin Contributions:
0

Re: FedEx Shipping using REST API

I planed to do some test with this code under testing site. I changed the BASE_URL to https://apis-sandbox.fedex.com, and use our testing account number, key and secret in the settings. But I cannot get a valid response. I can only receive the following error:

[errors] => Array
    (
        [0] => Array
            (
                [code] => BAD.REQUEST.ERROR
                [message] => The given JWT is invalid. Please modify your request and try again.
            )

    )

Is there anything else I need to change to make it work with testing server?

If I changed BASE_URL back and change account number, key and secret back, I can get a valid response.

Also, the reason why the intl quote is missing is because the customs information is missing from the request.

26 Oct 2023, 5:24 PM
#37
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,729
Plugin Contributions:
56

Re: FedEx Shipping using REST API

I planed to do some test with this code under testing site.

I would just point to live. There's really no disadvantage.

Also, the reason why the intl quote is missing is because the customs information is missing from the request.

I know.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

26 Oct 2023, 7:40 PM
#38
njcyx avatar

njcyx

Zen Follower

Join Date:
Apr 2019
Posts:
376
Plugin Contributions:
0

Re: FedEx Shipping using REST API

swguy:

I planed to do some test with this code under testing site.

I would just point to live. There's really no disadvantage.

Also, the reason why the intl quote is missing is because the customs information is missing from the request.

I know.

Thanks for your reply.

I used production server for testing before, but today I received this email from FedEx. "Introducing transaction quotas and rate limits for FedEx API."

Attachment 20413

Link is here, but it is blank page.

https://developer.fedex.com/api/en-us/guides/ratelimits/

Start date is Oct 15th. Not sure it is this year or not. Today is Oct 26th...

27 Oct 2023, 6:49 PM
#39
njcyx avatar

njcyx

Zen Follower

Join Date:
Apr 2019
Posts:
376
Plugin Contributions:
0

Re: FedEx Shipping using REST API

Hi @swguy,

I just listed three issues and proposed potential fixes in your github. I tried and it worked on my end. Maybe you have a better idea.

Three issues are following:

  1. Unable to get international priority quote displayed.

  2. Sometimes no quote for international due to missing customs information.

  3. Display international connect plus rate.

27 Oct 2023, 7:00 PM
#40
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,729
Plugin Contributions:
56

Re: FedEx Shipping using REST API

TY will look this weekend.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.