> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.oppigames.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Conversion

> This API converts an amount from one currency to another; if no currency is provided, it converts to all supported currencies, and if no amount is provided, it defaults to 1 USD.

## Headers

<ParamField header="x-api-key" type="string" required>
  A unique identifier associated with operator calling API.
</ParamField>

<ParamField header="x-signature" type="string" required>
  A SHA256 HMAC signature generated using the request body and timestamp.
  Format: HMAC\_SHA256(JSON.stringify(data) + '|' + timestamp), signed using the provided secret key.
</ParamField>

<ParamField header="x-timestamp" type="string" required>
  An Unix timestamp (milliseconds) Used to verify the request’s freshness.
  Ensure the same value is used in signature generation.

  <Note>
    The signature will remain valid for only 5 minutes from the provided timestamp.
  </Note>
</ParamField>

<ParamField header="Content-Type" type="string" required>
  Must be set to `application/json`.
</ParamField>

## Request Body

<ParamField body="currency" type="string">
  The currency code for which the conversion is requested (e.g., "INR", "USD").\
  See the list of supported currencies <a href="introduction#currency-codes">here</a>.
</ParamField>

<ParamField body="amount" type="number">
  The amount to be converted.
</ParamField>

## Response

<ResponseField name="status" type="string" required>
  Code indicates status of the request whether it is succeeded or failed. We have listed error codes <a href="/introduction#error-codes">here</a>.
</ResponseField>

<Expandable title="data properties">
  <ResponseField name="data" type="array" required>
    List of currency conversion details.
  </ResponseField>

  <Expandable title="data properties">
    <ResponseField name="currencyCode" type="string" required>
      The currency code used for the conversion.
    </ResponseField>

    <ResponseField name="amount" type="number" required>
      The converted amount in the requested currency.
    </ResponseField>
  </Expandable>
</Expandable>

<ResponseExample>
  ```json SUCCESS theme={null}
  {
    "status": "RS_OK",
      "data": [
        {
          "currencyCode": "INR",
          "amount": 170
        },
        {
          "currencyCode": "EUR",
          "amount": 500
        }
      ]
  }
  ```

  ```json FAILURE theme={null}
  {
    "status": "RS_ERROR",
    "message": "Oops! Something went wrong. Please refresh the page or try again in a moment"
  }
  ```
</ResponseExample>
