Skip to main content

Monetary Fields

Monetary values in purchase receipts and lookup receipts are returned in cents (the smallest ZAR unit), as integers. For example, 10037 means R100.37.

Request vs. response units
  • Requests (for example amount on POST /transactions/purchase) are sent in rands, e.g. 100.37.
  • Receipt monetary fields in responses are returned in cents, e.g. 10037.

To show a customer an amount in rands, divide the receipt value by 100 and format it to two decimals:

const rands = (cents / 100).toFixed(2); // 10037 -> "100.37"

Which fields are monetary?​

Not every number in a receipt is an amount (account numbers, unit counts and reference numbers are not). The category metadata tells you exactly which receipt paths hold money, in the monetaryFields array returned by GET /products/categories/{categoryId}/fields:

{
"receiptFields": ["amount", "voucher.pin", "voucher.amount", "details[0].productAmount"],
"monetaryFields": ["amount", "voucher.amount", "details[0].productAmount"]
}

Use monetaryFields to decide which values to divide by 100. If a category has no monetaryFields (or the key is absent), treat its receipt values as returned by the provider and do not convert them.

Monetary field reference​

The paths below use the same notation as receiptFields. A field only appears in a response when the product returns it.

Purchase receipt (receipt)​

PathDescriptionTypical products
amountAmount of the transactionAll categories
amountDueAmount due on the accountPay Bills, Money Transfer
voucher.amountFace value of the voucherVoucher, Gaming, Entertainment, Lifestyle
voucher.voucherBalanceRemaining balance on the voucherVoucher, Gaming, Entertainment, Lifestyle
details[0].productAmountAmount of the purchased productAirtime, Data, SMS, Minutes, Vouchers
mma.amountAmount of the money-movement sub-transactionWhere returned

Lookup receipt (lookUpReceipt)​

Lookup receipts flatten nested fields.* entries to their last key (for example fields.Amount Due is returned as Amount Due).

Key / PathDescription
amountOutstanding or payable amount
amountDueAmount due on the account
correctAmountExact amount that must be paid
minAmountMinimum amount accepted
maxAmountMaximum amount accepted
Amount Due (fields.Amount Due)Amount due, as reported for the account

Example​

Receipt returned by a purchase:

{
"successful": true,
"receipt": {
"amount": 10037,
"voucher": { "pin": "1234567890", "amount": 10037 },
"accountNumber": "00123"
}
}

Display values:

Amount:         R100.37
Voucher value: R100.37
Account number: 00123 (not monetary; shown as-is)

Best practices​

  • Always drive conversion from monetaryFields. Do not guess by field name or by whether a value looks numeric.
  • Convert only for display. Keep amounts as integer cents in your own logic to avoid floating-point rounding errors.
  • Values can be 0 or negative. Format them like any other amount (for example a zero balance is R0.00).
  • Missing fields are normal. Skip any path that is absent or null in a given response.

Last updated: October 2026