Get Buy Quotes
Get on-ramp quotes showing how much crypto you receive for a given fiat amount. Returns multiple quotes from different sources so you can compare rates and fees.
GET
https://api.zenpayz.com/payment/api/v1/on-ramp/quotesBearer · API key
Request
Headers
| Header | Description |
|---|---|
x-request-id OPTIONAL | Custom request ID for tracing |
Public Endpoint
This endpoint does not require authentication headers.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
source REQUIRED | string | Fiat currency (e.g. usd, eur) |
destination REQUIRED | string | Crypto ID (e.g. btc_bitcoin, eth_ethereum) |
amount REQUIRED | string | Fiat amount (e.g. 100) |
paymentMethod OPTIONAL | string | Filter by payment method (e.g. creditcard) |
country OPTIONAL | string | ISO country code |
walletAddress OPTIONAL | string | Destination wallet address |
uuid OPTIONAL | string | Unique user identifier |
Response
Success (200 OK)
{
"success": true,
"data": [
{
"onramp": "moonpay",
"paymentMethod": "creditcard",
"inputAmount": 100,
"outputAmount": 0.00112,
"rate": 89285.71,
"networkFee": 0.5,
"transactionFee": 3.99,
"totalFee": 4.49,
"recommended": true,
"labels": ["best_rate"],
"minAmount": 20,
"maxAmount": 10000,
"quoteId": "01H985NH79FW951SKERQ45JMYXmoonpay",
"availablePaymentMethods": [
{ "paymentTypeId": "creditcard", "name": "Credit Card", "icon": "https://cdn.onramper.com/icons/payments/creditcard.svg" },
{ "paymentTypeId": "banktransfer", "name": "Bank Transfer", "icon": "https://cdn.onramper.com/icons/payments/banktransfer.svg" }
]
},
{
"onramp": "transak",
"paymentMethod": "creditcard",
"inputAmount": 100,
"outputAmount": 0.00110,
"rate": 90909.09,
"networkFee": 1.0,
"transactionFee": 4.50,
"totalFee": 5.50,
"recommended": false,
"labels": [],
"minAmount": 30,
"maxAmount": 5000,
"quoteId": "01H985NH79FW951SKERQ45JMYXtransak",
"availablePaymentMethods": [
{ "paymentTypeId": "creditcard", "name": "Credit Card", "icon": "https://cdn.onramper.com/icons/payments/creditcard.svg" }
]
}
],
"message": "Quotes retrieved"
}
Response Fields
| Parameter | Type | Description |
|---|---|---|
onramp OPTIONAL | string | Reference identifier -- pass this to the checkout endpoint |
paymentMethod OPTIONAL | string | Payment method for this quote |
inputAmount OPTIONAL | number | Fiat amount you pay |
outputAmount OPTIONAL | number | Crypto amount you receive |
rate OPTIONAL | number | Exchange rate |
networkFee OPTIONAL | number | Blockchain network fee |
transactionFee OPTIONAL | number | Processing fee |
totalFee OPTIONAL | number | Combined fees |
recommended OPTIONAL | boolean | Whether this is the recommended quote |
labels OPTIONAL | string[] | Tags like best_rate, low_kyc |
minAmount OPTIONAL | number | Minimum allowed amount |
maxAmount OPTIONAL | number | Maximum allowed amount |
estimatedTime OPTIONAL | string | Estimated completion time |
errors OPTIONAL | string[] | Any issues with this quote |
quoteId OPTIONAL | string | Unique quote identifier for reference |
availablePaymentMethods OPTIONAL | array | Payment methods available for this quote. Each entry has paymentTypeId, name, and icon |
tip
The onramp field is a reference identifier. When creating a checkout, pass the onramp value from your selected quote.
Error Responses
| Code | HTTP | Message |
|---|---|---|
| RAMP_QUOTES_FAILED | 500 | Failed to get buy quotes |
Examples
- cURL
- JavaScript
- Python
curl "https://api.zenpayz.com/payment/api/v1/on-ramp/quotes?source=usd&destination=btc_bitcoin&amount=100&paymentMethod=creditcard"
const params = new URLSearchParams({
source: 'usd',
destination: 'btc_bitcoin',
amount: '100',
paymentMethod: 'creditcard',
});
const response = await fetch(
`https://api.zenpayz.com/payment/api/v1/on-ramp/quotes?${params}`
);
const { data: quotes } = await response.json();
// Find the recommended quote
const best = quotes.find(q => q.recommended) || quotes[0];
console.log(`Best rate: ${best.outputAmount} BTC for $${best.inputAmount}`);
console.log(`Fees: $${best.totalFee}`);
// Use best.onramp when creating checkout
import requests
response = requests.get(
"https://api.zenpayz.com/payment/api/v1/on-ramp/quotes",
params={
"source": "usd",
"destination": "btc_bitcoin",
"amount": "100",
"paymentMethod": "creditcard",
},
)
quotes = response.json()["data"]
# Find recommended quote
best = next((q for q in quotes if q["recommended"]), quotes[0])
print(f"Best rate: {best['outputAmount']} BTC for ${best['inputAmount']}")
print(f"Fees: ${best['totalFee']}")
# Use best["onramp"] when creating checkout
Next Steps
- Buy Checkout -- Create a checkout with the selected quote
- Buy Rates -- Get rates for multiple assets at once
- Buy Prices -- Get current crypto prices