Web Rabbit MediaDocs
Reference

Amounts & currency

Decimal cedis and exact pesewa minor units, and the rounding rules behind them.

Every money field on the API is available in two forms: a decimal amount in Ghana cedis (amount) and an exact integer in pesewas (amount_minor). They always describe the same value. Integrate against amount_minor if you want to keep floating point out of your ledger entirely.

Field pairs

FieldTypeDescription
amount / amount_minornumber / integerThe requested or captured amount. 10.50 GHS is 1050 pesewas.
gross_amount / gross_amount_minornumber / integerWhat the customer paid.
fee_amount / fee_amount_minornumber / integerWeb Rabbit fee deducted from the collection.
net_amount / net_amount_minornumber / integerWhat settles to you after the fee and any split legs.
balance / balance_minornumber / integerSub-account balances and ledger entries.

Sending amounts

On POST /v1/collect/momo, POST /v1/checkout/session and POST /v1/splits/preview you may send either field. Send amount_minor and nothing is ever converted through a float on our side.

request
{ "amount_minor": 1050, "subscriber_number": "0244000000", "network": "MTN" }

// equivalent to
{ "amount": 10.50, "subscriber_number": "0244000000", "network": "MTN" }
!Do not send both with different values
If you send amount and amount_minor and they disagree, the request is rejected with HTTP 400 amount_conflict rather than us guessing which one you meant.

Why minor units

Math.round(value * 100) is silently wrong for values such as 1.005, which is stored as 1.00499999… in IEEE 754 and rounds down. We parse decimal amounts from their exact string form, never through a float, and all fee and split arithmetic runs in integer pesewas. Remainders from percentage splits are allocated to the largest leg so the parts always sum exactly to the whole.

Limits and rounding rules

FieldTypeDescription
CurrencyGHSAll amounts are Ghana cedis. 1 GHS = 100 pesewas.
Precision2 decimalsMore than two decimal places is rejected — 10.505 is not a valid amount.
Minimum0.01 GHS1 pesewa. Amounts of zero or below are rejected.
Test mode cap10.00 GHSSimulated test charges are capped so nothing looks like production volume.