Square Sandbox Test Cards
Official test card numbers for Square Web Payments SDK, token generation, delayed capture, and card decline testing.
| Scenario / Test Goal | Test Card Number | Expiry | CVV | Expected Result | Verification |
|---|---|---|---|---|---|
| Success-state card (Visa) | 4111 1111 1111 1111 | Any future date | 111 | Generates a success-state payment token. CreatePayment is normally COMPLETED, or APPROVED when delayed capture is requested. | Verified against official source Recorded: 2026-09-16 Verified against the linked official provider documentation on 2026-09-16. |
| Success-state card (Mastercard) | 5105 1051 0510 5100 | Any future date | 111 | Generates a success-state payment token. CreatePayment is normally COMPLETED, or APPROVED when delayed capture is requested. | Verified against official source Recorded: 2026-09-16 Verified against the linked official provider documentation on 2026-09-16. |
| Card declined | 4000 0000 0000 0002 | Any future date | 111 | Generates a card-declined error when the payment token is processed by CreatePayment. | Verified against official source Recorded: 2026-09-16 Verified against the linked official provider documentation on 2026-09-16. |
| Card on file auth declined | 4000 0000 0000 0010 | Any future date | 111 | Card on file authorization declined. | Verified against official source Recorded: 2026-09-16 Verified against the linked official provider documentation on 2026-09-16. |
Using Square Sandbox Cards in Development
Square Sandbox provides official test card numbers to verify payments created with the Web Payments SDK and Payments API.
1. Configure Square Sandbox Credentials
Use your Square Sandbox Application ID and Sandbox Access Token from the Square Developer Dashboard. Point API requests to connect.squareupsandbox.com.
2. Enter Test Card Credentials
In the Web Payments SDK card element, enter official test cards from the table above. Use any future expiration date, CVV 111, and any valid postal code format.
3. Generate Payment Tokens
Calling card.tokenize() generates a test payment token (cnon:...) to pass to your backend CreatePayment endpoint.
4. Verify Payment Status & Declines
Success cards produce payment objects with status COMPLETED (or APPROVED for delayed capture). Decline cards trigger card-declined errors for checkout UI verification.
Related Payment Testing Tools & Resources
Gateway Sandbox Directory
Browse verified sandbox test cards, decline scenarios, and 3D Secure credentials for all major payment gateways.
Test Card Reference Guide
Understand the difference between synthetic test cards and official gateway sandbox cards.
Credit Card Validator
Validate card length, network prefix schemes, and Modulo 10 Luhn checksums locally.