Testing Authorize.NET Credentials with cURL

Published: July 18, 2019

Tags:

Recently, a client supplied me with Authorize.NET to configure a custom application. When I plugged them in I received the following error:

E00007: User authentication failed due to invalid authentication values.

I needed to get back to them that the credentials weren’t working, but wanted to provide evidence that the error wasn’t due to a coding error in the custom application.

Some quick research brought me to the authenticateTestRequest function.

Credentials can be tested with cURL using this function as follows:

curl https://api.authorize.net/xml/v1/request.api -d '
{
  "authenticateTestRequest": {
    "merchantAuthentication": {
      "name": "API-LOGIN-ID",
      "transactionKey": "TRANSACTION-KEY"  
    }
  }
}
'

Update API-LOGIN-ID and TRANSACTION-KEY as needed.

For sandbox testing switch the URL to https://apitest.authorize.net/xml/v1/request.api.

Max Chadwick Hi, I'm Max!

I'm a software developer who mainly works in PHP, but loves dabbling in other languages like Go and Ruby. Technical topics that interest me are monitoring, security and performance. I'm also a stickler for good documentation and clear technical writing.

During the day I lead a team of developers and solve challenging technical problems at Rightpoint where I mainly work with the Magento platform. I've also spoken at a number of events.

In my spare time I blog about tech, work on open source and participate in bug bounty programs.

If you'd like to get in contact, you can find me on Twitter and LinkedIn.