> ## Documentation Index
> Fetch the complete documentation index at: https://razorpay-881012b3.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch Forex Charges for Currency Conversion

> Fetch the converted amount for a currency pair using the Razorpay Forex Charges API. Learn about request parameters, authentication and expiry time.

<div style={{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"0.35rem 0.9rem",border:"1px solid rgba(128,128,128,0.28)",borderRadius:"0.5rem",padding:"0.45rem 0.75rem",margin:"0 0 1.25rem",fontSize:"0.875rem"}}>
  <span style={{fontWeight:600}}>Available in</span>
  <span>🇮🇳 India</span>
</div>

Use this endpoint to fetch the converted amount for a currency pair. The response also provides the time until which the foreign exchange rate is valid.

## Authentication

This endpoint supports Private Auth and Partner Auth. Use Basic Auth with the applicable key ID and key secret. Know more about [API authentication](/docs/api/authentication).

<RequestExample>
  ```bash Curl theme={null}
  curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
  -X GET "https://api.razorpay.com/v1/forex_charges?amount=1000000&base_currency=INR&conversion_currency=USD"
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "amount": 1000000,
    "base_currency": "INR",
    "conversion_currency": "USD",
    "converted_amount": 11388,
    "expiry_time": 1782363756
  }
  ```

  ```json Failure - Invalid Parameter theme={null}
  {
    "error": {
      "code": "BAD_REQUEST_ERROR",
      "description": "The amount must be an integer.",
      "source": "business",
      "step": null,
      "reason": "input_validation_failed",
      "metadata": {},
      "field": "amount"
    }
  }
  ```

  ```json Failure - Authentication theme={null}
  {
    "error": {
      "code": "BAD_REQUEST_ERROR",
      "description": "Authentication failed"
    }
  }
  ```
</ResponseExample>

## Query Parameters

<ParamField query="amount" type="integer" required>
  Amount to convert, in the smallest currency unit. For example, `1000000`.
</ParamField>

<ParamField query="base_currency" type="string" required>
  Currency of the amount you want to convert. For example, `INR`.
</ParamField>

<ParamField query="conversion_currency" type="string" required>
  Currency into which you want to convert the amount. For example, `USD`.
</ParamField>

## Response Parameters

<ResponseField name="amount" type="integer">
  Amount requested for conversion, in the smallest currency unit. For example, `1000000`.
</ResponseField>

<ResponseField name="base_currency" type="string">
  Currency of the amount requested for conversion. For example, `INR`.
</ResponseField>

<ResponseField name="conversion_currency" type="string">
  Currency into which the amount is converted. For example, `USD`.
</ResponseField>

<ResponseField name="converted_amount" type="integer">
  Converted amount after applying the foreign exchange rate, in the smallest currency unit. For example, `11388`.
</ResponseField>

<ResponseField name="expiry_time" type="integer">
  Unix timestamp at which the foreign exchange rate expires. For example, `1782363756`.
</ResponseField>

<api-errors>
  The amount must be an integer.

  * code: 400
  * description: The `amount` query parameter is a string, decimal number or another non-integer value.
  * solution: Pass the amount as a positive integer in the smallest currency unit.

  The **field name** is required.

  * code: 400
  * description: A mandatory query parameter is missing.
  * solution: Pass `amount`, `base_currency` and `conversion_currency` in the request.

  Currency is not supported.

  * code: 400
  * description: The `base_currency` or `conversion_currency` value is not supported for foreign exchange conversion.
  * solution: Pass supported three-letter currency codes in uppercase.

  Authentication failed.

  * code: 401
  * description: The API credentials in the request are invalid, inactive or do not have access to this API.
  * solution: Pass the applicable active key ID and key secret without extra spaces.
</api-errors>
