Showing results for 
Search instead for 
Did you mean: 

Accept.js returns E_WC_21 error even with correct login/key

I am testing our integration with I have two test accounts on (one for USD and one for GBP).


I am using the library for our testing.


In my testing the Accept.dispatchData method returns the E_WC_21 error even with a valid API login and public client key.


I've double checked against the accounts on


I generated a new public client key and tried that but I am getting the same error.


Does it take a while for a new public client key to become "live"?






Accepted Solutions

I got grumpy and made my own sandbox and  public key and it works now-


That old public client key was old or something?


So I will have to get this client to regenerate thier keys.


The public client key will not impact anything else. They are very nervous.


Thanks I am not a dork thanks!  Moving on now ..

View solution in original post


Hi @bkembree


Can you double check you passing the correct combination of  apiLoginID and clientKey per account ? 


E_WC_21 User authentication failed due to invalid authentication values. Either the API Login ID or Public Client Key, or both values, are incorrect. The value of apiLoginIDmust be same as the ID that you use to authenticate API requests. The value for clientKey can be obtained through the Authorize.Net Merchant Interface, by navigating to Account > Settings > Security Settings > General Security Settings > Manage Public Client Key.

Send feedback at
Moderator Moderator

Yes, as I said in my initial post I have double checked the values for login id and public key.


I generated new public api keys and used those.


I just now once again double checked what I am submitting against the accounts on and they match 100% as far as I can see.




I am stuck on an emergency accept.js conversion (coldfusion) to the hosted form using javascript.
So the creds ID and KEY  work on this page :
But when I submit them to the accept.js in test mode they are throwing this error:
  <button type="button"
data-billingAddressOptions='{"show":true, "required":false}'
data-acceptUIFormHeaderTxt="Card Information"
<script type="text/javascript"
I am getting this in the response error

E_WC_21: User authentication failed due to invalid authentication values.

I am not sure - what to do - 

@Madeleine Could you be more specific about Test Mode?  Did you switch your sandbox to test mode instead of live mode, or are you describing a request sent to the sandbox?



The client gave me the ID an KEY I do not have access - here is what client sent me..and other programmers..  on task


I rolled back to version r and the old url and production values work.

Sandbox account WORKING

API Login ID: 83u6---DWd

Transaction Key: 6S345vpd6WXtXp96



They work here


    "authenticateTestRequest": {
        "merchantAuthentication": {
            "name": "83u6---DWd",
            "transactionKey": "6S345vpd6WXtXp96"
    "messages": {
        "resultCode": "Ok",
        "message": [
                "code": "I00001",
                "text": "Successful."


SO -------


I am trying to do a Hosted form Accept.js - my CFML screen seems to be working JSON it works but my response handler in console returns this:  See the script I am calling here: jstest.


<script type="text/javascript" src="" charset="utf-8">


E_WC_21: User authentication failed due to invalid authentication values.


What is wrong?  Is it the Mode of the Sandbox?  I can ask them to change that?




@Madeleine Use this call in the API Reference with your sandbox credentials, it will tell you if the sandbox is in test mode.

So not in test mode 


<?xml version="1.0" encoding="utf-8"?>
<getMerchantDetailsResponse xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<name>First Data Nashville</name>



is it the following??????


The important thing to remember, though, is that you're not using your regular sandbox transaction key to use Accept.js. If that's what you're trying with Accept.js, that would explain the error.


Any credentials you use for Accept.js will be exposed in the browser, so we have you use a special client key that's only for Accept. That way, someone taking your credentials out of the browser would only be able to use them to generate card tokens, not for any transaction processing or anything like that.


We call his special client key the "public client key". If you haven't already, go back to the documentation and read through the section "Obtaining a Public Client Key". That will walk you through the steps of generating a public client key to use with Accept.js.


Tried the public Client Key no beans same error - any  Helpful ideas?  


<button type="button"
data-billingAddressOptions='{"show":true, "required":false}'
data-acceptUIFormHeaderTxt="Card Information"