curl --request POST \
--url https://api.sandbox.rails.wayex.com/v1/treasury/conversion-quotes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"externalReference": "<string>",
"sourceAmount": "<string>",
"destinationAmount": "<string>"
}
'import requests
url = "https://api.sandbox.rails.wayex.com/v1/treasury/conversion-quotes"
payload = {
"externalReference": "<string>",
"sourceAmount": "<string>",
"destinationAmount": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
externalReference: '<string>',
sourceAmount: '<string>',
destinationAmount: '<string>'
})
};
fetch('https://api.sandbox.rails.wayex.com/v1/treasury/conversion-quotes', 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://api.sandbox.rails.wayex.com/v1/treasury/conversion-quotes",
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([
'externalReference' => '<string>',
'sourceAmount' => '<string>',
'destinationAmount' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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://api.sandbox.rails.wayex.com/v1/treasury/conversion-quotes"
payload := strings.NewReader("{\n \"externalReference\": \"<string>\",\n \"sourceAmount\": \"<string>\",\n \"destinationAmount\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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://api.sandbox.rails.wayex.com/v1/treasury/conversion-quotes")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"externalReference\": \"<string>\",\n \"sourceAmount\": \"<string>\",\n \"destinationAmount\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.rails.wayex.com/v1/treasury/conversion-quotes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"externalReference\": \"<string>\",\n \"sourceAmount\": \"<string>\",\n \"destinationAmount\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"clientId": "<string>",
"externalReference": "<string>",
"source": {
"amount": "<string>",
"currency": "AUD",
"network": "ethereum"
},
"destination": {
"amount": "<string>",
"currency": "AUD",
"network": "ethereum"
},
"settlementNetwork": "ethereum",
"rate": "<string>",
"fee": {
"amount": "<string>",
"currency": "AUD",
"network": "ethereum"
},
"sourceDebit": {
"amount": "<string>",
"currency": "AUD",
"network": "ethereum"
},
"configurationId": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}Create a Treasury conversion quote
Creates an exact, short-lived quote to convert between AUD and an enabled stablecoin in this tenant account.
curl --request POST \
--url https://api.sandbox.rails.wayex.com/v1/treasury/conversion-quotes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"externalReference": "<string>",
"sourceAmount": "<string>",
"destinationAmount": "<string>"
}
'import requests
url = "https://api.sandbox.rails.wayex.com/v1/treasury/conversion-quotes"
payload = {
"externalReference": "<string>",
"sourceAmount": "<string>",
"destinationAmount": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
externalReference: '<string>',
sourceAmount: '<string>',
destinationAmount: '<string>'
})
};
fetch('https://api.sandbox.rails.wayex.com/v1/treasury/conversion-quotes', 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://api.sandbox.rails.wayex.com/v1/treasury/conversion-quotes",
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([
'externalReference' => '<string>',
'sourceAmount' => '<string>',
'destinationAmount' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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://api.sandbox.rails.wayex.com/v1/treasury/conversion-quotes"
payload := strings.NewReader("{\n \"externalReference\": \"<string>\",\n \"sourceAmount\": \"<string>\",\n \"destinationAmount\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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://api.sandbox.rails.wayex.com/v1/treasury/conversion-quotes")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"externalReference\": \"<string>\",\n \"sourceAmount\": \"<string>\",\n \"destinationAmount\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.rails.wayex.com/v1/treasury/conversion-quotes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"externalReference\": \"<string>\",\n \"sourceAmount\": \"<string>\",\n \"destinationAmount\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"clientId": "<string>",
"externalReference": "<string>",
"source": {
"amount": "<string>",
"currency": "AUD",
"network": "ethereum"
},
"destination": {
"amount": "<string>",
"currency": "AUD",
"network": "ethereum"
},
"settlementNetwork": "ethereum",
"rate": "<string>",
"fee": {
"amount": "<string>",
"currency": "AUD",
"network": "ethereum"
},
"sourceDebit": {
"amount": "<string>",
"currency": "AUD",
"network": "ethereum"
},
"configurationId": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}What this endpoint does
Creates an exact, short-lived quote to convert between AUD and an enabled stablecoin in this tenant account.When to use it
Create it after the user chooses a direction and source amount, then display its all-in rate, fee, source debit, destination amount, and expiry for review alongside the available source balance from the balances endpoint. The quote always returns the settlement network it was struck on; the console stores the returned quote ID internally.Before you call
Use a secret API key withtreasury:write. The pair must be enabled and the source amount must meet current limits. Converting AUD to a stablecoin requires settlementNetwork — the chain the purchased stablecoin is settled onto, and therefore the chain you will hold and withdraw it on. There is no default: omitting it fails with settlement_network_required, a chain Wayex cannot receive on fails with unsupported_asset_network, and a chain that differs from a route Wayex has pinned for that asset fails with conversion_route_conflict. Converting a stablecoin to AUD does not need the field — that direction routes by the balance you already hold, and a supplied value is only an override.
Money and balance effect
Creating a quote does not reserve or move money. The source wallet is checked and reserved only when the quote is accepted.States and completion
A quote is usable until its expiry. If it expires or no longer passes acceptance checks, create a fresh quote rather than altering it.Safe retries
Send a uniqueIdempotency-Key for the logical action. If the response is lost, retry the same payload with the same key; never create a new key merely because the first response timed out.
Read Conversions and withdrawals for the complete workflow.Authorizations
Send the same Wayex API key as Authorization: Bearer <key>.
Headers
A unique key for this logical action. Reuse the same key and identical payload when retrying after an unknown response.
8 - 255Body
AUD, USDC, USDT AUD, USDC, USDT 1Physical settlement network. REQUIRED when sourceAsset is AUD — the chain the purchased stablecoin is settled onto. Optional routing override when converting a stablecoin to AUD.
ethereum, base, arbitrum, optimism, polygon, bsc, avalanche, solana, tron The amount to convert, denominated in the source asset. Supply exactly one of sourceAmount / destinationAmount.
^\d+(\.\d+)?$The amount to receive, denominated in the destination asset — book an exact destination figure (e.g. AUD) and Wayex derives the required source amount. Supply exactly one of sourceAmount / destinationAmount.
^\d+(\.\d+)?$Response
111Show child attributes
Show child attributes
Show child attributes
Show child attributes
ethereum, base, arbitrum, optimism, polygon, bsc, avalanche, solana, tron ^\d+(\.\d+)?$Show child attributes
Show child attributes
Show child attributes
Show child attributes
1
