Learn how to handle currency exchange and multi-currency transactions in your Blnk Ledger.
$1000.00
to GBP. Assuming an exchange rate of $1.00 = £0.79
, $1000.00 = £790.00
. You can record this and ensure atomicity with the Bulk Transactions feature.
Create a bulk transaction request containing two transactions as shown below:
atomic = true
ensures that both transactions are processed together. If one fails, the other will be rolled back.
@Nostro-USD
and @Nostro-GBP
are created as internal balances in your General Ledger. You can use them to track your incoming and outgoing transactions per currency across your application.
parent_transaction
field that contains the batch_id
of the bulk transaction request.
$1 = £0.79
, but the customer receives at a rate of $1 = £0.77
, then:
$1000.00
£770.00
£20.00
Currency | Source | Destination | Amount | Purpose |
---|---|---|---|---|
USD | customer-balance-usd | @Nostro-USD | $1000.00 | Deduct USD from customer |
GBP | @Nostro-GBP | customer-balance-gbp | £770.00 | Credit GBP to customer (after deducting spread) |
GBP | @Nostro-GBP | @Spread-GBP | £20.00 | Record spread as revenue |