Skip to content

Usage metering

Usage records drive per-unit and percentage pricing — NHIS claims, SMS, AI requests, storage. Report counts and money values; the monthly billing run does the maths.

How metering is billed

Billing runs by calendar month. Plan fees are invoiced in advance; metered add-ons are invoiced in arrears on the next month’s invoice, using usage whose occurred_at fell in the previous month. Every add-on uses one formula:

charge = flat_fee
       + max(0, usage_quantity − included_units) × unit_price
       + value_amount × percentage_bps / 10 000
then clamped to [minimum_charge, maximum_charge]

Read the current values for each add-on from GET /addons: which usage_metric drives the quantity and which value_metric the percentage applies to.

Metrics

metricUnitvalue?AggregationMeaning
nhis_claims_submittedclaimpesewassumClaims submitted to NHIA. value = total amount claimed.
nhis_claims_rejectedclaimpesewassumClaims NHIA rejected or queried. value = amount rejected.
nhis_claims_recoveredclaimpesewassumPreviously rejected claims corrected and paid. value = amount recovered.
nhis_claims_paidclaimpesewassumClaims NHIA has paid out. value = amount received.
sms_sentSMS—sumOutbound SMS (reminders, results, alerts).
whatsapp_sentmessage—sumOutbound WhatsApp template messages.
ai_requestsrequest—sumAI documentation / coding-assist calls.
telehealth_minutesminute—sumConnected consultation minutes on the telehealth service (recorded by the hub at call end).
patients_registeredpatient—sumNew patient registrations (count only).
encountersencounter—sumOPD + IPD encounters (count only).
storage_gbGB—period maxDocument/imaging storage in GB (gauge; the period maximum is billed).

Example: NHIS claims

The NHIS Claims Manager add-on is priced as a monthly base fee, a per-claim fee above an allowance, and a success fee on rejected claims that are recovered. A facility reports its month like this:

POST https://admin.heka.care/api/platform/v1/usage
{
  "records": [
    { "metric": "nhis_claims_submitted", "quantity": 700, "value": 14000000,
      "occurred_at": "2026-09-30T20:00:00Z", "idempotency_key": "GH-VRH-001:claims:2026-09:submitted" },
    { "metric": "nhis_claims_rejected",  "quantity": 84,  "value": 1680000,
      "occurred_at": "2026-09-30T20:00:00Z", "idempotency_key": "GH-VRH-001:claims:2026-09:rejected" },
    { "metric": "nhis_claims_recovered", "quantity": 30,  "value": 600000,
      "occurred_at": "2026-09-30T20:00:00Z", "idempotency_key": "GH-VRH-001:claims:2026-09:recovered" }
  ]
}

With a base fee of GH₵ 300, 200 claims included, GH₵ 1.50 per further claim and a 10 % success fee, October’s invoice shows:

PartCalculationAmount
Base feeflatGH₵ 300.00
Per-claim(700 − 200) × GH₵ 1.50GH₵ 750.00
Success fee10 % × GH₵ 6,000 recoveredGH₵ 600.00
TotalGH₵ 1,650.00
Report rejected and paid too, even when they do not affect the fee: they power the claims analytics (rejection rate, recovery, return on the module) that facilities see.

Rules

  • Up to 500 records per request. Quantities and values are non-negative integers; values only on metrics that take one.
  • occurred_at must be within the last 400 days and not more than a day in the future. Usage reported after the month was invoiced is not re-billed.
  • idempotency_key (8–128 chars, A–Z a–z 0–9 . _ : -) is unique per facility forever. Build it from the facility, metric and period so re-sending is always safe. See idempotency.
  • Never put patient names, numbers or identifiers in metadata. Counts and money only.