> ## Documentation Index
> Fetch the complete documentation index at: https://dev.moonpay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Test mode

> Use test mode to develop and test your integration without transferring real assets.

MoonPay provides a test mode for integration development and testing. Test mode uses testnet blockchains and simulated payments. No real assets are transferred.

## Enabling test mode

Test mode is determined by the API key you use when [creating a session](/api-reference/platform/endpoints/sessions/create). Use your **test API key** (`sk_test_...`) to enable test mode. Use your **live API key** (`sk_live_...`) for production.

You can find your API keys on the [Developers page](https://dashboard.moonpay.com/developers) in your MoonPay dashboard.

<Info>
  All frames and SDK methods automatically operate in test mode when initialized
  with a session token created using test API keys.
</Info>

## Test accounts

When creating test accounts:

* **KYC verification is simulated** - documents are not verified
* **We recommend using a US or UK address** for test accounts, as these work best with test payment cards
* You can skip document submission by clicking "Skip document submission" if prompted

## Test data

### Email addresses

You must use a real email address that you can access. MoonPay sends OTP codes for login verification, and there are no test bypass values.

<Note>You cannot reuse the same email address for different customers.</Note>

**Tip:** Use the `+` suffix pattern to create multiple unique addresses from a single inbox: `you+test1@example.com`, `you+test2@example.com`, etc.

### Phone numbers

You must use a real phone number that you can access. MoonPay sends OTP codes for verification, and there are no test bypass values.

<Note>
  A phone number can only be associated with one customer at a time. If you
  verify with the same phone number on a different customer, it will be removed
  from the previous customer.
</Note>

### SSN (US residents)

SSN values are not verified in test mode. You can enter any 9-digit value.

<Warning>
  Do not use your real Social Security number. Use a fake value like
  `123456789`.
</Warning>

## Test payment cards

Use the following test cards to simulate payments. **Do not enter real payment card information.** Use any valid 3-digit CVV and any future expiration date.

### US customers

| Card type   | Card number           | Expiration | CVV   |
| :---------- | :-------------------- | :--------- | :---- |
| Visa Credit | `4000 0200 0000 0000` | `12/2030`  | `100` |

### UK customers

| Card type   | Card number           | Expiration | CVV   |
| :---------- | :-------------------- | :--------- | :---- |
| Visa Credit | `4242 4242 4242 4242` | `12/2030`  | `100` |
| Visa Debit  | `4659 1055 6905 1157` | `12/2030`  | `100` |

### EU customers

| Card type             | Card number           | Expiration | CVV   |
| :-------------------- | :-------------------- | :--------- | :---- |
| Mastercard Debit (DE) | `5305 4847 4880 0098` | `12/2030`  | `100` |

### 3D Secure test cards

3D Secure (3DS) is an additional verification step the customer's bank may require during a card payment. The cards below trigger deterministic 3DS outcomes so you can test your [challenge handling](/guides/handling-challenges) end to end.

* **Frictionless** outcomes complete without any customer interaction.
* **Challenge** outcomes render a 3DS challenge frame the customer must complete or cancel.

<Note>
  When a card triggers a 3DS challenge, the simulator prompts for a password.
  Enter `Checkout1!` to complete the challenge.
</Note>

#### Frictionless

| Outcome   | Region  | Card type         | Card number           | Expiration | CVV   |
| :-------- | :------ | :---------------- | :-------------------- | :--------- | :---- |
| Succeeded | US      | Visa Credit       | `4485 0403 7153 6584` | `12/2030`  | `100` |
| Succeeded | EU (FR) | Visa Credit       | `4010 0562 0000 0018` | `12/2030`  | `100` |
| Succeeded | EU (FR) | Mastercard Credit | `5137 2100 0000 0018` | `12/2030`  | `100` |
| Failed    | EU (FR) | Visa Credit       | `4022 0501 0000 0000` | `12/2030`  | `100` |
| Failed    | EU (FR) | Mastercard Credit | `5132 5626 0000 0029` | `12/2030`  | `100` |

#### Challenge

| Outcome   | Region  | Card type         | Card number           | Expiration | CVV   |
| :-------- | :------ | :---------------- | :-------------------- | :--------- | :---- |
| Succeeded | US      | Mastercard Credit | `5385 3083 6013 5181` | `12/2030`  | `100` |
| Succeeded | EU (FR) | Visa Debit        | `4010 0617 0000 0021` | `12/2030`  | `100` |
| Succeeded | EU (FR) | Mastercard Credit | `5137 2100 0000 0158` | `12/2030`  | `100` |
| Failed    | US      | Visa Credit       | `4243 7542 7170 0719` | `12/2030`  | `100` |
| Failed    | EU (FR) | Visa Credit       | `4150 5610 0000 0027` | `12/2030`  | `100` |
| Failed    | EU (FR) | Mastercard Credit | `5341 0348 0000 0024` | `12/2030`  | `100` |

### Declined transactions

Use these cards to test error handling for different failure scenarios.

| Card number           | Expiration | CVV   | Decline reason           |
| :-------------------- | :--------- | :---- | :----------------------- |
| `4544 2491 6767 3670` | `12/2030`  | `100` | Insufficient funds       |
| `4897 4535 6848 5113` | `12/2030`  | `100` | Suspected fraud          |
| `4818 9242 5013 1070` | `12/2030`  | `100` | Restricted card          |
| `4556 2537 5271 2245` | `12/2030`  | `100` | Security violation       |
| `4095 2548 0264 2505` | `12/2030`  | `100` | Timeout / Internal error |
| `5437 8211 3539 9682` | `12/2030`  | `100` | Insufficient funds       |
| `5279 9884 0539 8834` | `12/2030`  | `100` | Restricted card          |
| `5265 1622 7058 7964` | `12/2030`  | `100` | Timeout / Internal error |
| `5363 4501 8040 2239` | `12/2030`  | `100` | Lost card                |

## Apple Pay

In test mode, the Apple Pay frame renders a mock Apple Pay button instead of the native Apple Pay UI. When a customer taps the mock button, a browser confirmation dialog (`window.confirm`) appears in place of the Apple Pay payment sheet:

* **Ok** simulates a successful transaction.
* **Cancel** simulates a failed transaction.

This lets you test the full Apple Pay flow without a real Apple Pay account or Safari-specific setup.

<Note>
  If you embed the Apple Pay frame in an iframe with a `sandbox` attribute,
  include `allow-modals` in the sandbox value. This allows `window.confirm` to
  work cross-origin inside the frame. See the [Apple Pay frame
  reference](/platform/frames/apple-pay#permissions) for details.
</Note>

## Triggering challenges

In test mode, you can force a [challenge](/platform/guides/handling-challenges) by setting the buy amount to a specific value. This lets you test how your integration renders and resolves a challenge without reproducing the real-world conditions that normally trigger one.

| Buy amount | Challenge        | Payment method     |
| :--------- | :--------------- | :----------------- |
| `48`       | Wallet ownership | Apple Pay and card |
| `49`       | CVV re-entry     | Card               |

The amount must match exactly. For example, a quote for `49` triggers the CVV challenge, but `49.01` does not. These triggers only apply in test mode and have no effect with a live API key.

<Note>
  Challenges are surfaced by a `challenge` event that points to the [challenge
  frame](/platform/frames/challenge). See [Handle
  challenges](/platform/guides/handling-challenges) for how to render and
  resolve one.
</Note>

## Supported testnets

Test mode supports the following tokens and testnets:

| Token         | Testnet  |
| :------------ | :------- |
| Bitcoin       | Testnet3 |
| Ethereum      | Sepolia  |
| ERC-20 tokens | Sepolia  |
| Solana        | Testnet  |
| Binance Coin  | Testnet  |
| TON           | Testnet  |
| Stellar       | Testnet  |
| Litecoin      | Testnet  |

<Note>
  ERC-20 token transfers in test mode use MoonPay's test token contract.
</Note>

[Quote requests](/api-reference/platform/endpoints/quotes/get) for assets that aren't available in test mode fail with a `400 invalid_request` error. Use an asset such as `SOL` or `ETH` when testing.

## Troubleshooting

### Common errors

| Error                                                                 | Cause                                               | Solution                                                                                            |
| :-------------------------------------------------------------------- | :-------------------------------------------------- | :-------------------------------------------------------------------------------------------------- |
| `Framing 'https://blocks.moonpay.com' violates "frame-ancestors" CSP` | Your app or website domain has not been allowlisted | Add domains at [https://dashboard.moonpay.com/developers](https://dashboard.moonpay.com/developers) |
