FX conversion settled immediately using market rate

If you already have the required source amount in the customer wallet and you want to convert to the destination currency at the live market FX rate, follow these steps:

Step 1: Initiate the conversion

Once you have confirmed that the customer wallet has sufficient funds in the source currency, you can initiate the conversion by providing the sourceCurrencyCode, destinationCurrencyCode and either the sourceAmount or the destinationAmount as below:

curl -X POST "https://apisandbox.nium.com/api/v1/client/{clientHashId}/customer/{customerHashId}/wallet/{walletHashId}/conversions" \ 
-H "accept: application/json" \ 
-H "Content-Type: application/json" \ 
-d
'{
    "sourceCurrencyCode": "USD",
    "destinationCurrencyCode": "AUD",
    "sourceAmount": 100,
    "customerComments": "Transfering for AUD payroll"
}'

Step 2: Get the response

Nium internally calculates the FX rate for an immediate conversion schedule for the currency pair and uses this rate to calculate the destinationAmount or sourceAmount and return the response with the status as created. The response also includes the netExchangeRate, which is the rate used to perform the FX conversion. This is calculated by getting the latest interbank rate for that currency pair—exchangeRate—and reducing the total markup rate—markupRate—that has been configured for your account for the combination of the currency pair, lock period, and conversion schedule.

{
    "id": "conversion_46nn6y8gDX2Os6DHjlHdke",
    "status": "processing",
    "conversionTime": "2023-06-15 06:43:15",
    "sourceCurrencyCode": "USD",
    "destinationCurrencyCode": "AUD",
    "sourceAmount": 100,
    "destinationAmount": 145.83,
    "quoteId": "quote_6ghWKO8SV8gBC9rQvsHOLi",
    "netExchangeRate": 1.458319800,
    "exchangeRate": 1.468600000,
    "markupRate": 0.010280200,
    "destinationMarkupAmount": 1.03,
    "systemReferenceNumber": "WFT1180326200",
    "customerComments": "Transfering for AUD payroll",
    "createdTime": "2023-06-15 06:43:16",
    "updatedTime": "2023-06-15 06:43:16"
}

Step 3: Get the conversion settlement notification

Since this is a conversion that's settled immediately using the available balance, the balances in the wallet are updated and you immediately receive a webhook notification that shows the new status as completed.

{
"customerHashId":"e9f74ac0-8fc5-4879-8ace-6ca2084ba250",
"template":"FX_CONVERSION_COMPLETED_WEBHOOK",
"systemReferenceNumber":"WFT1180326200",
"walletHashId":"ebc26772-2d3e-4ab0-916a-3a7706a0c358",
"conversionId":"conversion_46nn6y8gDX2Os6DHjlHdke",
"clientHashId":"8bf73eb1-99e7-4a76-8ef2-cdeac938593a",
"status":"completed"
}