POST
/
api
/
v1
/
currency
/
get
curl --request POST \
  --url https://api.paytring.com/api/v1/currency/get \
  --header 'Content-Type: application/json' \
  --data '{
  "key": "<string>",
  "hash": "<string>",
  "from": "<string>",
  "to": "<string>"
}'
"{}"

This API is used to convert one currency to another.

Request Body

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

Responses

200 OK

{
  "status": true,
  "conversion_rate": "number", // Conversion rate between the currencies
  "converted_amount": "number" // Converted amount
}

400 Bad Request

{
  "status": false,
  "error": {
    "message": "string", // Error message
    "code": 400 // Error code
  }
}

Body

application/json
key
string
required

Merchant key, available in dashboard profile section

hash
string
required

to be calculated by key sort of all non-object key values of this request

from
string
required

base currency you want conversion to happen from

to
string
required

final currency you want conversion to happen to

Response

200
application/json
200

The response is of type object.