Skip to main content

Documentation

Get FX Rate

Retrieve a foreign exchange rate for conversion of currencies in payments and payouts.

The FX rate returned reflects the rate at that point in time. The FX rate may vary, depending on the time and the transaction details. The rate includes the FX markup fees.

Note

  1. In the sandbox, the FX rate is based on test data.

  2. This endpoint replaces the deprecated endpoint - GET /v1/rates/daily

    Rapyd will continue to support the deprecated endpoint until March 31, 2025.

    • action_type

    • Determines the type of transaction that the currency exchange applies to. One of the following:

      • payment

      • payout

    • amount

    • Amount of the currency exchange transaction, in units of the fixed_side currency. Decimal.

    • buy_currency

    • Defines the currency purchased in the currency exchange transaction. Three-letter ISO 4217 code.

    • date

    • The date when the rate is applicable. Today or earlier. Format: YYYY-MM-DD

    • fixed_side

    • Indicates whether the rate is fixed for the currency defined by buy_currency or sell_currency. One of the following:

      • buy

      • sell

    • sell_currency

    • Defines the currency sold in the currency exchange transaction. Three-letter ISO 4217 code.

  • /v1/fx_rates

  • Payment

  • curl -X get
    https://sandboxapi.rapyd.net/v1/fx_rates?action_type=payment&buy_currency=USD&sell_currency=EUR
    -H 'access_key: your-access-key-here'
    -H 'Content-Type: application/json'
    -H 'salt: your-random-string-here'
    -H 'signature: your-calculated-signature-here'
    -H 'timestamp: your-unix-timestamp-here'
    
  • {
        "status": {
            "error_code": "",
            "status": "SUCCESS",
            "message": "",
            "response_code": "",
            "operation_id": "aea11ec0-0d10-460a-81a9-d83d71620a9d"
        },
        "data": {
            "sell_currency": "USD",
            "buy_currency": "ISK",
            "fixed_side": "buy",
            "action_type": "payment",
            "rate": 128.1629678715,
            "date": "2024-06-15",
            "sell_amount": 7.8,
            "buy_amount": 1000
        }
    }
  • Payout

  • curl -X get
    https://sandboxapi.rapyd.net/v1/fx_rates?action_type=payout&buy_currency=USD&sell_currency=SGD
    -H 'access_key: your-access-key-here'
    -H 'Content-Type: application/json'
    -H 'idempotency: your-idempotency-parameter-here'
    -H 'salt: your-random-string-here'
    -H 'signature: your-calculated-signature-here'
    -H 'timestamp: your-unix-timestamp-here'
    
  • {
        "status": {
            "error_code": "",
            "status": "SUCCESS",
            "message": "",
            "response_code": "",
            "operation_id": "0c12bfeb-8b79-4f11-b522-0d09d84ba86f"
        },
        "data": {
            "sell_currency": "SGD",
            "buy_currency": "USD",
            "fixed_side": null,
            "action_type": "payout",
            "rate": 0.716238,
            "date": "2024-06-15",
            "sell_amount": null,
            "buy_amount": null
        }
    }