Trade Quotes

A trade quote is the price Coinify offers for a trade: the exchange rate plus the applicable fees. Before you can create any trade, you must request a quote and pass its ID to the create trade endpoint. The trade is then created at the rate in that quote.

ℹ️

Using the Trade Widget or SDK? The widget requests quotes for the end-user itself. The only decision that applies to you is whether fees are included in or added on top of the amount, covered under Fees below.

Two types of quote:

Approximate quoteTrade quote
PurposeShow the customer an estimate before they commitLock in a price and get a quoteId for creating a trade
Guaranteed?NoYes, until it expires (see Quote validity)
EndpointApproximate quote →Request trade quote →

The recommended flow:

  1. Show an estimate with the approximate quote while the customer chooses an amount.
  2. Request a trade quote once the customer decides to proceed.
  3. Show the final quote on your order summary screen.
  4. Create the trade with the quoteId before the quote expires.

Requesting a trade quote

Call Request trade quote → with the end-user's access token:

curl --request POST \
     --url https://app-api.sandbox.coinify.com/trades/quote \
     --header 'Authorization: Bearer {{accessToken}}' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '

{
  "baseCurrency": "USD",
  "quoteCurrency": "USDT",
  "baseAmount": -200,
  "transferIn": { "medium": "card" },
  "transferOut": { "medium": "blockchain" }
}

The transferIn and transferOut mediums also define the trade type:

transferIntransferOutTrade type
cardblockchainCard Buy
applepayblockchainApplePay Buy
googlepayblockchainGooglePay Buy
bankblockchainBank Buy
blockchainbankSell

For how baseCurrency, quoteCurrency and baseAmount are interpreted, see Request trade quote →.

In the response, the fields to work with are:

  • id: the quote ID you pass when creating the trade.
  • quoteAmount: the amount the quote results in.
  • transferIn.feeAmount / transferOut.feeAmount: the transfer fees.
  • expiryTime: when the quote stops being valid.

See Trade Quote Response object → for the full list.


Quote validity

Trade typeQuote validity
Card/ApplePay/GooglePay BuyValid for 15 minutes after being issued.
Sell (all supported cryptocurrencies except stablecoins)Valid for 15 minutes after being issued.
Sell (stablecoins)Between 15 and 60 minutes quote validity, depending on the selected stablecoin.
Bank BuyNot guaranteed. The quote is updated when Coinify receives the bank transfer. The trade's isPriceQuoteApproximate field is true.

Two further rules:

  • Use expiryTime to drive your UI. If the quote has expired, request a new one rather than creating the trade.
  • A quote only works for the end-user who requested it. Creating a trade with another end-user's quote returns an error.

Fees

Buy trades can be set up with fees included in or added on top of the amount the customer specifies. Decide which model fits your product before building the quote screen.

Fees-on-topFees-included
The customer paysThe amount they specified plus the feesExactly the amount they specified
How fees are appliedAdded at checkoutDeducted from the specified amount; the remainder is converted to crypto
Example200 USD of USDT with a 6 USD processing fee: pays 206 USD, receives about 198.95 USDT after the network feePays 200 USD, receives the crypto equivalent of 200 USD minus processing fees.
Approximate quote value to show the customerquoteAmountreceiveAmount

Fees-on-top works with the standard flow described above. For the approximate quote, see Fees-on-top quote →.

Fees-included needs one extra step in a full API integration. You first fetch a fees-included approximate quote, then pass the baseAmount from its response as the baseAmount of your trade quote request. See Fees-Included: API setup → for the full walkthrough, or Fees-Included: Trade Widget setup → if you use the widget.

ℹ️

Provide both transferIn.medium and transferOut.medium when requesting an approximate quote. Otherwise transfer fees are not included in the result.

ℹ️

Fees-included quotes apply to Buy trades only.


Next steps


Did this page help you?