Skip to content
Last updated

Whoosh Core API

Welcome to the Whoosh Innovations Pty. Core API — the integration layer for prepaid electricity vending, postpaid bill payments, and AARTO traffic fine management across South African municipalities.


Authentication

All API requests must include a valid API key in the X-API-KEY request header.

X-API-KEY: your-api-key-here

If the header is missing or the key is invalid, the API returns HTTP 401 Unauthorized.

Important: Your test environment API key is different from your production API key. Never use a production key against a test environment.


Environments

EnvironmentBase URL
Testinghttps://api-test.amabills.co.za/api
Productionhttps://api.amabills.co.za/api

Services Overview

Electricity Vending

Prepaid token vending for the following municipalities:

MunicipalityIdentifier
City of Tshwanetshwane_prepaid
Mogale Citymogale_prepaid
Zeerustzeerust_prepaid
Ngwathengwathe_prepaid
Thembelihlethembelihle_prepaid

Quick Start

  1. Confirm the meter — call POST /v2/Electricity/ConfirmCustomer with the meter number and municipality to validate the meter and retrieve customer details. This step is recommended before every purchase to confirm that you are vending for the correct meter.

  2. Purchase — call POST /v2/Electricity/Purchase with the confirmed meter number, municipality, amount, and payment method to make the actual token purchase.

  3. Monitor your balance — call POST /v1/Merchant/CheckBalance to check your remaining merchant credit before vending.

Idempotency

Pass a unique idempotency string on each Purchase request. If a request fails and you need to retry, reuse the same value — the system will not generate a duplicate vend.

Test Data

Tshwane
Meter NoResult
04243399104Normal Vend
07045191942FBE (if you want only FBE put an amount of R0)
07027050819Key Change
04292145648Key Change and FBE
81114325624Arrears
14445160626Fixed Charges
Mogale
Meter NoResult
81114338999Normal Vend
81114326440FBE
07600938182Key Change
Zeerust
Meter NoResult
04265463002Normal Vend
07025361416FBE
04235758721Key Change

Traffic Fines

Query and payment services for AARTO-registered traffic infringements, supporting lookups by ID number, business registration number, or notice number.

Quick Start

  1. Look up fines — search by ID number (ViewByIDnumber), business registration number (ViewByBusinessRegistration), or notice number (ViewByNoticeNumber). Each response includes a list of InfringementDetail objects with net amounts, vendor fees, and gross amounts.

  2. Validate the payment amount — call ValidateMarkTrafficFinesAsPaid with the proposed amount. The response confirms whether the amount is correct (isCorrectAmount: true) and returns the difference if not.

  3. Mark as paid — call MarkTrafficFineAsPaid to declare that the merchant received the gross amount from the customer and to clear the fines with AARTO. The response includes AARTO receipt numbers (receiptNumber) and invoice numbers (invoiceNumber) per fine.

Amount breakdown

Every fine exposes three amounts:

FieldMeaning
netFineAmntThe base fine amount set by the issuing authority
vendorFeeAmntWhoosh processing fee
grossAmntTotal to charge the customer (net + vendor)

When calling MarkTrafficFineAsPaid, submit the grossAmnt as the amount per fine.


Bill Payments

Post paid bill payments for the following municipalities:

MunicipalityIdentifier
City of Tshwanetshwane_postpaid
Mogale Citymogale_postpaid
  1. Confirm the meter — call POST /v2/Bills/ConfirmCustomer with an account number and municipality to validate the account and retrieve customer details. This step is recommended before every purchase to confirm that you are clearing debts for the correct account.

  2. Purchase — call POST /v2/Bills/Purchase with the confirmed account number, municipality, amount, and payment method to make the actual debt clarrenca


Value-Added Services (VAS)

Airtime, data bundles, lotto, and other value-added services. The Whoosh VAS API integration split into three simple operations: list products, confirm a quote, and purchase.

Quick Start

  1. List products — call GET /v1/VAS/Products to retrieve the full product catalogue. Each product includes an id (use as productID) and a reference array (pass as-is in subsequent calls).

  2. Confirm — call POST /v1/VAS/Confirm with the productID, amount, and reference to get a quote. The response includes the fee breakdown, total amount, and optionally a quoteId to bind to the purchase.

  3. Purchase — call POST /v1/VAS/Purchase with the same fields. For airtime and data products, value is delivered directly to the recipient. For voucher products, a pin and instructions are returned to present to the customer.

Key fields

FieldWhere it comes fromWhere it's used
productIDid from List ProductsConfirm & Purchase
referencereference array from List Products (JSON-encoded)Confirm & Purchase
amountCaller-supplied (open-value) or fixed (from product)Confirm & Purchase
quoteIdReturned by Confirm (if present)Purchase

Fixed vs open-value products

FieldFixed-amount productOpen-value product
fixedAmounttruefalse
amountSet by productCaller-supplied
minAmount / maxAmountnullDefines valid range

Whoosh Payments

Order creation and Mastercard Hosted Checkout payment initiation. Creates an order on the Whoosh platform and returns a payment URL to redirect customers for secure card capture.

Quick Start

  1. Create an order — call POST /v1/putOrderV2 with your merchantId, order details, line items, and redirect URLs.

  2. Redirect the customer — use the paymentPageUrl from the response to send the customer to the Mastercard Hosted Checkout page for secure card capture.

  3. Handle the redirect — after payment, Mastercard redirects the customer to your redirectSuccess or redirectCancel URL. Use the Whoosh Reconciliation endpoints to verify the final payment status.

Staging environment: Always use merchantId: staging when calling the test base URL. A production merchantId will be issued before go-live.

Whoosh Reconciliation

MPGS reconciliation and payment status verification. Retrieve end-of-day transaction ledgers and verify the payment status of individual orders.

Quick Start

  1. End-of-day ledger — call POST /v1/whooshEndOfDayLedgerV2 (no request body required) to retrieve all MPGS transactions for the previous South Africa business day, including totals and any verification errors.

  2. Check order payment status — call POST /v1/whooshCheckOrderPaymentStatusV2 with an orderId to verify the payment status of a specific order.

Payment statuses

StatusMeaning
PAIDPayment was successfully captured
PENDINGPayment is in progress
FAILEDPayment was attempted but failed
NO_ATTEMPTNo payment attempt was made
VERIFICATION_ERRORStatus could not be determined — check verificationErrors

Response format note

The reconciliation endpoints return different response shapes depending on the HTTP status code:

Status codeResponse shape
200, 500Direct response object
400, 404{ status, data } wrapper

Response Envelopes

Electricity endpoints

{
  "success": true,
  "data": { ... },
  "error": null,
  "errorNo": null
}

success is a boolean.

Traffic Fine endpoints

{
  "success": 1,
  "result": { ... },
  "error": null
}

success is an integer1 for success, 0 for error.


Error Handling (Traffic Fines)

When a Traffic Fine request fails (success: 0), the error field contains an ErrorMessage object:

{
  "success": 0,
  "error": {
    "code": 9,
    "message": "No infringement found for the provided ID number.",
    "validationMessage": []
  }
}
CodeMeaning
1Authentication failed
2Service unavailable – retry; contact support if it persists
3Service error – contact support
5Invalid ID
6ID must be numeric
7ID number check digit must be valid
8The identified infringer does not exist
9No infringement found for the identification type or number
10Check digit of the infringement notice number must be valid
11Fine must be payable at a registering authority
12Infringement notice number does not exist
13Infringement notice number does not exist
14Fine may not be in status 10 (court case)
15Elected to be tried in court – successful court application status
16Transaction not allowed – nomination of driver is pending
17Partially paid fine must be settled at a registering authority or DLTS
18Fine may not be in status 13 (partially paid)
23Validation error – see validationMessage array for details