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/v1>

Authentication

All API requests require a Bearer token in the Authorization header.


Get Exchange Rate

Endpoint

POST /exchange-rate

Headers

Header Type Required Description
Content-Type string Yes Must be application/json
Authorization string Yes Bearer token for authentication

Request Body Parameters

Parameter Type Required Description
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