Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

145
Views
usps-webtools authentication fails

I have a nodejs javascript test program as follows:

const USPS = require('usps-webtools');

const usps = new USPS({
    server: 'https://production.shippingapis.com/ShippingAPI.dll',
    userId: 'user:passwd',
    ttl: 10000 //TTL in milliseconds for request
    });
usps.verify({
    street1: '1234 Some Lane',
    city: 'AnyTown',
    state: 'MI',
    zip: '12345'
    }, function(err, address){
      console.log(err)
      console.log(address);
      });

It always returns with:

Authorization failure. Perhaps username and/or password is incorrect.

USPSCOM::DoAuth

But I can go to usps.gov and login with the same account name and password.
How does it want me to pass the username and password to it?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I just tested your code and the problem appears to be the value you are passing for the userId

Instead of passing your username and password in this format userId: 'user:passwd',

Set the userId equal to your WebTools username only.

Here is a screenshot of the email you'll receive once you register at the USPS website.

enter image description here

The docs for the USPS APIs aren't great, so we created some modern ones using Redocly at https://www.uspsweb.tools and create a public postman collection for developers to explore the APIs at https://www.postman.com/lobteam/workspace/usps-web-tools-public-workspace/overview

Best of Luck!

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!