π©Get a Quote
For a merchant, if you have a fiat amount you expect the customer to pay-in, and you want to know how much of a given cryptocurrency for them to deposit.
Get a Quote via API
I want X USD β User must pay Y Amount of Crypto
Quotes are meant to be used in conjunction with payment routes, which does not offer a βquoteβ by which a user can lock in a rate for a given amount of time, whereas, payment links do enable rate locks for a 15-30 minute window. The quote rates for this API are updated roughly every 15s.
This API is provided as a courtesy to estimate what you are likely to receive, to display in your web application for your customer to know how much crypto to transfer.
Example
I'm a platform, game, marketplace, or web/mobile application
I want the end-customer to pay-in 25 EUR
The customer should then transfer 103.802 TRX on Tron
I receive a webhook confirming a user transferred TRX on Tron
I top up the customers account on my platform
As the merchant, you may get a quote and display the data.toAmount.amount + data.toAmount.currency.symbol to the customer:
GET https://pay-api.swapped.com/v1/quotes?fromAmount=25&fromFiatCurrency=EUR&toCurrency=TRX&toBlockchain=tron
Response:
{
success: true,
message: "success",
data: {
exchangeRateSnapshotId: "e29af432-8775-4642-b71c-fe4987681fa1",
fromAmount: {
amount: "25.00",
currency: {
symbol: "EUR",
precision: 2,
type: "FIAT",
blockchain: null
}
},
toAmount: {
beforeFees: "103.802",
afterFees: "103.802",
currency: {
symbol: "TRX",
precision: 3,
type: "CRYPTO",
blockchain: {
name: "tron"
}
}
}
}
}API Spec
Get a quote for converting from one currency to another
Successful
Successful
Last updated