Skip to content

← All contracts

OHN-58 Certificates, Medicines Supply and Payments

Version
1.1.0
OpenAPI
3.1.0
Source in the repository
modules/OHN-58/api/openapi.yaml
Servers
https://opeshealthnetwork.com
Authentication
bearer: http bearer (JWT (ES256, iss ohn-platform-gateway, aud ohn-58))

Download the contract (YAML)

Contracts are written in English.

Synthetic data only. Reconciled with the observed TypeScript behaviour (see docs/program/java/ohn-58-contract-changes.md); served by the Java module `server/modules/ohn-58` in the portals deployable. Authentication: a gateway token (ES256, issuer `ohn-platform-gateway`, audience `ohn-58`) with the claims `sub`, `jurisdiction`, `organization_id` (all UUIDs), `role` and `purpose`. Each role has exactly one purpose (clinician `certification`, patient `patient_access`, pharmacist `medicine_supply`, ministry_officer `supply_oversight`, regulator `pharmacovigilance`, mutuelle_officer `mutuelle_administration`, payments_officer `payments`, services_admin `services_administration`, cashier `facility_payments`, distributor `medicine_distribution`). A bad token or claim is 401; a role used with another purpose is 403; an unknown route (after sign-in) is 404 `not_found`; a route the role is not listed for is 403 `denied_by_policy` (audited). The only unauthenticated routes are the health check and the employer's certificate check by code. Every write needs an `Idempotency-Key` header (1 to 255 characters; 400 `missing_idempotency_key`); the same key and body replays the first answer (`Idempotent-Replay: true`); the same key with another body is 409 `idempotency_conflict`; a key still in flight is 409 `request_in_progress`. Request bodies are strict: an unknown field (for example a `diagnosis` on a certificate) is refused with 422 `domain_validation_failed`. Errors are `{error, message, ...}` (problem+json superset: `type`, `title`, `status`, `detail`, `trace_id`). Configuration is never invented: with no certificate limit, signing key, payer-hash key or dependency the operation is refused with 503 `not_configured` (names the `setting`; nothing is stored). There is no live payment provider: only the sandbox moves no money. 1.1.0 (2026-11-23, owner decision on the #88 questions 4 and 5): role `cashier` (a facility's cashier) may list providers and create, list, read, check and complete (sandbox) payments of its own organisation only; a payment of another organisation is 404. It may not name a mutuelle member or take a `mutuelle_contribution` (403 `denied_by_policy`), and the mutuelle schemes, members, eligibility, provider balance, certificates and medicines routes are 403. Role `distributor` (a medicine distributor) has only the three `/medicines/distributor/...` routes: the batches whose `supplier_org_id` is its organisation, their recalls, and one acknowledgement per recall; every other route, including all patient routes, is 403. The registry import accepts the optional `supplier_org_id` per row.

Operations

Other operations

PUT/api/ohn/v1/payment-callbacks/{provider}/{paymentId}/{signature}

Operation ID: paymentCallback

Parameters

NameInTypeRequiredDescription
providerpath"mtn_momo" | "orange_money"yes
paymentIdpathstring (uuid)yes
signaturepathstringyes

Request body

  • application/json: object

Responses

CodeDescriptionMedia type
200Already final; no change—
202Accepted; the operator could not be reached and reconciliation will decide—
400Malformed—
401Signature or notification token does not match—
404Unknown payment—
503Provider not configured—
POST/api/ohn/v1/payment-callbacks/{provider}/{paymentId}/{signature}

Operation ID: paymentCallback

Parameters

NameInTypeRequiredDescription
providerpath"mtn_momo" | "orange_money"yes
paymentIdpathstring (uuid)yes
signaturepathstringyes

Request body

  • application/json: object

Responses

CodeDescriptionMedia type
200Already final; no change—
202Accepted; the operator could not be reached and reconciliation will decide—
400Malformed—
401Signature or notification token does not match—
404Unknown payment—
503Provider not configured—
GET/health/ohn-58Health. Public. Database ping, dependency modes (live or unconfigured), whether the signing key, the certificate limits and the payer-hash key are configured, the providers and whether writes are enabled.

Responses

CodeDescriptionMedia type
200{status: ok, module: OHN-58, dependencies: {OHN-45, OHN-23}, signing_key_configured, auth_configured, synthetic_auth (always false), certificate_policy_configured, payments_configured, payment_providers: [{id, sandbox, available}], writes_enabled}—
503{status: unavailable, ...} the database does not answer—
GET/api/ohn/v1/certificates/verify/{code}Public verification by code (the employer's check). Case and separators are ignored. Rate-limited per client address (429). Fails closed (503) when OHN-45 cannot answer.

Parameters

NameInTypeRequiredDescription
codepathstringyes

Responses

CodeDescriptionMedia type
200result
application/json: PublicVerification
404unknown or malformed code—
429rate limited—
503OHN-45 unavailable or not configured—
GET/api/ohn/v1/certificates/contextRole, purpose, organisation, today, signing readiness and the configured limits (all roles). A limit that is not configured is null.

Authentication: bearer

Responses

CodeDescriptionMedia type
200{role, purpose, organization_id, today, signing_ready, policy: {fitness_max_days, sick_leave_max_days, fitness_max_backdate_days, sick_leave_max_backdate_days}}—
401401 unauthenticated, or 403 denied_by_policy (role not listed or purpose not the role's)
application/json: Error
GET/api/ohn/v1/certificatesList (clinician own organisation; patient own certificates), newest first, at most 200.

Authentication: bearer

Parameters

NameInTypeRequiredDescription
kindquery"fitness" | "sick_leave"no
statusquery"active" | "revoked"no

Responses

CodeDescriptionMedia type
200{items}—
422422 domain_validation_failed: a strict body or query check failed. `details` maps each failing top-level field to a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value); unknown keys are reported under `_`.
application/json: Error
POST/api/ohn/v1/certificatesIssue (clinician). Signed with the Ed25519 key and registered with OHN-45 before it is stored. Contains no diagnosis.

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201issued
application/json: Certificate
403401 unauthenticated, or 403 denied_by_policy (role not listed or purpose not the role's)
application/json: Error
422domain_validation_failed (bad input, end before start, or a day not on the calendar), validity_too_long, backdated_too_far
application/json: Error
503503 not_configured (names `setting`, and `dependency` for OHN-45 and OHN-23) or dependency_unavailable; nothing was stored
application/json: Error
GET/api/ohn/v1/certificates/{id}Read (clinician of the issuing organisation, the patient). Another organisation, patient or jurisdiction is 404.

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200ok
application/json: Certificate
404not found or out of scope—
POST/api/ohn/v1/certificates/{id}/revokeRevoke (clinician of the issuing organisation), with optimistic concurrency.

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200revoked—
404not found—
409version_conflict (with current_version) or already_revoked—
422422 domain_validation_failed: a strict body or query check failed. `details` maps each failing top-level field to a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value); unknown keys are reported under `_`.
application/json: Error
GET/api/ohn/v1/certificates/reports/summaryOHN-58-R01 certificates issued and verified (clinician: own organisation; services_admin: the jurisdiction).

Authentication: bearer

Responses

CodeDescriptionMedia type
200{id, title, certificates: [{kind, status, n}], verifications_30_days: [{result, n}], generated_at}—
GET/api/ohn/v1/medicines/pharmacyOwn pharmacy profile (pharmacist)

Authentication: bearer

Responses

CodeDescriptionMedia type
200ok—
404none yet—
PUT/api/ohn/v1/medicines/pharmacySet own pharmacy profile (pharmacist).

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200saved—
404the organisation belongs to another jurisdiction—
422422 domain_validation_failed: a strict body or query check failed. `details` maps each failing top-level field to a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value); unknown keys are reported under `_`.
application/json: Error
GET/api/ohn/v1/medicines/stockOwn stock (pharmacist), with `level` (in_stock, low, out_of_stock)

Authentication: bearer

Responses

CodeDescriptionMedia type
200ok—
POST/api/ohn/v1/medicines/stockReport stock (pharmacist). Every product is validated by OHN-23 before anything is saved.

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201{items, new_stock_outs, receipt}—
404pharmacy profile missing—
422unknown_product (names `code`) or invalid
application/json: Error
503503 not_configured (names `setting`, and `dependency` for OHN-45 and OHN-23) or dependency_unavailable; nothing was stored
application/json: Error
GET/api/ohn/v1/medicines/availabilitySearch pharmacies (clinician, patient, pharmacist, ministry). Needs q (2 to 100 characters) or code. Patients get availability without quantity or unit.

Authentication: bearer

Parameters

NameInTypeRequiredDescription
qquerystringno
codequerystringno
code_systemquerystringno
districtquerystringno
latquerynumbernoneeds lon
lonquerynumbernoneeds lat
radius_kmquerynumberno
include_outquery"true" | "false"no

Responses

CodeDescriptionMedia type
200{items: [{id, pharmacy_id, pharmacy, district, phone, product, code_system, code, availability, quantity?, unit?, distance_km, reported_at, stale}]}, at most 100—
422422 domain_validation_failed: a strict body or query check failed. `details` maps each failing top-level field to a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value); unknown keys are reported under `_`.
application/json: Error
GET/api/ohn/v1/medicines/stock-outsOHN-58-R02 (ministry_officer

Authentication: bearer

Responses

CodeDescriptionMedia type
200{id, title, items, by_product, generated_at}—
GET/api/ohn/v1/medicines/stock-outs/exportOHN-58-R02 as CSV (formula-injection guarded; audited)

Authentication: bearer

Responses

CodeDescriptionMedia type
200text/csv; charset=utf-8, attachment ohn58-stock-outs-yyyy-MM-dd.csv—
GET/api/ohn/v1/medicines/batchesRegistry (regulator)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
qquerystringno

Responses

CodeDescriptionMedia type
200ok—
422422 domain_validation_failed: a strict body or query check failed. `details` maps each failing top-level field to a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value); unknown keys are reported under `_`.
application/json: Error
POST/api/ohn/v1/medicines/batches/importImport registry rows (regulator); rows are validated one by one.

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201{import_id, rows_accepted, rows_rejected, errors: [{row, message}], receipt}—
422invalid body, or a day the date check accepts but the calendar lacks (the whole import is refused and nothing is stored)—
POST/api/ohn/v1/medicines/batches/{id}/recallRecall (regulator)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200recalled—
404not found—
409already_recalled—
GET/api/ohn/v1/medicines/distributor/batchesOwn supply list (distributor): batches whose supplier_org_id is the token organisation, with this distributor's acknowledgement. No patient, pharmacy or stock data.

Authentication: bearer

Responses

CodeDescriptionMedia type
200{items: [{id, manufacturer, product_code, product_name, batch_number, expiry_date, status, recall_reason, updated_at, acknowledged_at}]}—
403401 unauthenticated, or 403 denied_by_policy (role not listed or purpose not the role's)
application/json: Error
GET/api/ohn/v1/medicines/distributor/recallsRecalls of batches this distributor supplied (distributor); never another supplier's

Authentication: bearer

Responses

CodeDescriptionMedia type
200{items: [... as distributor/batches, status recalled]}—
403401 unauthenticated, or 403 denied_by_policy (role not listed or purpose not the role's)
application/json: Error
POST/api/ohn/v1/medicines/distributor/recalls/{id}/acknowledgeAcknowledge a recall of a batch this distributor supplied (distributor; audited, event medicine.recall_acknowledged)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body

Responses

CodeDescriptionMedia type
201{id, batch_id, acknowledged_at, receipt}—
403401 unauthenticated, or 403 denied_by_policy (role not listed or purpose not the role's)
application/json: Error
404not a recalled batch this distributor supplied (another supplier's, active or unknown)—
409already_acknowledged—
422422 domain_validation_failed: a strict body or query check failed. `details` maps each failing top-level field to a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value); unknown keys are reported under `_`.
application/json: Error
GET/api/ohn/v1/medicines/authenticity/scansRecent scans (own organisation; regulator all)

Authentication: bearer

Responses

CodeDescriptionMedia type
200ok—
POST/api/ohn/v1/medicines/authenticity/scansCheck a pack (pharmacist, clinician). Unknown, recalled and duplicate_scan results open a regulator report.

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

  • application/json: Scan

Responses

CodeDescriptionMedia type
201result
application/json: ScanResult
GET/api/ohn/v1/medicines/regulator/reportsRegulator queue (regulator)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
statequery"open" | "investigating" | "closed"no

Responses

CodeDescriptionMedia type
200ok—
422422 domain_validation_failed: a strict body or query check failed. `details` maps each failing top-level field to a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value); unknown keys are reported under `_`.
application/json: Error
POST/api/ohn/v1/medicines/regulator/reports/{id}/transitionMove a report along its workflow (regulator), with optimistic concurrency.

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200{id, state, outcome, resolution, version, receipt}—
404not found—
409version_conflict or invalid_transition—
422422 domain_validation_failed: a strict body or query check failed. `details` maps each failing top-level field to a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value); unknown keys are reported under `_`.
application/json: Error
GET/api/ohn/v1/payments/providersProviders and availability (payments_officer, mutuelle_officer, pharmacist, services_admin). Only the sandbox can be available.

Authentication: bearer

Responses

CodeDescriptionMedia type
200{items: [{id, label, sandbox, available, reason}]}—
GET/api/ohn/v1/payments/mutuelle/schemesOwn organisation's schemes (mutuelle_officer

Authentication: bearer

Responses

CodeDescriptionMedia type
200ok—
POST/api/ohn/v1/payments/mutuelle/schemesCreate a scheme (mutuelle_officer)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201created—
409duplicate (same name in the organisation)—
422422 domain_validation_failed: a strict body or query check failed. `details` maps each failing top-level field to a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value); unknown keys are reported under `_`.
application/json: Error
GET/api/ohn/v1/payments/mutuelle/membersMembers of own schemes (mutuelle_officer

Authentication: bearer

Responses

CodeDescriptionMedia type
200ok—
POST/api/ohn/v1/payments/mutuelle/membersEnrol (mutuelle_officer)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201enrolled—
404scheme not found—
409duplicate or scheme_inactive—
422422 domain_validation_failed: a strict body or query check failed. `details` maps each failing top-level field to a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value); unknown keys are reported under `_`.
application/json: Error
GET/api/ohn/v1/payments/mutuelle/members/{patientId}/eligibilityCover on a day (mutuelle_officer and payments_officer: own schemes; clinician: all schemes)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
patientIdpathstring (uuid)yes
onqueryDaynodefault today (UTC); a day not on the calendar is 422

Responses

CodeDescriptionMedia type
200ok
application/json: Eligibility
422422 domain_validation_failed: a strict body or query check failed. `details` maps each failing top-level field to a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value); unknown keys are reported under `_`.
application/json: Error
GET/api/ohn/v1/payments/mutuelle/mePatient's own cover today and contributions

Authentication: bearer

Responses

CodeDescriptionMedia type
200Eligibility plus {contributions: [{id, amount_minor, currency, period_start, period_end, created_at}]}—
GET/api/ohn/v1/paymentsOwn organisation's payments

Authentication: bearer

Parameters

NameInTypeRequiredDescription
statusquery"pending" | "succeeded" | "failed" | "cancelled"no

Responses

CodeDescriptionMedia type
200ok—
422422 domain_validation_failed: a strict body or query check failed. `details` maps each failing top-level field to a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value); unknown keys are reported under `_`.
application/json: Error
POST/api/ohn/v1/paymentsRequest a payment. Only the sandbox is available (records a simulated collection; no money moves). A live provider is 503 provider_unavailable.

Authentication: bearer

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
201pending—
404member not found in your scheme—
409member_not_active—
422invalid, unknown_provider or amount_mismatch
application/json: Error
503provider_unavailable (the sandbox is off in production; a live provider has no adapter) or not_configured (payer-hash key)—
GET/api/ohn/v1/payments/{id}Read (own organisation)

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes

Responses

CodeDescriptionMedia type
200ok—
404not found—
POST/api/ohn/v1/payments/{id}/sandbox/{outcome}Sandbox approve (complete) or decline (fail), with optimistic concurrency

Authentication: bearer

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes
outcomepath"complete" | "fail"yes
Idempotency-Keyheaderstringyes

Request body (required)

Responses

CodeDescriptionMedia type
200the payment plus {contribution: {id, period_start, period_end} | null, receipt}—
404not found—
409not_sandbox—
422422 domain_validation_failed: a strict body or query check failed. `details` maps each failing top-level field to a zod issue code (invalid_type, too_small, too_big, invalid_string, invalid_enum_value); unknown keys are reported under `_`.
application/json: Error
GET/api/ohn/v1/payments/auditAudit trail of the jurisdiction (services_admin)

Authentication: bearer

Responses

CodeDescriptionMedia type
200{items: [{receipt_id, at, actor_role, action, resource_type, resource_id, decision, reason}]}—

Schemas

Error

NameTypeRequiredDescription
errorstringyesmachine code, for example not_found, denied_by_policy, domain_validation_failed, version_conflict, invalid_transition, validity_too_long, backdated_too_far, unknown_product, amount_mismatch, provider_unavailable, not_configured, dependency_unavailable, duplicate, rate_limited
messagestringyes
settingstringnothe configuration property that is missing (503 not_configured)
dependency"OHN-45" | "OHN-23"no
current_versionintegernoversion_conflict
codestringnounknown_product: the product code
providerstringnoprovider_unavailable
detailsobjectno
typestringno
titlestringno
statusintegerno
detailstringno
trace_idstringno

Day

yyyy-MM-dd with month 01 to 12 and day 01 to 31. A day the calendar lacks (2030-02-31) passes the check and is then refused as 422 domain_validation_failed (an integrity failure); nothing is stored.

string

IssueCertificate

object | object

RevokeCertificate

NameTypeRequiredDescription
reasonstringyestrimmed
expected_versionintegeryes

Certificate

NameTypeRequiredDescription
idstring (uuid)no
kind"fitness" | "sick_leave"no
patient_idstring (uuid)no
issued_bystring (uuid)no
organization_idstring (uuid)no
outcome"fit" | "not_fit" | nullno
valid_fromDaynoyyyy-MM-dd with month 01 to 12 and day 01 to 31. A day the calendar lacks (2030-02-31) passes the check and is then refused as 422 domain_validation_failed (an integrity failure); nothing is stored.
valid_toDaynoyyyy-MM-dd with month 01 to 12 and day 01 to 31. A day the calendar lacks (2030-02-31) passes the check and is then refused as 422 domain_validation_failed (an integrity failure); nothing is stored.
verify_codestringno
status"active" | "revoked"no
standing"valid" | "revoked" | "expired" | "not_yet_valid"no
revoked_atstring | null (date-time)no
revoke_reasonstring | nullno
versionintegerno
issued_atstring (date-time)no
ohn45_artifact_refstring (uuid)no
ohn45_signature_refstring (uuid)no
verify_pathstringno
receiptstring (uuid)noissue and revoke answers only

PublicVerification

Only these members. A certificate whose signature, stored columns or OHN-45 verification do not agree answers {code, result: invalid_signature, message} and no certificate data.

NameTypeRequiredDescription
codestringno
result"valid" | "revoked" | "expired" | "not_yet_valid" | "invalid_signature"no
kind"fitness" | "sick_leave"no
answer"fit" | "not_fit" | "unfit_for_work"no
valid_fromDaynoyyyy-MM-dd with month 01 to 12 and day 01 to 31. A day the calendar lacks (2030-02-31) passes the check and is then refused as 422 domain_validation_failed (an integrity failure); nothing is stored.
valid_toDaynoyyyy-MM-dd with month 01 to 12 and day 01 to 31. A day the calendar lacks (2030-02-31) passes the check and is then refused as 422 domain_validation_failed (an integrity failure); nothing is stored.
revoked_onDay | nullno
signature"verified_by_ohn45"no
messagestringno

PharmacyProfile

NameTypeRequiredDescription
namestringyes
districtstringyes
latitudenumber | nullyes
longitudenumber | nullyes
phonestring | nullyes

StockReport

NameTypeRequiredDescription
itemsarray of StockReport.items.itemyes

BatchRow

NameTypeRequiredDescription
manufacturerstringyes
product_codestringyes
product_namestringyes
batch_numberstringyes
expiry_dateDayyesyyyy-MM-dd with month 01 to 12 and day 01 to 31. A day the calendar lacks (2030-02-31) passes the check and is then refused as 422 domain_validation_failed (an integrity failure); nothing is stored.
status"active" | "recalled"no
recall_reasonstring | nullnorequired (non-empty) when status is recalled
serialsarray of stringno
supplier_org_idstring | null (uuid)nothe distributor organisation that supplied the batch; only it sees the batch and its recall on the distributor routes (1.1.0)

RecallAcknowledgement

NameTypeRequiredDescription
notestringno

BatchImport

NameTypeRequiredDescription
sourcestringyes
rowsarray of anyyeseach element is validated against BatchRow on its own; a bad row is reported in `errors` (row number from 1, message in the form `field: Required`) and the others are imported

Recall

NameTypeRequiredDescription
reasonstringyes

Scan

NameTypeRequiredDescription
product_codestringyes
batch_numberstringyes
serialstring | nullno
notestring | nullno

ScanResult

NameTypeRequiredDescription
idstring (uuid)no
result"genuine" | "unknown" | "recalled" | "duplicate_scan" | "expired"no
messagestringno
product_codestringno
batch_numberstringno
serialstring | nullno
product_namestring | nullno
manufacturerstring | nullno
expiry_datestring | nullno
recall_reasonstring | nullno
previous_scans_hereintegernogenuine and expired only
regulator_report_idstring | null (uuid)no
scanned_atstring (date-time)no
receiptstring (uuid)no

ReportTransition

closing needs an outcome and a resolution (422 otherwise); open -> investigating | closed, investigating -> closed, closed is final (409 invalid_transition)

NameTypeRequiredDescription
to_state"investigating" | "closed"yes
expected_versionintegeryes
outcome"substantiated" | "unsubstantiated"no
resolutionstringno

Scheme

NameTypeRequiredDescription
namestringyes
contribution_minorintegeryeswhole minor units; the scheme's own configuration, never computed here
currencystringyes
period_monthsintegeryes
waiting_daysintegeryes

Enrol

NameTypeRequiredDescription
scheme_idstring (uuid)yes
patient_idstring (uuid)yes
household_refstring | nullno
enrolled_onDayyesyyyy-MM-dd with month 01 to 12 and day 01 to 31. A day the calendar lacks (2030-02-31) passes the check and is then refused as 422 domain_validation_failed (an integrity failure); nothing is stored.

Payment

NameTypeRequiredDescription
providerstringyessandbox, mtn_momo or orange_money; any other value is 422 unknown_provider
purpose"mutuelle_contribution" | "service_fee" | "medicine_purchase"yes
amount_minorintegeryeswhole minor units; a contribution must equal the scheme's contribution_minor and currency exactly (422 amount_mismatch)
currencystringyes
payer_msisdnstringyesstored only as the last four digits and a keyed hash; never returned
member_idstring | null (uuid)norequired for mutuelle_contribution
referencestringyes

SandboxCallback

NameTypeRequiredDescription
expected_versionintegeryes

Eligibility

NameTypeRequiredDescription
patient_idstring (uuid)no
onDaynoyyyy-MM-dd with month 01 to 12 and day 01 to 31. A day the calendar lacks (2030-02-31) passes the check and is then refused as 422 domain_validation_failed (an integrity failure); nothing is stored.
eligiblebooleanno
membershipsarray of Eligibility.memberships.itemno
reasonsarray of "no_membership"nopresent only when there is no membership

StockReport.items.item defined inline

NameTypeRequiredDescription
code_systemstringyes
codestringyes
quantityintegeryes
reorder_levelintegerno
unitstringyes

Eligibility.memberships.item defined inline

NameTypeRequiredDescription
member_idstringno
schemestringno
scheme_org_idstringno
enrolled_onDaynoyyyy-MM-dd with month 01 to 12 and day 01 to 31. A day the calendar lacks (2030-02-31) passes the check and is then refused as 422 domain_validation_failed (an integrity failure); nothing is stored.
waiting_endsDaynoyyyy-MM-dd with month 01 to 12 and day 01 to 31. A day the calendar lacks (2030-02-31) passes the check and is then refused as 422 domain_validation_failed (an integrity failure); nothing is stored.
paid_untilstring | nullno
eligiblebooleanno
reasonsarray of "membership_suspended" | "membership_ended" | "waiting_period" | "no_paid_contribution"no