> 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/reference/test-cards.md).

# Test Cards Reference

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 redirect instructions such as `approval_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)
* [3D Secure Integration Guide](/rest-api/payments/3ds-integration.md)
* [Tokenization Guide](/rest-api/customers-and-saved-methods/tokenization-guide.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://plexo.gitbook.io/rest-api/reference/test-cards.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
