Blockchain.com Pay
  • ๐Ÿ’ธWelcome to Blockchain.com Pay
  • ๐Ÿ“Getting Started
    • Ramps
    • Try our Widget
    • Integration Options
      • ๐Ÿ“ฑMobile Integration
        • iOS Integration Options
        • Android Integration Guide
      • ๐Ÿ–ฅ๏ธWeb Integration
      • Brand Guidance
    • Testing your integration
    • Pre-Launch Checklist
    • Customise the Widget
      • Optional Customisation
    • Query parameter signing
  • ๐Ÿ“API
    • Partner API
      • Authentication
      • Eligibility
      • Quotes
      • Orders
      • Rate Limits
    • Webhooks
  • ๐Ÿ“Regions, payments and cryptos
    • Supported Regions
    • Supported Payment Methods
    • Supported Cryptocurrencies
  • ๐Ÿ“FAQs
Powered by GitBook
On this page
  1. API
  2. Partner API

Quotes

Returns the quote for a specific fiat currency, amount and payment method

Last updated 7 months ago

The Quotes API allows you to fetch real-time quotes for transactions across different fiat-to-crypto pairs. This information can be used to display quotes in your UI prior to redirecting them Blockchain.com Pay.

Note: Users may see a slightly different quote if it expires prior to them being redirected to Blockchain.com Pay

๐Ÿ“

Get buy quote

get

Returns real-time buy quote for a currency pair. Supply quoteCurrencyCode, baseCurrencyCode and quoteCurrencyAmount(fiat) to get a detailed buy quote, comprehensive of fees, and the amount of quote currency (fiat) that the user will need to pay for the transaction, as well as base currency (crypto) the user will get after the transaction.

Authorizations
Query parameters
quoteCurrencyCodestringRequired

The currency to buy with. Must be a fiat currency.

Example: USD
baseCurrencyCodestringRequired

The currency to buy. Must be crypto.

Example: BTC
quoteCurrencyAmountnumberRequired

A positive decimal representing how much crypto the customer wants to buy. Must be a decimal number with precision not higher then the currency precision.

Example: 100.00
paymentMethodstring ยท enumOptional

Payment method to be used for the order. If not set, the quote will not consider the payment method.

Possible values:
countryCodestring ยท min: 2 ยท max: 2Optional

e.g. US

Example: USPattern: Iso3188-1-alpha2
usStateCodestringOptional

e.g. AL. If country!=US this parameter is ignored.

Example: AL
walletAddressstringOptional

The wallet address where the user wants to receive the crypto.

Responses
200
ok
application/json
default
Returns error 400 when: 1. Any of the required query params are missing 2. `baseCurrencyCode` / `quoteCurrencyCode` is not supported 3. `baseCurrencyCode` is not of the type 'Crypto' 4. `quoteCurrencyCode` is not of the type 'Fiat' 5. `baseCurrencyCode` is not allowed for trading in this `country` 6. `baseCurrencyCode` is not allowed for trading in this `usState` 7. `quoteCurrencyCode` is not allowed for trading in this `country` 8. `quoteCurrencyCode` is not allowed for trading in this `usState` 9. `quoteCurrencyCode` is not allowed for any region 10. `baseCurrencyCode` is not allowed for any region Returns error 422 when: 1. `Fee profile` for partner not found 2. `Quote` not found for the requested parameters
application/json
get
GET /partner-gateway/partner-api/v1/quote/buy HTTP/1.1
Host: api.blockchain.info
X-Public-API-Key: YOUR_API_KEY
Accept: */*
{
  "quoteCurrencyAmount": "63.00",
  "quoteCurrencyCode": "USD",
  "quoteCurrency": [
    {
      "type": "FIAT",
      "name": "US Dollar",
      "code": "USD",
      "precision": 2,
      "minBuyAmount": 20,
      "maxBuyAmount": 1200
    }
  ],
  "baseCurrencyAmount": "0.001",
  "baseCurrencyCode": "BTC",
  "baseCurrency": [
    {
      "type": "CRYPTO",
      "name": "Bitcoin",
      "code": "BTC",
      "precision": 8,
      "network": "BTC",
      "supportsDestinationTag": false,
      "isSupportedInUS": true,
      "allowedUSStates": [
        "AL",
        "CT"
      ]
    }
  ],
  "price": "62451.29",
  "processingFeeAmount": "1.00",
  "partnerFeeAmount": "1.00",
  "networkFeeAmount": "1.00",
  "totalAmount": "0.0009",
  "paymentMethod": "CARD"
}