Forums / Addon Shipping Modules / USPS Shipping (RESTful) (USPSr)

USPS Shipping (RESTful) (USPSr)

Sticky

Views: 54,963

Results 241 to 260 of 558
26 Sep 2025, 5:17 PM
#241
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

USPS Shipping (RESTful) (USPSr)

Since there is a LOT being changed on this version. (Namely the build of the main module file.) I create a pre-release build of what will be version 1.5.0 (aptly named, 1.5.0-dev).

This version is ready for testing from the GitHub repo and linked below.

I'm hoping to get a lot more eyes on this before I submit it to the module directory.

Here's what changed:


Added in 1.5.0-dev

  • Added the other notifiers (there was only one missing) from the original USPS WebTools module (one was changed due to differences between the code bases but their insertion points remain).

Changed in 1.5.0-dev

  • Changed the HTML code for the backend from <b> to <strong>. (This is not going to be updated on current installs.)
  • Improved the building of quotes. Broadly instead of the module doing a double iteration over the full list of selected methods and the entire resultant request from the USPS API, the module now indexes that pull and will hunt down the desired method by named key now. This should greatly help with the problem of slow API pulls. [#50]
  • Moved some helper functions and language files from the main module to a new extra_functions file. (This resolves the "can't visit the cmd=configuration&gID=6 page" error in the backend.) Side note: Love the new look for the configuration in 2.2.0.

Fixed in 1.5.0-dev

  • Fixed an issue where the cart would reduce the weight of the quote if it reached ZenCart's maximum weight. (Example: If the order is 85 pounds, ZenCart makes the order send a quote for 42.5 pounds instead.) The quote is supposed to be multiplied for each "box" in the order when configured for such. Additionally, the "order" fee is also multiplied correctly. [#74]
  • Fixed an issue that would generate a warning when the module would try to request standards for services that don't provide them. (ie. Connect Local and all international shipments.) That problem is now squelched as the module will check to see such a result exist first before trying to access it.

Test builds have so far worked with all versions of ZenCart (and the upcoming preview 2.2.0 build).

You can download the desired version here for the repository or from the forum attachment:
https://github.com/retched/ZC-USPSRestful/releases/tag/v1.5.0

Attachment #21052

Will strongly advise that a full FRESH install install of the module be made.

26 Sep 2025, 8:35 PM
#242
njcyx avatar

njcyx

Zen Follower

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

Re: USPS Shipping (RESTful) (USPSr)

Thanks for your update.

I just tried to switch the shipping options under the checkout page (zc210). **This new version does much better. **It seems to me that the first click is still slightly slower, but if I choose any other options then, it is much faster than before. It is not a bit deal and I can use it for production now. Thanks again.

26 Sep 2025, 8:58 PM
#243
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Re: USPS Shipping (RESTful) (USPSr)

njcyx:

Thanks for your update.

I just tried to switch the shipping options under the checkout page (zc210). **This new version does much better. **It seems to me that the first click is still slightly slower, but if I choose any other options then, it is much faster than before. It is not a bit deal and I can use it for production now. Thanks again.

Curious is this with One Page Checkout?

27 Sep 2025, 5:39 AM
#244
chibipaw avatar

chibipaw

Zen Follower

Join Date:
Jul 2011
Posts:
167
Plugin Contributions:
0

Re: USPS Shipping (RESTful) (USPSr)

I've encountered a new and unexpected issue with a product release today.
The nature of my shop has collection release, some are more popular than others, and when it's popular it gets pretty crazy with hundreds of people all constantly refreshing to see the product release. Today was one of those rare times, and I have noticed USPS stopped responding to quotes requests after a few customers checked out, and my site subsequently overloaded. Thinking it was just a typical overload, I've scaled out a few additional servers, but I have noticed the quotes are still not being returned. Customer would see that they have no shipping options available to select.

Any idea what might caused this? Or I wouldn't think it would simply be USPS servers throttling my server's requests because there's too. many coming in too fast? or could there be some sort of misfiring of routines due to the heavy load? I've scanned the threads and havent seen anyone with a similar situation so far.

Im still on shipping module v1.41, ZC 1.55F

27 Sep 2025, 11:00 AM
#245
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Re: USPS Shipping (RESTful) (USPSr)

chibipaw:

I've encountered a new and unexpected issue with a product release today.
The nature of my shop has collection release, some are more popular than others, and when it's popular it gets pretty crazy with hundreds of people all constantly refreshing to see the product release. Today was one of those rare times, and I have noticed USPS stopped responding to quotes requests after a few customers checked out, and my site subsequently overloaded. Thinking it was just a typical overload, I've scaled out a few additional servers, but I have noticed the quotes are still not being returned. Customer would see that they have no shipping options available to select.

Any idea what might caused this? Or I wouldn't think it would simply be USPS servers throttling my server's requests because there's too. many coming in too fast? or could there be some sort of misfiring of routines due to the heavy load? I've scanned the threads and havent seen anyone with a similar situation so far.

Im still on shipping module v1.41, ZC 1.55F

This definitely sounds like the site exhausted its limit of API requests with USPS. The documentation of the API says that the limit is something 60 requests per hour. Anything above that and it would get rate limited and would return no rates.

From Getting Started (emphasis mine):

The default product includes OAuth, Addresses, Domestic Pricing, International Pricing, Locations, Service Standards, Service Standards Files, Shipping Options, and UserInfo, each with a quota of 60 calls per hour. To get started with APIs not included in the default or to request a quota increase, please contact us by submitting a USPS API service request on the Email Us page and a representative will assist.

And it definitely sounds like you were getting slammed. I would suggest reaching out to the USPS API team and request a higher limit on the OAuth, Domestic Pricing and International Pricing calls. But glad to hear it's working for the most part.

1 Oct 2025, 1:43 PM
#246
njcyx avatar

njcyx

Zen Follower

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

Re: USPS Shipping (RESTful) (USPSr)

retched:

Curious is this with One Page Checkout?

Yes, with one page checkout.

1 Oct 2025, 1:54 PM
#247
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Re: USPS Shipping (RESTful) (USPSr)

njcyx:

Yes, with one page checkout.

I'm still lost as to how to improve the speed for One Page Checkout. Like USPSr works with it but I know it can go faster.

1 Oct 2025, 7:01 PM
#248
njcyx avatar

njcyx

Zen Follower

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

Re: USPS Shipping (RESTful) (USPSr)

1.5.0-dev

I just noticed an issue, not sure if it is only me. I only use regular ground advantage and priority (for US domestic). When my quoted weight is 20 lb or less, I can get a shipping quote as normal for both (ground advantage and priority). But when my quoted weight is over 23 lb, I cannot get a quote. I tried both shipping estimate function in shopping cart, or OPC checkout page.

I compared the log files. In the good quote, the ground advantage has a name of "USPS Ground Advantage Machinable Single-piece", while in bad quote, the ground advantage has a name or "USPS Ground Advantage Nonstandard Single-piece".

Here are what I set:

Packaging Class - Media Mail
Nonstandard

Packaging Class - Dimensional Pricing
Rectangular

Packaging Class - Cubic Pricing
Non-Soft

Squash Alike Methods Together
--none--

1 Oct 2025, 7:10 PM
#249
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Re: USPS Shipping (RESTful) (USPSr)

njcyx:

1.5.0-dev

I just noticed an issue, not sure if it is only me. I only use regular ground advantage and priority (for US domestic). When my quoted weight is 20 lb or less, I can get a shipping quote as normal for both (ground advantage and priority). But when my quoted weight is over 23 lb, I cannot get a quote. I tried both shipping estimate function in shopping cart, or OPC checkout page.

I compared the log files. In the good quote, the ground advantage has a name of "USPS Ground Advantage Machinable Single-piece", while in bad quote, the ground advantage has a name or "USPS Ground Advantage Nonstandard Single-piece".

Here are what I set:

Packaging Class - Media Mail
Nonstandard

Packaging Class - Dimensional Pricing
Rectangular

Packaging Class - Cubic Pricing
Non-Soft

Squash Alike Methods Together
--none--

Can you include the complete USPSr log file? Namely I need the part that shows what was sent from the cart to the API

1 Oct 2025, 7:10 PM
#250
njcyx avatar

njcyx

Zen Follower

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

Re: USPS Shipping (RESTful) (USPSr)

It is the same for priority. In the good quote, it has a name of "Priority Mail Machinable Single-piece", while in bad quote, it only has a name or "Priority Mail Nonstandard Single-piece".

1 Oct 2025, 7:12 PM
#251
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Re: USPS Shipping (RESTful) (USPSr)

njcyx:

It is the same for priority. In the good quote, it has a name of "Priority Mail Machinable Single-piece", while in bad quote, it only has a name or "Priority Mail Nonstandard Single-piece".
I have a feeling this may be an overestimation of when Nonstandard applies

1 Oct 2025, 7:16 PM
#252
njcyx avatar

njcyx

Zen Follower

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

Re: USPS Shipping (RESTful) (USPSr)

Sure. Please check your DM.

2 Oct 2025, 4:41 PM
#253
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Re: USPS Shipping (RESTful) (USPSr)

njcyx:

1.5.0-dev

I just noticed an issue, not sure if it is only me. I only use regular ground advantage and priority (for US domestic). When my quoted weight is 20 lb or less, I can get a shipping quote as normal for both (ground advantage and priority). But when my quoted weight is over 23 lb, I cannot get a quote. I tried both shipping estimate function in shopping cart, or OPC checkout page.

I compared the log files. In the good quote, the ground advantage has a name of "USPS Ground Advantage Machinable Single-piece", while in bad quote, the ground advantage has a name or "USPS Ground Advantage Nonstandard Single-piece".

Here are what I set:

Packaging Class - Media Mail
Nonstandard

Packaging Class - Dimensional Pricing
Rectangular

Packaging Class - Cubic Pricing
Non-Soft

Squash Alike Methods Together
--none--

Another Release Candidate build is ready!

This one should resolve the problem here.

Same deal as before. Simply upload and overwrite (non-encapsulated) or upload zc_plugins (encapsulated, ZC 2.0.0 and 2.1.0 only.)

Attachment #21057 (175.7 KB)

Also available from GitHub:
https://github.com/retched/ZC-USPSRestful/releases/tag/v1.5.0-rc2

2 Oct 2025, 6:00 PM
#254
njcyx avatar

njcyx

Zen Follower

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

Re: USPS Shipping (RESTful) (USPSr)

retched:

Another Release Candidate build is ready!

This one should resolve the problem here.

Same deal as before. Simply upload and overwrite (non-encapsulated) or upload zc_plugins (encapsulated, ZC 2.0.0 and 2.1.0 only.)

Attachment #21057 (175.7 KB)

Also available from GitHub:
https://github.com/retched/ZC-USPSRestful/releases/tag/v1.5.0-rc2

Yes, it works now. I can get a proper quote when weight is over 25 lb now. Thanks.

3 Oct 2025, 1:40 AM
#255
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Re: USPS Shipping (RESTful) (USPSr)

The above version has been submitted to the directory.

For encapsulated users, you may need to reinstall the module to confirm/lock in any changes. (This is still being investigated.)

Normal users, should be able to just copy/overwrite existing files.

4 Oct 2025, 6:16 PM
#256
skipwater avatar

skipwater

Totally Zenned

Join Date:
Jun 2008
Location:
Washington, DC
Posts:
775
Plugin Contributions:
1

Re: USPS Shipping (RESTful) (USPSr)

Very old website running php 7.x zencart 1.5.7d

Loaded ZC-USPSRestful_v1_5_0-rc2.zip because old USPS web tools stopped working.

Checkout page would show "we are not shipping to your region at this time"

Turned on debug and got the following:

2025-10-03 15:31:29:
No token detected, requesting session token from USPS
Token Request
{
"grant_type": "client_credentials",
"client_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"scope": "domestic-prices addresses international-prices service-standards shipments"
}

2025-10-03 15:31:29:

TOKEN RESPONSE FROM USPS:

{
"error": "invalid_client",
"error_description": "Client authentication failed.",
"error_uri": "https://datatracker.ietf.org/doc/html/rfc6749#page-45"
}


CommErr (should be 0): 0 -

USPS Country - $order->delivery[country][iso_code_2]: US

To fix it was under Admin->Configuration->Shipping/Packaging->Shipping Estimator Display Settings for Shopping Cart was set to 2 it needs to be 0

This seemed to set the CommErr to 0

It's a long time posting here hope this helps someone.

• 446F63746F722057686F •

6 Oct 2025, 5:12 AM
#257
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Re: USPS Shipping (RESTful) (USPSr)

skipwater:

Very old website running php 7.x zencart 1.5.7d

Loaded ZC-USPSRestful_v1_5_0-rc2.zip because old USPS web tools stopped working.

Checkout page would show "we are not shipping to your region at this time"

Turned on debug and got the following:

2025-10-03 15:31:29:
No token detected, requesting session token from USPS
Token Request
{
"grant_type": "client_credentials",
"client_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"scope": "domestic-prices addresses international-prices service-standards shipments"
}

2025-10-03 15:31:29:

TOKEN RESPONSE FROM USPS:

{
"error": "invalid_client",
"error_description": "Client authentication failed.",
"error_uri": "https://datatracker.ietf.org/doc/html/rfc6749#page-45"
}


CommErr (should be 0): 0 -

USPS Country - $order->delivery[country][iso_code_2]: US

To fix it was under Admin->Configuration->Shipping/Packaging->Shipping Estimator Display Settings for Shopping Cart was set to 2 it needs to be 0

This seemed to set the CommErr to 0

It's a long time posting here hope this helps someone.

Uhhh... No. That error seems to lead me to believe that a server side connection was not possible. If I had to hazard a guess, it would be that you didn't get new credentials. (Please stop hiding the client_id... there's a reason I don't have the secret logged...) Can you verify that you're using the credentials from develoeprs.usps.com and not from the original Webtools.

All setting "Admin->Configuration->Shipping/Packaging->Shipping Estimator Display Settings " does is hide the shipping estimator.

6 Oct 2025, 4:51 PM
#258
skipwater avatar

skipwater

Totally Zenned

Join Date:
Jun 2008
Location:
Washington, DC
Posts:
775
Plugin Contributions:
1

Re: USPS Shipping (RESTful) (USPSr)

retched:

Uhhh... No. That error seems to lead me to believe that a server side connection was not possible. If I had to hazard a guess, it would be that you didn't get new credentials. (Please stop hiding the client_id... there's a reason I don't have the secret logged...) Can you verify that you're using the credentials from develoeprs.usps.com and not from the original Webtools.

All setting "Admin->Configuration->Shipping/Packaging->Shipping Estimator Display Settings " does is hide the shipping estimator.

Yes I recived new credentials from develoeprs.usps.com

Yes it does hide the shipping estimator. (Not needed on site)

Very old habit to block client_id etc. in any kind of public form.

ZC-USPSRestful_v1_5_0-rc2 works fine I had no issues with it.

The hard part was working with zencart after years away.

• 446F63746F722057686F •

6 Oct 2025, 4:55 PM
#259
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Re: USPS Shipping (RESTful) (USPSr)

skipwater:

Yes I recived new credentials from develoeprs.usps.com

Yes it does hide the shipping estimator. (Not needed on site)

Very old habit to block client_id etc. in any kind of public form.

ZC-USPSRestful_v1_5_0-rc2 works fine I had no issues with it.

The hard part was working with zencart after years away.

Were you running this from a fresh install or a slightly modified install of ZenCart? Again, I can run both types of shipping estimators cleanly and have tested it all the way back from 1.5.5 upward. Was encapsulated or unencapsulated?

Also, also: you should probably move up to the full release of 1.5.0 that's now available on the directory.

6 Oct 2025, 5:31 PM
#260
skipwater avatar

skipwater

Totally Zenned

Join Date:
Jun 2008
Location:
Washington, DC
Posts:
775
Plugin Contributions:
1

Re: USPS Shipping (RESTful) (USPSr)

retched:

Were you running this from a fresh install or a slightly modified install of ZenCart? Again, I can run both types of shipping estimators cleanly and have tested it all the way back from 1.5.5 upward. Was encapsulated or unencapsulated?

Also, also: you should probably move up to the full release of 1.5.0 that's now available on the directory.

Zencart install was 2003 updated to 1.5.7d when it came out.

Was encapsulated or unencapsulated? Just loaded /includes/ and /admin/ folders

• 446F63746F722057686F •