Get a quote

Get a buy/sell quote.

URL

POST https://exchange.savitar.io/api/v1/quote

Get a buy/sell quote on a given pair.

  • side parameter always indicates the action to make on the first currency of the pair.
  • amount and amount_currency parameters allow to specify both how much the user wants to pay or how much the user wants to get. The other ‘side’ of the trade will be computed on our side. See Examples
  • optional net_of_fees parameter indicates if provided amount includes fees in the computation. See Net Of Fees Examples

Response will include a unique price but multiple inputs/outputs with different fees based on method of payment and method of delivery :

  • in object indicates the amount the user must pay, including fees.
  • out object indicates the amount the user will get, after fees.
  • fees and tx_fee objects indicate the fees for payment and delivery.

Response returns only payment and delivery methods possible for a quote.

List of payment methods:

  • payment_card: mastercard, visa.
  • payment_bank_account: SEPA transfer.
  • payment_crypto: crypto sent on a deposit address.

List of delivery methods:

  • delivery_sepa: fiat sent on a bank account.
  • delivery_crypto: crypto sent on a deposit address.

Request Body

pair
string
Exchange pair. Example: 'btc:eur'
side
enum
Quote side.
Possible values: buy, sell
amount
string
Amount to exchange
amount_currency
string
Amount currency to exchange
net_of_fees (Optional)
bool
Set to true if quote fees must be included in amount
Default: false

Response Data

pair
string
Exchange pair. Example: 'btc:eur'
qid
string
Quote unique identifier to pass to further steps.
price
string
Quote price.
valid_until
Unix Timestamp
Time until the quote expires.
payment.<pmean>.fees.amount
string
Fee amount for a given pmean payment method.
payment.<pmean>.fees.currency
string
Fee currency for a given pmean payment method.
payment.<pmean>.<dmean>.tx_fee.amount
string
Fee amount for a given dmean delivery method.
payment.<pmean>.<dmean>.tx_fee.currency
string
Fee currency for a given dmean delivery method.
payment.<pmean>.<dmean>.in.amount
string
Amount the user must pay to complete the trade, including fees.
payment.<pmean>.<dmean>.in.currency
string
Currency of amount the user must pay to complete the trade.
payment.<pmean>.<dmean>.out.amount
string
Amount the user will receive at trade completion and after fees.
payment.<pmean>.<dmean>.out.currency
string
Currency of amount the user will receive at trade completion.

Examples

Buy 1 BTC with EUR

Request:

{
  "pair": "btc:eur",
  "side": "buy",
  "amount": "1",
  "amount_currency": "BTC"
}

Response:

{
  "status": "ok",
  "response": {
    "pair": "btc:eur",
    "payments": {
      "payment_card": {
        "deliver_crypto": {
          "in": { "amount": "8726.84", "currency": "EUR" },
          "out": { "amount": "1", "currency": "BTC" },
          "tx_fee": { "amount": "0.0005", "currency": "BTC" }
        },
        "fees": { "amount": "212.75", "currency": "EUR" }
      }
    },
    "price": "8509.84",
    "qid": "c1e9a816-8bbd-43e2-8db8-e07a5ae97143",
    "side": "buy",
    "valid_until": 1591266049
  }
}

Buy 10 EUR worth of BTC

Request:

{
  "pair": "btc:eur",
  "side": "buy",
  "amount": "10",
  "amount_currency": "EUR"
}

Response:

{
  "status": "ok",
  "response": {
    "pair": "btc:eur",
    "payments": {
      "payment_card": {
        "deliver_crypto": {
          "in": { "amount": "17.26", "currency": "EUR" },
          "out": { "amount": "0.00117451", "currency": "BTC" },
          "tx_fee": { "amount": "0.0005", "currency": "BTC" }
        },
        "fees": { "amount": "3", "currency": "EUR" }
      }
    },
    "price": "8514.19",
    "qid": "840d8ede-a2a1-4b0e-92c6-e1aed7397a4e",
    "side": "buy",
    "valid_until": 1591265533
  }
}

Net Of Fees Examples

Buy 10 EUR worth of BTC

Request:

{
  "pair": "btc:eur",
  "side": "buy",
  "amount": "10",
  "amount_currency": "EUR",
  "net_of_fees": true
}

Response:

{
  "status": "ok",
  "response": {
    "pair": "btc:eur",
    "payments": {
      "payment_card": {
        "deliver_crypto": {
          "in": { "amount": "10", "currency": "EUR" },
          "out": { "amount": "0.00032196", "currency": "BTC" },
          "tx_fee": { "amount": "0.0005", "currency": "BTC" }
        },
        "fees": { "amount": "3", "currency": "EUR" }
      }
    },
    "price": "8516.26",
    "qid": "b66b8762-d8a8-448f-bfb9-eaf10711196a",
    "side": "buy",
    "valid_until": 1591265818
  }
}