Magento – Magento 1.9.3.4 USPS API First Class No Longer Working

magento1.9.3usps

Just noticed today that First Class Package no longer works and won't
quote customers for shipments under 16oz.

Looks like the USPS changed their API for First Class to First-Class
Package Service – Retail from First Class Mail Package according to
the USPS debug log file. 0_FCP was resulting in the wrong description
so First Class USPS wasn't being offered to customers.

Edited app/code/core/Mage/USA/Model/Shipping/Carrier/Usps.php

line 703

was: 'First-Class Mail Parcel' => '0_FCP',
now: 'First-Class Package Service - Retail' => '0_FCP',

Now USPS First Class is again being offered to customers. Leave
'First Class Mail Parcel' highlighted in Admin so the service is
correctly calculated and offered as only this selection uses 0_FCP. Your customers will now see First Class Package Service – Retail when First Class Package is offered. Also, be sure to clear /var/cache or your Magento cache in Admin if the results don't appear. Sorry, can't assist with Magento2.

Has anyone else tested for this issue (it did not exist yesterday
during checkouts) which appeared this morning?

Also wondering why this occurred and if I missed anything in the file edit.

EDIT: Bad news is my fix will only pull First Class package rates for 12oz max (retail), however commercial discounted rates (if you use a PC Postage Product eg. Stamps or Endicia) which maxes out at 16oz is unavailable. This service will be named: 'First-Class Package Service – Commercial' which Magento doesn't have a code for. So, here's the current situation:

  • If you don't use the fix above, you can't display or retrieve First Class Package rates for your customers

  • If you use the fix above, anything over 12oz will use Priority Mail rates and First Class rates will not appear in your cart

Currently there is no way to pull USPS First Class Priority Commercial rates using Magento.

Not sure if Magento is aware of this or if/when this will be fixed.

Best Answer

To clarify on answer provided in original question, I was able to resolve issue by overwriting core file from:

app/code/core/Mage/USA/Model/Shipping/Carrier/Usps.php

and copied file to:

app/code/local/Mage/USA/Model/Shipping/Carrier/Usps.php

by editing line 703 per original questions posted in this thread:

was: 'First-Class Mail Parcel' => '0_FCP',
now: 'First-Class Package Service - Retail' => '0_FCP', 

This includes more information about the renaming of this shipping method: Federal Register

I've submitted bug report to Magento team, you can also follow that here: https://magento.com/tech-resources/bug-tracking/issue/index/id/1762/

Official fix from Magento here: https://magento.com/tech-resources/bug-tracking/issue/index/id/1762/

Related Topic