Source
The transaction can have two types of sources: single or multiple.
The sum of the source values (source
) must always be equal to the value informed immediately after sending the transaction (send
) and equal to the sum of the distributed values (distribute
).
Single source
The most basic format. The amount is deducted from the available balance (available.balance
) of a single source and transferred to a single destination (distribute
).
Multi-source
With multiple sources, you will have the amount deducted from different sources. For example, if Account A does not have enough balance to cover the transaction, the remaining amount will be deducted from Account B.
If both accounts together do not have the available balance, we will return an insufficient balance error.
To send percentage transactions, the user can enter the value in percentage or a fraction and can use both together.
Code examples
Percentage transactions
To send percentage transactions, users can enter the value as a percentage or a fraction or use both together, as shown below.
In this example, 25% would be debited from account 3172933b-50d2-4b17-96aa-9b378d6a6eac, 12% from account 8a1b173c-35fc-41f4-ac94-6b202e0bcd7f, BRL 0.0003 from account dd76761b-68e1-49f7-adcc-6788dd1a3656, and the remainder to top up BRL 0.0030 from account 01de90bf-5d09-461e-8a24-8e5cdb94968e.
The total amount will be sent to account 540b504c-8f9d-480f-9354-3728cf7025ef.
Code example
Last updated