v1

latestOpenAPI 3.0.02026-07-242830146.7 KB
Transaction

Payment quote creation method

post/v2/public/quote

Headers

X-User-Locale'en' | 'ru' | 'it' | 'fr' | 'es' | 'de' | 'pt' | 'ko'
X-User-IDstring

User ID detected by a public endpoint that uses the current one

X-User-IPstring

User IP detected by a public endpoint that uses the current one

Request body

currencyCodeFromstring

Fiat currency code in ISO alpha-3 format or crypto asset (i.e. BTC)

currencyCodeTostring

Fiat currency code in ISO alpha-3 format or crypto asset (i.e. BTC)

amountstring

The amount in the currency specified by either the directionChange or requestedCurrency parameters represented the payment amount with precision: 2 decimal places for fiat currencies (e.g., 100.12); and 8 decimal places for cryptocurrencies (e.g., 0.12345678).

directionChange'from' | 'to'

This field determines the currency in which amount is specified.

A value of from indicates that amount is in the currencyCodeFrom currency. A value of to indicates that amount is in the currencyCodeTo currency.

This parameter is required if requestedCurrency is not provided. It is mutually exclusive with requestedCurrency.

requestedCurrencystring

This field is used in swap-crypto exchanges and crypto-acquiring transactions where the transaction occurs in a fiat equivalent. This parameter is optional. It specifies the fiat currency in which amount is denominated.

isReceivedAmountboolean

Specifies how to process the value in the amount field: with or without fees. False, to set the total amount that the user will spend. True, to set the net amount of money (excluding fees) for which the user will get crypto.

paymentMethodstring nullable

ID of the payment method for which the quote is generated (optional)

payoutMethodstring nullable

ID of the payout method for which the quote is generated (optional)

promoCodestring nullable

Promo code to be used with transaction

Example request

{
  "currencyCodeFrom": "USD",
  "currencyCodeTo": "BTC-TESTNET",
  "amount": "1032.02",
  "directionChange": "from",
  "requestedCurrency": "EUR",
  "isReceivedAmount": true,
  "paymentMethod": "credit-card",
  "payoutMethod": "tether-trc20",
  "promoCode": "twyc54eozw"
}

Response

A Quote successfully created.

idstring uuid

Quote ID required for Create request method

currencyCodeFromstring

Fiat currency code in ISO alpha-3 format or crypto asset (i.e. BTC)

currencyCodeTostring

Fiat currency code in ISO alpha-3 format or crypto asset (i.e. BTC)

requestedAmountType'from' | 'to'

Type of the transaction direction. "from" value determines the quote amount based on fiat currency code, e.g. customer wants to purchase crypto for XX fiat. "to" determines the quote amount based on crypto currency code, e.g. customer wants to purchase XX crypto.

Example response

{
  "id": "14b555fe-6e61-47bf-82f3-de39c7d79a46",
  "currencyCodeFrom": "USD",
  "currencyCodeTo": "BTC",
  "exchangeRate": {
    "from": "USD",
    "to": "BTC",
    "rate": "0.000015595"
  },
  "exchangeRateCryptoToFiat": null,
  "requestedAmount": {
    "amount": "500",
    "currencyCode": "USD"
  },
  "requestedAmountType": "to",
  "paymentMethods": [
    {
      "id": "credit-card",
      "name": "Credit card",
      "amountFrom": {
        "amount": "500",
        "currencyCode": "USD"
      },
      "amountTo": {
        "amount": "0.0808632",
        "currencyCode": "BTC"
      },
      "amountToEquivalent": {
        "amount": "450",
        "currencyCode": "USD"
      },
      "fees": {
        "networkFee": {
          "amount": "10",
          "currencyCode": "USD"
        },
        "serviceFee": {
          "amount": "40",
          "currencyCode": "USD"
        },
        "totalFee": {
          "amount": "50",
          "currencyCode": "USD"
        }
      },
      "expiresAt": "2022-06-13T16:42:44+0000"
    }
  ],
  "paymentMethodErrors": [
    {
      "paymentMethod": "credit-card",
      "error": {
        "message": "Minimum limit error",
        "code": "VALIDATION_ERROR"
      }
    }
  ]
}