NMI test card numbers.
These are the card numbers NMI publishes in its testing documentation.1 They simulate approvals in test mode or a sandbox account, and they're the same across brands' happy paths — the differences that matter (declines, AVS, CVV) are driven by amounts and field values, covered in section 02.
| Brand | Card number | Notes |
|---|---|---|
| Visa | 4111111111111111 | The classic — most examples in NMI's docs use this one |
| Mastercard | 5431111111111111 | |
| Discover | 6011000991300009 | |
| American Express | 341111111111111 | 15 digits, like a real Amex |
| Diner's Club | 30205252489926 | |
| JCB | 3541963594572595 | |
| Maestro | 6799990100000000019 | 19 digits — a good length edge case for your form validation |
| Field | Test value | Notes |
|---|---|---|
| Expiration | 10/29 | The standard test expiration in NMI's docs1 |
| CVV | 999 | Triggers a CVV match response1 |
| ACH account | 24413815 | For testing echeck/ACH transactions1 |
| ACH routing | 490000018 |
Triggering declines, errors, and AVS/CVV results.
The part most people miss: on NMI, the interesting responses are driven by the amount and field values you submit, not by special card numbers. Per NMI's testing docs1:
| To simulate | Submit | What you get |
|---|---|---|
| Approval | Any test card above, amount 1.00 or more | Approved response |
| Decline | Amount less than 1.00 (e.g. 0.50) | Declined response — exercise your retry and dunning logic here |
| Fatal error | An invalid card number | Error response — tests your error handling, not just your decline path |
| AVS match | Address1 = 888, zip = 77777 | AVS match response |
| CVV match | CVV = 999 | CVV match response |
Declines, fatal errors, and field mismatches are three different code paths in your integration. A subscription business lives or dies on the decline path — that's the one that runs unattended at 3 a.m. on rebill day — so test it deliberately, not incidentally.
03 / EnvironmentsTest mode vs. sandbox account.
Three ways to test, one big trap.
NMI's docs describe three testing methods1, and they behave differently enough that picking the wrong one causes real problems:
- Sandbox account. A separate account purely for building and testing your integration — all transactions are simulated, nothing is ever charged. This is the right home for development and CI. Sandbox API keys come from your NMI sandbox account credentials.
- Per-transaction test flag. Send test_mode=enabled on a single API transaction with a test card. Useful for a one-off smoke test against an otherwise live setup without flipping the whole account.
- Account-wide test mode. Toggle a merchant account into test mode. While it's on, all valid credit cards are "approved" without actual charges or processing — including your real customers' cards.
Payer authentication (3DS) test cards.
If your integration uses 3-D Secure, NMI's sandbox docs publish a separate set of cards that simulate specific authentication outcomes2 — frictionless flows, and challenge flows where the test challenge code is 12345:
| Brand | Not enrolled | Frictionless | Challenge |
|---|---|---|---|
| Visa | 4111111111111111 | 4100000000000100 | 4100000000005000 |
| Mastercard | 5431111111111111 | 5100000000000107 | 5100000000005007 |
| American Express | 341111111111111 | 340000000000108 | 340000000005008 |
| Discover | 6799990100000000019 | 6440000000000104 | 6440000000005004 |
Brand-to-number mapping as published on NMI's payer authentication testing page, observed September 3, 2026. Skip this table entirely if you're not running 3DS.
05 / Pre-launch checklistWhat to test before a subscription business goes live.
For a one-off ecommerce store, an approved sale is most of the story. For recurring billing, the sale is the easy transaction — the ones that break are unattended. Before launch, run each of these end to end (general good practice, not NMI-specific):
- Straight sale. Test card, amount ≥ 1.00, confirm the approval lands everywhere it should — gateway, your database, the customer's email.
- Auth + capture. If you authorize at signup and capture later (common for trials), test both halves separately, and test an auth you never capture.
- Refund. Full and partial. Confirm your records and the customer notification both reflect it.
- Void. Cancel a transaction before settlement and confirm your system doesn't count it as revenue.
- Card-on-file rebill. Store the payment method, then trigger a recurring charge without the customer present. This is the transaction your subscription business actually runs on.
- The decline path. Amount under 1.00 to force a decline, then watch what your system does: does it retry? Notify the customer? Mark the subscription past-due? This path runs unsupervised — it has to work.
- Error handling. Send an invalid card number and confirm your checkout shows a human error message, not a stack trace.
- AVS/CVV responses. Use the match values (address 888, zip 77777, CVV 999) and confirm your fraud rules read the responses the way you intend.
- Test mode off. Last step, every time: flip test mode off and verify with one real card and a refund.
Common mistakes.
- Launching with test mode on. Covered above, worth repeating: fake approvals look exactly like real ones until you check your bank account.
- Testing only approvals. If every test you ran was a happy path, your decline handling ships untested — and for subscriptions, declines aren't an edge case, they're a scheduled event.
- Assuming test behavior predicts production behavior. Test mode approves everything; production involves real issuers, real AVS, real fraud rules. Treat the sandbox as an integration test, then do a small real-money verification.
- Hardcoding test credentials. Sandbox keys in a config file have a way of surviving into production deploys. Keep environments cleanly separated.
- Testing the gateway but not the stack. An approval at the gateway isn't the finish line — confirm the order, the subscription record, the receipt email, and your reporting all agree.
Where NMI fits in a subscription stack.
NMI is a payment gateway: it moves the transaction between your site and your merchant account. What it doesn't do is the layer above — the checkout pages, subscription schedules, retry logic, upsells, and customer records that decide whether a subscriber stays. That's a billing layer's job, and it's what Admoji does: a checkout and CRM that sits on top of your own merchant account, with NMI gateways supported alongside Stripe, Authorize.net, and high-risk specialists.3 If you're still choosing the gateway itself, start with our guide to picking a subscription payment gateway — and once real rebills are flowing, chargeback prevention is the next thing to get ahead of.
08 / FAQCommon questions.
Are NMI test card numbers safe to use and share?
Do NMI test cards work in production?
How do I simulate a declined transaction on NMI?
Does Admoji work with NMI?
Your gateway's set up.
Now put a real billing layer on it.
Admoji runs checkout, subscriptions, retries, and CRM on top of your own merchant account — NMI included — for $79/mo + 0.35% of volume.
Start your free trial →or see everything Admoji does →
14-DAY FREE TRIAL · NO CREDIT CARD REQUIRED · CANCEL ANYTIME
Sources — all observed September 3, 2026
- docs.nmi.com — 3 Different API Testing Methods — the test card numbers per brand, expiration 10/29, CVV 999, ACH test values, decline via amount under 1.00, fatal error via invalid card number, AVS match values, and the three testing methods (sandbox account, per-transaction test flag, account-wide test mode).
- docs.nmi.com — Testing Values for Payer Authentication — the 3DS test cards per brand for not-enrolled, frictionless, and challenge flows, and the test challenge code.
- admoji.com — supported processors (Stripe, Authorize.net, NMI gateways, high-risk specialists) and Launch pricing: $79/mo + 0.35% of volume, 14-day free trial.
Gateway documentation changes; values reflect what NMI published on the date above. If you spot something outdated, email info@admoji.com and we'll correct it promptly.