Skip to main content
A swap converts balance from one of your wallets to another, for example from your USD wallet to your USDC wallet. No beneficiary is involved, and the swap completes immediately. You can only swap between the currency pairs Yativo has enabled for your account. Each pair has its own rate, fees and amount limits.

How it works

The fee is charged in the source currency and deducted before conversion:
to_amount is rounded down to the destination currency’s decimal places. You need a wallet in the source currency. If you don’t have a wallet in the destination currency yet, Yativo creates it on your first swap into it.
Team members need the Wallets → view permission to list pairs, quote and view swaps, and Wallets → manage to run a swap.

List swap pairs

Returns every pair you can swap, with its current rate and fees.

Quote a swap

Prices a swap without moving money. Use it to show the fee and the amount you’ll receive before you confirm.
string
required
Currency of the wallet to debit, for example "USD".
string
required
Currency of the wallet to credit, for example "USDC". Must differ from from_currency.
number
required
Amount to swap, in from_currency, including the fee. Must be greater than 0.
A quote doesn’t reserve the rate or your balance. The swap uses the pair’s rate and fees at the moment you run it.

Run a swap

Debits the source wallet and credits the destination wallet in one step. If the credit fails, the debit is reversed. Takes the same body as Quote a swap, plus:
string
Alternative to the Idempotency-Key header, up to 100 characters.
Send a unique Idempotency-Key header. If you retry with the same key, you get the original swap back and no second swap runs.
Keep the reference. Use it to look the swap up later. Each swap also appears in your transaction history as two entries of type swap: the debit from the source wallet and the credit to the destination wallet.

List swaps

Returns your swaps, newest first, 10 per page. Use page and per_page to page through them.

Get a swap

string
required
The reference returned when you ran the swap.
Returns the same object as Run a swap, or 404 with Swap not found if the reference isn’t one of yours.

USDC wallet

Your USDC wallet funds corporate cards. You can swap into it from USD only, and you can’t swap out of it. A swap from USDC, or into USDC from any currency other than USD, fails with Invalid wallet selected.

Errors

Swap errors return 422 with a message in data.error, except a missing swap, which returns 404. A validation error, such as a missing field or to_currency equal to from_currency, returns the failing fields in data: