post
https://sandboxapi.legendtrading.com/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.
