Exchange Calculate
Request Body
Name
Type
Description
{
"result": integer, // The result code indicates the success or failure of the request.
"message": string, // A message providing additional information about the result.
"rate": string, // The real-time exchange rate representing the number of units of `fromCurrency` equivalent to `toCurrency`.
"amount": string, // The amount you want to exchange
"toAmount": string // The amount you'll receive in your desired cryptocurrency.
}Example codes
curl -X POST https://api.oxapay.com/exchange/calculate \
-d '{
"amount": 12,
"fromCurrency": "USDT",
"toCurrency": "TRX"
}'<?php
$url = "https://api.oxapay.com/exchange/calculate";
$data = array(
"amount" => 12,
"fromCurrency" => "USDT",
"toCurrency" => "TRX"
);
$options = array(
'http' => array(
'header' => 'Content-Type: application/json',
'method' => 'POST',
'content' => json_encode($data),
),
);
$context = stream_context_create($options);
$response = file_get_contents($url, false, $context);
$result = json_decode($response);
var_dump($result);
?>Usage
Last updated