Braintree test cards are the card numbers, payment method nonces, and amount triggers you use in a Braintree sandbox to simulate approvals, declines, and verification responses without moving real money. Send them through a sandbox client token flow, submit the charge with the API, and read the response object to confirm your integration handles every outcome.
Braintree Card Test Numbers for the Sandbox
Prerequisites
- A Braintree sandbox account, which has its own merchant ID and API keys
- Sandbox credentials: merchant ID, public key, private key
- A server SDK (Node, Python, PHP, Java, .NET, or Ruby)
- An endpoint on your server that returns a client token
- A test page that loads Drop-in UI or Hosted Fields
Charge a test card in the sandbox
- Initialize your server SDK with the sandbox merchant ID, public key, and private key.
- Request a client token for the customer record you want to test.
- Load Drop-in UI or Hosted Fields on a staging page with that client token.
- Enter a test card number, any future expiry date, and 123 as the CVV.
- Submit the form and capture the payment method nonce your client returns.
- Call the transaction sale method with that nonce, a test amount, and a unique order ID.
- Log the full response: status, processor response code, CVV result, and AVS result.
Card numbers that authorize in the sandbox
- 4111111111111111, Visa
- 5555555555554444, Mastercard
- 378282246310005, American Express
- 6011111111111117, Discover
- 3530111333300000, JCB
- 30569309025904, Diners Club
These values authorize in the sandbox only. Braintree rejects them in production, which makes them safe to commit to fixture files and staging scripts.
Simulate declines and verification failures
Test a successful charge first, then test the failure paths your support team will face. Amounts in the 2000.00 to 2999.99 range return a processor decline in the sandbox, so use 2001.00 for a decline case and a round number for the success case. For CVV and postal code failures, use the sandbox nonces listed on Braintree's Testing page instead of card numbers, because Braintree lets you inject nonces that represent a missing CVV, a failed postal code check, or a specific card brand. Read the processor response text, not just the boolean success flag, when you assert on results.
Verify before switching to production keys
- Confirm every decline path shows a customer-facing message and does not retry in a loop.
- Confirm your code stores the nonce, never the raw card number or CVV.
- Confirm webhook handlers accept sandbox dispute and settlement events.
- Replace sandbox credentials with production keys in environment variables, not in code.
- Remove test card numbers from any page that production users can reach.