Fetching Buy Price
The Fetching Buy Quote API enables merchants to retrieve the buy price for specific crypto assets in real time. This is essential for providing accurate quotes to users during the onramp process.
Merchants can use this API to get the buy price for the required crypto assets in exchange for supported fiat currencies on the required blockchain network.
Functionality Overview
The API calculates the price based on:
- The fiat currency (from_currency).
- The crypto token to be purchased (to_currency).
- The blockchain network (network).
- Either the fiat amount to be converted (from_amount) or the crypto amount required (to_amount).
This flexibility ensures real-time, accurate pricing tailored to merchant and user needs.
Sample Request
Here’s an example API request:
curl --location 'https://mudrex.com/api/v2/wallet/w/quote?from_currency=INR&to_currency=USDT&network=BSC&to_amount=55.38' \
--header 'X-Timestamp: {{timestamp}}' \
--header 'X-Client-Id: •••••••' \
--header 'X-Request-Id: 3456' \
--header 'X-User-Id: •••••••' \
--header 'X-Secret-Key: •••••••'
{
"success": true,
"data": {
"from_currency": "INR",
"to_currency": "USDT",
"from_amount": 5036.81,
"pre_fee_to_amount": 55.49,
"to_amount": 55.38,
"base_price": 90.77,
"final_price": 90.95,
"total_fee": 0.11,
"fee_currency": "USDT",
"fee_breakup": {
"platform_fee": 0.111,
"network_fee": 0,
"client_fee": 0,
"discount": 0,
"tax_on_fee": 0,
"tds": 0
}
}
}
Required Parameters
Parameter | Description | Supported Values | Required |
---|---|---|---|
from_currency | The fiat currency to be converted | INR (Indian Rupee) EUR (Euro) GBP (Pound) | Yes |
to_currency | The crypto asset to be purchased | USDT, USDC | Yes |
network | The blockchain network for the transaction | All major networks (Matic preferred for cost-efficiency) | Yes |
from_amount | Amount of fiat currency to be converted | Required numeric value | Either this or to_amount is required |
to_amount | Amount of crypto asset to be purchased | Required numeric value | Either this or from_amount is required |
Additional Notes
- Preferred Network: While all major networks are supported, Matic is recommended due to lower costs.
- Mandatory Parameters: Ensure all required parameters are included to avoid errors.
For more details on the quote, refer to the Fetch Buy Quote API Reference here.
Updated 10 days ago