USPS2 Not Providing Rates

  • Posts: 126
  • Thank you received: 8
  • Hikaserial Standard Hikashop Business
3 months 3 weeks ago #368579

nicolas wrote: Hi,

Thanks for your feedback.

- For the name of the services in the plugin settings, I've made a modification for this for the next version of the plugin.

- For the plugin version, same, I've made a modification for this for the next version.

- For the name of the services in the email and order details in the backend, I'm not able to reproduce the issue anymore. I don't see why @gpraceman would still have the issue. Could you please double check ? Do you also have the issue @jazzmang ?

- Regarding "if you have a "FIRST-CLASS_MAIL" check, you can only receive FIRST-CLASS_MAIL rates", I'm also not able to reproduce the problem. I've tested the current version of the plugin with both package services and the new FIRST-CLASS_MAIL services checked, and when the product in the cart had dimensions and weight of a letter or flat I would get the FIRST-CLASS_MAIL service rate, and when they would exceed the limits of a flat, the plugin then switched automatically to package rates. Could you please double check ?

- Regarding the Priority Mail rate being high, I'm surprised you get these results. I actually have the rate for Priority Mail just a few dollars above the rate for Ground Advantage on my tests. Could it be you have "NONSTANDARD" selected, or the "Has non standard characteristics" checkbox checked on your end which would lead to the high Priority Mail rate on your end ?
I also can't compare to the old plugin on my end as I don't have a USPS WebTools User ID. The old USPS plugin was made by a third party developer and donated to us years ago. We only maintained the plugin.
This might require checking the situation directly on your website with some backend and FTP access in order to really understand what's going on.


Yes, I'm still having that problem with the order emails and when viewing the order in the admin console. See attached screenshots.





I do see an oddity where the Priority Mail Express rate is substantially lower than the Priority Mail rate. Should be the other way around. I have the "Processing Category" set to "Machinable", "Has non standard characteristics" set to "No" and "Commercial" rates.

Attachments:
Last edit: 3 months 3 weeks ago by gpraceman.

Please Log in or Create an account to join the conversation.

  • Posts: 126
  • Thank you received: 8
  • Hikaserial Standard Hikashop Business
3 months 3 weeks ago #368580

Strange. I made some minor tweaks to the product dimensions for my test products and now the Priority Mail rate is cheaper than the Priority Mail Express rate (as it should be).

Last edit: 3 months 3 weeks ago by gpraceman.

Please Log in or Create an account to join the conversation.

  • Posts: 278
  • Thank you received: 25
  • Hikamarket Multivendor Hikashop Business Hikashop Essential
3 months 3 weeks ago #368582

#1 - The text, instead of variable names, now appears in the plugin correctly.

#2 - The 0.5oz decal with dimensions of L3.25in x W1.25in x 0.1in is still not yielding any results. The debug file just says

USPS 2: No shipping services available for the shipping address provided.
09.17.25 19:19:01

USPS 2: No shipping services available for the shipping address provided.
09.17.25 19:27:06

USPS 2: No shipping services available for the shipping address provided.

The old USPS plugin and usps.com itself both provide me with the same rates.

#3 - With NONSTANDARD vs MACHINEABLE, at least with Priority & Ground Advantage that we use, the results vary by weight/height/dimension, which will yield different results.

For instance, we have a book that is 9oz, 11 x 9 x 0.5 inches, and if ordered by itself, will only show results if I use MACHINEABLE. However, it provided the incorrect rate for Priority Mail ($34.35 vs. $13.30). It displays no results under 'NONSTANDARD' in the cart, but the debug output does show results coming back in an array.

File Attachment:

File Name: report_2025debug.txt
File Size:402 KB


In the debug array, it lists USPS Ground Advantage Machinable Single-piece for the correct amount ($9.50), but it isn't being displayed because I believe the processingCategory is MACHINABLE in the results.

And, if I switch to a different product that is 8lbs, 42 x 1.25 x 1.325 inches, ordered by itself, MACHINEABLE results in nothing. It requires using NONSTANDARD to get correct results for Priority Mail and Ground Advantage.

If both of these products are in the cart, the NONSTANDARD works, but the MACHINEABLE does not. There is a minimum that is not being met with NONSTANDARD, which would normally be met. Sometimes, a product's dimensions by themselves are not indicative of the actual shipping container.

The processingCategory being submitted doesn't seem to limit the results returned by USPS, and my guess is the plugin is doing the filtering.

This might explain why USPS.com itself and the old plugin provide results (with or without dimension) when the new one doesn't, despite returning hits in the array. I'm wondering if the plugin shouldn't be filtering in some cases.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 126
  • Thank you received: 8
  • Hikaserial Standard Hikashop Business
3 months 3 weeks ago #368584

I tried with Version 1.3.1 of the plugin and do now see that plain text is being used instead of the variable names.

The following user(s) said Thank You: nicolas

Please Log in or Create an account to join the conversation.

  • Posts: 84888
  • Thank you received: 13833
  • MODERATOR
3 months 3 weeks ago #368601

The text, instead of variable names, now appears in the plugin correctly.

Great !

The 0.5oz decal with dimensions of L3.25in x W1.25in x 0.1in is still not yielding any results. The debug file just says
USPS 2: No shipping services available for the shipping address provided.

I found the issue for this. It's because I hadn't tested with just the letter service selected in the shipping method.
It's the line:
if(empty($mailClasses)) {
which needs to be changed to:
if(empty($mailClasses) && !$letters) {
in plugins/hikashopshipping/usps2/usps2.php
I'll be adding that for the next version.

The processingCategory being submitted doesn't seem to limit the results returned by USPS, and my guess is the plugin is doing the filtering.

It's indeed the case. The total rates endpoint doesn't let us specify a processingCategory. So it returns everything possible. And so I made the option and done the filtering on my end upon receiving the rates.
Potentially, we could add a third option "auto" to the "processing category" setting, so that it would accept any rate from USPS, as long as it is returned, and if several are returned, it would provide the cheapest for the service. What do you think ?

Sometimes, a product's dimensions by themselves are not indicative of the actual shipping container.

Note that the plugin only combine the dimensions and weight of the products in the cart and send that information to USPS.
If you know that the dimensions of the package for a product are higher than the product itself, you likely want to enter the dimensions of the package the product will be in, not the product's.

Please Log in or Create an account to join the conversation.

  • Posts: 278
  • Thank you received: 25
  • Hikamarket Multivendor Hikashop Business Hikashop Essential
3 months 3 weeks ago #368626

nicolas wrote: Potentially, we could add a third option "auto" to the "processing category" setting, so that it would accept any rate from USPS, as long as it is returned, and if several are returned, it would provide the cheapest for the service. What do you think ?


That might work, but I'm not sure. I still think rateIndicator might be needed, even if it will be a single piece most of the time.

I looked at the Domestic Mail Manual (DMM), which is referenced, but the link is broken in their API doc. The correct link is at pe.usps.com/text/dmm300/dmm300_landing.htm .

For Priority Mail ( pe.usps.com/text/dmm300/123.htm ), it explains that the minimum postage amount per addressed piece is the 1-pound price. i.e., there are no minimum dimensions, but just maximum dimensions. At least for packages (letters, flats, and envelopes are different).

The same goes for Ground Advantage, pe.usps.com/text/dmm300/133.htm .

Dimensions are factored in only for larger packages, along with their weight; however, even then, it must be quite substantial, likely above the maximums. I think this is where rateIndicator would be helpful for those odd shapes/oversized products, which is what we currently have to do with the old plugin in a very clunky way, using warehouses in HikaShop to target those items. Having access to rateIndicator could enable better handling of these unusual package types and reduce the number of shipping methods to manage, or at least to better target them to the correct service.

I'm unsure whether USPS is ignoring their own dimensional requirements in the API, as indicated by their website's rate lookup (where we don't enter dimensions), or if they are setting some kind of default/minimum "package" dimensions that aren't documented.

I'm starting to suspect that they are using maximum dimensions as their defaults for Priority Mail and Ground Advantage. That would make the weight the determining factor, which is what the old plugin results kick back despite not having dimensions set on products.

My concern is ensuring that multiple small products in an order don't combine to meet a hidden threshold with USPS for the rates, but in reality, the boxes we put them in meet the threshold. And I don't think adding a percentage additional will solve that.

Ultimately, I'd have to test multiple combinations to see if we get the correct results.

Last edit: 3 months 3 weeks ago by jazzmang.

Please Log in or Create an account to join the conversation.

  • Posts: 84888
  • Thank you received: 13833
  • MODERATOR
3 months 3 weeks ago #368636

Hi,

Thanks for the details.

I've just made a new version of the plugin available.
It contains the fix for the letter service, as explained in my previous message.
And I've also added back a rate indicator setting. Now, you can select several of them.
The plugin will filter the rates returned by USPS based on what you select in that setting, like the processing category. And if no rate indicator is selected, it will take them all into account.
I've also added the "all" choice for the processing category setting.
Hopefully, with all this, the plugin should now cover everything.

Please Log in or Create an account to join the conversation.

  • Posts: 278
  • Thank you received: 25
  • Hikamarket Multivendor Hikashop Business Hikashop Essential
3 months 2 weeks ago #368675

I had some time to do some testing, and it seems to be better, but I need to do more.

I think there might be something not quite right with letters/first-class mail, but I haven't been able to isolate it yet.

It will be a few days before I can test and provide further updates.

The following user(s) said Thank You: nicolas

Please Log in or Create an account to join the conversation.

  • Posts: 278
  • Thank you received: 25
  • Hikamarket Multivendor Hikashop Business Hikashop Essential
1 day 14 hours ago #369945

Hi Nicolas,

Sorry, I'm late getting back to this.

I've been absolutely swamped, but found the situation with minimum volume/dimensions.

I connected first about this with the USPS API development team during one of their seminars.

They said there is a minimum per service, as noted at pe.usps.com/text/dmm300/welcome.htm .
I noted to them that there was no minimum, only a maximum, as with UPS Ground Advantage, and they said to figure it out.

From what I can test with USPS Ground, it is 1x1x1 inch for USPS Ground Advantage.
First-Class goes as low as 0.001 x 0.001 x 0.001 inch.

The problem arises when an order contains multiple small products, such as small paper-thin decals. Together, they can exceed the First-Class Mail weight limit (the total cart weight must stay under 1.5 oz because you still have to add the envelope, invoice, etc.), or they can exceed the USPS 3.5 oz max for letters (first-class mail) yet still remain below the Ground volume limit.

Simply setting all products to a minimum size of 1x1x1 creates issues with other services, so that is not a viable solution.

Adding dimension approximation (%) either has no effect or doesn't work - not sure which. It also doesn't seem like a good idea in general to use a %, as we need to ensure we meet a minimum. It would be better as a numeric value added to the cart total (cubic volume), not as a %, which can be very hit-or-miss.

The only other suggestion I have is to add the option to specify a minimum set of dimensions or volume to send to the API if the calculated products in the cart don't meet it. That way, we can at least set up a method that, when it falls into such a situation, triggers something like USPS Ground Advantage.

I think that will be much easier than determining the undocumented minimum cubic volume for all USPS services, while also providing flexibility to address situations like the one above.

We already have multiple methods set up to trigger specific USPS services under specific conditions, but they are weight-based, and the situation above is falling through the cracks because we cannot meet the minimum volume for some services, even though we will in reality.

Please Log in or Create an account to join the conversation.

  • Posts: 84888
  • Thank you received: 13833
  • MODERATOR
1 day 11 hours ago #369946

Hi,

Thanks for the detailed feedback and investigation on this issue.

I've just released version 1.4.4 of the plugin which addresses the minimum dimension problem you've described.

The issue was that when an item doesn't qualify for letter/first-class shipping (due to weight limits, multiple packages, etc.), the plugin falls back to the package API. However, the USPS package API has undocumented minimum dimension requirements that weren't being enforced.

The plugin now automatically applies the USPS minimum dimensions for machinable parcels (6" x 3" x 0.25" as per the USPS Domestic Mail Manual section 3.2.1) when using the package rates API. This ensures that small items like your decals will now get valid rates from services like USPS Ground Advantage when they exceed the first-class mail weight limits.

The letter API still uses the actual product dimensions, so thin items shipped as letters/flats will continue to work as expected.

You can find the official USPS minimum size requirements here: pe.usps.com/text/dmm300/101.htm

Please update to version 1.4.4 and let me know if this resolves the issue for your small decal products.

Please Log in or Create an account to join the conversation.

  • Posts: 278
  • Thank you received: 25
  • Hikamarket Multivendor Hikashop Business Hikashop Essential
14 hours 31 minutes ago #369966

We couldn't find the minimums in section 3.2.1 of pe.usps.com/text/dmm300/101.htm , which you mentioned.

It appears the 6" x 3" x 0.25" either is not kicking or something in the plung-in isn't working right.

I'm still encountering situations where it returns no rates or incorrect rates with the wrong processing category.

Stay with me, because below is the result of hours of trial and error and parsing USPS documentation.

I am also pretty sure we discovered a bug or two in which the weight unit is used with LETTERS and FLAT processingCategory.

It started with testing an item with one 3.75 x 0.313 x 0.028, 1.5oz, up to 8 of the same decal in the cart produced a first-class letter metered at $0.74.
That seems OK.

NOTE: it should be $0.78, not metered, when using retail, I believe, since Account Type is NONE

The quantity 9+ is where we first see a problem: no rate is returned.

In the debug log, it returns:

[message] => Provided dimensions do not meet minimum allowed for First Class Flats.
            [errors] => Array
                (
                    [0] => Array
                        (
                            [title] => Provided dimensions do not meet minimum allowed for First Class Flats.
                            [detail] =>
                            [code] => 030018

Note that it changed the category to [processingCategory] => FLATS vs LETTERS; it was previously (in the log), which seems odd.

Checking our current plugin settings:
  • USPS Account Type is NONE.
  • Priority Mail, Ground Advantage, and First-Class Mail selected.
  • Processing category is set to MACHINABLE (but setting it to ALL has the same results).
  • The rate indicator restriction only has Single Piece selected.
  • Price type is Retail

My understanding is that the changes in v1.4.4 of the plug-in should make it MACHINABLE under those conditions, not LETTER or FLATS

This is when I started to suspect that the plugin's minimums were wrong, but something else was wrong, too.

Per pe.usps.com/text/dmm300/101.htm :

For LETTERS:
Minimum is 5" x 3.5" x 0.007"
Maximum is 11.5" x 6.125" x 0.25"
Max weight is 3.5oz

For FLATS
Minimum is 11.5" x 6.125" x >0.25"
Maximum is 15.5" x 12" x 0.75"
Maximum weight 13oz.

In debug mode, when a dimension doesn't meet the minimum for a processingCategory, it defaults to the above minimum, or at least LETTERS and FLATS.

i.e., if I set the product dimension to be less than the minimum, USPS returns results for the minimum dimensions (below).
<pre>Array
(
    [weight] => 0.03125
    [length] => 5
    [height] => 3.5
    [thickness] => 0.007
    [processingCategory] => LETTERS
)
</pre>

Seems fine until we test a HikaShop product with a weight of 14 and a unit type of oz.

I'm stressing that this is the unit type set in Hikashop for the product: oz, not lbs.
<h3>01.09.26 19:20:06</h3>
<pre>Array
(
    [weight] => 0.875
    [length] => 11.5
    [height] => 6.125
    [thickness] => 0.25
    [processingCategory] => LETTERS
)
</pre>
<h3>01.09.26 19:20:06</h3>
<pre>Array
(
    [totalBasePrice] => 0.74
    [rates] => Array
        (
            [0] => Array
                (
                    [SKU] => DFLL0XXXXR00010
                    [description] => First Class Letter Metered
                    [priceType] => RETAIL
                    [price] => 0.74
                    [weight] => 0.875
                    [fees] => Array
                        (
                        )

                    [startDate] => 2025-10-05
                    [endDate] => 2026-01-17
                    [warnings] => Array
                        (
                        )

                    [mailClass] => FIRST-CLASS_MAIL
                )

        )

)
</pre>

We get a result for a LETTER, not FLAT or MACHINEABLE, despite [weight] => 0.875 or above.

My guess is that HikaShop is converting 14 oz to 0.875 lb, which seems reasonable, but it is still above the 3.5- and 13-oz maximums for letter and flats.

But we entered up to 56 oz (3.5 lb) in the HikaShop product, and it still returned LETTERS results.

Obviously, you can't fit 3.5 lbs in a letter envelope.

It is when we got to 56.1 OZ (above 3.5 lbs) in Hikashop that it finally broke:
<pre>Array
(
    [weight] => 3.5000625
    [length] => 11.5
    [height] => 6.125
    [thickness] => 0.25
    [processingCategory] => LETTERS
)
</pre>
<h3>01.09.26 19:29:57</h3>
<pre>Array
(
    [apiVersion] => /prices/v3
    [error] => Array
        (
            [code] => 400
            [message] => Provided weight exceeds maximum allowed for First Class Letters.
            [errors] => Array
                (
                    [0] => Array
                        (
                            [title] => Provided weight exceeds maximum allowed for First Class Letters.
                            [detail] =>
                            [code] => 030014
                        )

                )

        )

)
</pre>
<h3>01.09.26 19:29:57</h3>
<pre>Array
(
    [apiVersion] => /prices/v3
    [error] => Array
        (
            [code] => 400
            [message] => Provided weight exceeds maximum allowed for First Class Letters.
            [errors] => Array
                (
                    [0] => Array
                        (
                            [title] => Provided weight exceeds maximum allowed for First Class Letters.
                            [detail] =>
                            [code] => 030014
                        )

                )

        )

)
</pre>

It seems one side uses OZ, and the other uses LBS.

Converting to LBS in HikaShop doesn't fix the problem either.
i.e, setting the product to 0.875 lb (14 oz) yields LETTERS.

It only breaks when the [weight] value exceeds 3.5, according to the debug log.

I'm not sure where the conversion problem is occurring (on the USPS side or the plug-in side).

Now back to FLATS and dimensions.

Weight-wise, if you set any of the dimensions above the minimum (thickness/height is the easiest), it goes to FLATS:
<pre>Array
(
    [weight] => 13
    [length] => 11.5
    [height] => 6.125
    [thickness] => 0.251
    [processingCategory] => FLATS
)
</pre>
<h3>01.09.26 19:38:34</h3>
<pre>Array
(
    [totalBasePrice] => 5.04
    [rates] => Array
        (
            [0] => Array
                (
                    [SKU] => DFXF0XXXXR00130
                    [description] => First Class Flats
                    [priceType] => RETAIL
                    [price] => 5.04
                    [weight] => 13
                    [fees] => Array
                        (
                        )

                    [startDate] => 2025-10-05
                    [endDate] => 2026-01-17
                    [warnings] => Array
                        (
                        )

                    [mailClass] => FIRST-CLASS_MAIL
                )

        )

)
</pre>

But the same issue as with LETTERS, USPS sees 13 oz, not 13 LBS, despite it being 13 LBS in HikaShop:
<h3>01.09.26 19:44:16</h3>
<pre>Array
(
    [weight] => 13.001
    [length] => 11.5
    [height] => 6.125
    [thickness] => 0.251
    [processingCategory] => FLATS
)
</pre>
<h3>01.09.26 19:44:16</h3>
<pre>Array
(
    [apiVersion] => /prices/v3
    [error] => Array
        (
            [code] => 400
            [message] => Provided weight exceeds maximum allowed for First Class Flats.
            [errors] => Array
                (
                    [0] => Array
                        (
                            [title] => Provided weight exceeds maximum allowed for First Class Flats.
                            [detail] =>
                            [code] => 030015
                        )

                )

        )

)
</pre>

However, if I adjust one of the dimensions above the maximum for FLATS (thickness/height against the easist, i.e., 0.751), it returns MACHINEABLE results!

But now it is giving us price results for lbs pricing (i.e., USPS lbs matches HikaShop lbs).

For dimensions and parcels, it seems that if any dimension exceeds FLAT's maximum, MACHINABLE will be returned. I found using the height/thickness to be the easiest, i.e., 0.75,1 but that's also generally where our problem is with thin decals. Others could have issues with width or height. It may be that we are yet to discover those products in our own catalogs.

I'm not sure what the best approach is, but the weight issue has to be fixed; otherwise, LETTERS and FLATS have real issues.

I'm not sure what the best approach is to ensure results are returned in the plug-in itself.

Obviously, the minimum and maximum values for productCategory define a range for LETTERS and FLATS; anything above those should be classified as MACHINEABLE.

I think it's the range of the minimum and maximum values for both weight and dimensions that is making it difficult.

Two other things came out of this as well, which may be a bug in the plug-in, I'm not sure:
  1. What we set the plug-in's pricing didn't matter for FLATS and LETTERS, the results always returned retail
  2. What we set the processing category to didn't seem to matter, LETTERS and FLATS are not listed but are used - I expected ALL to be required to get FLATS and LETTERS results

I hope the above helps. I'm sorry for the long post, but I wanted to share what we found and tested.

Last edit: 12 hours 47 minutes ago by jazzmang.

Please Log in or Create an account to join the conversation.

  • Posts: 84888
  • Thank you received: 13833
  • MODERATOR
2 hours 58 minutes ago #369968

Hi,

Thanks for the detailed testing and feedback. I've released version 1.5.0 which addresses, I think, all the issues you've identified.

Please update to version 1.5.0 and let me know how it works for you.

Please Log in or Create an account to join the conversation.

Time to create page: 0.100 seconds
Powered by Kunena Forum