Skip to main content
Currency swap lets you convert funds between any two currency wallets you hold in your Yativo account — for example, moving USD to BRL, EUR to MXN, or CLP to USD — without sending to an external beneficiary. The flow is two steps: first initiate to preview the rate and terms, then process to execute the conversion and move the balance.

How it works

Both wallets must exist before swapping. Create missing wallets with POST /wallet/create.

Step 1: Initiate Swap

Preview the exchange rate and resulting converted amount before committing.
Requires Idempotency-Key header.
string
required
The source wallet currency code (ISO 4217), e.g. "USD", "EUR".
string
required
The target wallet currency code (ISO 4217), e.g. "BRL", "MXN", "CLP".
number
required
Amount in the source currency to convert.

Step 2: Process Swap

Execute the conversion. Funds are debited from the from_currency wallet and credited to the to_currency wallet at the live rate.
Requires Idempotency-Key header. Use a new, unique key for the process step — reusing the init key will be rejected.
string
required
The source wallet currency code.
string
required
The target wallet currency code.
number
required
Amount in the source currency to convert.
string
Optional description for this swap, recorded on the transaction record.

Full example

Node.js — complete swap flow

Notes

  • Both wallets must exist before swapping. Create them with POST /wallet/create if needed.
  • The live rate is fetched at execution time — rates are not locked between /init and /process. Use /init to show the customer a preview, then execute /process promptly.
  • Swaps are recorded as currency_swap transactions and appear in your transaction history.
  • Check available wallet balances with GET /wallet/balance before initiating.