Amounts & precision¶
The Settlement API uses different representations for fiat (minor units) and crypto (decimal numbers). Understanding this is essential to avoid off-by-decimal bugs.
Rules¶
source_amountandexpected_source_amountare integers in minor units.- Fiat currencies follow ISO 4217 minor units (e.g.,
KEShas 2 decimals). - Crypto amounts follow the token's on-chain decimals (e.g.,
USDThas 6 decimals on Polygon). destination_amountandplatform_feeare decimal numbers; clients should accept up to the destination currency's decimal precision.exchange_rateis a decimal number with up to 8 decimal places.- Trailing zeros may be omitted (e.g.,
1.5and1.500000are equivalent).
Examples¶
| Currency | Decimals | Example |
|---|---|---|
KES |
2 | 100000 = 1,000.00 KES |
USDT |
6 | 1.5 = 1.500000 USDT |
Gross vs. net¶
Bitlipa distinguishes between the gross source amount it expects to receive and the net destination amount delivered to the wallet:
source_amount/expected_source_amount— gross amount Bitlipa receives.destination_amount— net amount delivered to the wallet (afterplatform_feededuction).
platform_fee is denominated in the destination currency
The fee is a fixed amount in the destination currency (e.g., USDT). It can vary per merchant and chain.
Fulfillment¶
| Value | Meaning |
|---|---|
full |
expected_source_amount equals the requested source_amount. |
partial |
expected_source_amount is less than requested due to liquidity constraints. Present to the merchant for acceptance. |
none |
Settlement cannot be fulfilled. |