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

# Currency Conversion

This API is used to convert one currency to another.

### Request Body

```json theme={null}
{
  "key": "string", // Merchant key
  "hash": "string", // Calculated hash for request validation
  "from": "string", // Base currency code
  "to": "string" // Target currency code
}
```

### Responses

#### 200 OK

```json theme={null}
{
  "status": true,
  "conversion_rate": "number", // Conversion rate between the currencies
  "converted_amount": "number" // Converted amount
}
```

#### 400 Bad Request

```json theme={null}
{
  "status": false,
  "error": {
    "message": "string", // Error message
    "code": 400 // Error code
  }
}
```


## OpenAPI

````yaml POST /api/v1/currency/get
openapi: 3.1.0
info:
  title: Orchestration
  version: '1'
servers:
  - url: https://api.paytring.com
security:
  - sec0: []
paths:
  /api/v1/currency/get:
    post:
      summary: Currency Conversion
      operationId: currency-conversion
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - key
                - hash
                - from
                - to
              properties:
                key:
                  type: string
                  description: Merchant key, available in dashboard profile section
                hash:
                  type: string
                  description: >-
                    to be calculated by key sort of all non-object key values of
                    this request
                from:
                  type: string
                  description: base currency you want conversion to happen from
                to:
                  type: string
                  description: final currency you want conversion to happen to
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: '{}'
              schema:
                type: object
                properties: {}
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: |-
                    {
                        "status": false,
                        "error": {
                            "message": "Hash is not verified",
                            "code": 204
                        }
                    }
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                    default: true
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                        example: Hash is not verified
                      code:
                        type: integer
                        example: 204
                        default: 0
      deprecated: false
      security: []
components:
  securitySchemes:
    sec0:
      type: http
      scheme: basic

````