Skip to content

Testing Fresh

Simulate payments to test your integration. Test your integration in a sandbox — an isolated test environment where transactions don't move real funds.

How to use test cards

When testing, use your test API keys (sk_test_... and pk_test_...) in all API calls.

Do not use real card details in test mode. Use only the test card numbers below.

Testing interactively

In the Dashboard or any payment form:

  • Card number: 4242 4242 4242 4242
  • Expiry: any future date, e.g. 12/34
  • CVC: any 3 digits (4 for Amex)

Testing in code

Use PaymentMethod tokens instead of card numbers:

bash
curl https://api.stripe.com/v1/payment_intents \
  -u "sk_test_YOUR_KEY:" \
  -d amount=500 \
  -d currency=usd \
  -d payment_method=pm_card_visa \
  -d "payment_method_types[]=card"

Test cards by brand

See the full table in Quick Reference → Test Cards.

Most commonly used:

BrandNumberCVCDate
Visa4242424242424242Any 3 digitsAny future date
Mastercard5555555555554444Any 3 digitsAny future date
American Express378282246310005Any 4 digitsAny future date
Discover6011111111111117Any 3 digitsAny future date

Decline scenarios

Test specific decline codes by using these cards:

ScenarioCard numberCode
Generic decline4000000000000002card_declined
Insufficient funds4000000000009995insufficient_funds
Lost card4000000000009987lost_card
Stolen card4000000000009979stolen_card
Expired card4000000000000069expired_card
Incorrect CVC4000000000000127incorrect_cvc
Processing error4000000000000119processing_error
Blocked by Radar4000000000000101card_declined (Radar)

3D Secure test cards

ScenarioCard number
3DS required4000002760003184
3DS supported but not required4000002500003155
3DS authentication fails4000008400001629
3DS — card not enrolled4000008400001280

PaymentMethod tokens for test code

TokenCard
pm_card_visaVisa (succeeds)
pm_card_mastercardMastercard (succeeds)
pm_card_amexAmerican Express
pm_card_visa_debitVisa debit
pm_card_chargeDeclinedGeneric decline
pm_card_chargeDeclinedInsufficientFundsInsufficient funds
pm_card_threeDSecure2RequiredRequires 3DS2

Non-card payment method testing

Each payment method has its own test values. Examples:

ACH / US bank accounts:

  • Routing: 110000000
  • Account: 000123456789 (success), 000111111116 (fail)

SEPA Direct Debit:

  • IBAN: DE89370400440532013000

iDEAL, Bancontact, etc.:

  • Use test mode — these methods always succeed in sandbox.

Testing webhooks locally

bash
# Forward events to your local server
stripe listen --forward-to localhost:3000/webhooks

# Trigger specific events
stripe trigger payment_intent.succeeded
stripe trigger customer.subscription.created
stripe trigger invoice.payment_failed

Simulate specific charge outcomes

Stripe provides magic amounts for specific test behaviors:

AmountBehavior
5000 (50.00)Succeeds
4000 (40.00)Attaches to customer without charging
9991 (99.91)Always declines
9992 (99.92)Declines with insufficient_funds
9993 (99.93)Declines with lost_card

Rate limits in testing

Don't use sandbox environments for load testing — you may hit rate limits. For load testing strategies, see the Stripe rate limits documentation.

Moving to live mode

When you're ready:

  1. Replace sk_test_... with sk_live_...
  2. Replace pk_test_... with pk_live_...
  3. Register live webhook endpoints (sandbox webhooks don't fire in live mode)
  4. Re-create any Products, Prices, and Coupons — test objects aren't usable in live mode

Stripe API Reference - Self-contained docs reference, refreshed 2026-05-18