Carbon

Documentation

Welcome to Carbon's docs!

Get Started    

Get a Quote

Overview

Get a Quote is the endpoint responsible for determining the costs and fees for Crypto to Fiat withdrawals.

The charge for fiat withdrawals includes the cryptocurrency exchange rate for fiat . Fees include a 2% payment method fee via SEPA or Paypal and a 0.1% Carbon fee.

The goal of the Get a Quote endpoint is to answer one of two questions for Crypto to Fiat sales:

       - How much cryptocurrency would I have to sell to receive the given amount of fiat?
       - How much fiat currency would I receive if I sell the given amount of cryptocurrency?

You must always specify the fiat currency & cryptocurrency for the crypto > fiat exchange. You can specify either the amount of fiat currency you want to receive and we will include in the response the amount of crypto you need to send. Conversely, you can specify the amount of crypto you plan to send and we will specify the amount of fiat currency you will receive.

Rate Convention

cryptoFiatExchangeRate is denominated as the cryptocurrency price over fiat.

For example cryptoFiatExchangeRate can be 10000 EUR / BTC.

The first symbol is the base currency and the second symbol is the quote currency.

Get Quote (Fiat Amount Specified, EUR Fiat Currency, TRX CryptoCurrency)

GET

Fee Incorporation Note

If fiatAmount is specified, the fee will be included in the cryptoAmount to send. So cryptoAmountNoFee will be the amount of crypto the user is actually selling. If cryptoAmount is specified, the fee will be subtracted from the fiatAmount to payout. So fiatAmountNoFee will be the amount of fiat that would have been paid out if there were no fees. To clarify fiatAmount will always include the amount of fiat that will be payed out to users and cryptoAmount will always be the cryptoAmount that must be sent to the recipientAddress to trigger the fiat payout. We show the corresponding no-fee amounts in the responses for clarity and transparency. All fees are also broken down by type in fiat and crypto terms in addition to the crypto > fiat exchange rate.

Fiat Amount & Crypto Amount Precisions

All fiat amounts are returned to a precision of 2 decimal places, while crypto amounts are returned to the precision native to the token/coin itself.

// const ROOT = "https://sandbox.carbon.money" // for Sandbox
// const ROOT = "https://api.carbon.money"     // for Production

let jwtToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJlMzE3YjdlNy0yMzQ1LTQ0MWMtODA0Ni1kYjgxNTkyYmEyN2YiLCJzdXBlclVzZXIiOnRydWUsImNvbnRhY3QiOmZhbHNlLCJlbWFpbCI6ImRhbmllbEBjYXJib24ubW9uZXkiLCJpYXQiOjE1NTczMjc5MTR9.WZnSR5N1FebmT9nMu97PJvku49NY0jk4aKVPKm_1MlM';

let headers = {
  headers: {
    Authorization: `Bearer ${jwtToken}`
  }
};

let url = `${ROOT}/v1/c2f/quote?fiatCurrency=EUR&cryptoCurrency=TRX&fiatAmount=100&contactId=${contactId}`;



axios.get(url, headers).then(result => console.log).catch(err => console.log);
{"message":"Obtained crypto > fiat quote successfully",
  "code":200,
    "details":{
  "cryptoCurrency":"TRX",
  "fiatCurrency":"EUR",
  "cryptoAmount":6433.1577,
  "cryptoAmountNoFee":6300.840059,
  "fiatAmount":100,
  "cryptoFiatExchangeRate":0.01587089960462891,
  "quoteId":2510222,
  "createdTime":"2019-08-15T02:45:58.035Z",
  "paymentMethodFeePercent":2,
  "paymentMethodFeeFiat":2,
  "paymentMethodFeeCrypto":126.016801,
  "withdrawalFeePercent":0.1,
  "withdrawalFeeFiat":0.1,
  "withdrawalFeeCrypto":6.30084,
  "totalFeePercent":2.1,
  "totalFeeFiat":2.1,
  "totalFeeCrypto":132.317641}
  }
}

Get Quote (Crypto Amount Specified, EUR Fiat Currency, EOS Cryptocurrency)

GET
// const ROOT = "https://sandbox.carbon.money" // for Sandbox
// const ROOT = "https://api.carbon.money"     // for Production

let jwtToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJlMzE3YjdlNy0yMzQ1LTQ0MWMtODA0Ni1kYjgxNTkyYmEyN2YiLCJzdXBlclVzZXIiOnRydWUsImNvbnRhY3QiOmZhbHNlLCJlbWFpbCI6ImRhbmllbEBjYXJib24ubW9uZXkiLCJpYXQiOjE1NTczMjc5MTR9.WZnSR5N1FebmT9nMu97PJvku49NY0jk4aKVPKm_1MlM';

let headers = {
  headers: {
    Authorization: `Bearer ${jwtToken}`
  }
};

let url = `${ROOT}/v1/c2f/quote?fiatCurrency=EUR&cryptoCurrency=EOS&cryptoAmount=100&contactId=${contactId}`;


axios.post(url, headers).then(result => console.log).catch(err => console.log);
{"message":"Obtained crypto > fiat quote successfully",
  "code":200,
    "details":
   { "cryptoCurrency":"EOS",
     "fiatCurrency":"EUR",
      "cryptoAmount":100,
      "fiatAmountNoFee":327.47,
      "fiatAmount":320.59,
      "cryptoFiatExchangeRate":3.274667048798541,
      "quoteId":2510317,
      "createdTime":"2019-08-15T03:06:33.154Z",
      "paymentMethodFeePercent":2,
      "paymentMethodFeeFiat":6.55,
      "paymentMethodFeeCrypto":2,             
       "withdrawalFeePercent":0.1,
       "withdrawalFeeFiat":0.33,
       "withdrawalFeeCrypto":10,
       "totalFeePercent":2.1,
       "totalFeeFiat":6.88,
       "totalFeeCrypto":2.1
   }
}
Parameters
Access
Description

fiatCurrency

required

Denominated fiat currency of the transaction

cryptoCurrency

required

Denominated cryptocurrency
to sell

fiatAmount

required (if 'cryptoAmount' not specified)

if 'cryptoAmount' is also specified will be overruled by 'fiatAmount' and re-calculated.

cryptoAmount

required (if 'fiatAmount' not specified)

if 'fiatAmount' is also specified 'cryptoAmount' will be re-calculated according to 'fiatAmount'.

contactId

required


Get a Quote


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.