Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Response from USPS Rate Calculator

I need to get shipping rates from USPS.

I have signed up with them, got myself a user id and trying to use the sample request XML as shown on page - https://www.usps.com/webtools/htm/Rate-Calculators-v1-3.htm , but keeping getting following error response.

<Error>
<Number>80040b1a</Number>
<Description>API Authorization failure. RateV4 is not a valid API name for this protocol.</Description>
<Source>UspsCom::DoAuth</Source>

I cant figure out where I am missing the point. Google has not been helpful as well :-(

I am passing the API name as RateV4. I have tried with the international shipping API as well - IntlRateV2. And yes, I have tried the Secure https://secure.shippingapis.com/ShippingAPITest.dll api as well. And I have mailed to support staff. Nothing has worked.

Once this basic thing works, I plan to get the classes and use custom serialization to serialize my request and then deserialize the response. That would be better than using XMLs directly. But that would probably more suitable as other question. Getting the basic thing working is a concern right now. Thanks

like image 843
Upendra Avatar asked Oct 25 '11 06:10

Upendra


1 Answers

It means the server you are targeting does not support the RateV4. I think you need to use the production server for RateV4 even when doing tests.

like image 58
Simon Mourier Avatar answered Sep 20 '22 06:09

Simon Mourier