Execute FX Quote
curl --request POST \
--url https://api.hopnow.io/v1/accounts/{account_id}/fx/quotes/{quote_id}/execute \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.hopnow.io/v1/accounts/{account_id}/fx/quotes/{quote_id}/execute"
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.hopnow.io/v1/accounts/{account_id}/fx/quotes/{quote_id}/execute', 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.hopnow.io/v1/accounts/{account_id}/fx/quotes/{quote_id}/execute",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-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"
"net/http"
"io"
)
func main() {
url := "https://api.hopnow.io/v1/accounts/{account_id}/fx/quotes/{quote_id}/execute"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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.hopnow.io/v1/accounts/{account_id}/fx/quotes/{quote_id}/execute")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hopnow.io/v1/accounts/{account_id}/fx/quotes/{quote_id}/execute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "<string>",
"account_id": "<string>",
"quote_id": "<string>",
"source_currency": "<string>",
"target_currency": "<string>",
"amount_type": "<string>",
"source_amount": "<string>",
"target_amount": "<string>",
"all_in_rate": "<string>",
"status": "<string>",
"trade_type": "<string>",
"executed_at": "<string>",
"note": "<string>",
"created": "<string>",
"updated": "<string>"
}Foreign Exchange
Execute FX Quote
Execute a foreign exchange quote to perform the currency conversion
POST
/
v1
/
accounts
/
{account_id}
/
fx
/
quotes
/
{quote_id}
/
execute
Execute FX Quote
curl --request POST \
--url https://api.hopnow.io/v1/accounts/{account_id}/fx/quotes/{quote_id}/execute \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.hopnow.io/v1/accounts/{account_id}/fx/quotes/{quote_id}/execute"
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.hopnow.io/v1/accounts/{account_id}/fx/quotes/{quote_id}/execute', 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.hopnow.io/v1/accounts/{account_id}/fx/quotes/{quote_id}/execute",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-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"
"net/http"
"io"
)
func main() {
url := "https://api.hopnow.io/v1/accounts/{account_id}/fx/quotes/{quote_id}/execute"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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.hopnow.io/v1/accounts/{account_id}/fx/quotes/{quote_id}/execute")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hopnow.io/v1/accounts/{account_id}/fx/quotes/{quote_id}/execute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "<string>",
"account_id": "<string>",
"quote_id": "<string>",
"source_currency": "<string>",
"target_currency": "<string>",
"amount_type": "<string>",
"source_amount": "<string>",
"target_amount": "<string>",
"all_in_rate": "<string>",
"status": "<string>",
"trade_type": "<string>",
"executed_at": "<string>",
"note": "<string>",
"created": "<string>",
"updated": "<string>"
}Path Parameters
string
required
The account’s external ID (starts with
acc_)string
required
The FX quote’s external ID (starts with
fxq_)Response
string
FX trade identifier (starts with
fxt_)string
Always returns
"fx_trade"string
Account ID
string
FX quote ID
string
Source currency code
string
Target currency code
string
Whether the amount is
source or targetstring
Source currency amount (decimal)
string
Target currency amount (decimal)
string
All-in exchange rate (decimal)
string
Trade status:
pending, completed, or failedstring
Type of trade (e.g.,
market)string
ISO 8601 timestamp when trade was executed
string
Optional note
string
ISO 8601 timestamp when created
string
ISO 8601 timestamp when last updated
Response Example
{
"id": "fxt_1234567890abcdef",
"object": "fx_trade",
"account_id": "acc_1234567890abcdef",
"quote_id": "fxq_1234567890abcdef",
"source_currency": "USD",
"target_currency": "EUR",
"amount_type": "source",
"source_amount": "1000.00",
"target_amount": "855.69",
"all_in_rate": "0.85569",
"status": "completed",
"trade_type": "market",
"executed_at": "2024-01-15T10:00:30Z",
"note": null,
"created": "2024-01-15T10:00:30Z",
"updated": "2024-01-15T10:00:30Z"
}
⌘I