On-ramp Request- Fiat to Stablecoins
In this scenario, your customer pays with fiat currency, and the equivalent stablecoin amount is sent to their crypto wallet.
Step 1: Get a Quote
Request a quote for a "BUY" transaction.
Endpoint: POST /quote
Request Body:
{
"tokenAmount": 100,
"asset": "USDT",
"chain": "TRON",
"type": "BUY"
}
Success Response (201):
{
"data": {
"quoteId": "b6df418e-0aed-4e9a-9e2c-35b9ef3d07a7",
"price": 1505,
"fiatAmount": 150500,
"tokenAmount": 100
},
"message": "success",
"error": null,
"statusCode": 201
}
Step 2: Create the Order
Create the order using the quoteId and provide the user's destination crypto wallet address.
Endpoint: POST /order
Request Body:
{
"quoteId": "b6df418e-0aed-4e9a-9e2c-35b9ef3d07a7",
"recipientWallet": {
"address": "TXYZ...abcd",
"chain": "TRON"
}
}
Success Response:
The API response will provide the bank account details where your user needs to send their fiat payment.
{
"data": {
"orderId": "e9c1b3a2-8d7e-4c6f-a8b9-2f1a0d9c8b7e",
"status": "PENDING_PAYMENT",
"paymentDetails": {
"accountNumber": "0987654321",
"accountName": "DexPay Merchant Services",
"bankName": "Providus Bank",
"amount": 150500,
"currency": "NGN",
"paymentReference": "DEXPAY-XYZ123" // User must include this in their transfer narration
},
"settlementDetails": {
"address": "TXYZ...abcd",
"chain": "TRON",
"expectedAmount": 100,
"asset": "USDT"
}
},
"message": "Order created successfully. Awaiting fiat payment."
}
Step 3: Await Confirmation
Your application must display the paymentDetails to your user. Once DexPay's system confirms receipt of the fiat payment with the correct reference, the stablecoins will be automatically sent to the user's recipientWallet. You can track the order status via webhooks or by polling the GET /order/{orderId} endpoint.
Last updated