FX Rate Locks
FX Rate Locks allow you to lock an exchange rate for an extended period of time beyond the default simulation expiry. This is useful when you need more time to confirm a transaction with your end user or when you want to guarantee a rate while awaiting approval.
When you create a simulation, Caliza automatically generates FX Lock variants with different durations. Each variant applies a small spread on top of the market rate — the longer the lock, the higher the spread.
| Lock Type | Duration | Spread |
|---|---|---|
| DEFAULT | 2 hours | 0% |
| FX_LOCK_5 | 5 hours | 0.1% |
| FX_LOCK_24 | 24 hours | 0.25% |
| FX_LOCK_48 | 48 hours | 0.5% |
| FX_LOCK_72 | 72 hours | 1.0% |
To use FX Rate Locks, follow this workflow:
- Create a simulation using v2.
- Retrieve the available FX Lock options.
- Choose the lock variant that best fits your needs.
- Execute the payment or transaction using the chosen simulation ID.
Step 1: Create a simulation
To get started, create a simulation using the v2 endpoint. Make sure to replace the following:
YOUR_TOKENwith your actual API tokenbeneficiaryIdwith the ID of the beneficiary
curl -s --location --request POST 'https://api.sandbox.caliza.com/core-api/v2/simulations' \
--header "Authorization: Bearer YOUR_TOKEN" \
--header 'Content-Type: application/json' \
--data '{
"from": {
"currencyCode": "USDC",
"value": 1000
},
"to": {
"currencyCode": "BRL"
},
"beneficiaryId": "69261109adcc7b2db705a123",
"recipientId": "12ace467-8189-42ec-8b21-0a5bf7cd7f5e",
"funding": "ETH",
"payout": "PIX"
}'Where:
from: An object containing details about the source of funds, including currency code and value.to: An object containing details about the destination of funds, including currency code.beneficiaryId: The ID of the beneficiary associated with the simulation.recipientId: The ID of the recipient where the funds will be sent.funding: The funding rail used for the transaction (e.g., "ETH").payout: The payout rail used for the transaction (e.g., "PIX").
Step 2: Retrieve FX Lock options
Using the simulation ID from the previous step, retrieve all available FX Lock variants.
curl --location 'https://api.sandbox.caliza.com/core-api/v2/simulations/{{simulationId}}/fxlocks' \
--header 'Authorization: Bearer YOUR_TOKEN'Where simulationId is the ID of the simulation created in Step 1.
Step 3: Choose a lock and execute
Once you've reviewed the FX Lock options, pick the simulation that best fits your needs and use its id to execute the payment or transaction.
Execute as a payment
curl 'https://api.sandbox.caliza.com/core-api/v1/payments' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"simulationId": "{{chosenSimulationId}}",
"beneficiaryIp": "{{beneficiaryIp}}"
}'Where:
simulationId: The ID of the FX Lock simulation you chose from the list (e.g., theFX_LOCK_24variant).beneficiaryIp: The IP address of the beneficiary initiating the payment.
Execute as a transaction
Alternatively, you can execute as a transaction:
curl 'https://api.sandbox.caliza.com/core-api/v1/transactions' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"simulationId": "{{chosenSimulationId}}",
"beneficiaryIp": "{{beneficiaryIp}}"
}'
Locked rate guaranteeThe exchange rate is guaranteed for the full duration of the chosen lock. If you selected
FX_LOCK_24, you have 24 hours from the simulation creation time to execute the payment or transaction at the locked rate. After theexpiresAttime, the simulation can no longer be used.
Spread trade-offLonger lock durations provide more time to execute but come with a higher spread. Choose the shortest lock duration that meets your operational needs to minimize costs.
Related Articles
Updated 3 days ago
