Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.yativo.com/llms.txt

Use this file to discover all available pages before exploring further.

Preview a currency swap. Returns the live rate and resulting amount without committing any funds. Use this to show customers a confirmation screen before calling /swap/process.
POST https://api.yativo.com/api/v1/swap/init
Requires Idempotency-Key header. The rate shown here is indicative — it is fetched live again at execution time. Execute /swap/process promptly after previewing.
from_currency
string
required
The source wallet currency code (ISO 4217), e.g. "USD", "EUR".
to_currency
string
required
The target wallet currency code (ISO 4217), e.g. "BRL", "MXN".
amount
number
required
Amount in the source currency to convert.
curl -X POST 'https://api.yativo.com/api/v1/swap/init' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: swap-init-001' \
  -d '{
    "from_currency": "USD",
    "to_currency": "BRL",
    "amount": 500
  }'
{
  "status": "success",
  "status_code": 200,
  "message": "Request successful",
  "data": {
    "from_currency": "USD",
    "to_currency": "BRL",
    "from_amount": "500.00",
    "to_amount": "2491.00",
    "exchange_rate": "4.9820",
    "fee": "5.00",
    "fee_currency": "USD"
  }
}