Guides • Manage Accounts
Test your flows with simulations (Sandbox only)
doc

Test your flows with simulations (Sandbox only)

Before pushing your solution to Production, you should test it in the Sandbox environment. We realise that certain flows involve interaction with third parties, which are not possible in the Sandbox environment. To facilitate testing of such flows, Revolut lets you simulate top-ups and transfer state updates in the Sandbox environment.

caution

These simulations are only available in the Sandbox environment.

Simulate a top-up

When testing certain flows, such as making payments, you need money in your test account. It might happen that in the testing process, you run out of that money and need to top up such an account.

To simulate an account top-up, send a POST request to the /sandbox/topup endpoint, including the following information in the body:

  • account_id: The ID of the account that you want to top up.
  • amount: The amount with which you want to top up the account. Maximum value is 10000 regardless of the currency.
  • currency: The currency of the account that you want to top up.
  • reference: A short description for your top-up. The default value is: Test Top-up.
  • state: The state to which the top-up should be set. Possible values are: pending, completed, reverted, failed. Default is completed.
curl -X POST https://sandbox-b2b.revolut.com/api/1.0/sandbox/topup \
-H "Authorization: Bearer <your access token>" \
--data @- << EOF
{
"account_id": "e042f1fe-f721-49cc-af82-db7a6c46944f",
"amount": 100,
"currency": "GBP"
"reference": "Test Top-up",
"state": "completed"
}

EOF

To see example requests and responses:

See the API reference: Simulate a transfer state update (Sandbox only)

Simulate a transfer state update

For certain flows involving transfers, when testing them end-to-end, you need to have the transfer state changed, for example to completed.

To simulate a transfer state change, send a POST request to the /sandbox/transactions/{id}/{action} endpoint, where:

  • id: The ID of the transfer whose state you want to update.

  • action: The transfer state modification that you want to perform. Possible transfer state modifications are:

    • complete: The transfer is successfully processed (and sometimes settled). The resulting state is completed.
    • revert: The transfer is reverted by the system or company, but not the user. The resulting state is reverted.
    • decline: The transfer is declined to the user for a good reason, such as insufficient balance, invalid merchant etc. The resulting state is declined.
    • fail: The transfer fails during initiation or completion. The resulting state is failed.

    All these resulting states are final and cannot be changed.

curl -X POST https://sandbox-b2b.revolut.com/api/1.0/sandbox/transactions/a6ea39d7-62c9-481c-8ba6-8a887a44c486/complete \
-H "Authorization: Bearer <your access token>"

To see example requests and responses:

See the API reference: Simulate an account top-up (Sandbox only)
Was this page helpful?