Stripe in test mode

Build the full checkout, subscription & webhook flow with fake cards — no activation needed.

Test mode is on the moment you sign up — no activation form needed. Build the entire checkout, subscription, and webhook flow with fake cards; the only thing it can't do is move real money.

A · Get your test credentials

  1. 1

    Create the account, skip activation

    Sign up at dashboard.stripe.com. You do not need to submit the activation form to build — test mode lives behind the Test mode toggle (top-right).
  2. 2

    Copy your test API keys

    Developers → API keys. You get a publishable key (pk_test_…, safe for frontend) and a secret key ( sk_test_…, server only) — completely separate from live keys.

B · Take your first test payment

  1. 3

    Create a Checkout Session

    Easiest path: a hosted Checkout Session — Stripe builds the payment page for you.
    terminal
    # server-side, with your secret test key
    curl https://api.stripe.com/v1/checkout/sessions \
      -u sk_test_xxx: \
      -d mode=payment \
      -d "line_items[0][price_data][currency]"=usd \
      -d "line_items[0][price_data][product_data][name]"=Pro \
      -d "line_items[0][price_data][unit_amount]"=2000 \
      -d "line_items[0][quantity]"=1 \
      -d success_url=https://you.dev/ok
  2. 4

    Pay with a test card — no real money moves

    On the Checkout page use these magic numbers (any future expiry, any CVC, any ZIP):
    text
    4242 4242 4242 4242  # succeeds
    4000 0025 0000 3155  # requires 3-D Secure
    4000 0000 0000 9995  # declined (insufficient funds)
    4000 0000 0000 0002  # generic decline

C · Wire up webhooks & advanced flows

  1. 5

    Forward live events to localhost with the CLI

    Install the Stripe CLI, then stream real test-mode events to your machine and replay any event on demand — no public URL needed.
    terminal
    stripe login
    stripe listen --forward-to localhost:4242/webhook
    stripe trigger checkout.session.completed
  2. 6

    Test subscriptions & renewals with Test Clocks

    Create a test clock, attach a customer + subscription, then fast-forward weeks/months to watch invoices, retries, and renewal webhooks fire — without waiting in real time. Billing → Test clocks.
  3. 7

    Try refunds, disputes & Payment Links

    Issue refunds from the dashboard, simulate a chargeback with card 4000 0000 0000 0259, or spin up a no-code Payment Link to share a working test checkout instantly.

Switch to live

The only thing test mode can't do is move real money. When you flip to Live, your sk_test_ keys become sk_live_, and that's when identity/payout verification kicks in — everything you built carries over unchanged.
keys · Developers → API keyscards · stripe.com/docs/testingCLI · stripe.com/docs/stripe-cli