Skip to content

Update USPS sandbox APIs to apis-tem.usps.com#1118

Open
zebradots wants to merge 3 commits into
karrioapi:mainfrom
zebradots:main
Open

Update USPS sandbox APIs to apis-tem.usps.com#1118
zebradots wants to merge 3 commits into
karrioapi:mainfrom
zebradots:main

Conversation

@zebradots

Copy link
Copy Markdown

As of Jan 25, 2026, USPS retired the USPS Web Tools APIs. With this change, the sandbox / test server API hostname moved from api-cat.usps.com to apis-tem.usps.com. See Slide 5 of The Retirement of USPS Web Tools
APIs Presentation
for details.

In Karrio 2026.1.31, transactions sent in Test Mode to USPS will fail with a confusing "Invalid credentials" error until the correct test server hostname is fixed.

This pull request simply updates providers usps and usps-international to point to the correct test mode API endpoints.

@vercel

vercel Bot commented Jun 5, 2026

Copy link
Copy Markdown

@zebradots is attempting to deploy a commit to the karrio Team on Vercel.

A member of the Team first needs to authorize it.

@property
def server_url(self):
return "https://api-cat.usps.com" if self.test_mode else "https://api.usps.com"
return "https://apis-tem.usps.com" if self.test_mode else "https://api.usps.com"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check if the production one here should also go to the 'plural' one like the non international one did? It seems like that change happened during the same transition?

Looks like this commit d7ad6af did just the one and should have changed all 4?

Might as well catch the other too imo

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChrisNolan you are correct. We confirmed that the USPS International production server points to the wrong endpoint and should be plural, just as you pointed out. Updated in this additional commit.

The previous PR only addressed testing endpoints for both USPS and USPS International, but apparently USPS International will not function at all (neither in testing nor production) until this gets merged.

USPS (domestic) currently points to the correct production endpoint, so only 3 changes are required:

  1. USPS Testing: https://apis-tem.usps.com
  2. USPS Production: https://apis.usps.com <-- Only one that is currently correct
  3. USPS International Testing: https://apis-tem.usps.com
  4. USPS International Production: https://apis.usps.com

@danh91

danh91 commented Jun 9, 2026

Copy link
Copy Markdown
Member

Thanks @zebradots, good catch on the sandbox endpoint. Queuing for review and merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants