Esta página se muestra en inglés. Una traducción al español está en curso.
KnowledgeMay 8, 2026·6 min de lectura

Stripe Test Cards — Card Number Reference for AI Agents

Stripe test card numbers covering success, decline, 3DS challenge, insufficient funds, expired, and disputed flows. Required for AI agent QA.

Listo para agents

Este activo puede ser leído e instalado directamente por agents

TokRepo expone el comando CLI, metadata JSON, plan de instalación y contenido raw para que los agents evalúen compatibilidad, riesgo y próximos pasos.

Native · 96/100Política: permitir
Destino
Claude Code, Codex, Gemini CLI
Tipo
Knowledge
Instalación
Single
Confianza
Confianza: New
Entrada
Asset
Comando CLI de instalación
npx tokrepo install 4605bf87-8fee-4583-a28f-e00d98237ecc --target codex
Introducción

Stripe test cards are special card numbers that work only in test mode (sk_test_... keys). Each number triggers a deterministic outcome — success, decline, 3D Secure challenge, insufficient funds, dispute, or chargeback — without moving real money. AI agents that handle payments need this reference to write integration tests, simulate failure modes, and seed demo accounts. Best for: agent QA, payment flow demos, integration test fixtures. Works with: any Stripe-connected agent (Stripe Agent Toolkit, custom tool calls). Setup time: zero — copy and paste.


Success cards

Number Brand Use case
4242 4242 4242 4242 Visa Default success
5555 5555 5555 4444 Mastercard Mastercard success
3782 822463 10005 Amex Amex success (15-digit)
6011 1111 1111 1117 Discover Discover success
4000 0566 5566 5556 Visa (debit) Debit success

CVC: any 3 digits (4 for Amex). Expiry: any future date. Postal: any.

Decline cards (test failure flows)

Number Decline reason
4000 0000 0000 0002 card_declined (generic)
4000 0000 0000 9995 insufficient_funds
4000 0000 0000 9987 lost_card
4000 0000 0000 9979 stolen_card
4000 0000 0000 0069 expired_card
4000 0000 0000 0127 incorrect_cvc
4000 0000 0000 0119 processing_error

3D Secure / SCA

Number Behavior
4000 0027 6000 3184 Always requires authentication
4000 0025 0000 3155 Authentication required if PaymentIntent SCA detected
4000 0082 6000 3178 Authentication, then declines

Disputes / chargebacks

Number Triggers
4000 0000 0000 0259 Successful payment, then disputed (fraudulent)
4000 0000 0000 1976 Disputed (product_not_received)
4000 0000 0000 5423 Disputed (unrecognized)

Programmatic seeding

import stripe
stripe.api_key = "sk_test_..."

# Seed 5 successful customers each with a default decline-on-charge card
for i in range(5):
    cust = stripe.Customer.create(email=f"qa+decline-{i}@example.com")
    stripe.PaymentMethod.attach(
        stripe.PaymentMethod.create(
            type="card",
            card={"number": "4000000000000002", "exp_month": 12, "exp_year": 2030, "cvc": "123"},
        ).id,
        customer=cust.id,
    )

FAQ

Q: Will these cards work in live mode? A: No — they only work with sk_test_... keys. In live mode they decline as invalid card numbers. This is by design so test fixtures can never accidentally charge real customers.

Q: How do I test webhook delivery for declines? A: Charge a decline card with a real PaymentIntent flow and Stripe will fire a payment_intent.payment_failed webhook. Use the Stripe CLI (stripe listen --forward-to localhost:4242/webhook) to receive events locally.

Q: Are these the same as the Connect test cards? A: Mostly yes for the card itself, but Connect platform tests have additional test bank accounts and external accounts. See stripe.com/docs/connect/testing for the platform-specific test resources.


Quick Use

  1. Get sk_test_... key from dashboard.stripe.com/test/apikeys
  2. Use 4242 4242 4242 4242 for success, 4000 0000 0000 0002 for generic decline
  3. Pair with stripe listen for webhook testing

Intro

Stripe test cards are special card numbers that work only in test mode (sk_test_... keys). Each number triggers a deterministic outcome — success, decline, 3D Secure challenge, insufficient funds, dispute, or chargeback — without moving real money. AI agents that handle payments need this reference to write integration tests, simulate failure modes, and seed demo accounts. Best for: agent QA, payment flow demos, integration test fixtures. Works with: any Stripe-connected agent (Stripe Agent Toolkit, custom tool calls). Setup time: zero — copy and paste.


Success cards

Number Brand Use case
4242 4242 4242 4242 Visa Default success
5555 5555 5555 4444 Mastercard Mastercard success
3782 822463 10005 Amex Amex success (15-digit)
6011 1111 1111 1117 Discover Discover success
4000 0566 5566 5556 Visa (debit) Debit success

CVC: any 3 digits (4 for Amex). Expiry: any future date. Postal: any.

Decline cards (test failure flows)

Number Decline reason
4000 0000 0000 0002 card_declined (generic)
4000 0000 0000 9995 insufficient_funds
4000 0000 0000 9987 lost_card
4000 0000 0000 9979 stolen_card
4000 0000 0000 0069 expired_card
4000 0000 0000 0127 incorrect_cvc
4000 0000 0000 0119 processing_error

3D Secure / SCA

Number Behavior
4000 0027 6000 3184 Always requires authentication
4000 0025 0000 3155 Authentication required if PaymentIntent SCA detected
4000 0082 6000 3178 Authentication, then declines

Disputes / chargebacks

Number Triggers
4000 0000 0000 0259 Successful payment, then disputed (fraudulent)
4000 0000 0000 1976 Disputed (product_not_received)
4000 0000 0000 5423 Disputed (unrecognized)

Programmatic seeding

import stripe
stripe.api_key = "sk_test_..."

# Seed 5 successful customers each with a default decline-on-charge card
for i in range(5):
    cust = stripe.Customer.create(email=f"qa+decline-{i}@example.com")
    stripe.PaymentMethod.attach(
        stripe.PaymentMethod.create(
            type="card",
            card={"number": "4000000000000002", "exp_month": 12, "exp_year": 2030, "cvc": "123"},
        ).id,
        customer=cust.id,
    )

FAQ

Q: Will these cards work in live mode? A: No — they only work with sk_test_... keys. In live mode they decline as invalid card numbers. This is by design so test fixtures can never accidentally charge real customers.

Q: How do I test webhook delivery for declines? A: Charge a decline card with a real PaymentIntent flow and Stripe will fire a payment_intent.payment_failed webhook. Use the Stripe CLI (stripe listen --forward-to localhost:4242/webhook) to receive events locally.

Q: Are these the same as the Connect test cards? A: Mostly yes for the card itself, but Connect platform tests have additional test bank accounts and external accounts. See stripe.com/docs/connect/testing for the platform-specific test resources.


Source & Thanks

Compiled from Stripe Docs. Reference open and unrestricted.

stripe/stripe-docs — official source

🙏

Fuente y agradecimientos

Compiled from Stripe Docs. Reference open and unrestricted.

stripe/stripe-docs — official source

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados