Off-ramp Request- Stablecoins to Fiat

In this scenario, your customer pays with a stablecoin (e.g., USDT, DUSD), and the equivalent fiat amount is settled to their local bank account.

Step 1: Get a Quote

First, get a real-time quote for the transaction. You can request a quote based on either the amount of stablecoin the user wants to sell or the amount of fiat they wish to receive.

Endpoint: POST /quote

Request Body (by tokenAmount):

{ "tokenAmount": 100, "asset": "DUSD", "chain": "BSC", "type": "SELL" }

Request Body (by fiatAmount):

{ "fiatAmount": 150000, "asset": "USDT", "chain": "TRON", "type": "SELL" }

Success Response (201):

The response contains the exchange rate and a unique quoteId that is valid for a short time.

{ "data": { "quoteId": "a5ce307d-fbad-40ac-8a2b-2428df2cf086", "price": 1500, "fiatAmount": 150000, "tokenAmount": 100 }, "message": "success", "error": null, "statusCode": 201 }

Step 2: Get Bank Information (Optional)

If you need to present your user with a list of supported banks, you can fetch them with this endpoint.

Endpoint: GET /banks

Success Response (200):

[ { "name": "Kuda Bank", "code": "090267", "currency": "NGN" }, { "name": "9 Payment Service Bank", "code": "120001", "currency": "NGN" } // ... and more ]

Step 3: Create the Order

Using the quoteId, create the order and provide the user's bank account details for settlement.

Endpoint: POST /order

Request Body:

{ "quoteId": "a5ce307d-fbad-40ac-8a2b-2428df2cf086", "bankCode": "090267", "accountNumber": "1234567890", "accountName": "John Doe" }

Success Response:

The API response will provide a unique orderId and, most importantly, a deposit address. Your application must display this address to the user and instruct them to send the exact tokenAmount from the quote to it.

{ "data": { "orderId": "dbe8a4f1-9c8f-4b9a-8f9b-1e2d3c4b5a6d", "status": "PENDING_DEPOSIT", "depositDetails": { "address": "0xABC...DEF", // The address for the user to send crypto to "chain": "BSC", "expectedAmount": 100, "asset": "DUSD" }, "settlementDetails": { "accountNumber": "1234567890", "bankName": "Kuda Bank", "expectedAmount": 150000, "currency": "NGN" } }, "message": "Order created successfully. Awaiting crypto deposit." }

Step 4: Await Confirmation

DexPay's system will automatically monitor the deposit address. Once the correct amount of stablecoin is received, the order status will update, and the fiat settlement will be processed instantly. You can use webhooks (contact us for setup) or poll the GET /order/{orderId} endpoint to track the status.

Last updated