/app/rfqbyfiat

Get an indicative quote by the amount of fiat
(e.g. spend 50 USD, or 60 EUR to buy BTC)

用法币金额询价

import requests
import uuid

headers = {
    'Authorization': 'Bearer %s' % api_token,
    'Accept':'application/json'
}

# Get a quote for buying BTC using 500 USD
uuid = str(uuid.uuid4())
size = '500' 
side = 'buy'
pair = 'BTCUSD'
user_id = '21321323few234'

post_data = {
    'pair': pair,
    'side': side,
    'size': size,
    'type' = 'card'  # card or bank

    
}

response = requests.post('https://sandboxapi.legendtrading.com/app/rfqbyfiat/', json=post_data, headers=headers)

print(response.json())

If you are integrated with SaaS 2.0, the fee_format should be 2.0;
If you are integrated with SaaS 3.0, the fee_format should be 3.0. It will include network_fee, processing_fee, commission, size in the API response, and the price, quantity will be different too.
if fee_format is 3.1 the quote price calculate is including network_fee and processing_fee.

Query Params
string
required
Defaults to BTCUSD

Trading pair

string
required
Defaults to buy

buy or sell

string
required
Defaults to 10

Fiat size

string
enum
Defaults to bank

Payment by bank transfers or Credit Card or ACH Pull returns different prices.

Allowed:
string
Defaults to 2.0

Optional. The allowed parameter is [2.0 or 3.0 or 3.1]. If there is no fee_format, it will be 2.0 by default

string
Defaults to 0.01

commission rate (only available for fee_format 3.0)

string
enum
Defaults to ETH
Allowed:
Responses

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json