What we do
Tools
Industries
Department
How we workLet's talk →
Home/Authorize.net/Authorize.net Test Cards and Decline Triggers
Authorize.net API

Authorize.net Test Cards: The Numbers, and How to Force a Decline

These card numbers only work in the Authorize.net sandbox, which has its own account and its own API credentials. Below are the numbers, the values that trigger declines and AVS or CVV results, and the response code most integrations forget to handle.

Sandbox test card numbers

Visa: 4111111111111111, 4012888818888, 4007000000027

Mastercard: 5424000000000015, 2223000010309703, 2223000010309711

American Express: 370000000000002 · Discover: 6011000000000012 · JCB: 3088000000000017 · Diners Club: 38000000000006

Expiry: any date after today. CVV: any 3 digits, or 4 for American Express.

Send them to apitest.authorize.net/xml/v1/request.api. Production is api.authorize.net/xml/v1/request.api.

Sandbox results that look wrong but aren't

Every transaction ID comes back as 0

How you'll know: Charges seem to go through, but nothing shows in the sandbox's transaction search.

Fix: The sandbox is in Test Mode, which doesn't store transactions. Switch it to Live Mode. Sandbox charges still never reach a bank.

Response reason code 13

How you'll know: Authentication fails even though you copied the keys carefully.

Fix: You're sending production credentials to the sandbox, or the other way round. Each environment has its own API Login ID and Transaction Key.

A decline trigger that stopped working

How you'll know: Old code sends $70.02 to force a decline and now gets an approval.

Fix: The amount-based triggers are deprecated and can stop working without notice. Use ZIP 46282 instead.

A decline recorded as a sale

How you'll know: Your order system marks orders paid when the card was declined.

Fix: The code checks that the request succeeded, not the responseCode inside it. Branch on that field: 1 Approved, 2 Declined, 3 Error, 4 Held for Review.

How to force a decline, an AVS result or a CVV mismatch

Use a valid test card from above, then change the value in the middle column. Authorize.net's testing guide lists more; these cover most test plans.

To test Send this What comes back
A plain bank decline Billing ZIP 46282 responseCode 2 (Declined).
Address and ZIP both wrong Billing ZIP 46205 AVS result N.
Address matches, ZIP doesn't Billing ZIP 46201 AVS result A.
ZIP matches, address doesn't Billing ZIP 46217 AVS result Z.
AVS unavailable Billing ZIP 46207 AVS result R.
CVV mismatch Card code 901 CVV result N. Use 900 for a match, 904 for not processed.
A partial authorization ZIP 46225 (card not present) or an amount of $462.25 (card present) Only $1.23 authorized.
An eCheck decline Any eCheck over $100 Declined. Amounts under $100 are accepted.

From sandbox to live, in order

  1. 1

    Create a sandbox account

    Sign up on Authorize.net's developer site. It's free and separate from any live merchant account, with its own login at sandbox.authorize.net.

  2. 2

    Generate sandbox API credentials

    Account Settings Security Settings API Credentials & Keys

    Copy the API Login ID and create a Transaction Key. Store both as environment settings, never in code.

  3. 3

    Run your test plan

    An approval, each decline trigger above, a refund, a void, and every AVS and CVV case your fraud rules care about.

    Watch for: the held-for-review case. If your sandbox shows the Fraud Detection Suite, set an Amount Filter to authorize and hold for review, then send a charge above it.

  4. 4

    Swap to production

    Change the endpoint, API Login ID and Transaction Key. The request format doesn't change between the two.

  5. 5

    Watch the first real charges settle

    Confirm the first live transactions settle in the next batch before you remove whatever manual check covered the cutover.

Response code 4: the one that gets lost after go-live

A held transaction has been authorized but sits in Authorized/Pending Review until someone approves or voids it in the Merchant Interface. It isn't a sale yet and it isn't a decline. Integrations written against a happy path often treat it as one or the other, so the order either ships on an unsettled charge or quietly stalls until the customer asks where it is.

Handling it properly means pausing fulfillment on code 4, telling whoever reviews holds, and acting on the decision when it's made. Authorize.net webhooks can report held, approved and declined fraud decisions, so the order can move on its own once the review is done. Errors (code 3) deserve their own path too, apart from a normal decline, because they often mean a bad request rather than a bad card.

If transactions start failing across the board and you suspect Authorize.net rather than your code, check its status page first. It's faster than an afternoon of debugging something that isn't broken on your side.

Questions people ask

Where do I find Authorize.net's test card numbers?

They're in Authorize.net's testing guide on its developer site, and the main ones are at the top of this page: 4111111111111111 for Visa, 5424000000000015 for Mastercard, 370000000000002 for Amex and 6011000000000012 for Discover. They only work in the sandbox.

What's the difference between Authorize.net sandbox and production credentials?

They're separate accounts with separate API Login IDs and Transaction Keys. Sandbox credentials only work against apitest.authorize.net, and crossing them returns response reason code 13. The request format is the same in both.

What do Authorize.net's response codes mean?

In a transaction response, responseCode 1 means approved, 2 declined, 3 error and 4 held for review. Branch on this field, not on whether the API call returned, or a decline can be recorded as a sale.

What does "held for review" mean on an Authorize.net transaction?

A fraud filter flagged it. Depending on the filter's action, the charge is either authorized and held, or held without authorization, until someone approves or voids it in the Merchant Interface. Your integration should pause the order until that decision comes through.

Is Authorize.net down right now?

Check Authorize.net's status page before debugging your own code. If it shows no incident, look at your credentials and endpoint next, since crossed sandbox and production keys are a common cause of sudden failures.

Does testing in the Authorize.net sandbox cost anything?

No. The sandbox is free, and its transactions are never sent to a bank. eCheck testing has a $5,000 monthly limit in the sandbox.

How do I test a declined card in the Authorize.net sandbox?

Use any test card number with the billing ZIP 46282. That returns a general decline (responseCode 2). For AVS and CVV results, use the ZIP codes and card codes in the table above.

Let's talk

Tell us the one thing your team does manually that eats up time. We read every message and reply within a day.