Money
Integer minor units, one settlement currency, and why display amounts are never settlement.
Settlement amounts are integer minor units of the settlement currency plus a currency code. There are no floats anywhere in the API.
{ "amount": 1450, "currency": "USD" }That is $14.50. amount is cents, as an integer; currency is an ISO 4217 code, and for
settlement it is always USD.
The wallet is closed-loop USD
Every account has one USD wallet per mode. Funding credits it, purchases debit it, and nothing else moves the balance. There are no withdrawals, and the balance is spendable only on products.
curl https://api.tizon.mobile/v1/wallet \
-H "Authorization: Bearer $TIZON_KEY"{
"id": "wlt_01J9Z8T4M7Q2V5X8B3N6D9F2H4",
"object": "wallet",
"currency": "USD",
"balance": { "amount": 24500, "currency": "USD" },
"available_to_spend": { "amount": 24500, "currency": "USD" },
"overdraft": {
"limit": { "amount": 0, "currency": "USD" },
"used": { "amount": 0, "currency": "USD" }
},
"pending_credit": { "amount": 0, "currency": "USD" },
"status": "active"
}The field to spend against is available_to_spend: the balance plus any overdraft
limit. It is what a wallet quote is checked against, and it is not the same as
balance for accounts with credit. See overdraft.
pending_credit is stablecoin deposits a provider has detected but not yet confirmed.
It is not spendable and not part of balance until it is credited.
Display amounts are presentation only
Ask for display_currency on the catalog and every offer gains an indicative display
amount beside its USD price:
curl -G https://api.tizon.mobile/v1/offers \
-H "Authorization: Bearer $TIZON_KEY" \
-d display_currency=NGNA display amount is for showing a customer a familiar number. It is never used for
settlement, never binding, and may move between the moment you show it and the moment
you quote. Settle on price, always.
A currency Tizon has no rate for is 400 unsupported_display_currency. Asking for USD
adds nothing, since price is already USD.
Prices already include the margin
An offer's price is the binding amount a quote will debit. Tizon's margin is inside it,
and the wholesale cost is never exposed.