> For the complete documentation index, see [llms.txt](https://plexo.gitbook.io/rest-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://plexo.gitbook.io/rest-api/operations/testing/test-cards.md).

# Test cards

Use these cards in the testing environment to validate payment, tokenization, and 3DS flows.

## Overview

All examples in this page assume:

* Base URL: `https://api.testing.plexo.com.uy`
* HTTP Basic authentication
* Public payment creation through `POST /v1/payments`

## Successful Payment Cards

| Card Number        | Brand      | CVV          | Expiry          | Description                 |
| ------------------ | ---------- | ------------ | --------------- | --------------------------- |
| `4444333322221111` | VISA       | Any 3 digits | Any future date | Standard successful payment |
| `5555444433332222` | MASTERCARD | Any 3 digits | Any future date | Standard successful payment |
| `4507990000004905` | VISA       | Any 3 digits | Any future date | Uruguayan issuer            |
| `5588220000000006` | MASTERCARD | Any 3 digits | Any future date | Uruguayan issuer            |

Example request:

```json
{
  "merchantId": 12345,
  "referenceId": "test-success-1001",
  "invoiceNumber": "TEST-1001",
  "amount": {
    "total": 10000,
    "currency": "UYU"
  },
  "paymentMethod": {
    "source": "card",
    "card": {
      "number": "4444333322221111",
      "expMonth": 12,
      "expYear": 2028,
      "cvc": "123",
      "cardholder": {
        "firstName": "Test",
        "lastName": "User",
        "email": "test.user@example.com"
      }
    }
  },
  "capture": {
    "method": "automatic"
  }
}
```

## Decline Scenario Cards

| Card Number        | Brand | Expected Error       |
| ------------------ | ----- | -------------------- |
| `4000000000000002` | VISA  | `card_declined`      |
| `4000000000000010` | VISA  | `insufficient_funds` |
| `4000000000000028` | VISA  | `lost_card`          |
| `4000000000000036` | VISA  | `stolen_card`        |
| `4000000000000044` | VISA  | `expired_card`       |
| `4000000000000051` | VISA  | `invalid_cvv`        |
| `4000000000000069` | VISA  | `processing_error`   |
| `4000000000000077` | VISA  | `fraud_detected`     |

Decline example:

```json
{
  "merchantId": 12345,
  "referenceId": "test-decline-1001",
  "invoiceNumber": "TEST-DECLINE-1001",
  "amount": {
    "total": 10000,
    "currency": "UYU"
  },
  "paymentMethod": {
    "source": "card",
    "card": {
      "number": "4000000000000010",
      "expMonth": 12,
      "expYear": 2028,
      "cvc": "123",
      "cardholder": {
        "firstName": "Test",
        "lastName": "User"
      }
    }
  },
  "capture": {
    "method": "automatic"
  }
}
```

## 3D Secure Test Cards

These cards are useful when the selected merchant payment method has 3DS enabled.

| Card Number        | Brand      | Flow              | Expected Behavior                           |
| ------------------ | ---------- | ----------------- | ------------------------------------------- |
| `4000000000003055` | VISA       | Frictionless      | No redirect challenge                       |
| `4000000000003063` | VISA       | Challenge success | Returns redirect action, challenge succeeds |
| `4000000000003071` | VISA       | Challenge failure | Returns redirect action, challenge fails    |
| `5200000000003002` | MASTERCARD | Frictionless      | No redirect challenge                       |
| `5200000000003010` | MASTERCARD | Challenge success | Returns redirect action, challenge succeeds |

3DS example:

```json
{
  "merchantId": 12345,
  "referenceId": "test-3ds-1001",
  "invoiceNumber": "TEST-3DS-1001",
  "amount": {
    "total": 10000,
    "currency": "UYU"
  },
  "paymentMethod": {
    "source": "card",
    "card": {
      "number": "4000000000003063",
      "expMonth": 12,
      "expYear": 2028,
      "cvc": "123",
      "cardholder": {
        "firstName": "Test",
        "lastName": "User",
        "email": "test.user@example.com"
      }
    }
  },
  "browserDetails": {
    "ipAddress": "203.0.113.10",
    "userAgent": "Mozilla/5.0"
  },
  "capture": {
    "method": "automatic"
  },
  "callbackUrl": "https://merchant.example.com/callbacks/payments"
}
```

Inspect these fields in the response:

* `status`
* `actions` for 3DS redirect instructions with `rel = threeds_redirect_url`
* `threeDS` once the payment has been processed

## Tokenization Test Flow

To test tokenization with the public contract:

1. Create or reuse a customer
2. Save an instrument through a tokenization session or a payment with `paymentMethod.card.tokenizationSettings`
3. Read the saved token from `GET /v1/customers/{customerId}/payment-instruments`
4. Reuse that token in a new payment

Example recurring charge request:

```json
{
  "merchantId": 12345,
  "referenceId": "test-token-reuse-1001",
  "invoiceNumber": "TEST-TOKEN-1001",
  "customerId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "amount": {
    "total": 10000,
    "currency": "UYU"
  },
  "paymentMethod": {
    "source": "token",
    "paymentInstrument": {
      "token": "9b7f1c2e-4a3d-4e8b-9c1f-2d3e4f5a6b7c"
    }
  },
  "capture": {
    "method": "automatic"
  }
}
```

## PIX Test Data

For PIX flows in Brazil, use your configured testing merchant and the PIX-specific instructions in the wallet and processor guides. Validate the flow in the testing environment before switching to production.

## Important Notes

* Never use real cards in the testing environment
* Test cards do not work in production
* Treat testing callbacks and 3DS redirects as asynchronous flows and verify the final state through the API

## Related Resources

* [Testing Guide](/rest-api/operations/testing.md)
* [Cybersource 3DS test matrix](/rest-api/operations/testing/cybersource-3ds.md)
* [3D Secure Integration Guide](/rest-api/payments/3ds-integration.md)
* [Tokenization Guide](/rest-api/customers-and-saved-methods/tokenization-guide.md)
