Business API
Exchange money
api
post
/exchange

Exchange money

Exchange money using one of these methods:

  • Sell currency: You know the amount of currency to sell. For example, you want to exchange 135.5 USD to some EUR.

    Specify the amount in the from object.

  • Buy currency: You know the amount of currency to buy. For example, you want to exchange some USD to 200 EUR.

    Specify the amount in the to object.

note

You must specify the amount field only once, either in the from object or in the to object.

For more information, see the guides: Exchange money.

Access Token

Each Business API request must contain an authorization header in the following format to make a call: Bearer <your_access_token>.

The access token will be obtained the first time you set up your application and has an expiration of 40 minutes. During setup, a refresh_token will also be obtained which allows to obtain a new access_token.

danger

Never share your client-assertion JWT (JSON web token), access_token and refresh_token with anyone, as these can be used to access your banking data and initiate transactions.

Access tokens can be issued with four security scopes and require a JWT (JSON Web Token) signature to be obtained:

  • READ: Permissions for GET operations.

  • WRITE: Permissions to update counterparties, webhooks, and issue payment drafts.

  • PAY: Permissions to initiate or cancel transactions and currency exchanges.

  • READ_SENSITIVE_CARD_DATA: Permissions to retrieve sensitive card details.

    caution

    If you enable the READ_SENSITIVE_CARD_DATA scope for your access token, you must set up IP whitelisting. Failing to do so will prevent you from accessing any Business API endpoint.

    IP whitelisting means that you must specify an IP or a set of IPs which will be the only IPs from which requests to the API will be accepted. To do so:

    1. Go to the Revolut Business web app settings -> APIs -> Business API.
    2. Select the corresponding API certificate.
    3. In Production IP whitelist, provide the IP(s) which should be whitelisted, and save.

To configure your JWT and obtain the refresh and first access tokens, complete the following steps:

  1. Sign up for a Revolut Business account
  2. Prepare your Sandbox environment
  3. Make your first API request

Request

Specify the exchange information

Request body
Body object

The details of the currency to exchange from.

The ID of the account to sell currency from.

Possible values: Value must match regular expression ^[A-Z]{3}$

ISO 4217 currency code in upper case.

The amount of currency. Specify only if you want to sell currency.

The details of the currency to exchange to.

The ID of the account to receive exchanged currency into.

Possible values: Value must match regular expression ^[A-Z]{3}$

ISO 4217 currency code in upper case.

The amount of currency. Specify only if you want to buy currency.

The reference for the exchange transaction, provided by you. It helps you to identify the transaction if you want to look it up later.

Possible values: <= 40 characters

The ID of the request, provided by you. It helps you identify the transaction in your system.

caution

To ensure that an exchange transaction is not processed multiple times if there are network or system errors, the same request_id should be used for requests related to the same transaction.

Response

Exchange operation details

Response body
Body object

The ID of the created transaction.

The type of the transaction. For money exchange, it is exchange.

The reason code when the state parameter of the transaction is declined or failed.

The date and time the transaction was created in ISO 8601 format.

The date and time the transaction was completed in ISO 8601 format.

Possible values: [created, pending, completed, declined, failed, reverted]

Indicates the transaction state. Possible values:

  • created: The transaction has been created and is either processed asynchronously or scheduled for a later time.
  • pending: The transaction is pending until it's being processed. If the transfer is made between Revolut accounts, this state is skipped and the transaction is executed instantly.
  • completed: The transaction was successful.
  • declined: The transaction was unsuccessful. This can happen for a variety of reasons, for example, insufficient account balance, wrong receiver information, etc.
  • failed: The transaction was unsuccessful. This can happen for a variety of reasons, for example, invalid API calls, blocked payments, etc.
  • reverted: The transaction was reverted. This can happen for a variety of reasons, for example, the receiver being inaccessible.
Was this page helpful?
Loading...