# Set up test environment

**Create a Sandbox account, get your test keys, and point your integration at Sandbox - whatever you're building.**

Whatever you're building, Sandbox gives you a safe place to rehearse: try payment links with test data, run test checkouts in your plugin, or exercise your API calls - all without touching real money. The [Revolut Business Sandbox environment](https://sandbox-business.revolut.com/) mirrors Production with test data.

:::warning
The Sandbox and Production accounts are **not connected** in any way - make sure you use the appropriate credentials and API keys for each. See [Environments](/docs/guides/merchant/test-and-go-live/environments).
:::

## How it works

Setting up your test environment takes one of two paths:

- ![Build with API]
  When you signed up through the [API Console](https://developer.revolut.com/console), a Sandbox account was created for you - you'll find your Sandbox login credentials and your API keys in the Console, see [Get started with the API Console](/docs/guides/api-console/get-started).
  
  This page picks up from there: [Get API keys](#get-api-keys), then [Point integration at Sandbox](#point-integration-at-sandbox) - building your integration around a single environment switch you'll flip when you [go live](/docs/guides/merchant/test-and-go-live/go-live).

- ![Dashboard only]
  [Create Sandbox account](#create-sandbox-account) manually, then explore the dashboard - payment links, subscriptions, invoices - with test data. No API keys or code needed.

### Before you begin

Run through these checks before you start - they decide which parts of this page apply to you:

- [ ] **Know your path** - building with the API or connecting a plugin that uses an API key, or exploring the dashboard only? The tabs above show which sections you should follow.
- [ ] **A working email address and phone number** - that's all you need to create an account, from the [API Console](https://developer.revolut.com/console) if you're building, or [directly in Sandbox](#create-sandbox-account) if you're not.
- [ ] **If you're building - a dual-environment setup** - decide where your app keeps the base URL and API key config for each environment, so the Sandbox and Production pairs can't mix. See [Point integration at Sandbox](#point-integration-at-sandbox).
- [ ] **If your server allowlists incoming traffic** - get ready to allowlist the [Sandbox webhook IPs](/docs/guides/merchant/test-and-go-live/environments.md#webhooks) alongside your Production ones.

## Implement your test environment

Work through the sections your path needs:

### Create Sandbox account

On the [Dashboard only](#how-it-works) path, this is your only step: create your Sandbox account here, then skip the rest of the steps - no keys to fetch, no development environments to point anywhere.

:::note [Building with the API, or connecting a plugin that uses an API key?]
Signing up through the [API Console](https://developer.revolut.com/console) already created your Sandbox account - [skip to your API keys](#get-api-keys).
:::

Here's how to get started:

1. **Register:** Visit the [Revolut Business Sandbox sign-up page](https://sandbox-business.revolut.com/signup) and register a new account.
1. **Provide details:** Fill in the necessary details to create your account.
   - If you're unsure about which option to choose as **Legal business type**, select **Public Limited Company**. Freelancer accounts are not supported in Revolut Business.
   - When you see the pop-up about verification email, click the **Skip email verification** button in the top right corner.
   - When asked for a confirmation code, click the **Autofill code** button above the input field.

1. **Automatic approval:** Unlike the Production environment, where account verification and approval might take some time, Sandbox account approvals are automatic. This lets you jump straight into testing without any delays.
1. **Log in:** Once the registration is complete, you can start using your account. These account credentials are unique to the Sandbox environment and cannot be used in the Production environment.

:::warning
**We don't send confirmation emails or SMS in the Sandbox environment.**

Instead, the Sandbox environment offers **helper buttons** to let you proceed when approval or confirmation is needed.
:::

![Sandbox registration](/img/accept-payments/get-started/sandbox-registration.mp4)

:::tip
If you encounter any issues during Sandbox registration, try creating another account.
:::

### Get API keys

Building with the API, or connecting a plugin that uses an API key? This step happens entirely in the [API Console](https://developer.revolut.com/console) - the Console guides cover the mechanisms, and your Sandbox account comes with everything you need:

- [Get started with the API Console](/docs/guides/api-console/get-started) - create your account and choose **Sandbox**: a Revolut Business Sandbox account is created for you, and it includes a pre-generated full-access API key.
- [Test your integration with Revolut Sandbox](/docs/guides/api-console/test-with-sandbox) - open the Sandbox app and log in with your Sandbox credentials from API Console.
- [Create an API key](/docs/guides/api-console/create-key) - when you need more keys or different permissions.

### Point integration at Sandbox

The final step of the build path: point whatever you've built - a plugin, or your custom integration - at Sandbox.

:::info
Only [**test cards**](/docs/guides/merchant/test-and-go-live/testing/test-cards) will work in the Sandbox environment. For full payment-flow test scenarios (Revolut Pay, Google Pay, and error cases), see [Test payment flows](/docs/guides/merchant/test-and-go-live/testing/test-flows). For 3D Secure (3DS) scenarios, see [3DS simulator](/docs/guides/merchant/test-and-go-live/testing/3ds-simulator).
:::

#### Plugins

If you have installed one of our no-code plugins, you can test payments by changing the mode of the plugin to **Sandbox mode** (or **Test mode** in some cases) and, if your plugin connects with an API key, providing your **Sandbox API key** from the [API Console](#get-api-keys) in the configuration. 

:::info
For the configuration of each plugin, see [Revolut Gateway plugins](/docs/guides/merchant/accept-payments/no-code/plugins/introduction).
:::

#### API

Most integrations run on two layers: your backend calls the Merchant API to create orders and manage payments, and your checkout initialises a Revolut SDK to render the payment method for your customer. Some flows run on the API alone. Point both layers at Sandbox through a single environment switch in your app - one config value that selects the Sandbox or Production pair across your base URL, API key, and SDK mode. Flip it once, and your whole integration moves:

##### Server-side calls

Keep the base URL and API key for each environment in your app's config - never inline - and load the pair that matches the switch:

- ```ini [.env.sandbox]
  REVOLUT_MERCHANT_API_BASE_URL=https://sandbox-merchant.revolut.com/
  REVOLUT_MERCHANT_API_KEY=r_test_...
  ```

- ```ini [.env.production]
  REVOLUT_MERCHANT_API_BASE_URL=https://merchant.revolut.com/
  REVOLUT_MERCHANT_API_KEY=r_prod_...
  ```

The pairs never mix: your Sandbox API key only works against the Sandbox base URL, and your Production key only against live endpoints. Secret keys carry their environment in the prefix - `r_test_...` for Sandbox, `r_prod_...` for Production - but public keys look the same in both environments.

##### Checkout SDKs

Every Revolut SDK has its own environment switch - initialise it from the same config, using the public key from the matching account in the API Console: Sandbox key with `sandbox` mode, Production key with `prod`:

- ```ts [checkout.ts]
  // Token-based initialisation - mode is a positional argument (default: 'prod')
  await RevolutCheckout('order_token_here', 'sandbox')

  // Payments module - mode is part of the options object
  await RevolutCheckout.payments({ publicToken: 'pk_...', mode: 'sandbox' })
  ```

- ```kotlin [MainActivity.kt]
  val configuration = RevolutPaymentsSDK.Configuration(
      merchantPublicKey = "pk_...",
      environment = Environment.SANDBOX
  )
  ```

- ```swift [AppDelegate.swift]
  RevolutPaymentsSDK.configure(
      with: .init(
          merchantPublicKey: "pk_...",
          environment: .sandbox
      )
  )
  ```

With the switch in place, [going live](/docs/guides/merchant/test-and-go-live/go-live) is a flip, not a rewire: switch the base URL, the API key, and the SDK mode to Production all at once.

## What's next

- [:Workflow: Environments](/docs/guides/merchant/test-and-go-live/environments 'The two setups - Sandbox and Production - and what belongs in each')
- [:Card: Test cards](/docs/guides/merchant/test-and-go-live/testing/test-cards 'The full list of Sandbox test cards and their outcomes')
- [:CardSecurity: 3DS simulator](/docs/guides/merchant/test-and-go-live/testing/3ds-simulator 'How the simulated 3DS challenge page works and how to complete or automate it')
- [:Timeline: Test payment flows](/docs/guides/merchant/test-and-go-live/testing/test-flows 'Walk through checkout flows in Sandbox - payment links, Revolut Pay, and Google Pay')
- [:Questionnaire: Sandbox test scenarios](/docs/guides/merchant/test-and-go-live/testing/sandbox-test-scenarios 'The order, refund, and webhook scenarios every backend should handle')
- [:Rocket: Go live](/docs/guides/merchant/test-and-go-live/go-live 'Switch to Production and verify your first live payment')