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.
These simulations are only available in the Sandbox environment.
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:
10000
regardless of the currency.Test Top-up
.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:
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: