Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Confirming quote

PATCH /api/public/v1/exchange/quotes/:id

Confirms a pending quote and executes the exchange at the quoted rate. A quote can be confirmed until its expiresAt, 30 seconds after creation. After that it returns exchange_quote_expired and you create a new quote. On success status becomes completed and the two exchange transactions, one debiting the charged account and one crediting the received account, are returned in included[]. The charged account must hold amountCharged at confirmation time.

Headers

Name
Value

Content-Type

application/vnd.api+json

Authorization

Bearer <api_key>

Path Parameters

Name
Type
Description

id

string

Quote ID.

cURL

curl -X "PATCH" "https://api.sandbox.txn.io/api/public/v1/exchange/quotes/f13501a9-cb6f-4789-acfc-fde88a6fe00c" \
     -H 'Content-Type: application/vnd.api+json' \
     -H 'Authorization: Bearer <api_key>'

Response

{
  "data": {
    "id": "f13501a9-cb6f-4789-acfc-fde88a6fe00c",
    "type": "exchangeQuotes",
    "attributes": {
      "expiresAt": "2026-11-01T13:27:36.958Z",
      "amountCharged": "100.0",
      "amountReceived": "110.606489",
      "rate": "0.89958555",
      "exchangeFee": "0.50",
      "exchangeFeeCurrency": "EUR",
      "rateCurrency": "EUR",
      "accountChargedId": "13a85b45-8543-41c7-b963-394d4ea128ae",
      "accountReceivedId": "e289de2b-37bd-4eff-b832-f754c31a2d95",
      "status": "completed",
      "amountChargedCurrency": "EUR",
      "amountReceivedCurrency": "USDT"
    },
    "relationships": {
      "exchangeOrder": {
        "data": {
          "type": "orders",
          "id": "6c255add-5123-4b2f-8bf8-f883217e680c"
        }
      },
      "transactions": {
        "data": [
          {
            "type": "transactions",
            "id": "2977adf1-ba61-41c9-935f-296ef9985c48"
          },
          {
            "type": "transactions",
            "id": "2105159b-7991-4908-88ae-6cee7a66e182"
          }
        ]
      },
      "author": {
        "meta": {
          "included": false
        }
      },
      "accountCharged": {
        "data": {
          "type": "accounts",
          "id": "13a85b45-8543-41c7-b963-394d4ea128ae"
        }
      },
      "accountReceived": {
        "data": {
          "type": "accounts",
          "id": "e289de2b-37bd-4eff-b832-f754c31a2d95"
        }
      }
    }
  },
  "included": [
    {
      "id": "6c255add-5123-4b2f-8bf8-f883217e680c",
      "type": "orders",
      "attributes": {
        "baseCode": "USDT",
        "quoteCode": "EUR",
        "quantity": "110.606489"
      }
    },
    {
      "id": "2977adf1-ba61-41c9-935f-296ef9985c48",
      "type": "transactions",
      "attributes": {
        "createdAt": "2026-11-01T13:27:07.762Z",
        "simplifiedState": "completed",
        "transactionType": "ExchangeTransaction",
        "amount": "-100.00",
        "currency": "EUR",
        "balance": null,
        "reference": null,
        "accountId": "13a85b45-8543-41c7-b963-394d4ea128ae"
      },
      "relationships": {
        "account": {
          "meta": {
            "included": false
          }
        },
        "transactionDetails": {
          "meta": {
            "included": false
          }
        },
        "author": {
          "meta": {
            "included": false
          }
        }
      }
    },
    {
      "id": "2105159b-7991-4908-88ae-6cee7a66e182",
      "type": "transactions",
      "attributes": {
        "createdAt": "2026-11-01T13:27:07.789Z",
        "simplifiedState": "completed",
        "transactionType": "ExchangeTransaction",
        "amount": "110.606489",
        "currency": "USDT",
        "balance": null,
        "reference": null,
        "accountId": "e289de2b-37bd-4eff-b832-f754c31a2d95"
      },
      "relationships": {
        "account": {
          "meta": {
            "included": false
          }
        },
        "transactionDetails": {
          "meta": {
            "included": false
          }
        },
        "author": {
          "meta": {
            "included": false
          }
        }
      }
    },
    {
      "id": "13a85b45-8543-41c7-b963-394d4ea128ae",
      "type": "accounts",
      "attributes": {
        "master": true,
        "currencyCode": "EUR",
        "label": "master",
        "bankReference": "BDR6421088115176062",
        "balance": "39261.07",
        "totalBalance": null,
        "bankWithdrawalAvailable": true,
        "bankDepositAvailable": true,
        "transferAvailable": true,
        "currencyType": "fiat"
      },
      "relationships": {
        "company": {
          "meta": {
            "included": false
          }
        },
        "networks": {
          "meta": {
            "included": false
          }
        },
        "txnBankCredentials": {
          "meta": {
            "included": false
          }
        }
      }
    },
    {
      "id": "e289de2b-37bd-4eff-b832-f754c31a2d95",
      "type": "accounts",
      "attributes": {
        "master": true,
        "currencyCode": "USDT",
        "label": "master",
        "bankReference": "BDR4180381621673581",
        "balance": "307028.827169",
        "totalBalance": null,
        "bankWithdrawalAvailable": false,
        "bankDepositAvailable": false,
        "transferAvailable": true,
        "currencyType": "crypto"
      },
      "relationships": {
        "company": {
          "meta": {
            "included": false
          }
        },
        "networks": {
          "meta": {
            "included": false
          }
        },
        "txnBankCredentials": {
          "meta": {
            "included": false
          }
        }
      }
    }
  ],
  "meta": {},
  "jsonapi": {
    "version": "1.0"
  }
}

Response Body

Name
Type
Description

data.id

string

Quote ID.

data.type

string

Entity type returned. Always exchangeQuotes.

data.attributes

object

A set of quote attributes.

data.attributes.amountCharged

string

Amount to be debited from your accountChargedId.

data.attributes.amountChargedCurrency

string

Account charged currency code.

data.attributes.amountReceivedCurrency

string

Account received cyrrency code.

data.attributes.amountReceived

string

Amount to be credited to your accountReceivedId.

data.attributes.rate

string

Exchange rate.

data.attributes.status

string

One of: pending, completed, expired, or failed. Note: A transaction with status failed can be updated to completed via a support request.

data.attributes.rateCurrency

string

Exchange rate currency code.

data.attributes.exchangeFee

string

Txn fee amount.

data.attributes.exchangeFeeCurrency

string

Fee currency code.

data.attributes.expiresAt

string

Quote expiry timestamp.

data.relationships.exchangeOrder

object

The order placed with the liquidity provider for this quote. data.type is orders; the entity is returned in included[].

data.relationships.transactions

array

The account transactions booked by the exchange: the debit on accountChargedId and the credit on accountReceivedId. data[].type is transactions; the entities are returned in included[]. Empty until the quote is confirmed and executed, and for quotes created by an invoice settlement, whose credit is booked on the invoice instead.

data.relationships.accountCharged

object

The account debited. data.type is accounts and data.id equals data.attributes.accountChargedId; the entity is returned in included[].

data.relationships.accountReceived

object

The account credited. data.type is accounts and data.id equals data.attributes.accountReceivedId; the entity is returned in included[].

data.relationships.author

object

Not expanded (meta.included is false).

included[].type(orders)

object

The order placed with the liquidity provider.

included[].type(orders).attributes.baseCode

string

Base currency of the traded pair, e.g. USDT for USDT/EUR. One of data.attributes.amountChargedCurrency and data.attributes.amountReceivedCurrency.

included[].type(orders).attributes.quoteCode

string

Quote currency of the traded pair: the other of the two.

included[].type(orders).attributes.quantity

string

Order size, always in baseCode: whichever of amountCharged and amountReceived is in the base currency.

included[].type(transactions)

object

One entry per balance movement, in the shape returned by Listing transactions: the debit on the charged account and the credit on the received account. Present only once the quote has executed.

included[].type(transactions).attributes.amount

string

amountCharged negated on the charged account; amountReceived on the received account.

included[].type(transactions).attributes.currency

string

Currency of that account.

included[].type(transactions).attributes.accountId

string

accountChargedId or accountReceivedId.

included[].type(transactions).attributes.transactionType

string

Always ExchangeTransaction.

included[].type(transactions).attributes.simplifiedState

string

Always completed: both transactions are booked when the order executes.

included[].type(transactions).attributes.balance

string

Always null here. The running balance is only computed by the transaction listings.

included[].type(transactions).attributes.reference

string

Always null for exchange transactions.

included[].type(transactions).attributes.createdAt

string

When the order executed.

included[].type(transactions).relationships

object

account, transactionDetails and author: not expanded (meta.included is false).

included[].type(accounts)

object

The two accounts involved (data.relationships.accountCharged and data.relationships.accountReceived). Same fields as Reading account; the ones most relevant here are listed below.

included[].type(accounts).attributes.currencyCode

string

data.attributes.amountChargedCurrency for the charged account, data.attributes.amountReceivedCurrency for the received account.

included[].type(accounts).attributes.label

string

Account label.

included[].type(accounts).attributes.master

boolean

true for the master account, false for a subaccount.

included[].type(accounts).attributes.balance

string

Account balance at the time of the request.

included[].type(accounts).attributes.currencyType

string

fiat or crypto.

included[].type(accounts).relationships

object

company, networks and txnBankCredentials: not expanded (meta.included is false).

Last updated