Skip to main content

Foreign Exchange

Generate Quote​

This API generates a quote for currency conversion or payout transactions.

POST {{baseUrl}}/roecny/api/v1/transfer/quote

Description

Retrieve a foreign exchange (FX) quote for a currency conversion. The quote provides the indicative exchange rate and related fees that would apply for converting between two currencies at a specified amount. Used to preview the cost and rate of an FX conversion before creating a transaction.

Request Headers

ParameterTypeRequiredDescription
x-api-keystringYesShared X-API key provided by Roecny
x-program-idstringYesProgram identifier
x-request-idstringYesIdempotency key
x-user-idstringYesUser identification key
AuthorizationstringYesBearer token

Query Parameters

ParameterTypeRequiredDescriptionValues
quote_typestringYesType of quotepayout, conversion
lock_periodstringYesRate lock duration5_mins, 15_mins, 1_hour, 4_hours, 8_hours, 24_hours
conversion_schedulestringYesConversion timingimmediate, end_of_day, next_day, 2_days
source_currencycodestringYesSource currencyISO currency code
destination_currencycodestringYesTarget currencyISO currency code
source_amountnumberConditional*Amount to convertMust be null if destination_amount provided
destination_amountnumberConditional*Target amountMust be null if source_amount provided

*Either source_amount or destination_amount must be provided, but not both

Request Example

curl --request GET \
--url '{{baseUrl}}/roecny/api/v1/transfer/quote?quote_type=payout&lock_period=5_mins&conversion_schedule=immediate&source_currencycode=USD&destination_currencycode=SGD&source_amount=100' \
--header 'x-api-key: {{Shared Xapikey By Roecny}}' \
--header 'x-program-id: {{BasedOnRequirement}}' \
--header 'x-request-id: {{IdempotencyKey}}' \
--header 'x-user-id: {{Useridentificationkey}}' \
--header 'Authorization: Bearer {{YOUR_TOKEN}}'

Response Example

{
"code": 200,
"status": "success",
"message": "",
"data": {
"id": "quote_6wBIHIRhPElAHfcgVaDFZs",
"netExchangeRate": 1.3279389,
"expiryTime": "2023-06-16T05:07:03Z",
"sourceCurrencyCode": "USD",
"destinationCurrencyCode": "SGD",
"quoteType": "payout",
"conversionSchedule": "immediate",
"lockPeriod": "5_mins",
"rateCaptureTime": "2023-06-16T01:02:03Z",
"sourceAmount": 100,
"destinationAmount": 132.79,
"createdTime": "2023-06-16T05:02:03Z"
}
}

Fetch Quote Details​

This API retrieves details of a previously generated quote.

GET {{baseUrl}}/roecny/api/v1/transfer/quotedetails

Description

Retrieve the full details of a previously generated FX quote using it’s unique quote ID. It is used to confirm quote details such as exchange rate, buy/sell currencies, and quote expiration before executing the conversion. This ensures that the quote is still valid and can be referenced in a conversion request.

Request Headers

ParameterTypeRequiredDescription
x-api-keystringYesShared X-API key provided by Roecny
x-program-idstringYesProgram identifier
x-request-idstringYesIdempotency key
x-user-idstringYesUser identification key
AuthorizationstringYesBearer token
Content-TypestringYesMust be application/json

Query Parameters

ParameterTypeRequiredDescription
quote_idstringYesThe ID of the quote to retrieve

Request Example

curl --request GET \
--url '{{baseUrl}}/roecny/api/v1/transfer/quotedetails?quote_id=quote_6wBIHIRhPElAHfcgVaDFZs' \
--header 'x-api-key: {{Shared Xapikey By Roecny}}' \
--header 'x-program-id: {{BasedOnRequirement}}' \
--header 'x-request-id: {{IdempotencyKey}}' \
--header 'x-user-id: {{Useridentificationkey}}' \
--header 'Authorization: Bearer {{YOUR_TOKEN}}'

Response Example

{
"code": 200,
"status": "success",
"message": "",
"data": {
"id": "quote_6wBIHIRhPElAHfcgVaDFZs",
"netExchangeRate": 1.3279389,
"expiryTime": "2023-06-16T05:07:03Z",
"sourceCurrencyCode": "USD",
"destinationCurrencyCode": "SGD",
"conversionSchedule": "immediate",
"lockPeriod": "5_mins",
"rateCaptureTime": "2023-06-16T01:02:03Z",
"sourceAmount": 100,
"destinationAmount": 132.79
}
}

Create Conversion​

This API executes a currency conversion based on a previously generated quote.

POST {{baseUrl}}/roecny/api/v1/transfer/conversion

Description

Initiate a currency conversion between two wallets. This will debit one currency and credit another in your Roecny account. It is used to perform actual FX transactions to convert wallet balances, optionally tied to a quote or payout. You can reference a previously obtained quote for a fixed rate, or proceed.

Request Headers

ParameterTypeRequiredDescription
x-api-keystringYesShared X-API key provided by Roecny
x-program-idstringYesProgram identifier
x-request-idstringYesIdempotency key
x-user-idstringYesUser identification key
AuthorizationstringNoBearer token
Content-TypestringYesMust be application/json

Request Body Parameters

ParameterTypeRequiredDescription
quote_idstringYesValid quote ID from Generate Quote
source_amountnumberConditional*Amount to convert
destination_amountnumberConditional*Target amount
source_currencystringYesThe currency code being sent
destination_currencystringYesThe currency code being received
validAmountbooleanYesIndicates whether the entered amount is valid for exchange (true/false)

*Either source_amount or destination_amount must match the original quote

Request Example

curl --request POST \
--url {{baseUrl}}/roecny/api/v1/transfer/conversion \
--header 'x-api-key: {{Shared Xapikey By Roecny}}' \
--header 'x-program-id: {{BasedOnRequirement}}' \
--header 'x-request-id: {{IdempotencyKey}}' \
--header 'x-user-id: {{Useridentificationkey}}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{YOUR_TOKEN}}' \
--data '{
"quote_id": "quote_6WRfj2CkYaRSuiPskK3kj3",
"source_amount": 100,
"destination_amount": 132.52
}'

Response Example

{
"code": 200,
"status": "success",
"message": "",
"data": {
"id": "conversion_4UTXo2tQnThdZGrMz6FdQR",
"status": "processing",
"conversion_time": "2023-06-16T05:22:14Z",
"source_currencycode": "USD",
"destination_currencycode": "SGD",
"source_amount": 100,
"destination_amount": 132.52,
"quote_id": "quote_6WRfj2CkYaRSuiPskK3kj3",
"net_exchangerate": 1.3251652,
"system_reference_number": "WFT9188961163",
"createdTime": "2023-06-16T05:22:14Z"
}
}

Get Conversion​

This API retrieves the status and details of a specific currency conversion.

GET {{baseUrl}}/roecny/api/v1/transfer/conversion/{{conversion_id}}

Description

Fetch details of a specific conversion using its conversion_id. Used to track or audit the status and details of a particular FX conversion transaction. This includes transaction status, rates, currencies involved, and settlement details.

Request Headers

ParameterTypeRequiredDescription
x-api-keystringYesShared X-API key provided by Roecny
x-program-idstringYesProgram identifier
x-request-idstringYesIdempotency key
x-user-idstringYesUser identification key
AuthorizationstringYesBearer token
Content-TypestringYesMust be application/json

Query Parameters

ParameterTypeRequiredDescription
conversion_idstringYesThe ID of the conversion to retrieve

Request Example

curl --request GET \
--url '{{baseUrl}}/roecny/api/v1/transfer/conversion?conversion_id=conversion_4UTXo2tQnThdZGrMz6FdQR' \
--header 'x-api-key: {{Shared Xapikey By Roecny}}' \
--header 'x-program-id: {{BasedOnRequirement}}' \
--header 'x-request-id: {{IdempotencyKey}}' \
--header 'x-user-id: {{Useridentificationkey}}' \
--header 'Authorization: Bearer {{YOUR_TOKEN}}'

Response Example

{
"code": 200,
"status": "success",
"message": "Conversion Details Fetched",
"data":
{
"id": "13a154ca-4ca6-4f8b-9c30-eb09312f44ce",
"status": "SETTLED",
"conversionTime": "2025-04-23T08:05:52+0000",
"sourceCurrencycode": "USD",
"destinationCurrencycode": "SGD",
"sourceAmount": 100.0,
"destinationAmount": 131.73,
"quoteId": "cf9dbf97-a74f-3f77-8ced-913861b31336",
"netExchangerate": 1.317342,
"systemReferenceNumber": "C250423-V53OOTQ",
"createdTime": "2025-04-23T08:05:52+0000"
}
}