Get a Quote
curl --request POST \
--url https://access.utgl.io/v1/conversions/quote \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"accountId": "6a3176fe-7715-4fe0-a548-034912d7f800",
"pair": "USDC/HKD",
"idempotencyKey": "xeev1she5eegh9daiviethahchoo1muW",
"xid": "<string>",
"xmetadata": "<unknown>"
}
'import requests
url = "https://access.utgl.io/v1/conversions/quote"
payload = {
"amount": 123,
"accountId": "6a3176fe-7715-4fe0-a548-034912d7f800",
"pair": "USDC/HKD",
"idempotencyKey": "xeev1she5eegh9daiviethahchoo1muW",
"xid": "<string>",
"xmetadata": "<unknown>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 123,
accountId: '6a3176fe-7715-4fe0-a548-034912d7f800',
pair: 'USDC/HKD',
idempotencyKey: 'xeev1she5eegh9daiviethahchoo1muW',
xid: '<string>',
xmetadata: '<unknown>'
})
};
fetch('https://access.utgl.io/v1/conversions/quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://access.utgl.io/v1/conversions/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 123,
'accountId' => '6a3176fe-7715-4fe0-a548-034912d7f800',
'pair' => 'USDC/HKD',
'idempotencyKey' => 'xeev1she5eegh9daiviethahchoo1muW',
'xid' => '<string>',
'xmetadata' => '<unknown>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://access.utgl.io/v1/conversions/quote"
payload := strings.NewReader("{\n \"amount\": 123,\n \"accountId\": \"6a3176fe-7715-4fe0-a548-034912d7f800\",\n \"pair\": \"USDC/HKD\",\n \"idempotencyKey\": \"xeev1she5eegh9daiviethahchoo1muW\",\n \"xid\": \"<string>\",\n \"xmetadata\": \"<unknown>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://access.utgl.io/v1/conversions/quote")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"accountId\": \"6a3176fe-7715-4fe0-a548-034912d7f800\",\n \"pair\": \"USDC/HKD\",\n \"idempotencyKey\": \"xeev1she5eegh9daiviethahchoo1muW\",\n \"xid\": \"<string>\",\n \"xmetadata\": \"<unknown>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://access.utgl.io/v1/conversions/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 123,\n \"accountId\": \"6a3176fe-7715-4fe0-a548-034912d7f800\",\n \"pair\": \"USDC/HKD\",\n \"idempotencyKey\": \"xeev1she5eegh9daiviethahchoo1muW\",\n \"xid\": \"<string>\",\n \"xmetadata\": \"<unknown>\"\n}"
response = http.request(request)
puts response.read_body{
"quoteId": "<string>",
"baseCurrency": "<string>",
"baseAmount": 123,
"quoteCurrency": "<string>",
"quoteAmount": 123,
"rate": 123,
"expiresAt": "2023-11-07T05:31:56Z"
}Conversions
Get a Quote
Convert from one fungible asset to another and settle transactions without ever taking assets out of custody.
POST
/
conversions
/
quote
Get a Quote
curl --request POST \
--url https://access.utgl.io/v1/conversions/quote \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"accountId": "6a3176fe-7715-4fe0-a548-034912d7f800",
"pair": "USDC/HKD",
"idempotencyKey": "xeev1she5eegh9daiviethahchoo1muW",
"xid": "<string>",
"xmetadata": "<unknown>"
}
'import requests
url = "https://access.utgl.io/v1/conversions/quote"
payload = {
"amount": 123,
"accountId": "6a3176fe-7715-4fe0-a548-034912d7f800",
"pair": "USDC/HKD",
"idempotencyKey": "xeev1she5eegh9daiviethahchoo1muW",
"xid": "<string>",
"xmetadata": "<unknown>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 123,
accountId: '6a3176fe-7715-4fe0-a548-034912d7f800',
pair: 'USDC/HKD',
idempotencyKey: 'xeev1she5eegh9daiviethahchoo1muW',
xid: '<string>',
xmetadata: '<unknown>'
})
};
fetch('https://access.utgl.io/v1/conversions/quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://access.utgl.io/v1/conversions/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 123,
'accountId' => '6a3176fe-7715-4fe0-a548-034912d7f800',
'pair' => 'USDC/HKD',
'idempotencyKey' => 'xeev1she5eegh9daiviethahchoo1muW',
'xid' => '<string>',
'xmetadata' => '<unknown>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://access.utgl.io/v1/conversions/quote"
payload := strings.NewReader("{\n \"amount\": 123,\n \"accountId\": \"6a3176fe-7715-4fe0-a548-034912d7f800\",\n \"pair\": \"USDC/HKD\",\n \"idempotencyKey\": \"xeev1she5eegh9daiviethahchoo1muW\",\n \"xid\": \"<string>\",\n \"xmetadata\": \"<unknown>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://access.utgl.io/v1/conversions/quote")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"accountId\": \"6a3176fe-7715-4fe0-a548-034912d7f800\",\n \"pair\": \"USDC/HKD\",\n \"idempotencyKey\": \"xeev1she5eegh9daiviethahchoo1muW\",\n \"xid\": \"<string>\",\n \"xmetadata\": \"<unknown>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://access.utgl.io/v1/conversions/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 123,\n \"accountId\": \"6a3176fe-7715-4fe0-a548-034912d7f800\",\n \"pair\": \"USDC/HKD\",\n \"idempotencyKey\": \"xeev1she5eegh9daiviethahchoo1muW\",\n \"xid\": \"<string>\",\n \"xmetadata\": \"<unknown>\"\n}"
response = http.request(request)
puts response.read_body{
"quoteId": "<string>",
"baseCurrency": "<string>",
"baseAmount": 123,
"quoteCurrency": "<string>",
"quoteAmount": 123,
"rate": 123,
"expiresAt": "2023-11-07T05:31:56Z"
}Authorizations
BasicBearer
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
application/json
Amount of asset to trading
Side of trade, buying, or selling the base currency
Available options:
buy, sell Account ID
Example:
"6a3176fe-7715-4fe0-a548-034912d7f800"
Symbol of the pair to trade
Example:
"USDC/HKD"
Unique idempotency key for ensuring exactly-once execution of mutating requests.
Example:
"xeev1she5eegh9daiviethahchoo1muW"
External identifier, unique across all resources created under this account.
Was this page helpful?
⌘I

