# Exchange rates

## Returns a converted amount.

> Returns a converted amount to the specified currency formatted as a string.

```json
{"openapi":"3.0.0","info":{"title":"x-gateway-external-api","version":"0.0.1"},"servers":[{"url":"https://api.xgateway.tech/api/v2"}],"security":[],"paths":{"/exchange/rate":{"get":{"operationId":"ConvertOneAsync","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppSuccessResponse_string_"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppErrorResponse"}}}},"422":{"description":"Unprocessable content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppValidationErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppErrorResponse"}}}}},"description":"Returns a converted amount to the specified currency formatted as a string.","summary":"Returns a converted amount.","tags":["Exchange"],"parameters":[{"description":"- The amount to convert (optional). Can be a number or string\nrepresentation. Defaults to `1`.","in":"query","name":"amount","required":false,"schema":{"default":"1"}},{"description":"- The currency to convert to/from (see the `direction` parameter).","in":"query","name":"target","required":true,"schema":{"$ref":"#/components/schemas/Currency"}},{"description":"- The currency to convert from/to (see the `direction` parameter).","in":"query","name":"source","required":true,"schema":{"$ref":"#/components/schemas/Currency"}},{"description":"- The direction to convert value. Defaults to\n`toTarget`.","in":"query","name":"direction","required":false,"schema":{"default":"toTarget","type":"string","enum":["toSource","toTarget"]}},{"description":"- The invoice id for fixed invoices rates.","in":"query","name":"invoiceId","required":false,"schema":{"type":"string"}}]}}},"components":{"schemas":{"AppSuccessResponse_string_":{"description":"The AppSuccessResponse object contains general information about the success execution.","properties":{"success":{"type":"boolean","default":true},"data":{"type":"string"}},"required":["success","data"],"type":"object","additionalProperties":false},"AppErrorResponse":{"description":"The AppErrorResponse object contains general information about the error message.","properties":{"success":{"type":"boolean","default":false},"errors":{"items":{"$ref":"#/components/schemas/IAppError"},"type":"array"}},"required":["success","errors"],"type":"object","additionalProperties":false},"IAppError":{"description":"The IAppError interface represents an application error message.","properties":{"code":{"anyOf":[{"$ref":"#/components/schemas/AppClientErrorResponseCode"},{"$ref":"#/components/schemas/AppServerErrorResponseCode"}]},"message":{"type":"string"}},"required":["code","message"],"type":"object","additionalProperties":false},"AppClientErrorResponseCode":{"type":"string","enum":["bad_request","db_violation","unauthorized","payment_required","forbidden","not_found","method_not_allowed","not_acceptable","proxy_authentication_required","request_timeout","conflict","db_unique_violation","gone","length_required","precondition_failed","payload_too_large","uri_too_long","unsupported_media_type","range_not_satisfiable","expectation_failed","misdirected_request","unprocessable_content","db_non_null_violation","locked","failed_dependency","upgrade_required","precondition_required","too_many_requests","request_header_fields_too_large","unavailable_for_legal_reasons"],"nullable":false,"description":"The AppClientErrorResponseCode object contains all client error response codes."},"AppServerErrorResponseCode":{"type":"string","enum":["internal_server_error","not_implemented","bad_gateway","service_unavailable","gateway_timeout","http_version_not_supported","variant_also_negotiates","insufficient_storage","loop_detected","not_extended","network_authentication_required"],"nullable":false,"description":"The AppServerErrorResponseCode object contains all server error response codes."},"AppValidationErrorResponse":{"description":"The AppValidationErrorResponse object contains general information about the validation error.","properties":{"success":{"type":"boolean","default":false},"errors":{"items":{},"type":"array"}},"required":["success","errors"],"type":"object","additionalProperties":false},"Currency":{"type":"string","enum":["USDC","USDT","BNB","bUSDT","BTC","ETH","eUSDC","eUSDT","FTN","POL","pUSDC","SOL","sUSDT","TRX","tUSDC","tUSDT","wpUSDC","wpUSDT","EUR","GBP","AZN","BDT","INR","JPY","PKR","RUB","TRY","UZS","AUD","BRL","CAD","CHF","CZK","DKK","KES","NOK","NZD","SEK","USD"],"description":"Represents all currencies in the payment processing system.\n\nUsed to specify the currency of accounts, exchange rates, and transactions in the payment\nprocessing system.\n\nIt provides a controlled and standardized list of supported currencies for all transactions and\nbalances in the payment processing system.\n\nNew currencies can be added to the payment processing system as additional members.\n\nSupported cryptocurrencies:\n- `BNB` - Binance Coin\n- `bUSDT` - Tether (pegged to USD), issued on BNB Smart Chain network (BEP20 token)\n- `BTC` - Bitcoin\n- `ETH` - Ether\n- `eUSDC` - USD Coin (pegged to USD), issued on Ethereum network (ERC20 token)\n- `eUSDT` - Tether (pegged to USD), issued on Ethereum network (ERC20 token)\n- `FTN` - Fasttoken\n- `POL` - POL\n- `pUSDC` - USD Coin (pegged to USD), issued on Polygon network (ERC20 token)\n- `SOL` - SOL\n- `sUSDT` - Tether (pegged to USD), issued on Solana network (SPL token)\n- `TRX` - Tronix (native coin), issued on Tron network\n- `tUSDC` - USD Coin (pegged to USD), issued on Tron network (TRC20 token)\n- `tUSDT` - Tether (pegged to USD), issued on Tron network (TRC20 token)\n- `wpUSDC` - wrapped USD Coin (pegged to USD), issued on Polygon network (ERC20 token)\n- `wpUSDT` - wrapped Tether (pegged to USD), issued on Polygon network (ERC20 token).\n\nSupported fiat currencies:\n- `AZN` - Azerbaijani Manat\n- `BDT` - Bangladeshi Taka\n- `EUR` - Euro\n- `GBP` - Pound Sterling\n- `INR` - Indian Rupee\n- `JPY` - Japanese Yen\n- `KES` - Kenyan Shilling\n- `PKR` - Pakistani Rupee\n- `RUB` - Russian Ruble\n- `TRY` - Turkish Lira\n- `USD` - United States Dollar\n- `UZS` - Uzbekistani Som."}}}}
```
