Skip to main content

Test Cards

Quick Reference

WhatSandbox test card behavior and simulation
WhyTest every payment scenario — approval, decline, timeout — without real money
Reading Time5 min
DifficultyBeginner
PrerequisitesAuthentication → Environment

Why test cards matter

Without systematic testingWith A55 test cards
You discover declines in production, from real customersYou simulate every outcome in sandbox before go-live
Edge cases (timeout, expired card, blocked card) are untestedOne digit change exercises any scenario
QA takes days of manual card swipingBatch-test 9 scenarios in a single script run
You don't know how your UI handles failuresYou see exactly what your error screens look like

How the simulator works

In sandbox, only the last digit of the card number controls the transaction outcome. The first 15 digits can be anything.

Rules:

  • Use any plausible 16-digit card number — only the last digit matters.
  • CVV: any 3 digits (e.g., 123).
  • Expiry: any future date in MM/YYYY (e.g., 12/2030).

Last-digit outcomes

Last digitStatusReturn codeMessageUse case
0, 1, 4Authorized4 or 6Operation completed successfullyHappy path — test successful payments
2Not authorized05Not authorizedGeneric decline — test error handling
3Not authorized57Expired cardTest expired-card UX
5Not authorized78Blocked cardTest blocked/fraud-flagged card
6Not authorized99TimeoutTest timeout handling and retries
7Not authorized77Canceled cardTest canceled-card UX
8Not authorized70Credit card problemsTest generic card error
9Random499Success or timeout (random)Chaos testing — verify resilience
Quick reference cards

Use these ready-made numbers — change only the last digit:

ScenarioCard number
Confirmed4024 0071 5376 3191
Declined4024 0071 5376 3192
Expired4024 0071 5376 3193
Blocked4024 0071 5376 3195
Timeout4024 0071 5376 3196

Step-by-step: test each scenario

1. Test a successful payment

curl -s -X POST https://sandbox.api.a55.tech/api/v1/bank/wallet/charge/ \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"wallet_uuid": "YOUR_WALLET_UUID",
"merchant_id": "YOUR_MERCHANT_UUID",
"payer_name": "Test User",
"payer_email": "test@example.com",
"payer_tax_id": "12345678909",
"payer_cell_phone": "+5511999999999",
"installment_count": 1,
"installment_value": 100.00,
"currency": "BRL",
"due_date": "2026-12-31",
"description": "Sandbox test — confirmed",
"type_charge": "credit_card",
"card_name": "TEST USER",
"card_number": "4024007153763191",
"card_expiry_month": "12",
"card_expiry_year": "2030",
"card_cvv": "123"
}'

2. Test a declined payment

Change only the last digit to 2:

Card: 4024007153763192  →  Return code 05 (Not authorized)

Your application should show an appropriate error message and let the user retry with a different card.

3. Test a timeout

Change the last digit to 6:

Card: 4024007153763196  →  Return code 99 (Timeout)

Your application should implement retry logic with exponential backoff and display a "please wait" state.


Batch-test all scenarios

Run all 9 scenarios in a single script to validate your error handling.

scenarios = [
("4024007153763190", "Confirmed (0)"),
("4024007153763191", "Confirmed (1)"),
("4024007153763192", "Declined (2)"),
("4024007153763193", "Expired card (3)"),
("4024007153763194", "Confirmed (4)"),
("4024007153763195", "Blocked card (5)"),
("4024007153763196", "Timeout (6)"),
("4024007153763197", "Canceled card (7)"),
("4024007153763198", "Card problems (8)"),
("4024007153763199", "Random (9)"),
]

for card_number, label in scenarios:
result = create_test_charge(token, card_number, f"Batch test — {label}")
print(f"{label:25s} → status={result.get('status', 'N/A'):15s} code={result.get('return_code', 'N/A')}")

Zero Auth in sandbox

The zero-auth endpoint (POST /api/v1/bank/wallet/zeroauth/) uses the same last-digit simulator as charges. Dedicated 3DS test cards take precedence when the card number matches exactly.

Prerequisite: zeroauth_enabled must be true on the merchant configuration. Contact your account manager to enable it.

Last digitis_validTypical codeUse case
0, 1, 4true00, 4, or 6Card passes validation
2false05Generic decline
3false57Expired / not permitted
5false78Blocked card
6false99Timeout / issuer unavailable
7false77Canceled card
8false70Insufficient funds / card problems
9Random4 or 99Chaos testing

The endpoint always returns HTTP 200 — inspect is_valid and code in the response body.

# Decline — last digit 2
curl -s -X POST https://sandbox.api.a55.tech/api/v1/bank/wallet/zeroauth/ \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"wallet_uuid": "YOUR_WALLET_UUID",
"holder_name": "TEST USER",
"card_number": "4024007153763192",
"expiry_month": "12",
"expiry_year": "2030",
"cvv": "123",
"brand": "visa"
}'

Expected: { "is_valid": false, "code": "05", ... }


Tokenization in sandbox

The tokenization endpoint (POST /api/v1/bank/wallet/tokenization/) follows the same last-digit simulator. Failures return HTTP 400 with card_tokenization_failed.

Prerequisite: tokenization_enabled must be true on the merchant configuration.

Last digitOutcomeHTTPUse case
0, 1, 4Success — returns token_uuid200Happy path
2, 5, 7, 8declined400Card rejected for enrollment
3not_eligible400Card not eligible (e.g. expired)
6retryable_error400Timeout — retry with backoff
9Random success or timeout200 or 400Chaos testing

Use 4024007153763191 in card.number for a successful tokenization. See Tokenize card for the full request shape.


Test the full validate → store → charge sequence:

Repeat with ...3192 at each step to verify your error handling for declines.


Important limitations

Sandbox ≠ production behavior
  • Sandbox return codes and messages are simulated. Production responses come from real issuers and networks — codes and messages will differ.
  • Never use real card numbers in sandbox. The simulator overrides outcomes based on the last digit regardless of PAN validity.
  • If your gateway requires a specific card format (e.g., BIN prefix), keep the last digit per the table above and adjust other digits to satisfy the gateway.
Supported flows in sandbox

The simulator supports authorization, capture (full and partial), cancellation, status checks, zero-auth, and tokenization. All follow the same last-digit rules (3DS test cards take precedence when matched).