So, I've done all that I can do with regards to the "429 - Too Many Requests" errors that pop up. Evidently, the USPS by default puts everyone on "Public Access I" API access which limits users of THAT tier API to "60 requests per hour". That means at best one call per minute. However, the module on average (assuming that you're not using "One Page Checkout") will use use on average three to four requests per customer. That's:
- A request to get an OAuth token. (Now moved to the database and will generate another one if it's expired.)
- The shipping estimator quotes
- The quotes provided during the shipping method selector.
- Retrieve the quote from the shipping method selector.
- With OPC - One Page Checkout, you can remove one of these four steps (provided you don't change your address).
The only way to get around this would be to request elevated access. Problem is, the USPS API Team have a backlog of requests to get through. (Evidently the process is a bit more involved than Web Tools.)
I have provided these instructions on the Repo's Wiki but here they are here. (Again, I cannot help with ANY OF THIS as there isn't much I can do about the limit.)
This process involves you sending in a service ticket to the Email Us page (located at: https://emailus.usps.com/s/web-tools-inquiry) page on the USPS Website. From there, you'll be making a request with the following details:
- Provide your username to USPS.com (this is your REGULAR username, not the API credential)
- Choose "Price Calculator APIs" and "Error Messages"
- The date, or close approximation, of when the error message was discovered. (Theoretically today.)
- For "Additional information," provide them with this (obviously, providing your own information):
* Your Name
* Company Name
* Contact Phone Number
* Developer Portal Username
* Developer Portal App Name
* URL being called: apis.usps.com
* Consumer Key/client_id
* Customer Registration ID (CRID)
* Mailer ID (MID)
* Country
* ZIP Code
Do not ever provide your Consumer Secret (client_secret). (I don't even have it included in your Debug Logs.)
To get your CRID (Customer Registration ID) or MID (Mailer Identification), check your email for the original confirmation you received when you created your USPS Business Account from the Consumer Onboarding Portal (COP). (You made one, right?) If you lost that email or otherwise misplaced them, you can retrieve them from the USPS COP Business Center. After you log in, click the "Explore The Business Portal" on the bottom right section of the menu or "My Account" on the top navbar. From there, if your account has at least one business location attached, click "Manage Locations". (If you didn't make one, make one now. This will also provide you a CRID and MID.) On the following screen, you will see your CRID and MIDs assigned to you. Provide one of the MIDs (preferably your Master) along with your CRID to the ticket above.
They will follow up with you in a few days with some follow-up questions. Some of the follow-up questions may be:
What APIs are you requesting access to/a quota increase for? Domestic Prices, International Prices, Service Standards, and International Service Standards
What is your legacy USPS Web Tools UserID (if you have one)?
What is your consumer key?
What is your CRID (if you have one)?
What is your estimated maximum daily API request volume at peak?
If you are not developing your own solution, what 3rd party software/plugin are you using to access our APIs?
Are you accessing the APIs on behalf of your own merchandise shipments?
How are you generating your shipping labels today?
How would access to the APIs enhance your shipping process today?
Please provide a list of at least 20 recent example tracking numbers for which you would like to use the API.
Be honest with your answers. Estimate where you can, and if you don't have tracking numbers (which you might not), don't worry about it. (I provided the first answer for you because the module DOES need higher quotas for those four in particular.) Consumer Key in this case is your API Consumer Key.
It will be a WHILE before you get your access granted. (I'm on week two of waiting.)
Hopefully this helps.