List FX Trades
curl --request GET \
--url https://api.hopnow.io/v1/accounts/{account_id}/fx/trades \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.hopnow.io/v1/accounts/{account_id}/fx/trades"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.hopnow.io/v1/accounts/{account_id}/fx/trades', 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/trades",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/trades"
req, _ := http.NewRequest("GET", 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.get("https://api.hopnow.io/v1/accounts/{account_id}/fx/trades")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hopnow.io/v1/accounts/{account_id}/fx/trades")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"items": [
{
"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>"
}
],
"page": 123,
"size": 123,
"total": 123,
"pages": 123
}Foreign Exchange
List FX Trades
Retrieve a paginated list of executed foreign exchange trades
GET
/
v1
/
accounts
/
{account_id}
/
fx
/
trades
List FX Trades
curl --request GET \
--url https://api.hopnow.io/v1/accounts/{account_id}/fx/trades \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.hopnow.io/v1/accounts/{account_id}/fx/trades"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.hopnow.io/v1/accounts/{account_id}/fx/trades', 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/trades",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/trades"
req, _ := http.NewRequest("GET", 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.get("https://api.hopnow.io/v1/accounts/{account_id}/fx/trades")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hopnow.io/v1/accounts/{account_id}/fx/trades")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"items": [
{
"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>"
}
],
"page": 123,
"size": 123,
"total": 123,
"pages": 123
}Path Parameters
string
required
The account’s external ID (starts with
acc_)Query Parameters
string
Filter trades created on or after this date (ISO 8601 format)
string
Filter trades created before this date (ISO 8601 format)
integer
default:"1"
Page number (minimum 1)
integer
default:"10"
Items per page (1-100)
Response
array
Array of FX trade objects
Show FX Trade Fields
Show FX Trade Fields
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
string
Trade status:
pending, completed, or failedstring
Type of trade (e.g.,
market)string
When trade was executed
string
Optional note
string
ISO 8601 timestamp
string
ISO 8601 timestamp
integer
Current page number
integer
Items per page
integer
Total number of items
integer
Total number of pages
Response Example
{
"items": [
{
"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"
}
],
"page": 1,
"size": 10,
"total": 1,
"pages": 1
}
⌘I