Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Payment gateway keys expired: why every payment is declined

CNV-206High impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

Your store talks to a payment gateway (such as Stripe, PayPal, Braintree or Authorize.net) using API keys. These are long secret strings that prove the request comes from your account. If a key is expired, deleted, rolled (replaced by a new one) or restricted, the gateway rejects every request.

Why it costs you leads or sales

Where the funnel breaks
  1. Product pageLoads fine
  2. Checkout formCustomer enters card
  3. Gateway callInvalid or expired key
  4. Order confirmationNever reached
  5. Purchase trackingNever fires

The checkout page loads normally, but the gateway rejects the request.

Orders per day before and after keys breakExample numbers
Orders per day before and after keys break (example)Day 1: 12 orders; Day 2: 11 orders; Day 3: 13 orders; Day 4: 2 orders; Day 5: 0 orders051012111320Day 1Day 2Day 3Day 4Day 5orders

Example: illustrative numbers for a small store whose keys were rolled on day 4.

How to check if your site has it

Quick diagnosis
  • Check your order count: did it drop to near zero at a specific time?
  • Log in to the gateway dashboard and look for failed requests or an "Invalid API Key provided" error (Stripe: Developers > Logs).
  • Check whether the keys were rolled, deleted or had an expiry date set (Stripe: Developers > API keys).
  • Confirm your site uses live keys, not test keys, and keys from the right account.
  • Look at your store's payment settings or logs for authentication errors.
  • Check the gateway for account notices: verification needed, restricted or paused account.
  • Try one real purchase with a card you own, or a test order if test mode is set up.
Common causes and where to look
CauseSignWhere to look
Key rolled or deletedAuthentication error in logsGateway dashboard API keys page
Key expired (set expiry)Failures begin on a dateGateway API keys page
Test keys on live siteReal cards failStore payment settings
Restricted key lacks permissionsPermission error in logsKey permissions in gateway
Account restrictedDashboard banner or emailGateway account status

How to fix it

Replace the keys
  1. Open your gateway dashboard

    Sign in to the correct account and switch to live mode.

  2. Find the API keys

    For Stripe this is Developers > API keys. Other gateways have a similar page. Check status and expiry.

  3. Create or reveal current live keys

    If a key was rolled or deleted, create a new one. Copy it carefully with no spaces and store it in a password manager.

  4. Paste the keys into your store

    Use the platform steps below. Update the publishable key and the secret key together.

  5. Update the webhook secret if needed

    If you recreated the webhook endpoint, copy the new signing secret into your store too.

  6. Test a checkout

    Place an order and check it appears in both the store and the gateway.

Where to enter the keys
  1. Open the gateway plugin settings

    In WooCommerce go to WooCommerce > Settings > Payments and open your gateway (for example Stripe).

  2. Paste the live keys

    Make sure Test mode is off, enter the live publishable and secret keys, and save. Some plugins offer a reconnect button instead, which is easier.

How to confirm it's fixed

Confirm with a test order
  1. Run a payment

    Use the gateway's test mode with a test card if your store supports it, or a small real purchase you refund afterwards.

  2. Check the gateway logs

    The request should show as successful, with no authentication errors.

  3. Check the order and emails

    The order should appear in your store, with a confirmation email sent.

  4. Check tracking

    The thank-you page should fire your purchase event in GA4 and ad platforms.

How to prevent it happening again

Prevention
  • Note any key expiry dates in a calendar with a reminder two weeks ahead.
  • Before rolling a key, update your store straight away or use the gateway's grace period if it offers one.
  • Keep keys in a shared password manager, not in one person's inbox.
  • Turn on gateway alerts for failed API requests and account issues, sent to more than one person.
  • Watch daily order counts and investigate sudden drops.
  • Run a scheduled test checkout (see below).

How FunnelGuard handles this

Checkout before and after

Keys expired

  • Every card is declined
  • Gateway logs show authentication errors
  • No orders or purchase events

Live keys replaced

  • Payments go through
  • Gateway logs show successes
  • Orders, emails and tracking arrive

Questions people ask

Why are all my payments being declined?

If every card fails, the cause is often on your side: expired, rolled or wrong API keys, test keys on a live site, or a restricted gateway account. Check the gateway dashboard logs for authentication errors.

Do Stripe API keys expire?

Standard Stripe keys do not expire by default, but they stop working if you roll or delete them. Rolling a key can also be set to expire the old one at a chosen time. Check Developers > API keys in Stripe.

How do I fix an invalid API key error at checkout?

Copy the current live keys from your gateway dashboard and paste them into your store's payment settings, with no extra spaces. Save, then place a test order and check the gateway logs.

How can I tell a key problem from a bank decline?

A bank decline affects individual cards and shows a decline code. A key problem affects every customer and shows authentication or permission errors in the gateway logs.

Will my store tell me when the keys stop working?

Often not. The checkout page still loads and customers just see a failure message. Set up gateway alerts and watch your order count.

Can FunnelGuard detect expired payment keys?

Only partly. It can run a test purchase if test mode is configured, but it does not check your live keys or real card payments. Cover that with gateway alerts and manual checks.

Is it safe to put my secret key in my theme or page code?

No. Secret keys must stay on the server or in the platform's secure settings. If one was exposed, roll it in the gateway and update your store.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

How: test purchase only if test mode configured.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.