cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Invalid TransKey / Login Message But Using the Correct Sandbox URL

Hi, I was wondering if anyone might have any ideas this. I've got a sandbox account. It is definitely active. I run fake transactions through it without issue.

 

After running one through, I wanted to test / try to get the details back so I posted the below XML per the API guide (GetTransactionDetails) using C#'s WebClient (I replaced my Sandbox Login + TransKey with keywords for security purposes). 

 

I'm basically executed one line of code seen here:

 

    // Line of code (XMLReq is Below):

    WebClient.UploadString("https://test.authorize.net/gateway/transact.dll", XMLReq)

 

For some reason, Auth.Net keeps returing the "(13) The merchant login ID or password is invalid or the account is inactive." error.

 

I am 100% positive that my Login, TransKey, and Sanbox URLs are correct / the same as they are when I run through fake charges / AuthCaptures that work just fine. Anyone have any idea why this might be?

 

Thanks

 

--------------

 

POSTED:
<getTransactionDetailsRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
    <merchantAuthentication>
        <name>  {Put LoginID Here}  </name>
        <transactionKey>  {Put TransKey Here}  </transactionKey>
    </merchantAuthentication>
    <transId>60029260419</transId>
</getTransactionDetailsRequest>

 

TO:
https://test.authorize.net/gateway/transact.dll

 

USING C#:

WebClient.UploadString("https://test.authorize.net/gateway/transact.dll", XMLPacketAbove)

 

REPONSE:
<HTML><BODY><H3>The following errors have occurred.</H3>(13) The merchant login ID or password is invalid or the account is inactive.<BR></BODY></HTML>

decker
Member
2 REPLIES 2

If anyone happens to be struggling with this, I was able to get it working.

 

The issue is that you don't use the normal sanbox URL (...test.authorize.net...). There is a completely different URL you must use (https://apitest.authorize.net/xml/v1/request.api). 

 

But wait, the fun doesn't stop there :)

You also have to log into your sandbox account, go to your settings, and turn on the "Transactions Details API". For some reason the secret answer is just hardcoded to "Simon".

 

Hopfully that saves someone else a full day of keyboard head-bashing.

decker
Member

Hi @decker,

 

Let me explain the different sandbox URL. The URL you were posting to originally (ending in transact.dll) is the endpoint for our older, deprecated name-value pair API. Our newer API has requests constructed using XML (or JSON), and has it's own URLs:

 

Sandbox URL: https://apitest.authorize.net/xml/v1/request.api

Production URL: https://api.authorize.net/xml/v1/request.api

 

These endpoints are also in the "Authentication" section of our API Reference.

 

So, when posting that XML request to our older API endpoint, that system couldn't find any authentication information in the request and gave you that error.

 

With regards to not having the Transaction Details API enabled, newer accounts (sandbox or production) should have that enabled by default. That's only an error that an older account might get. If and when an account does get that error, though, we do have help at our Response Code lookup tool to walk someone through the process of getting that turned on.