Local-amount-in-usd

/info/local-amount-in-usd

You might want to get the value of an a currency amount in a USD, here is how to it, Chief 😉

GET https://live.chimoney.io/api/v0.1/info/local-amount-in-usd?originCurrency=NGN&amountInOriginCurrency=38120.2

Get the value of an a currency amount in a USD

Path Parameters

Headers

{
    // transaction detail
}

#Javascript FETCH

var myHeaders = new Headers();
myHeaders.append("X-API-Key", "API_KEY_FROM_DEV_PORTAL");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://live.chimoney.io/api/v0.1/info/local-amount-in-usd?originCurrency=NGN&amountInOriginCurrency=38120.2", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

#Python REQUESTS

import requests

url = "https://live.chimoney.io/api/v0.1/info/local-amount-in-usd?originCurrency=NGN&amountInOriginCurrency=38120.2"

payload={}
headers = {
  'X-API-Key': 'API_KEY_FROM_DEV_PORTAL'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

#PHP cURL

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://live.chimoney.io/api/v0.1/info/local-amount-in-usd?originCurrency=NGN&amountInOriginCurrency=38120.2',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'X-API-Key: API_KEY_FROM_DEV_PORTAL'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Yay! It's done.

Last updated