This comes up frequently and the reasons are always the same:
- You are using your production credentials but hitting the sandbox endpoints
- You are using your sandbox credentials but are hitting the production endpoints
- The credentials you are using are incorrect
Verifying which API endpoint URL you are actually hitting.
If you are testing against the production environment, verify that the URL you have in your code is the actual production URL (or if you are using a framework, the configuration is set to production).
The correct URL for production is https://api2.authorize.net/xml/v1/request.api
.
The correct URL for testing is https://apitest.authorize.net/xml/v1/request.api
Verify your all of your credentials are correct
If you are sure that you are hitting the correct endpoint you then need to verify that you are using the correct credentials for that environment.
- Make sure you are using the API login and transaction key and not the console login and password. They are not the same thing. Only the API login and transaction key will work when accessing the APIs. You can get these after logging in to the console.
- Double check that the API login is correct in the console.
- If the API login is correct, from within the customer console generate a new transaction key to verify that you have the correct one.
- Make sure that the credentials are not accidentally entered incorrectly in your code. Make sure all of the characters are there. Also, the credentials are case sensitive. Make sure you did not capitalize or lowercase those values.
- If you need to verify your login credentials work set up a MVCE that hits the endpoint you are trying to reach with your API credentials. It should be a simple script that makes a basic API call. This will make it easy to debug why you are getting this error.
Test mode is not the sandbox
It is common to confuse test mode with the sandbox environment. Test mode in production uses the production environment and production credentials. Using the sandbox credentials or URLs will not work.