Requesting a quote
Before redirecting your user to the checkout, you can request a quote to show pricing information in your own UI. This is useful if you want to display the exchange rate, fees, or total cost before the user leaves your platform.
Prerequisites
Section titled “Prerequisites”Before requesting a quote, you need:
- A valid JWT token. See Quick start: step 1 for how to authenticate.
- The payment method the user wants to use. See Retrieving payment methods to get available methods.
- The currency pair. See Retrieving supported currencies to get available pairs.
How it works
Section titled “How it works”- Your backend calls the quote endpoint with the currency pair, amount, and payment method.
- The API returns a quoted price including fees, exchange rate, and an expiry time.
- You display this information to the user in your UI.
- If the user accepts, you create a checkout session using the quick start flow.
Endpoint
Section titled “Endpoint”Required fields
Section titled “Required fields”| Field | Description |
|---|---|
currencyPair | The currency pair (e.g. BTC-EUR). Use the value from the currency pairs endpoint. |
paymentMethod | The payment method code (e.g. iDeal, creditCard). Use the value from the payment methods endpoint. |
You must also provide one of:
| Field | Description |
|---|---|
fiatAmount | The amount in fiat the user wants to spend. |
cryptoAmount | The amount of crypto the user wants to buy. |
Example
Section titled “Example”curl -X POST https://api-sandbox.btcdirect.eu/api/v1/buy/quote \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_TOKEN" \ -d '{ "currencyPair": "BTC-EUR", "paymentMethod": "iDeal", "fiatAmount": 100 }'Try it out
Request a quote for a fiat-to-coin order. Requires a valid JWT token.
Response
Section titled “Response”{ "currencyPair": "BTC-EUR", "fiatAmount": 100, "cryptoAmount": 0.00123456, "paymentMethodCost": 0.50, "networkFeeCost": 1.25, "btcdirectFee": 2.00, "btcdirectFeePercentage": 2.0, "partnerFee": 0.50, "partnerFeePercentage": 0.5, "totalCost": 100, "singleCoinEstimate": 81000.00, "paymentMethod": "iDeal", "expiryDate": "2026-04-13T12:00:00Z"}The expiryDate indicates when the quote is no longer valid. After this time, you must request a new quote.
See the endpoint specification for the full request and response schema.