Skip to main content
GET
/
v1
/
exchange
/
stablefx
/
trades
/
{tradeId}
Get a trade
curl --request GET \
  --url https://api.circle.com/v1/exchange/stablefx/trades/{tradeId} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.circle.com/v1/exchange/stablefx/trades/{tradeId}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.circle.com/v1/exchange/stablefx/trades/{tradeId}', 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.circle.com/v1/exchange/stablefx/trades/{tradeId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$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.circle.com/v1/exchange/stablefx/trades/{tradeId}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

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.circle.com/v1/exchange/stablefx/trades/{tradeId}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.circle.com/v1/exchange/stablefx/trades/{tradeId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "id": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5",
  "contractTradeId": "24",
  "rate": 0.915,
  "from": {
    "amount": "100.00"
  },
  "to": {
    "amount": "100.00"
  },
  "fee": "100.00",
  "createDate": "2023-01-01T12:04:05Z",
  "updateDate": "2023-01-01T12:04:05Z",
  "quoteId": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5",
  "collateral": "100.00",
  "settlementTransactionHash": "0xf97c6a87511583d5c7e8e72f8e1fe38bfd24350edda78fddbe67125f3cf0a122",
  "maturity": "2023-01-01T12:04:05Z",
  "completeDate": "2023-01-01T12:04:05Z",
  "signerAddress": "0xf0e7ccf7817b30fa0dd6bdeaea3ad54c140647b2",
  "contractTransactions": {
    "recordTrade": {
      "status": "success",
      "txHash": "0x522a01ed8750423ab213a3d4618f231e0984874509521e98977f017b452cd455",
      "errorDetails": "<string>"
    },
    "takerDeliver": {
      "status": "success",
      "txHash": "0x522a01ed8750423ab213a3d4618f231e0984874509521e98977f017b452cd455",
      "errorDetails": "<string>"
    },
    "makerDeliver": {
      "status": "success",
      "txHash": "0x522a01ed8750423ab213a3d4618f231e0984874509521e98977f017b452cd455",
      "errorDetails": "<string>"
    },
    "breach": {
      "status": "success",
      "txHash": "0x522a01ed8750423ab213a3d4618f231e0984874509521e98977f017b452cd455",
      "errorDetails": "<string>"
    }
  }
}

Authorizations

Authorization
string
header
required

Circle's API Keys are formatted in the following structure "PREFIX:ID:SECRET". All three parts are requred to make a successful request.

Path Parameters

tradeId
string<uuid>
required

The ID of the trade. System-generated unique identifier of the resource.

Example:

"c4d1da72-111e-4d52-bdbf-2e74a2d803d5"

Query Parameters

type
enum<string>
required

The type of trader.

Available options:
maker,
taker

Response

200 - application/json

Trade retrieved successfully

Detailed trade information including contract transactions

id
string<uuid>

System-generated unique identifier of the resource.

Example:

"c4d1da72-111e-4d52-bdbf-2e74a2d803d5"

contractTradeId
string

The ID of the trade on the contract.

Pattern: ^[0-9]+$
Example:

"24"

status
enum<string>
Available options:
pending,
complete,
confirmed,
pending_settlement,
taker_funded,
maker_funded,
refunded,
breaching,
breached
rate
number<double>

Exchange rate for the quote

Example:

0.915

from
object

Currency and amount details for a foreign exchange transaction

to
object

Currency and amount details for a foreign exchange transaction

fee
string

Trade fee charged to the requesting party (matching the type parameter — taker or maker), denominated in the to currency.

Pattern: ^\d+(?:\.\d{1,6})?$
Example:

"100.00"

createDate
string<date-time>

Date and time when the resource was created

Example:

"2023-01-01T12:04:05Z"

updateDate
string<date-time>

Date and time when the resource was last updated

Example:

"2023-01-01T12:04:05Z"

quoteId
string<uuid>

System-generated unique identifier of the resource.

Example:

"c4d1da72-111e-4d52-bdbf-2e74a2d803d5"

collateral
string

Collateral amount required for the trade, denominated in the from currency.

Pattern: ^\d+(?:\.\d{1,6})?$
Example:

"100.00"

settlementTransactionHash
string | null

The hash of the settlement transaction on-chain.

Pattern: ^0x[a-fA-F0-9]{64}$
Example:

"0xf97c6a87511583d5c7e8e72f8e1fe38bfd24350edda78fddbe67125f3cf0a122"

maturity
string<date-time> | null

The date when the trade has matured.

Example:

"2023-01-01T12:04:05Z"

tenor
enum<string>

The settlement schedule for the trade

Available options:
instant,
hourly,
daily
completeDate
string<date-time> | null

The time/date the trade was completed.

Example:

"2023-01-01T12:04:05Z"

signerAddress
string | null

The wallet address of the signer.

Example:

"0xf0e7ccf7817b30fa0dd6bdeaea3ad54c140647b2"

contractTransactions
object

Collection of contract functions associated with a trade