Creating quote

Create quote

POST /api/public/v1/exchange/quotes

This endpoint creates quotes.

Headers

NameValue

Content-Type

application/json

Authorization

Bearer <api_token>

Body

NameTypeDescription

data

object

Object with exchange request data.

data.type

string

Exchange request type. Always quotes.

data.attributes

object

A set of exchange request attibutes.

data.attributes.accountChargedId

string

Account ID from which funds are being converted. See Listing Accounts.

data.attributes.accountReceivedId

string

Account ID to which funds are being converted. See Listing Accounts.

data.attributes.amount

number

Exchange amount.

data.attributes.amountCurrency

string

Exchange currency. Can be either BTC, USDT, TRX, EUR, USD or TRY.

Request JSON

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

Response

{
  "data": {
    "id": "58011bca-f22b-4fe2-b977-7cc69aec8b4a",
    "type": "exchange_quotes",
    "attributes": {
      "amountCharged": "0.0005",
      "amountReceived": "1065.24",
      "rate": "2152000.0",
      "fee": "10.76",
      "feeCurrency": "TRY",
      "expiresAt": "2024-04-22T14:31:37.660Z"
    },
    "relationships": {
      "accountCharged": {
        "data": {
          "type": "accounts",
          "id": "5850abb7-0a60-4041-800c-1d43b4dcf4d6"
        }
      },
      "accountReceived": {
        "data": {
          "type": "accounts",
          "id": "746e3b21-595e-4540-8436-4658cb508d11"
        }
      },
      "exchangeOrder": {
        "data": {
          "type": "orders",
          "id": "19c9e540-a616-41a1-8e27-1e68bfc73d68"
        }
      }
    }
  },
  "included": [
    {
      "id": "5850abb7-0a60-4041-800c-1d43b4dcf4d6",
      "type": "accounts",
      "attributes": {
        "currencyCode": "BTC",
        "balance": "0.94086678",
        "currencyType": "crypto"
      },
      "relationships": {
        "company": {
          "meta": {
            "included": false
          }
        },
        "networks": {
          "meta": {
            "included": false
          }
        }
      }
    },
    {
      "id": "746e3b21-595e-4540-8436-4658cb508d11",
      "type": "accounts",
      "attributes": {
        "currencyCode": "TRY",
        "balance": "18981.20",
        "currencyType": "fiat"
      },
      "relationships": {
        "company": {
          "meta": {
            "included": false
          }
        },
        "networks": {
          "meta": {
            "included": false
          }
        }
      }
    },
    {
      "id": "19c9e540-a616-41a1-8e27-1e68bfc73d68",
      "type": "orders",
      "attributes": {
        "baseCode": "BTC",
        "quoteCode": "TRY",
        "quantity": "0.0005"
      }
    }
  ],
  "meta": {},
  "jsonapi": {
    "version": "1.0"
  }
}

Response Body

NameTypeDescription

data.id

string

Quote ID.

data.type

string

Entity type returned. Always quotes.

data.attributes

object

A set of quote attributes.

data.attributes.amountCharged

string

Amount to be debited from your accountChargedId.

data.attributes.amountReceived

string

Amount to be credited to your accountReceivedId.

data.attributes.rate

string

Exchange rate.

data.attributes.fee

string

Txn fee amount.

data.attributes.feeCurrency

string

Fee currency code.

data.attributes.expiresAt

string

Quote expiry timestamp.

Last updated