Showing results for 
Search instead for 
Did you mean: 

Terse transaction status messages

When we initiate a transaction to and it is declined, the message returned is Transaction Declined.  If we look at our interface on the site it gives more detail such as "Card declined by issuer".  Is there any way to get this more descriptive declination message from the API?


This is on AIM by the way...


Can you paste the code you're currently using to access the error message?

Basically I hit with a query string with all of the transaction data and then I get the response data from that.

The code is this:


		private static void _Charge(CreditCard cc, string username, string persona, string ip, string documentId, decimal amount, bool avs, string chargeType, string tranID, out string response)
			bool isTest = (cc.Number == CC_NUMBER_TEST || cc.Domain == 1);
            string url = isTest ? TEST_BASE_URL : BASE_URL;

            AddParameter(ref url, PK_VERSION, PV_VERSION);
            AddParameter(ref url, PK_DELIM_DATA, PV_DELIM_DATA);
            AddParameter(ref url, PK_LOGIN, (isTest ? PV_TEST_LOGIN : PV_LOGIN));
            AddParameter(ref url, PK_TRANSACTION_KEY, (isTest ? PV_TEST_TRAN_KEY : PV_TRAN_KEY));
            AddParameter(ref url, PK_TYPE, chargeType);
            AddParameter(ref url, PK_CARD_NUM, DecryptCCNumber(cc.Number));

            if (tranID != "NONE")
                AddParameter(ref url, PK_TRAN_ID, tranID);


            if (cc.CSV != null)
                AddParameter(ref url, PK_CARD_CODE, cc.CSV);

            if (!avs)
                AddParameter(ref url, PK_RECURRING_BILLING, "true");                

            AddParameter(ref url, PK_EXPIRATION_DATE, cc.Expiration);
            AddParameter(ref url, PK_AMOUNT, amount);
            AddParameter(ref url, PK_DESCRIPTION, PV_DESCRIPTION_TEMPLATE.Replace(PVP_PERSONA, persona));
            AddParameter(ref url, PK_INVOICE_NUMBER, PV_INVOICE_NUMBER.Replace(PVP_DOCUMENT_ID, documentId.ToString()));
            AddParameter(ref url, PK_CUSTOMER_ID, username);
            AddParameter(ref url, PK_FIRST_NAME, cc.FirstName);
            AddParameter(ref url, PK_LAST_NAME, cc.LastName);
            AddParameter(ref url, PK_ADDRESS, cc.Address1 + " " + cc.Address2);
            AddParameter(ref url, PK_CITY, cc.City);
            AddParameter(ref url, PK_STATE, cc.Region);
            AddParameter(ref url, PK_ZIP, cc.PostalCode);
            AddParameter(ref url, PK_COUNTRY, cc.Country);
            AddParameter(ref url, PK_PHONE, cc.Phone);
            AddParameter(ref url, PK_EMAIL, cc.Email);
            AddParameter(ref url, PK_CUSTOMER_IP, ip);

            WebClient client = new WebClient();

            client.Headers.Add(HK_USER_AGENT, HV_USER_AGENT);
            Stream data = client.OpenRead(url);
            StreamReader reader = new StreamReader(data);

            response = reader.ReadToEnd();


Hmm, not familiar with that syntax. I do know that when I use the PHP API, I get back a response that contains error codes and response reason text:


Some of the text is fairly specific, some is not - either for security reasons or because they haven't bothered. There are also additional notes beyond what is shown in the table here if you use this other tool:

Thanks gents.  I used the reason tool but it gave me back the same generic transaction declined that the API returns on a transaction that was declined by the card issuer.   Even looking at the table here:


I will not see the specific error code that the web interface to the account will list.

Can you tell us what Response reason code and what the specific error code on the web interface that you get?