Skip to content

API reference

Generated from the same schemas that validate requests, so it matches the running API. Base URL https://admin.heka.care/api/platform/v1. Download the OpenAPI 3.1 document for Postman, Insomnia or a client generator.

Catalogue

Plans and add-ons — the price book.

get/plansList plans
Scopes:plans:read
Parameters
include_inactivequery · "true" | "false"
Response 200
dataPlan[]required
Show fields
idstringrequired
codestringrequired
namestringrequired
descriptionstring | null
license_tierstringrequired
basic | standard | enterprise — drives the EHR licence tier
monthly_priceintegerrequired
Amount in pesewas (GHS × 100)
annual_priceintegerrequired
Amount in pesewas (GHS × 100)
currencystringrequired
featuresstring[]required
limitsobjectrequired
Show fields
max_bedsinteger | null
max_sitesinteger | null
max_usersinteger | null
included_sms_per_monthinteger | null
storage_gbinteger | null
trial_daysintegerrequired
is_publicbooleanrequired
is_activebooleanrequired
has_morebooleanrequired
next_cursorstring | null
Pass as `cursor` to fetch the next page
get/addonsList add-ons

Add-on pricing is one formula: flat_fee + max(0, usage − included_units) × unit_price + value × percentage_bps / 10 000, clamped to [minimum_charge, maximum_charge].

Scopes:plans:read
Parameters
include_inactivequery · "true" | "false"
Response 200
dataAddon[]required
Show fields
idstringrequired
codestringrequired
namestringrequired
descriptionstring | null
pricing_model"flat" | "per_unit" | "percentage" | "hybrid"required
flat_feeintegerrequired
Monthly flat fee, pesewas
unit_priceintegerrequired
Price per billable unit, pesewas
unit_labelstring | null
included_unitsintegerrequired
usage_metricstring | null
percentage_bpsintegerrequired
value_metricstring | null
minimum_chargeintegerrequired
Amount in pesewas (GHS × 100)
maximum_chargeinteger | null
currencystringrequired
featuresstring[]required
is_activebooleanrequired
has_morebooleanrequired
next_cursorstring | null
Pass as `cursor` to fetch the next page

Facilities

Facilities on the network, their balances and entitlements.

get/facilitiesList facilities

Facility-scoped keys see only their own facility.

Scopes:facilities:read
Parameters
limitquery · integer
cursorquery · string
regionquery · string
is_activequery · "true" | "false"
Response 200
dataFacility[]required
Show fields
facility_idstringrequired
namestringrequired
typestring | null
countrystring | null
regionstring | null
districtstring | null
tierstring | null
is_activebooleanrequired
created_atstringrequired
ISO-8601 timestamp (UTC)
has_morebooleanrequired
next_cursorstring | null
Pass as `cursor` to fetch the next page
get/facilities/{facility_id}Get a facility
Scopes:facilities:read
Parameters
facility_idpath · stringrequiredFacility identifier, e.g. GH-VRH-001
Response 200
dataFacilityrequired
Show fields
facility_idstringrequired
namestringrequired
typestring | null
countrystring | null
regionstring | null
districtstring | null
tierstring | null
is_activebooleanrequired
created_atstringrequired
ISO-8601 timestamp (UTC)
get/facilities/{facility_id}/balanceGet the outstanding balance
Scopes:facilities:read
Parameters
facility_idpath · stringrequiredFacility identifier
Response 200
dataBalancerequired
Show fields
facility_idstringrequired
currencystringrequired
balance_dueintegerrequired
Unpaid total across open invoices
overdue_amountintegerrequired
Part of the balance past its due date
oldest_due_datestring | null
ISO-8601 timestamp (UTC)
get/facilities/{facility_id}/entitlementsGet features, limits and commercial state

What the EHR should switch on. `clinical_access` is always "full": non-payment pauses premium add-ons at most.

Scopes:entitlements:read
Parameters
facility_idpath · stringrequiredFacility identifier
Response 200
dataEntitlementsrequired
Show fields
facility_idstringrequired
planobject | null
subscription_status"trialing" | "active" | "past_due" | "grace" | "restricted" | "cancelled" | null
commercial_state"none" | "trial" | "ok" | "past_due" | "grace" | "restricted" | "cancelled"required
clinical_access"full"required
Always "full": non-payment never blocks clinical work
featuresstring[]required
suspended_featuresstring[]required
limitsobjectrequired
restrictions"billing_banner" | "admin_warning" | "premium_features_suspended"[]required
messagestring | null
trial_ends_atstring | null
ISO-8601 timestamp (UTC)
current_period_endstring | null
ISO-8601 timestamp (UTC)
balance_dueintegerrequired
Amount in pesewas (GHS × 100)
overdue_amountintegerrequired
Amount in pesewas (GHS × 100)
currencystringrequired
generated_atstringrequired
ISO-8601 timestamp (UTC)

Subscriptions

Plan subscriptions and add-ons per facility.

get/subscriptionsList subscriptions
Scopes:subscriptions:read
Parameters
limitquery · integer
cursorquery · string
statusquery · "trialing" | "active" | "past_due" | "grace" | "restricted" | "cancelled"
facility_idquery · string
Response 200
dataSubscription[]required
Show fields
idstringrequired
facility_idstringrequired
facility_namestring
planobjectrequired
Show fields
codestringrequired
namestringrequired
license_tierstringrequired
status"trialing" | "active" | "past_due" | "grace" | "restricted" | "cancelled"required
interval"monthly" | "annual"required
currencystringrequired
price_overrideinteger | null
discount_bpsintegerrequired
mrrinteger
Monthly recurring revenue contribution
started_atstringrequired
ISO-8601 timestamp (UTC)
current_period_startstringrequired
ISO-8601 timestamp (UTC)
current_period_endstringrequired
ISO-8601 timestamp (UTC)
plan_billed_throughstring | null
ISO-8601 timestamp (UTC)
trial_ends_atstring | null
ISO-8601 timestamp (UTC)
cancel_at_period_endbooleanrequired
cancelled_atstring | null
ISO-8601 timestamp (UTC)
cancellation_reasonstring | null
past_due_sincestring | null
ISO-8601 timestamp (UTC)
billing_contact_namestring | null
billing_emailstring | null
billing_phonestring | null
po_numberstring | null
addonsSubscriptionAddon[]
Show fields
codestringrequired
namestringrequired
pricing_modelstringrequired
quantityintegerrequired
unit_price_overrideinteger | null
flat_fee_overrideinteger | null
percentage_bps_overrideinteger | null
started_atstringrequired
ISO-8601 timestamp (UTC)
ended_atstring | null
ISO-8601 timestamp (UTC)
created_atstringrequired
ISO-8601 timestamp (UTC)
updated_atstringrequired
ISO-8601 timestamp (UTC)
has_morebooleanrequired
next_cursorstring | null
Pass as `cursor` to fetch the next page
post/subscriptionsCreate a subscription

A facility can have one live subscription. Omit trial_days for the plan default; 0 starts billing immediately. Billing is by calendar month: the plan is invoiced in advance, metered add-ons in arrears.

Scopes:subscriptions:writeIdempotency-Key supported
Request body
facility_idstringrequired
Facility identifier, e.g. GH-VRH-001
plan_codestringrequired
interval"monthly" | "annual"default "monthly"
price_overrideinteger | null
discount_bpsintegerdefault 0
Basis points (1 bps = 0.01 %, 10 000 = 100 %)
trial_daysinteger
Omit for the plan default; 0 bills immediately
start_atdatetime
ISO-8601 timestamp, e.g. 2026-11-01T00:00:00Z
billing_contact_namestring | null
billing_emailstring | null
billing_phonestring | null
po_numberstring | null
notesstring | null
addonsobject[]default []
Show fields
addon_codestringrequired
quantityintegerdefault 1
unit_price_overrideinteger | null
flat_fee_overrideinteger | null
percentage_bps_overrideinteger | null
Example
{
  "facility_id": "GH-VRH-001",
  "plan_code": "hospital",
  "interval": "monthly",
  "discount_bps": 1000,
  "addons": [
    {
      "addon_code": "nhis_claims"
    }
  ]
}
Response 201
dataSubscriptionrequired
Show fields
idstringrequired
facility_idstringrequired
facility_namestring
planobjectrequired
Show fields
codestringrequired
namestringrequired
license_tierstringrequired
status"trialing" | "active" | "past_due" | "grace" | "restricted" | "cancelled"required
interval"monthly" | "annual"required
currencystringrequired
price_overrideinteger | null
discount_bpsintegerrequired
mrrinteger
Monthly recurring revenue contribution
started_atstringrequired
ISO-8601 timestamp (UTC)
current_period_startstringrequired
ISO-8601 timestamp (UTC)
current_period_endstringrequired
ISO-8601 timestamp (UTC)
plan_billed_throughstring | null
ISO-8601 timestamp (UTC)
trial_ends_atstring | null
ISO-8601 timestamp (UTC)
cancel_at_period_endbooleanrequired
cancelled_atstring | null
ISO-8601 timestamp (UTC)
cancellation_reasonstring | null
past_due_sincestring | null
ISO-8601 timestamp (UTC)
billing_contact_namestring | null
billing_emailstring | null
billing_phonestring | null
po_numberstring | null
addonsSubscriptionAddon[]
Show fields
codestringrequired
namestringrequired
pricing_modelstringrequired
quantityintegerrequired
unit_price_overrideinteger | null
flat_fee_overrideinteger | null
percentage_bps_overrideinteger | null
started_atstringrequired
ISO-8601 timestamp (UTC)
ended_atstring | null
ISO-8601 timestamp (UTC)
created_atstringrequired
ISO-8601 timestamp (UTC)
updated_atstringrequired
ISO-8601 timestamp (UTC)
get/subscriptions/{id}Get a subscription
Scopes:subscriptions:read
Parameters
idpath · stringrequiredSubscription id (UUID)
Response 200
dataSubscriptionrequired
Show fields
idstringrequired
facility_idstringrequired
facility_namestring
planobjectrequired
Show fields
codestringrequired
namestringrequired
license_tierstringrequired
status"trialing" | "active" | "past_due" | "grace" | "restricted" | "cancelled"required
interval"monthly" | "annual"required
currencystringrequired
price_overrideinteger | null
discount_bpsintegerrequired
mrrinteger
Monthly recurring revenue contribution
started_atstringrequired
ISO-8601 timestamp (UTC)
current_period_startstringrequired
ISO-8601 timestamp (UTC)
current_period_endstringrequired
ISO-8601 timestamp (UTC)
plan_billed_throughstring | null
ISO-8601 timestamp (UTC)
trial_ends_atstring | null
ISO-8601 timestamp (UTC)
cancel_at_period_endbooleanrequired
cancelled_atstring | null
ISO-8601 timestamp (UTC)
cancellation_reasonstring | null
past_due_sincestring | null
ISO-8601 timestamp (UTC)
billing_contact_namestring | null
billing_emailstring | null
billing_phonestring | null
po_numberstring | null
addonsSubscriptionAddon[]
Show fields
codestringrequired
namestringrequired
pricing_modelstringrequired
quantityintegerrequired
unit_price_overrideinteger | null
flat_fee_overrideinteger | null
percentage_bps_overrideinteger | null
started_atstringrequired
ISO-8601 timestamp (UTC)
ended_atstring | null
ISO-8601 timestamp (UTC)
created_atstringrequired
ISO-8601 timestamp (UTC)
updated_atstringrequired
ISO-8601 timestamp (UTC)
post/subscriptions/{id}/change-planChange plan or terms

Downgrades take effect at the next renewal. Upgrades with prorate_now=true invoice the difference for the rest of the current term.

Scopes:subscriptions:writeIdempotency-Key supported
Parameters
idpath · stringrequiredSubscription id
Request body
plan_codestringrequired
interval"monthly" | "annual"
price_overrideinteger | null
discount_bpsinteger
Basis points (1 bps = 0.01 %, 10 000 = 100 %)
prorate_nowbooleandefault false
Upgrades only: invoice the difference for the rest of the term now
notestring
Response 200
dataobjectrequired
Show fields
subscriptionSubscriptionrequired
Show fields
idstringrequired
facility_idstringrequired
facility_namestring
planobjectrequired
Show fields
codestringrequired
namestringrequired
license_tierstringrequired
status"trialing" | "active" | "past_due" | "grace" | "restricted" | "cancelled"required
interval"monthly" | "annual"required
currencystringrequired
price_overrideinteger | null
discount_bpsintegerrequired
mrrinteger
Monthly recurring revenue contribution
started_atstringrequired
ISO-8601 timestamp (UTC)
current_period_startstringrequired
ISO-8601 timestamp (UTC)
current_period_endstringrequired
ISO-8601 timestamp (UTC)
plan_billed_throughstring | null
ISO-8601 timestamp (UTC)
trial_ends_atstring | null
ISO-8601 timestamp (UTC)
cancel_at_period_endbooleanrequired
cancelled_atstring | null
ISO-8601 timestamp (UTC)
cancellation_reasonstring | null
past_due_sincestring | null
ISO-8601 timestamp (UTC)
billing_contact_namestring | null
billing_emailstring | null
billing_phonestring | null
po_numberstring | null
addonsSubscriptionAddon[]
Show fields
codestringrequired
namestringrequired
pricing_modelstringrequired
quantityintegerrequired
unit_price_overrideinteger | null
flat_fee_overrideinteger | null
percentage_bps_overrideinteger | null
started_atstringrequired
ISO-8601 timestamp (UTC)
ended_atstring | null
ISO-8601 timestamp (UTC)
created_atstringrequired
ISO-8601 timestamp (UTC)
updated_atstringrequired
ISO-8601 timestamp (UTC)
proration_invoice_idstring | null
post/subscriptions/{id}/cancelCancel a subscription

at_period_end=true (default) keeps the service until the paid term ends.

Scopes:subscriptions:writeIdempotency-Key supported
Parameters
idpath · stringrequiredSubscription id
Request body
at_period_endbooleandefault true
reasonstringrequired
Response 200
dataSubscriptionrequired
Show fields
idstringrequired
facility_idstringrequired
facility_namestring
planobjectrequired
Show fields
codestringrequired
namestringrequired
license_tierstringrequired
status"trialing" | "active" | "past_due" | "grace" | "restricted" | "cancelled"required
interval"monthly" | "annual"required
currencystringrequired
price_overrideinteger | null
discount_bpsintegerrequired
mrrinteger
Monthly recurring revenue contribution
started_atstringrequired
ISO-8601 timestamp (UTC)
current_period_startstringrequired
ISO-8601 timestamp (UTC)
current_period_endstringrequired
ISO-8601 timestamp (UTC)
plan_billed_throughstring | null
ISO-8601 timestamp (UTC)
trial_ends_atstring | null
ISO-8601 timestamp (UTC)
cancel_at_period_endbooleanrequired
cancelled_atstring | null
ISO-8601 timestamp (UTC)
cancellation_reasonstring | null
past_due_sincestring | null
ISO-8601 timestamp (UTC)
billing_contact_namestring | null
billing_emailstring | null
billing_phonestring | null
po_numberstring | null
addonsSubscriptionAddon[]
Show fields
codestringrequired
namestringrequired
pricing_modelstringrequired
quantityintegerrequired
unit_price_overrideinteger | null
flat_fee_overrideinteger | null
percentage_bps_overrideinteger | null
started_atstringrequired
ISO-8601 timestamp (UTC)
ended_atstring | null
ISO-8601 timestamp (UTC)
created_atstringrequired
ISO-8601 timestamp (UTC)
updated_atstringrequired
ISO-8601 timestamp (UTC)
put/subscriptions/{id}/addons/{addon_code}Attach or replace an add-on
Scopes:subscriptions:write
Parameters
idpath · stringrequiredSubscription id
addon_codepath · stringrequiredAdd-on code, e.g. nhis_claims
Request body
quantityintegerdefault 1
unit_price_overrideinteger | null
flat_fee_overrideinteger | null
percentage_bps_overrideinteger | null
Response 200
dataSubscriptionrequired
Show fields
idstringrequired
facility_idstringrequired
facility_namestring
planobjectrequired
Show fields
codestringrequired
namestringrequired
license_tierstringrequired
status"trialing" | "active" | "past_due" | "grace" | "restricted" | "cancelled"required
interval"monthly" | "annual"required
currencystringrequired
price_overrideinteger | null
discount_bpsintegerrequired
mrrinteger
Monthly recurring revenue contribution
started_atstringrequired
ISO-8601 timestamp (UTC)
current_period_startstringrequired
ISO-8601 timestamp (UTC)
current_period_endstringrequired
ISO-8601 timestamp (UTC)
plan_billed_throughstring | null
ISO-8601 timestamp (UTC)
trial_ends_atstring | null
ISO-8601 timestamp (UTC)
cancel_at_period_endbooleanrequired
cancelled_atstring | null
ISO-8601 timestamp (UTC)
cancellation_reasonstring | null
past_due_sincestring | null
ISO-8601 timestamp (UTC)
billing_contact_namestring | null
billing_emailstring | null
billing_phonestring | null
po_numberstring | null
addonsSubscriptionAddon[]
Show fields
codestringrequired
namestringrequired
pricing_modelstringrequired
quantityintegerrequired
unit_price_overrideinteger | null
flat_fee_overrideinteger | null
percentage_bps_overrideinteger | null
started_atstringrequired
ISO-8601 timestamp (UTC)
ended_atstring | null
ISO-8601 timestamp (UTC)
created_atstringrequired
ISO-8601 timestamp (UTC)
updated_atstringrequired
ISO-8601 timestamp (UTC)
delete/subscriptions/{id}/addons/{addon_code}Remove an add-on
Scopes:subscriptions:write
Parameters
idpath · stringrequiredSubscription id
addon_codepath · stringrequiredAdd-on code
Response 200
dataSubscriptionrequired
Show fields
idstringrequired
facility_idstringrequired
facility_namestring
planobjectrequired
Show fields
codestringrequired
namestringrequired
license_tierstringrequired
status"trialing" | "active" | "past_due" | "grace" | "restricted" | "cancelled"required
interval"monthly" | "annual"required
currencystringrequired
price_overrideinteger | null
discount_bpsintegerrequired
mrrinteger
Monthly recurring revenue contribution
started_atstringrequired
ISO-8601 timestamp (UTC)
current_period_startstringrequired
ISO-8601 timestamp (UTC)
current_period_endstringrequired
ISO-8601 timestamp (UTC)
plan_billed_throughstring | null
ISO-8601 timestamp (UTC)
trial_ends_atstring | null
ISO-8601 timestamp (UTC)
cancel_at_period_endbooleanrequired
cancelled_atstring | null
ISO-8601 timestamp (UTC)
cancellation_reasonstring | null
past_due_sincestring | null
ISO-8601 timestamp (UTC)
billing_contact_namestring | null
billing_emailstring | null
billing_phonestring | null
po_numberstring | null
addonsSubscriptionAddon[]
Show fields
codestringrequired
namestringrequired
pricing_modelstringrequired
quantityintegerrequired
unit_price_overrideinteger | null
flat_fee_overrideinteger | null
percentage_bps_overrideinteger | null
started_atstringrequired
ISO-8601 timestamp (UTC)
ended_atstring | null
ISO-8601 timestamp (UTC)
created_atstringrequired
ISO-8601 timestamp (UTC)
updated_atstringrequired
ISO-8601 timestamp (UTC)

Invoices

Invoices from the monthly billing run, setup fees, rentals and manual charges.

get/invoicesList invoices
Scopes:invoices:read
Parameters
limitquery · integer
cursorquery · string
statusquery · "draft" | "open" | "paid" | "void" | "uncollectible"
facility_idquery · string
overduequery · "true" | "false"
issued_fromquery · datetimeISO-8601 timestamp, e.g. 2026-11-01T00:00:00Z
issued_toquery · datetimeISO-8601 timestamp, e.g. 2026-11-01T00:00:00Z
Response 200
dataInvoice[]required
Show fields
idstringrequired
numberstringrequired
facility_idstringrequired
facility_namestring
status"draft" | "open" | "paid" | "void" | "uncollectible"required
sourcestringrequired
currencystringrequired
issue_datestringrequired
ISO-8601 timestamp (UTC)
due_datestringrequired
ISO-8601 timestamp (UTC)
period_startstring | null
ISO-8601 timestamp (UTC)
period_endstring | null
ISO-8601 timestamp (UTC)
subtotalinteger
Amount in pesewas (GHS × 100)
discount_totalinteger
Amount in pesewas (GHS × 100)
tax_totalinteger
Amount in pesewas (GHS × 100)
totalintegerrequired
Amount in pesewas (GHS × 100)
amount_paidintegerrequired
Amount in pesewas (GHS × 100)
amount_dueintegerrequired
Amount in pesewas (GHS × 100)
overdue_daysinteger
memostring | null
tax_breakdownTaxLine[]
Show fields
codestringrequired
namestringrequired
rate_bpsintegerrequired
baseintegerrequired
Amount in pesewas (GHS × 100)
amountintegerrequired
Amount in pesewas (GHS × 100)
linesInvoiceLine[]
Show fields
idstringrequired
kind"subscription" | "addon" | "usage" | "nhis_claims" | "setup_fee" | "server_rental" | "server_deposit" | "adjustment" | "credit"required
descriptionstringrequired
quantityintegerrequired
unit_amountintegerrequired
Amount in pesewas (GHS × 100)
amountintegerrequired
Signed: credits are negative
taxablebooleanrequired
revenue_streamstringrequired
paymentsPayment[]
Show fields
idstringrequired
invoice_idstringrequired
invoice_numberstring | null
facility_idstringrequired
amountintegerrequired
Amount in pesewas (GHS × 100)
currencystringrequired
method"mobile_money" | "card" | "bank_transfer" | "cash" | "cheque" | "other"required
providerstringrequired
manual | paystack
referencestring | null
status"pending" | "succeeded" | "failed" | "refunded"required
paid_atstring | null
ISO-8601 timestamp (UTC)
failure_reasonstring | null
created_atstringrequired
ISO-8601 timestamp (UTC)
finalized_atstring | null
ISO-8601 timestamp (UTC)
paid_atstring | null
ISO-8601 timestamp (UTC)
voided_atstring | null
ISO-8601 timestamp (UTC)
void_reasonstring | null
has_morebooleanrequired
next_cursorstring | null
Pass as `cursor` to fetch the next page
post/invoicesCreate a manual invoice

Draft by default; finalize=true issues it. Taxes are computed from the hub billing settings.

Scopes:invoices:writeIdempotency-Key supported
Request body
facility_idstringrequired
Facility identifier, e.g. GH-VRH-001
linesobject[]required
Show fields
kind"subscription" | "addon" | "usage" | "nhis_claims" | "setup_fee" | "server_rental" | "server_deposit" | "adjustment" | "credit"default "adjustment"
descriptionstringrequired
quantityintegerdefault 1
unit_amountintegerrequired
Pesewas; negative only for credit/adjustment
taxablebooleandefault true
revenue_stream"subscription" | "addon" | "nhis" | "setup" | "server" | "messaging" | "ai" | "other"default "other"
memostring | null
due_datedatetime
ISO-8601 timestamp, e.g. 2026-11-01T00:00:00Z
finalizebooleandefault false
true issues the invoice immediately; false leaves a draft
Example
{
  "facility_id": "GH-VRH-001",
  "lines": [
    {
      "kind": "setup_fee",
      "description": "Additional on-site training day",
      "quantity": 1,
      "unit_amount": 150000,
      "revenue_stream": "setup"
    }
  ],
  "finalize": true
}
Response 201
dataInvoicerequired
Show fields
idstringrequired
numberstringrequired
facility_idstringrequired
facility_namestring
status"draft" | "open" | "paid" | "void" | "uncollectible"required
sourcestringrequired
currencystringrequired
issue_datestringrequired
ISO-8601 timestamp (UTC)
due_datestringrequired
ISO-8601 timestamp (UTC)
period_startstring | null
ISO-8601 timestamp (UTC)
period_endstring | null
ISO-8601 timestamp (UTC)
subtotalinteger
Amount in pesewas (GHS × 100)
discount_totalinteger
Amount in pesewas (GHS × 100)
tax_totalinteger
Amount in pesewas (GHS × 100)
totalintegerrequired
Amount in pesewas (GHS × 100)
amount_paidintegerrequired
Amount in pesewas (GHS × 100)
amount_dueintegerrequired
Amount in pesewas (GHS × 100)
overdue_daysinteger
memostring | null
tax_breakdownTaxLine[]
Show fields
codestringrequired
namestringrequired
rate_bpsintegerrequired
baseintegerrequired
Amount in pesewas (GHS × 100)
amountintegerrequired
Amount in pesewas (GHS × 100)
linesInvoiceLine[]
Show fields
idstringrequired
kind"subscription" | "addon" | "usage" | "nhis_claims" | "setup_fee" | "server_rental" | "server_deposit" | "adjustment" | "credit"required
descriptionstringrequired
quantityintegerrequired
unit_amountintegerrequired
Amount in pesewas (GHS × 100)
amountintegerrequired
Signed: credits are negative
taxablebooleanrequired
revenue_streamstringrequired
paymentsPayment[]
Show fields
idstringrequired
invoice_idstringrequired
invoice_numberstring | null
facility_idstringrequired
amountintegerrequired
Amount in pesewas (GHS × 100)
currencystringrequired
method"mobile_money" | "card" | "bank_transfer" | "cash" | "cheque" | "other"required
providerstringrequired
manual | paystack
referencestring | null
status"pending" | "succeeded" | "failed" | "refunded"required
paid_atstring | null
ISO-8601 timestamp (UTC)
failure_reasonstring | null
created_atstringrequired
ISO-8601 timestamp (UTC)
finalized_atstring | null
ISO-8601 timestamp (UTC)
paid_atstring | null
ISO-8601 timestamp (UTC)
voided_atstring | null
ISO-8601 timestamp (UTC)
void_reasonstring | null
get/invoices/{id}Get an invoice with lines and payments
Scopes:invoices:read
Parameters
idpath · stringrequiredInvoice id (UUID)
Response 200
dataInvoicerequired
Show fields
idstringrequired
numberstringrequired
facility_idstringrequired
facility_namestring
status"draft" | "open" | "paid" | "void" | "uncollectible"required
sourcestringrequired
currencystringrequired
issue_datestringrequired
ISO-8601 timestamp (UTC)
due_datestringrequired
ISO-8601 timestamp (UTC)
period_startstring | null
ISO-8601 timestamp (UTC)
period_endstring | null
ISO-8601 timestamp (UTC)
subtotalinteger
Amount in pesewas (GHS × 100)
discount_totalinteger
Amount in pesewas (GHS × 100)
tax_totalinteger
Amount in pesewas (GHS × 100)
totalintegerrequired
Amount in pesewas (GHS × 100)
amount_paidintegerrequired
Amount in pesewas (GHS × 100)
amount_dueintegerrequired
Amount in pesewas (GHS × 100)
overdue_daysinteger
memostring | null
tax_breakdownTaxLine[]
Show fields
codestringrequired
namestringrequired
rate_bpsintegerrequired
baseintegerrequired
Amount in pesewas (GHS × 100)
amountintegerrequired
Amount in pesewas (GHS × 100)
linesInvoiceLine[]
Show fields
idstringrequired
kind"subscription" | "addon" | "usage" | "nhis_claims" | "setup_fee" | "server_rental" | "server_deposit" | "adjustment" | "credit"required
descriptionstringrequired
quantityintegerrequired
unit_amountintegerrequired
Amount in pesewas (GHS × 100)
amountintegerrequired
Signed: credits are negative
taxablebooleanrequired
revenue_streamstringrequired
paymentsPayment[]
Show fields
idstringrequired
invoice_idstringrequired
invoice_numberstring | null
facility_idstringrequired
amountintegerrequired
Amount in pesewas (GHS × 100)
currencystringrequired
method"mobile_money" | "card" | "bank_transfer" | "cash" | "cheque" | "other"required
providerstringrequired
manual | paystack
referencestring | null
status"pending" | "succeeded" | "failed" | "refunded"required
paid_atstring | null
ISO-8601 timestamp (UTC)
failure_reasonstring | null
created_atstringrequired
ISO-8601 timestamp (UTC)
finalized_atstring | null
ISO-8601 timestamp (UTC)
paid_atstring | null
ISO-8601 timestamp (UTC)
voided_atstring | null
ISO-8601 timestamp (UTC)
void_reasonstring | null
post/invoices/{id}/finalizeFinalize a draft
Scopes:invoices:writeIdempotency-Key supported
Parameters
idpath · stringrequiredInvoice id
Response 200
dataInvoicerequired
Show fields
idstringrequired
numberstringrequired
facility_idstringrequired
facility_namestring
status"draft" | "open" | "paid" | "void" | "uncollectible"required
sourcestringrequired
currencystringrequired
issue_datestringrequired
ISO-8601 timestamp (UTC)
due_datestringrequired
ISO-8601 timestamp (UTC)
period_startstring | null
ISO-8601 timestamp (UTC)
period_endstring | null
ISO-8601 timestamp (UTC)
subtotalinteger
Amount in pesewas (GHS × 100)
discount_totalinteger
Amount in pesewas (GHS × 100)
tax_totalinteger
Amount in pesewas (GHS × 100)
totalintegerrequired
Amount in pesewas (GHS × 100)
amount_paidintegerrequired
Amount in pesewas (GHS × 100)
amount_dueintegerrequired
Amount in pesewas (GHS × 100)
overdue_daysinteger
memostring | null
tax_breakdownTaxLine[]
Show fields
codestringrequired
namestringrequired
rate_bpsintegerrequired
baseintegerrequired
Amount in pesewas (GHS × 100)
amountintegerrequired
Amount in pesewas (GHS × 100)
linesInvoiceLine[]
Show fields
idstringrequired
kind"subscription" | "addon" | "usage" | "nhis_claims" | "setup_fee" | "server_rental" | "server_deposit" | "adjustment" | "credit"required
descriptionstringrequired
quantityintegerrequired
unit_amountintegerrequired
Amount in pesewas (GHS × 100)
amountintegerrequired
Signed: credits are negative
taxablebooleanrequired
revenue_streamstringrequired
paymentsPayment[]
Show fields
idstringrequired
invoice_idstringrequired
invoice_numberstring | null
facility_idstringrequired
amountintegerrequired
Amount in pesewas (GHS × 100)
currencystringrequired
method"mobile_money" | "card" | "bank_transfer" | "cash" | "cheque" | "other"required
providerstringrequired
manual | paystack
referencestring | null
status"pending" | "succeeded" | "failed" | "refunded"required
paid_atstring | null
ISO-8601 timestamp (UTC)
failure_reasonstring | null
created_atstringrequired
ISO-8601 timestamp (UTC)
finalized_atstring | null
ISO-8601 timestamp (UTC)
paid_atstring | null
ISO-8601 timestamp (UTC)
voided_atstring | null
ISO-8601 timestamp (UTC)
void_reasonstring | null
post/invoices/{id}/voidVoid an invoice

Refused when payments are recorded against it.

Scopes:invoices:writeIdempotency-Key supported
Parameters
idpath · stringrequiredInvoice id
Request body
reasonstringrequired
Response 200
dataInvoicerequired
Show fields
idstringrequired
numberstringrequired
facility_idstringrequired
facility_namestring
status"draft" | "open" | "paid" | "void" | "uncollectible"required
sourcestringrequired
currencystringrequired
issue_datestringrequired
ISO-8601 timestamp (UTC)
due_datestringrequired
ISO-8601 timestamp (UTC)
period_startstring | null
ISO-8601 timestamp (UTC)
period_endstring | null
ISO-8601 timestamp (UTC)
subtotalinteger
Amount in pesewas (GHS × 100)
discount_totalinteger
Amount in pesewas (GHS × 100)
tax_totalinteger
Amount in pesewas (GHS × 100)
totalintegerrequired
Amount in pesewas (GHS × 100)
amount_paidintegerrequired
Amount in pesewas (GHS × 100)
amount_dueintegerrequired
Amount in pesewas (GHS × 100)
overdue_daysinteger
memostring | null
tax_breakdownTaxLine[]
Show fields
codestringrequired
namestringrequired
rate_bpsintegerrequired
baseintegerrequired
Amount in pesewas (GHS × 100)
amountintegerrequired
Amount in pesewas (GHS × 100)
linesInvoiceLine[]
Show fields
idstringrequired
kind"subscription" | "addon" | "usage" | "nhis_claims" | "setup_fee" | "server_rental" | "server_deposit" | "adjustment" | "credit"required
descriptionstringrequired
quantityintegerrequired
unit_amountintegerrequired
Amount in pesewas (GHS × 100)
amountintegerrequired
Signed: credits are negative
taxablebooleanrequired
revenue_streamstringrequired
paymentsPayment[]
Show fields
idstringrequired
invoice_idstringrequired
invoice_numberstring | null
facility_idstringrequired
amountintegerrequired
Amount in pesewas (GHS × 100)
currencystringrequired
method"mobile_money" | "card" | "bank_transfer" | "cash" | "cheque" | "other"required
providerstringrequired
manual | paystack
referencestring | null
status"pending" | "succeeded" | "failed" | "refunded"required
paid_atstring | null
ISO-8601 timestamp (UTC)
failure_reasonstring | null
created_atstringrequired
ISO-8601 timestamp (UTC)
finalized_atstring | null
ISO-8601 timestamp (UTC)
paid_atstring | null
ISO-8601 timestamp (UTC)
voided_atstring | null
ISO-8601 timestamp (UTC)
void_reasonstring | null

Payments

Payments against invoices: manual recording and Paystack checkout.

post/invoices/{id}/paymentsRecord a manual payment

For money received outside Paystack. Overpayment and a reused reference are refused.

Scopes:payments:writeIdempotency-Key supported
Parameters
idpath · stringrequiredInvoice id
Request body
amountintegerrequired
Pesewas; cannot exceed the amount due
method"mobile_money" | "card" | "bank_transfer" | "cash" | "cheque" | "other"required
paid_atdatetime
ISO-8601 timestamp, e.g. 2026-11-01T00:00:00Z
referencestring
MoMo transaction id, bank slip or cheque number — unique per method
payer_namestring
payer_phonestring
notesstring
Example
{
  "amount": 350000,
  "method": "mobile_money",
  "reference": "MP241125.1432.A12345",
  "payer_name": "Accounts Office"
}
Response 201
dataobjectrequired
Show fields
paymentPayment | null
invoiceInvoicerequired
Show fields
idstringrequired
numberstringrequired
facility_idstringrequired
facility_namestring
status"draft" | "open" | "paid" | "void" | "uncollectible"required
sourcestringrequired
currencystringrequired
issue_datestringrequired
ISO-8601 timestamp (UTC)
due_datestringrequired
ISO-8601 timestamp (UTC)
period_startstring | null
ISO-8601 timestamp (UTC)
period_endstring | null
ISO-8601 timestamp (UTC)
subtotalinteger
Amount in pesewas (GHS × 100)
discount_totalinteger
Amount in pesewas (GHS × 100)
tax_totalinteger
Amount in pesewas (GHS × 100)
totalintegerrequired
Amount in pesewas (GHS × 100)
amount_paidintegerrequired
Amount in pesewas (GHS × 100)
amount_dueintegerrequired
Amount in pesewas (GHS × 100)
overdue_daysinteger
memostring | null
tax_breakdownTaxLine[]
Show fields
codestringrequired
namestringrequired
rate_bpsintegerrequired
baseintegerrequired
Amount in pesewas (GHS × 100)
amountintegerrequired
Amount in pesewas (GHS × 100)
linesInvoiceLine[]
Show fields
idstringrequired
kind"subscription" | "addon" | "usage" | "nhis_claims" | "setup_fee" | "server_rental" | "server_deposit" | "adjustment" | "credit"required
descriptionstringrequired
quantityintegerrequired
unit_amountintegerrequired
Amount in pesewas (GHS × 100)
amountintegerrequired
Signed: credits are negative
taxablebooleanrequired
revenue_streamstringrequired
paymentsPayment[]
Show fields
idstringrequired
invoice_idstringrequired
invoice_numberstring | null
facility_idstringrequired
amountintegerrequired
Amount in pesewas (GHS × 100)
currencystringrequired
method"mobile_money" | "card" | "bank_transfer" | "cash" | "cheque" | "other"required
providerstringrequired
manual | paystack
referencestring | null
status"pending" | "succeeded" | "failed" | "refunded"required
paid_atstring | null
ISO-8601 timestamp (UTC)
failure_reasonstring | null
created_atstringrequired
ISO-8601 timestamp (UTC)
finalized_atstring | null
ISO-8601 timestamp (UTC)
paid_atstring | null
ISO-8601 timestamp (UTC)
voided_atstring | null
ISO-8601 timestamp (UTC)
void_reasonstring | null
post/invoices/{id}/checkoutCreate a Paystack checkout link

Returns 503 payments_unavailable when Paystack is not configured on the hub. Settlement is confirmed by Paystack webhook and re-verified with Paystack before crediting.

Scopes:payments:writeIdempotency-Key supported
Parameters
idpath · stringrequiredInvoice id
Request body
emailstringrequired
Payer email (Paystack requires one; a billing address is fine)
callback_urlstring
Response 201
dataCheckoutrequired
Show fields
authorization_urlstringrequired
Send the payer here (Paystack hosted page: MoMo, card, bank)
referencestringrequired
amountintegerrequired
Amount in pesewas (GHS × 100)
currencystringrequired
get/paymentsList payments
Scopes:payments:read
Parameters
limitquery · integer
statusquery · "pending" | "succeeded" | "failed" | "refunded"
facility_idquery · string
fromquery · datetimeISO-8601 timestamp, e.g. 2026-11-01T00:00:00Z
toquery · datetimeISO-8601 timestamp, e.g. 2026-11-01T00:00:00Z
Response 200
dataPayment[]required
Show fields
idstringrequired
invoice_idstringrequired
invoice_numberstring | null
facility_idstringrequired
amountintegerrequired
Amount in pesewas (GHS × 100)
currencystringrequired
method"mobile_money" | "card" | "bank_transfer" | "cash" | "cheque" | "other"required
providerstringrequired
manual | paystack
referencestring | null
status"pending" | "succeeded" | "failed" | "refunded"required
paid_atstring | null
ISO-8601 timestamp (UTC)
failure_reasonstring | null
created_atstringrequired
ISO-8601 timestamp (UTC)
has_morebooleanrequired
next_cursorstring | null
Pass as `cursor` to fetch the next page

Usage

Metered usage that drives per-unit and percentage pricing (NHIA claims, SMS, AI).

post/usageReport metered usage

Up to 500 records. Each record needs an idempotency_key unique per facility; repeats are skipped and counted in `duplicates`, so whole batches can be retried. Counts and money only — never patient data.

Scopes:usage:write
Request body
facility_idstring
Required for network keys; must be omitted or match for facility-scoped keys
recordsUsageRecord[]required
Show fields
metric"nhis_claims_submitted" | "nhis_claims_rejected" | "nhis_claims_recovered" | "nhis_claims_paid" | "sms_sent" | "whatsapp_sent" | "ai_requests" | "telehealth_minutes" | "patients_registered" | "encounters" | "storage_gb"required
quantityintegerrequired
valueintegerdefault 0
Money value in pesewas (claim metrics only)
occurred_atdatetimerequired
ISO-8601 timestamp, e.g. 2026-11-01T00:00:00Z
idempotency_keystringrequired
metadataobject
Example
{
  "records": [
    {
      "metric": "nhis_claims_submitted",
      "quantity": 412,
      "value": 8240000,
      "occurred_at": "2026-11-30T23:00:00Z",
      "idempotency_key": "claims-2026-11-batch-7"
    }
  ]
}
Response 200
dataUsageResultrequired
Show fields
facility_idstringrequired
acceptedintegerrequired
Records stored
duplicatesintegerrequired
Records skipped because their idempotency_key was already seen

Analytics

Network revenue analytics. Requires a network (not facility-scoped) key with analytics:read.

get/analytics/summaryRevenue summary

Headline SaaS metrics for the whole network: MRR, ARR, growth, NRR/GRR, churn, ARPA, LTV estimate, trial conversion, cash collected, receivables, DSO and collections aging. Ratios are fractions (0.92 = 92 %).

Scopes:analytics:read
Response 200
dataAnalyticsSummaryrequired
Show fields
as_ofstringrequired
ISO-8601 timestamp (UTC)
currencystringrequired
mrrintegerrequired
Amount in pesewas (GHS × 100)
arrintegerrequired
Amount in pesewas (GHS × 100)
mrr_last_monthintegerrequired
Amount in pesewas (GHS × 100)
mrr_growthnumber | null
Month-on-month MRR growth (ratio, e.g. 0.92 = 92 %); null when undefined
net_new_this_monthintegerrequired
Amount in pesewas (GHS × 100)
nrrnumber | null
Trailing-12-month net revenue retention (ratio, e.g. 0.92 = 92 %); null when undefined
grrnumber | null
Trailing-12-month gross revenue retention (ratio, e.g. 0.92 = 92 %); null when undefined
logo_churn_ratenumber | null
Average monthly logo churn, last 12 complete months (ratio, e.g. 0.92 = 92 %); null when undefined
revenue_churn_ratenumber | null
Average monthly gross revenue churn, last 12 complete months (ratio, e.g. 0.92 = 92 %); null when undefined
active_customersintegerrequired
arpainteger | null
ltvinteger | null
status_countsobjectrequired
Show fields
trialingintegerrequired
activeintegerrequired
past_dueintegerrequired
graceintegerrequired
restrictedintegerrequired
trial_conversionobjectrequired
Show fields
endedintegerrequired
convertedintegerrequired
ratenumber | null
Converted ÷ ended, last 90 days (ratio, e.g. 0.92 = 92 %); null when undefined
cashobjectrequired
Show fields
this_monthintegerrequired
Amount in pesewas (GHS × 100)
last_monthintegerrequired
Amount in pesewas (GHS × 100)
receivablesobjectrequired
Show fields
openintegerrequired
Amount in pesewas (GHS × 100)
overdueintegerrequired
Amount in pesewas (GHS × 100)
billed_last_90dintegerrequired
Amount in pesewas (GHS × 100)
dsonumber | null
Days sales outstanding (90-day window)
agingobject[]required
Show fields
bucketstringrequired
amountintegerrequired
Amount in pesewas (GHS × 100)
invoicesintegerrequired
get/analytics/mrrMRR series with movements

One point per calendar month ending with the current month: MRR at month end and the movements (new, expansion, reactivation, contraction, churn) that produced it.

Scopes:analytics:read
Parameters
monthsquery · integerNumber of months ending with the current month (1–36)
Response 200
dataMrrPoint[]required
Show fields
monthstringrequired
Calendar month, 'YYYY-MM' (UTC)
mrrintegerrequired
MRR at month end (now, for the current month)
arrintegerrequired
MRR × 12
active_customersintegerrequired
movementsMrrMovementsrequired
Show fields
newintegerrequired
New-logo MRR incl. trial conversions
expansionintegerrequired
MRR increases on existing customers
reactivationintegerrequired
MRR from returning customers
contractionintegerrequired
MRR decreases on retained customers (negative)
churnintegerrequired
MRR lost to cancellations (negative)
net_newintegerrequired
Sum of the movements

Events

The append-only platform event log.

get/eventsList platform events
Scopes:events:read
Parameters
limitquery · integer
cursorquery · string
typequery · "subscription.created" | "subscription.updated" | "subscription.cancelled" | "subscription.status_changed" | "invoice.created" | "invoice.finalized" | "invoice.paid" | "invoice.voided" | "invoice.uncollectible" | "payment.succeeded" | "payment.failed" | "usage.recorded" | "implementation.updated" | "server_rental.created" | "server_rental.updated" | "facility.restricted" | "facility.restored"
facility_idquery · string
Response 200
dataEvent[]required
Show fields
idstringrequired
type"subscription.created" | "subscription.updated" | "subscription.cancelled" | "subscription.status_changed" | "invoice.created" | "invoice.finalized" | "invoice.paid" | "invoice.voided" | "invoice.uncollectible" | "payment.succeeded" | "payment.failed" | "usage.recorded" | "implementation.updated" | "server_rental.created" | "server_rental.updated" | "facility.restricted" | "facility.restored"required
facility_idstring | null
dataobjectrequired
created_atstringrequired
ISO-8601 timestamp (UTC)
has_morebooleanrequired
next_cursorstring | null
Pass as `cursor` to fetch the next page

Webhooks

Signed HTTP callbacks for platform events.

get/webhook-endpointsList webhook endpoints
Scopes:webhooks:manage
Response 200
dataWebhookEndpoint[]required
Show fields
idstringrequired
urlstringrequired
descriptionstring | null
eventsstring[]required
is_activebooleanrequired
secret_prefixstringrequired
First characters of the signing secret, for identification
consecutive_failuresintegerrequired
disabled_atstring | null
ISO-8601 timestamp (UTC)
created_atstringrequired
ISO-8601 timestamp (UTC)
secretstring
Signing secret. Returned only when the endpoint is created.
has_morebooleanrequired
next_cursorstring | null
Pass as `cursor` to fetch the next page
post/webhook-endpointsCreate a webhook endpoint

The response includes the signing secret once. URLs must be public https (private, loopback and metadata addresses are refused).

Scopes:webhooks:manageIdempotency-Key supported
Request body
urlstringrequired
descriptionstring
events"*" | "subscription.created" | "subscription.updated" | "subscription.cancelled" | "subscription.status_changed" | "invoice.created" | "invoice.finalized" | "invoice.paid" | "invoice.voided" | "invoice.uncollectible" | "payment.succeeded" | "payment.failed" | "usage.recorded" | "implementation.updated" | "server_rental.created" | "server_rental.updated" | "facility.restricted" | "facility.restored"[]required
Example
{
  "url": "https://erp.example.com/hooks/hekasoftlink",
  "events": [
    "invoice.finalized",
    "invoice.paid",
    "payment.succeeded"
  ]
}
Response 201
dataWebhookEndpointrequired
Show fields
idstringrequired
urlstringrequired
descriptionstring | null
eventsstring[]required
is_activebooleanrequired
secret_prefixstringrequired
First characters of the signing secret, for identification
consecutive_failuresintegerrequired
disabled_atstring | null
ISO-8601 timestamp (UTC)
created_atstringrequired
ISO-8601 timestamp (UTC)
secretstring
Signing secret. Returned only when the endpoint is created.
delete/webhook-endpoints/{id}Delete a webhook endpoint
Scopes:webhooks:manage
Parameters
idpath · stringrequiredEndpoint id
Response 200
dataobjectrequired
Show fields
idstringrequired
deletedtruerequired