Reference guide

PayPal Test Cards: Sandbox Card Numbers, Decline Triggers and 3D Secure

The card numbers PayPal gives you for sandbox testing, how to make a card payment decline on purpose, which cards drive each 3D Secure outcome, and how to force API errors your integration has to handle.

Checked against PayPal’s card testing documentation on . PayPal adds and retires test cards; confirm a number there before you depend on it.

How to use PayPal test cards

PayPal's test cards are for card payments in the sandbox: Expanded Checkout (advanced card fields) and saved payment methods. No money moves. Before you enter one, check that:

  • Your integration runs in sandbox mode, with a sandbox client ID, and calls the api-m.sandbox.paypal.com endpoints.
  • You enter a future expiration date and a 3-digit CVV, or a 4-digit CVV for American Express.

Paying with a PayPal wallet in the sandbox is different: the buyer logs in with a sandbox personal account and the payment lands in a sandbox business account. PayPal creates one of each the first time you log into the Developer Dashboard, and you can add more under Testing Tools > Sandbox Accounts.

Never test with real card details. Test cards are only accepted by the sandbox, and a real card entered there isn't charged, so it tells you nothing about how live payments behave.

PayPal sandbox test card numbers

These static numbers succeed in Expanded Checkout and in saved payment method flows.

Card typeTest number
Visa4012888888881881
Visa4005519200000004
Visa4012000033330026
Visa4012000077777777
Visa4217651111111119
Visa4500600000000061
Visa4772129056533503
Visa4915805038587737
Mastercard2223000048400011
American Express371449635398431
American Express376680816376961
Diners Club36461510000039
Diners Club36461510000013
Maestro6304000000000000
Maestro5063516945005047
China UnionPay (CUP)6200680000000004
China UnionPay (CUP)6200680000000038
JCB3636500000000260
JCB3636500000000989

When you need more numbers, use the credit card generator on PayPal's card testing page. A generated card can be used directly in a card payment or added to a sandbox account as one of its payment methods.

Declined payments: rejection triggers

PayPal doesn't use a separate card number per decline reason. Instead, you pay with a normal test card (PayPal suggests the Visa 4012 8888 8888 1881) and put a rejection trigger where the cardholder's name goes:

  • In a checkout form: type the trigger into the First Name or Name on Card field.
  • Through the Orders API: set the card's name, or address_line_1, to the trigger in the payment_source of your create order call.
ScenarioTriggerProcessor response codeDescription
Card refusedCCREJECT-REFUSED0500DO_NOT_HONOR
Fraudulent cardCCREJECT-SF9500SUSPECTED_FRAUD; don't retry the same card
Card expiredCCREJECT-EC5400EXPIRED_CARD
Luhn check failsCCREJECT-IRC5180INVALID_OR_RESTRICTED_CARD; don't retry the same card
Insufficient fundsCCREJECT-IF5120INSUFFICIENT_FUNDS
Card lost or stolenCCREJECT-LS9520LOST_OR_STOLEN; don't retry the same card
Card not validCCREJECT-IA1330INVALID_ACCOUNT
Card declinedCCREJECT-BANK_ERROR5100GENERIC_DECLINE
CVC check failsCCREJECT-CVV_F00N7CVV2_FAILURE_POSSIBLE_RETRY_WITH_CVV

Triggers are case-sensitive. Every rejection returns the AVS code G (globally unavailable) and the CVV code P (not processed).

A declined card doesn't fail the API call. The order can still come back with status COMPLETED while the capture inside it is DECLINED, so read purchase_units[].payments.captures[].status and processor_response.response_code rather than the order's top-level status.

3D Secure test cards

Plain test cards don't produce a meaningful 3D Secure result. To test authentication, create an order with one of PayPal's 3D Secure test cards and pass SCA_ALWAYS as the verification.method to force 3D Secure. Follow the payer-action link in the response (the sandbox approves the order when you visit it), then get the order and check its authentication_result.

United States cards for purchase flows
ScenarioVisaMastercardExpected authentication_result
Successful frictionless48687191968290385329879707824603liability_shift POSSIBLE, authentication_status Y
Failed frictionless48687191581300605329879769571910liability_shift NO, authentication_status N
Attempts stand-in frictionless48687195819207235329879715396727liability_shift POSSIBLE, authentication_status A
Unavailable frictionless48687190334825615329879705777613liability_shift NO, authentication_status U
Rejected frictionless48687190815641535319541865518409liability_shift NO, authentication_status R
Not available on lookup48687194886519675329879714462553liability_shift NO, enrollment_status U
Successful step-up (challenge)48687191661013685329879735316929liability_shift POSSIBLE, authentication_status Y
Failed step-up (challenge)48687191818955565329879768013724liability_shift NO, authentication_status N
Step-up unavailable48687195577185805329879734808405liability_shift NO, authentication_status U

Every scenario except "not available on lookup" also returns enrollment_status Y. PayPal lists the same scenarios with Discover, JCB, Diners and CUP cards for the US, and local cards for Great Britain, China, Australia, France, Germany, Italy, Japan, Mexico and Spain (not every country has every scenario), on its 3D Secure test scenarios page.

The cards above only work for purchases. Saving a card with 3D Secure through the Payment Method Tokens v3 API uses a separate set (for example 4000000000002701 for a successful no-challenge authentication on Visa), and those cards need an expiration month of 01 and a year three years from now. Don't mix the two sets: each only works for its own flow.

Forcing API errors with PayPal-Mock-Response

Some failures don't come from the card at all: a duplicate invoice ID, an authorization that can't be captured, a refund that's refused. To make the sandbox return one of those, add the PayPal-Mock-Response header to the call with the error code you want:

PayPal-Mock-Response: {"mock_application_codes": "DUPLICATE_INVOICE_ID"}

The header works on Orders API v2 calls (create, update, show, authorize, capture) and Payments API v2 calls (show, capture and void an authorization, show and refund a capture, show a refund). The codes you can mock are the ones in PayPal's Orders API and Payments API error message references. Without the header, the sandbox returns its real response.

What to test with them before going live

PayPal's own pre-launch checklist for card payments comes down to these flows, each run in the sandbox with a test card:

  1. Accept a payment: pay on your checkout page with a test card, confirm the order was processed, then log into the sandbox business account and check the payment shows in its activity.
  2. Decline a payment: repeat with a rejection trigger in the name field and check your page shows the decline message, and that the API response carries the matching processor response code.
  3. Authenticate with 3D Secure: use a 3D Secure test card with SCA_ALWAYS and check the authentication_result matches the scenario.
  4. Authorize and capture: create an order with intent AUTHORIZE, authorize it, capture the authorization and check the capture is COMPLETED.
  5. Void: authorize an order, then void the authorization before it's fully captured.
  6. Refund: refund a fully captured payment and check the response has a refund ID and status COMPLETED.

The order of those calls matters as much as the card. See PayPal capture, authorize and void flows in order processing and, for saved cards, PayPal advanced credit card payments and vaulting flow.

What PayPal test cards don't cover

A test card decides how one card payment ends. It doesn't make the sandbox behave like production:

Testing Stripe or Adyen as well? The equivalent lists are in Stripe test cards and Adyen test cards.

Frequently asked questions

What is the PayPal test credit card number?

PayPal publishes several. A common choice is the Visa 4012 8888 8888 1881, which it also suggests for decline testing. Use any future expiration date and any 3-digit CVV (4 digits for American Express), in sandbox mode only.

What expiry date and CVV do PayPal test cards use?

Any future expiration date and any 3-digit CVV, or a 4-digit CVV for American Express. The exception is the 3D Secure cards for saving payment methods, which need month 01 and a year three years from now.

How do I make a PayPal sandbox card payment decline?

Pay with a normal test card and enter a rejection trigger, such as CCREJECT-IF for insufficient funds, in the First Name or Name on Card field, or as the card name in an Orders API call. Triggers are case-sensitive.

Do PayPal test cards work in live mode?

No. They only work in the sandbox, with a sandbox client ID calling api-m.sandbox.paypal.com.

Sources

  1. PayPal: Card testing
  2. PayPal: 3D Secure test scenarios
  3. PayPal: Simulate negative responses with request headers
  4. PayPal: Sandbox accounts