Skip to main content
POST
/
v1
/
exchange
/
stablefx
/
trades
Create a trade
curl --request POST \
  --url https://api-sandbox.circle.com/v1/exchange/stablefx/trades \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "idempotencyKey": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11",
  "quoteId": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5"
}'
{
  "id": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5",
  "contractTradeId": "24",
  "status": "pending",
  "rate": 0.915,
  "from": {
    "currency": "USDC",
    "amount": "<string>"
  },
  "to": {
    "currency": "USDC",
    "amount": "<string>"
  },
  "createDate": "2023-01-01T12:04:05Z",
  "updateDate": "2023-01-01T12:04:05Z",
  "quoteId": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5",
  "settlementTransactionHash": "0xf97c6a87511583d5c7e8e72f8e1fe38bfd24350edda78fddbe67125f3cf0a122"
}

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.

Body

application/json

Request body for creating a trade based on a previously generated quote

idempotencyKey
string<uuid>
required

Universally unique identifier (UUID v4) idempotency key. This key is utilized to ensure exactly-once execution of mutating requests. To create a UUIDv4 go to uuidgenerator.net. If the same key is reused, it will be treated as the same request and the original response will be returned.

Example:

"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11"

quoteId
string<uuid>
required

System-generated unique identifier of the resource.

Example:

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

Response

200 - application/json

Trade created successfully

A StableFX trade created from a quote.

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.

Example:

"24"

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

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

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"

settlementTransactionHash
string | null

The hash of the settlement transaction on-chain.

Example:

"0xf97c6a87511583d5c7e8e72f8e1fe38bfd24350edda78fddbe67125f3cf0a122"