Quote ID addition
This document describes the updates to our APIs to address the potential issue of rate changes between fetching a rate/quote and initiating a transfer or currency swap. We have implemented the use of a quoteID to lock rates for a specified duration within which the locked rates can be used.
A. Fetch Rates/Quotes API
Endpoint: GET /api/v1/quotes
Description: Fetches the current exchange rates and returns alongside a quoteID to lock the rate for a specified duration.
Sample Response
{
"status": 200,
"data": {
"exchange_rate": 1600,
"fee_percentage": 10,
"flat_fee": 0,
"fee_amount": 100000,
"amount_receivable": 562.5,
"quote_id": "9b532b81-8f3b-40cf-8fe3-816a59548757",
"quote_expiry_in_minutes": "10m0s"
},
"message": "Retrieved exchange rates successfully",
"error": null
}
B. Initiate Currency Swap API
Endpoint: POST /api/v1/initiateCurrencySwap
Description: Initiates a currency swap. Optionally accepts a quoteID to use a previously locked rate.
Request Body:
quoteID (optional): The quoteID received from the fetch rates/quotes API.
Response Body:Same as before
C. Initiate Transfer API
Endpoint: POST /api/v1/transfers
Description: Initiates a transfer. Optionally accepts a quoteID to use a previously locked rate.
Request Body:
{
"amount": 212,
"source_currency": "USD",
"destination_currency": "NGN",
"use_balance": "no",
"destination": {
"type": "fiat",
"bank_details": {
"account_name": "Olawale OLADAPO",
"account_number": "201148503",
"bank_address": "1, God's Own Avenue, Lagos",
"bank_branch": "",
"bank_code": "058",
"bank_name": "First Bank",
"city": "God's Own",
"country": "NG",
"district": "",
"is_mobile_money": "no",
"is_within_us": "no",
"postal_code": "",
"routing_number": "",
"swift_code": "FBNINGLA"
},
"personal_details": {
"name": "Olawale OLADAPO",
"address": "Olawale Avenue",
"city": "Lagos",
"country": "NG",
"district": "",
"email": "",
"postal_code": "",
"phone_number": ""
}
},
"quote_id": "9b532b81-8f3b-40cf-8fe3-816a59548757",
"note": "this is the first note here",
"reason": "some reason for the transfer"
}