Txn.pro - API Documentation
Sandbox LoginChangelogStatus Page
  • Getting setup
    • Environments
    • Creating a Sandbox account
    • Back office user roles
    • Creating your API keys
    • Postman collection
  • API Basics
    • API specification
    • API status
    • Supported currencies
    • Date and time format
    • Authenticating the API
    • Webhooks
      • Verifying webhooks
      • Source IP addresses
      • Retrying schedule
    • Rate limits
  • Hosted pages
  • Accounts
    • Accounts concept
    • Listing accounts
    • Reading account
    • Listing account addresses
    • Creating account address
    • Listing account transactions
    • Reading account transaction
  • Exchange
    • Exchange concept
    • Supported currency pairs
    • Reading exchange rates
    • Exchange webhooks
    • Creating quote
    • Confirming quote
  • Invoices
    • Invoices concept
    • Invoice status flow
    • Invoices in cashier
    • Invoice limitations
    • Listing invoice currency pairs
    • Invoice webhooks
    • Creating invoice
    • Reading invoice
    • Listing invoices
    • Invoice refunds
  • Payouts
    • Payouts concept
    • Payout status flow
    • Payout limitations
    • Listing payout currency pairs
    • Validating addresses
    • Payout webhooks
    • Creating payout
    • Reading payout
    • Listing payouts
  • Mass Payouts
  • PAYMENT LINKS
    • Payment links concept
    • Creating payment link
    • Expiring payment link
    • Reading payment link
    • Listing payment links
  • CHANNELS
    • Channels concept
    • Channels deposit flow
    • Listing channel currency pairs
    • Channel webhooks
    • Creating channel
    • Reading channel
    • Updating channel
    • Listing channels
    • Listing channel deposits
    • Reading channel deposit
  • (BETA) Fiat Settlements
    • Important information
    • Bank withdrawal webhooks
    • Bank deposit webhooks
    • Listing bank accounts
    • Reading bank account
    • Previewing bank withdrawal
    • Creating bank withdrawal
    • Listing bank withdrawals
    • Reading bank withdrawal
    • Listing bank deposits
    • Reading bank deposit
Powered by GitBook
On this page
  1. Exchange

Creating quote

Create quote

POST /api/public/v1/exchange/quotes

This endpoint creates quotes.

Headers

Name
Value

Content-Type

application/vnd.api+json

Authorization

Bearer <api_token>

Body

Name
Type
Description

data

object

Object with exchange request data.

data.type

string

Exchange request type. Always quotes.

data.attributes

object

A set of exchange request attributes.

data.attributes.accountChargedId

string

data.attributes.accountReceivedId

string

data.attributes.amount

number

Exchange amount.

data.attributes.amountCurrency

string

Exchange amount currency. Can be the currency associated with the accountCharged or accountReceived.

Request JSON

{
  "data": {
    "type": "quotes",
    "attributes": {
      "accountChargedId": string,
      "accountReceivedId": string,
      "amount": number,
      "amountCurrency": string
    }
  }
}

Response

{
  "data": {
    "id": "0592492e-0088-446c-98fa-7149c8734939",
    "type": "exchangeQuotes",
    "attributes": {
      "expiresAt": "2024-07-01T14:12:08.475Z",
      "amountCharged": "59.47",
      "amountReceived": "0.001",
      "rate": "58880.0",
      "exchangeFee": "0.59",
      "exchangeFeeCurrency": "EUR",
      "rateCurrency": "EUR",
      "amountChargedCurrency": "EUR",
      "amountReceivedCurrency": "BTC"
    },
    "relationships": {
      "exchangeOrder": {
        "data": {
          "type": "orders",
          "id": "58530d58-6ffd-4b6b-a6bf-204c9dd056bc"
        }
      }
    }
  },
  "included": [
    {
      "id": "58530d58-6ffd-4b6b-a6bf-204c9dd056bc",
      "type": "orders",
      "attributes": {
        "baseCode": "EUR",
        "quoteCode": "BTC",
        "quantity": "59.47"
      }
    }
  ],
  "meta": {},
  "jsonapi": {
    "version": "1.0"
  }
}
{
  "errors": [
    {
      "status": 422,
      "title": "amount is below minimum",
      "code": "amount_below_minimum"
    }
  ]
}
{
  "errors": [
    {
      "status": 422,
      "title": "amount is above maximum",
      "code": "amount_above_maximum"
    }
  ]
}
{
  "errors": [
    {
      "status": 422,
      "title": "account has insufficient balance",
      "code": "account_has_insufficient_balance"
    }
  ]
}

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.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.

PreviousExchange webhooksNextConfirming quote

Last updated 15 days ago

Account ID from which funds are being converted. See .

Account ID to which funds are being converted. See .

Listing Accounts
Listing Accounts