v2
You are reading v1 & v2. v1 and v2 are deprecated. They keep working and are still supported, but new integrations should use v3.

Generate a sell quote

Sell

POST/api/v1/sell/quote

Send two credentials: your own, and the customer's.

How authentication works
Either
Authorization: BearerorUser-Authorization: Bearer

Language

Environment

Credentials

Your credential, or the customer's

Choose an environment first.

cURL request
curl -X POST https://api.btcdirect.eu/api/v1/sell/quote \  -H "Authorization: Bearer $BTCD_PARTNER_TOKEN" \  -H "Content-Type: application/json" \  -d '{    "currencyPair": "BTC-EUR",    "paymentMethod": "bankTransfer",    "fiatAmount": 50,    "cryptoAmount": null,    "fee": "1.5"  }'
Choose an environment to run this.

Response

Returns a quote and appropriate data.
{  "quote": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjEyMzQ1NjcsImV4cCI6MTU1NDU0N",  "currencyPair": "BTCEUR",  "fiatAmount": "50",  "cryptoAmount": "0.5",  "fiatNetworkFee": "0",  "btcdirectFee": "0.75",  "btcdirectFeePercentage": "0.75",  "partnerFee": "1.00",  "partnerFeePercentage": "1.00",  "singleCoinEstimate": "96779.04",  "expiryDate": "2019-06-06T16:16:16Z",  "bankAccountDisabled": false,  "userLimitExceeded": false,  "currencyLimitExceeded": false,  "quoteUnconfirmableReasons": [    "currencyLimitExceeded",    "userLimitExceeded",    "userRegistrationNotCompleted"  ],  "sourceCurrency": {},  "targetCurrency": {}}

Request

currencyPairstringrequired

The currency pair that is used for the quote.

ExampleBTC-EUR

paymentMethodstring

The payment method that the user wants to use to receive the payment.

DefaultbankTransfer

ExamplebankTransfer

fiatAmountnumber

The amount at which the user wants to buy cryptos.

cryptoAmountnumber

The amount of cryptos that the user wants to buy.

feenumber

The profit in terms of a percentage for this order. If not present or null, your default fee is used. The default fee is also used for DCA and the widgets and can be set by your accountmanager.

Example1.5

Responses

200Returns a quote and appropriate data.
400A list of possible errors for this endpoint.

Body of the success response

quotestringrequired

The quote that is generated based on the submitted data.

ExampleeyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjEyMzQ1NjcsImV4cCI6MTU1NDU0N

currencyPairstringrequired

The currency pair that is used for the quote.

ExampleBTCEUR

fiatAmountnumber

The amount that the user will receive.

Example50

cryptoAmountnumber

The amount of cryptos that the user will have to pay.

Example0.5

fiatNetworkFeenumberrequired

The fee charged for consolidating transactions on the blockchain.

Example0

btcdirectFeenumberrequired

The fee charged by BTC Direct.

Example0.75

btcdirectFeePercentagenumber

The fee charged in percentage by BTC Direct.

Example0.75

partnerFeenumberrequired

The fee earned by the partner.

Example1.00

partnerFeePercentagenumber

The fee earned in percentage by the partner.

Example1.00

singleCoinEstimatenumberrequired

The estimated value of a single coin.

Example96779.04

expiryDatestringrequired

The date and time when this quote expires.

Example2019-06-06T16:16:16Z

bankAccountDisabledbooleanrequired

Whether or not the bank account provided has been disabled. Only bank accounts which have not been disabled can be used to sell cryptos to us.

userLimitExceededbooleanrequired

Replaced by `quoteUnconfirmableReasons`. Whether the user has exceeded their personal limit.

currencyLimitExceededbooleanrequired

Replaced by `quoteUnconfirmableReasons`. Whether the currency limit has been exceeded.

quoteUnconfirmableReasonsstring[]required

Reasons why this quote can not be confirmed.

sourceCurrencyone of

The source (crypto) currency with CAIP-19 identifier.

targetCurrencyone of

The target (fiat) currency with CAIP-19 identifier.

Every failure answers with a message and a code. Switch on the code — messages are written for people and can change.