Founder deal: 75% off the lifetime licence. Unlimited sites, one payment, every update.See the founder plan
Home / Blog / Declines and diagnostics

NMI Plugin Bad Auth Response: Causes and Fixes in WooCommerce

An NMI plugin bad auth response means the gateway refused your credentials, not the card. Check key type, sandbox versus live, permissions and typos.

An NMI plugin bad auth response means the gateway did not accept the credentials your store sent, so the payment never reached the bank. It is a gateway-side authentication problem, not a card decline. The fix is nearly always a wrong, mismatched or under-permissioned security key.

What a bad auth response means

NMI’s classic API returns response 3 for an error in the data or system, plus a numeric response_code and free-form responsetext. Rejections by the gateway fall under code 300, “Transaction was rejected by gateway”. NMI documents the numeric table but not a fixed list of text strings, so the exact wording you see (for example “bad auth” in a plugin message) varies by plugin and version. Read the whole text and the code. Details are in the NMI gateway response codes guide.

Key point: no customer card is at fault. Do not ask shoppers to try another card, and do not retry in a loop.

Why it happens, most common first

  1. Wrong key type. A tokenization (public) key pasted into the security key field, or the reverse. The public key works only with Collect.js, and API keys do not work with Collect.js.
  2. Sandbox and live mixed up. Sandbox keys used against the live gateway, or live keys with sandbox mode on. They are separate credentials.
  3. Key from another account. Copied from a different merchant account, or from a reseller portal you do not use.
  4. Key was deleted or regenerated. Someone rotated it in the Merchant Portal and the store still holds the old one.
  5. Insufficient key permissions. Keys inherit the permissions of the user they are tied to. A key tied to a restricted user may be refused for sales.
  6. Old username and password credentials. Legacy logins still work on some accounts, but NMI recommends security keys. One third-party source says NMI is retiring them; confirm the timing with your provider.
  7. Copy and paste damage. A trailing space, a missing character or a line break.

What to do: ordered steps

  1. Open the failed order and read the note: response code and response text. Confirm it is an authentication or permission message, not a 2xx decline.
  2. In the plugin settings, check whether sandbox mode is on. It should match the keys you pasted.
  3. In the NMI Merchant Portal, go to Settings, then Security Keys. Create a new key with API permissions, tied to a user that is allowed to process sales.
  4. Create a separate tokenization (public) key with Tokenization permission for the card fields.
  5. Paste each key in its own field, with no spaces, and save.
  6. Run one small sale in sandbox, then one small live sale and refund it.

If the key was deleted, the old one will not come back. The step-by-step lives in gateway credentials.

Decision rule: key or something else

  • Fails on every order straight after a credentials change: key issue.
  • Fails only on one payment type, such as ACH: the account may not be enabled for it, which is a different error. Ask your provider.
  • Fails with a 4xx code: merchant setup, not authentication.
  • Fails only in live: sandbox keys, or a live account not enabled yet. See testing and sandbox.

When to contact your gateway provider

Contact the party that issued your account if a fresh, correctly typed key with API permission still fails, or if you cannot see Security Keys in your portal. You may be on a reseller white-label gateway where an administrator manages keys. See the gateway check and gateway, processor, merchant account for who controls what. Send the response code, response text, REFID and time.

How NMIWP helps

NMI for WooCommerce shows a sandbox banner, keeps sandbox and live credentials separate, writes the gateway response into the order note and redacts the security key in its logs, all in the free plugin. That makes a mixed-up key visible quickly. It cannot fix a key that the gateway rejects. For more checks, see the troubleshooting center and troubleshooting docs.

Quick answers

Is a bad auth response a declined card?

No. The gateway refused your credentials before any bank was asked.

Can I use my tokenization key as the security key?

No. The public key is for Collect.js only.

Why does it work in sandbox but not live?

The two environments use different keys and accounts.

Does NMI authentication failed always mean a bad key?

Usually, but read the text and code. Permissions and account status can also cause it.

Running NMI on WooCommerce? Free covers the basics and Pro adds the paid features. Compare Free and Pro.

More in this series: NMI Processor Response Codes vs Gateway Response Codes | NMI Response Codes 400 to 461: Processor Errors and Merchant Setup Problems | NMI Response Codes 220 to 226: Incorrect Payment Information

Last reviewed November 2026.

NMI for WooCommerce

Keep sandbox and live keys apart

Separate credentials, a sandbox banner and redacted logs come with the free plugin.

See pricing

Free on WordPress.org. Pro adds 3D Secure 2.