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 quote | Trade quote | |
|---|---|---|
| Purpose | Show the customer an estimate before they commit | Lock in a price and get a quoteId for creating a trade |
| Guaranteed? | No | Yes, until it expires (see Quote validity) |
| Endpoint | Approximate quote → | Request trade quote → |
The recommended flow:
- Show an estimate with the approximate quote while the customer chooses an amount.
- Request a trade quote once the customer decides to proceed.
- Show the final quote on your order summary screen.
- Create the trade with the
quoteIdbefore 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:
transferIn | transferOut | Trade type |
|---|---|---|
card | blockchain | Card Buy |
applepay | blockchain | ApplePay Buy |
googlepay | blockchain | GooglePay Buy |
bank | blockchain | Bank Buy |
blockchain | bank | Sell |
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 type | Quote validity |
|---|---|
| Card/ApplePay/GooglePay Buy | Valid 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 Buy | Not guaranteed. The quote is updated when Coinify receives the bank transfer. The trade's isPriceQuoteApproximate field is true. |
Two further rules:
- Use
expiryTimeto 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-top | Fees-included | |
|---|---|---|
| The customer pays | The amount they specified plus the fees | Exactly the amount they specified |
| How fees are applied | Added at checkout | Deducted from the specified amount; the remainder is converted to crypto |
| Example | 200 USD of USDT with a 6 USD processing fee: pays 206 USD, receives about 198.95 USDT after the network fee | Pays 200 USD, receives the crypto equivalent of 200 USD minus processing fees. |
| Approximate quote value to show the customer | quoteAmount | receiveAmount |
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 bothtransferIn.mediumandtransferOut.mediumwhen requesting an approximate quote. Otherwise transfer fees are not included in the result.
Next steps
- Buy Crypto: Card Payment → to create a card Buy trade from a quote
- Buy Crypto: Bank Transfer → to create a bank Buy trade
- Sell Crypto → to create a Sell trade
Updated about 1 month ago
