Exchange Rate
Overview
The Yativo Exchange Rate API allows you to retrieve real-time exchange rates and calculate transaction fees for currency conversions with various payout methods. This endpoint generates quotes that are valid for 5 minutes and can be used to execute transactions through the deposit and payout endpoints.
Base URL
https://api.yativo.com/api/v1Authentication
Get Exchange Rate
Endpoint
POST /exchange-rateHeaders
Content-Type
string
Yes
Must be application/json
Authorization
string
Yes
Bearer token for authentication
Request Body Parameters
from_currency
string
Yes
Source currency code (ISO 4217)
to_currency
string
Yes
Target currency code (ISO 4217)
method_id
integer
Yes
Payout method identifier
method_type
string
Yes
Transaction type: "payin" or "payout"
amount
number
Yes
Amount to convert in the source currency
Example Request
curl --location 'https://api.yativo.com/api/v1/exchange-rate' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciO...' \
--data '{
"from_currency": "USD",
"to_currency": "USD",
"method_id": 21,
"method_type": "payout",
"amount": 406
}'Response Structure
Success Response (200 OK)
{
"status": "success",
"status_code": 200,
"message": "Request successful",
"data": {
"quote_id": "4a72ecf8-6c8a-4e38-9971-8aabe9f785ed",
"from_currency": "USD",
"to_currency": "USD",
"rate": "1.00000000",
"amount": "406.00000000",
"converted_amount": "1USD - 1.00000000 USD",
"payout_data": {
"total_transaction_fee_in_from_currency": "11.15000000",
"total_transaction_fee_in_to_currency": "11.15",
"customer_sent_amount": "406.00",
"customer_receive_amount": "406.00",
"customer_total_amount_due": "417.15"
},
"calculator": {
"total_fee": {
"wallet_currency": 11.15,
"payout_currency": 11.15,
"usd": 11.15
},
"total_amount": {
"wallet_currency": 417.15,
"payout_currency": 417.15
},
"amount_due": 417.15,
"exchange_rate": 1,
"adjusted_rate": 1,
"target_currency": "USD",
"base_currencies": ["USD"],
"debit_amount": {
"wallet_currency": 417.15,
"payout_currency": 417.15
},
"customer_receive_amount": {
"wallet_currency": 406,
"payout_currency": 406
},
"fee_breakdown": {
"float": {
"wallet_currency": 10.15,
"payout_currency": 10.15
},
"fixed": {
"wallet_currency": 1,
"payout_currency": 1
},
"total": 11.15
},
"PayoutMethod": {
"id": 21,
"method_name": "PayPal",
"country": "PER",
"currency": "USD",
"payment_method_code": null,
"cutoff_hrs_start": null,
"cutoff_hrs_end": null,
"base_currency": "USD",
"exchange_rate_float": "0",
"expiration_time": null
}
}
}
}Response Fields Explanation
Root level:
status: Status of the API call ("success"or"error")status_code: HTTP status codemessage: Human-readable message about the requestdata: Main response data object
Data object:
quote_id: Unique identifier for the quote (valid for 5 minutes)from_currency: Source currency codeto_currency: Target currency coderate: Base exchange rate (as string with 8 decimal places)amount: Original amount being convertedconverted_amount: Formatted conversion description
Payout data:
total_transaction_fee_in_from_currency: Total fees in source currencytotal_transaction_fee_in_to_currency: Total fees in target currencycustomer_sent_amount: Amount customer sendscustomer_receive_amount: Amount customer receives after feescustomer_total_amount_due: Total amount customer needs to pay
Calculator object (detailed breakdown):
Fee information:
total_fee: Total fees in wallet currency, payout currency, and USDfee_breakdown: Breakdown of fees into float and fixed components
Amount information:
total_amount: Total transaction amount in both currenciesamount_due: Total amount the customer owesdebit_amount: Amount to be debited from customer's accountcustomer_receive_amount: Final amount recipient receives
Rate information:
exchange_rate: Base exchange rateadjusted_rate: Exchange rate after adjustmentstarget_currency: Target currency for the transactionbase_currencies: Array of supported base currencies
Payout method:
id: Method identifiermethod_name: Display name (e.g., "PayPal")country: Country code where method is availablecurrency: Currency supported by this methodbase_currency: Base currency for this methodexchange_rate_float: Additional rate adjustmentcutoff_hrs_start/end: Processing time windows (if applicable)expiration_time: Rate validity period (if applicable)
Using the Quote ID
The quote_id returned in the response can be used to execute transactions within 5 minutes of generation.
Error Handling
The API returns standard HTTP status codes. Common error responses include:
400 Bad Request
{
"status": "error",
"status_code": 400,
"message": "Invalid request parameters",
"errors": ["Invalid currency code"]
}401 Unauthorized
{
"status": "error",
"status_code": 401,
"message": "Authentication failed"
}404 Not Found
{
"status": "error",
"status_code": 404,
"message": "Payout method not found"
}Usage Examples
Cross-Currency Exchange
curl --location 'https://api.yativo.com/api/v1/exchange-rate' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--data '{
"from_currency": "USD",
"to_currency": "EUR",
"method_id": 15,
"method_type": "payout",
"amount": 1000
}'Payin Transaction Quote
curl --location 'https://api.yativo.com/api/v1/exchange-rate' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--data '{
"from_currency": "GBP",
"to_currency": "USD",
"method_id": 8,
"method_type": "payin",
"amount": 500
}'Important Notes
Quote Validity: Quotes are valid for 5 minutes from generation
Rate Lock: Exchange rates are locked during the quote validity period
Two-Step Process: Generate quote first, then execute transaction using the quote_id
Method Consistency: Use the same method_id in both quote generation and transaction execution
Amount Matching: Ensure the amount in the execution request matches the quote amount
Rate Limits
Maximum 100 requests per minute per API key
Rate limit headers are included in all responses
Support
For API support and questions, contact: [email protected]
Last Updated: September 2025 API Version: v1