Run your clinic

Cash sales and finance preparations

Record cash sales and prepare cited finance reviews for owner approval.

These commands use the native signed-in person door, POST /api/balm/command, with a JSON object containing name and input. They are partial capabilities; no provider charge, automatic renewal, provider refund or outbound request runs here. The existing patient portal supplies the original cash-sale receipts and current statement. Visit superbills retain their existing coding requirements; goods and gift value are not represented as insured services.

pay.retail.sell accepts clientId, kind (package, membership, product or gift_card), label, positive integer amountCents, a unique reference for cash actually received, and confirm: true. Packages and finite memberships also require serviceId and units. Product sales require taxState, taxEvidence and an owner-verified taxBasisPoints rate, with tax rounded once to the nearest cent. Balm does not decide tax applicability. Pass giftId instead of recording new cash to redeem that patient's gift value. Gift purchases cannot use gift value. No expiry or transfer is implemented. The owner records all four sale kinds in the patient file under Cash sales and visit packages; cash-pay visit assignment is available there too. Reservations cannot exceed unused visits.

Before attendance, pay.retail.assign takes clientId, saleId and appointmentId for the matching cash-pay service. Attendance atomically consumes one visit, refuses exhaustion, and starts a zero-dollar invoice draft. Invoice preparation cannot increase that covered visit's charge. Cancelled and no-show visits do not consume package visits. The staff patient JSON includes billing.retail with remaining visits and gift value. Sale and gift totals appear in financial reports; redemption posts existing gift value without another deposit. Patient gift value remains separate from general invoice credit.

finance.observation.record takes clientId, kind (eft or card), positive amountCents, occurredOn, unique settlement reference, sourceReference (the original EFT trace or card charge), and evidence identifying the owner-reviewed source. These are observations, never an adjudication or proof that a claim is paid. No bank credentials or account numbers are needed. Repeated card settlement references for the same patient, source charge and amount are flagged for review, not declared fraudulent or automatically refunded.

Create an agent key explicitly scoped to finance.reconcile.prepare. Through POST /api/balm/agent/command, that command takes month in YYYY-MM form and creates cited, immutable request and refund drafts. It does not send a request. The owner uses finance.review.approve with id, the returned sha256, and confirm: true to approve the exact preparation once. That approval neither issues a refund nor sends a message; execution and full provider reconciliation remain unbuilt. Legacy keys gain no finance scope.

Ct approved the limited conservative defaults with changes on 25 October 2026; the adopted-default riders in CONTRACT.md and ACCEPTANCE.md bind future execution and custody. Ordinary patient erasure refuses these financial originals. Approved retention destruction now removes retail identifying records, receipt bytes, assignments, uses and membership events after the applicable retained period, measured from the later treatment, sale, redemption, actual visit consumption or membership event. Unused visits and gift value block destruction; completing their actual use resolves that fence without forfeiture. It preserves anonymous dated sale amounts, tax, units and gift arithmetic for financial reports. Legal holds and digest review remain mandatory. Finance records still refuse destruction pending their complete custody implementation. Archives carry the records and frozen originals; keys and sessions remain excluded under the existing archive policy. No complete retention or reconciliation claim is made.

pay.retail.membership accepts clientId, saleId, state (paused or active), reason, consentEvidence, effectiveAt, authorizedAt, authorizationMethod and confirm. Effective and authorization times are UTC ISO timestamps, authorization must precede the effective change, and future-effective changes refuse. The evidence names the specific patient-authorized transition; general intake, treatment or card consent is insufficient. The event retains the unused count, actor and both times. Historical events without these fields remain historical evidence with unknown authorization details; restore never supplies missing facts. Only the active owner records an explicit patient-authorized change. A paused membership cannot be assigned or consumed, including a visit assigned before the pause. Resume preserves every unused visit. Repeated identical changes refuse; concurrent changes require review. Exhaustion prevents further assignment. A later cash purchase is a separate sale with a separate original; it is never an automatic renewal or a charge. Ct approved the reversible pause default with riders on 26 October 2026. PAY-008 remains partial.

pay.retail.cancel uses the same explicit transition authorization fields and accepts only an exhausted membership. It records cancellation once, keeps the original receipt and pause history, and blocks subsequent resume or assignment. Cancellation with unused visits refuses, preserving the entitlement. Recording cancellation neither changes an external billing arrangement nor initiates any refund, charge or renewal. CT RL-104 on 28 October 2026 approves this owner-recorded, specifically patient-authorized exhausted cancellation default with riders. Settlement of unused entitlements, complete cancellation and renewal, staff sale authority, provider handoff, patient-facing notices and complete membership reporting remain Gaps.

finance.source.record accepts the same patient, original reference, source evidence and transaction date as a settlement observation, with kind of charge, payout or accounting, positive integer amountCents, a unique reference and confirm: true. Only payouts accept nonnegative feeCents. A payout source is the owner's explicitly allocated patient-and-charge portion, not an imported whole processor payout. No provider or accounting account is connected.

The monthly preparation returns matching, with one entry for every recorded settlement and source. Each names its amount, original reference, cited evidence, group totals and every missing or differing source. Payout net plus fees is compared with settlements; charges and accounting amounts are compared separately. Patient identity and requested transaction month bound each group; equal references on another patient never join. Adding the missing accounting remainder can make the recorded amounts agree, but this status grants no provider verification, payment posting or execution authority. Request and refund drafts retain their previous preparation-only boundaries. Complete payout allocation, cross-period reconciliation, actual ERA pursuit and finance-record destruction remain unproved.

pay.retail.renew records an explicitly patient-authorized new finite cash membership only after the source membership is exhausted and not cancelled. It requires clientId, saleId, kind: membership, the same serviceId, new label, units, amountCents and reference, every transition authorization field above, and cashConfirm: true for cash already received. The new immutable receipt names its source; the old receipt and history do not change. A source may be renewed once. Non-owner, wrong-patient, cancelled, unconsumed, gift-funded and representative-authorized requests refuse. CT RL-104 approves this finite cash-renewal default with riders; no automatic debit or external billing change occurs.

The signed-in patient portal lists recorded membership lifecycle notices and unused visits beside each original purchase receipt. It shows no internal consent evidence and sends no outbound notice. Financial reports add a retail obligations CSV with state counts, sold and used visits, unused visits, purchase price allocated to unused visits, renewal counts and separately held gift value, as of the selected period end. The allocated value is not a refund quote. Approved destruction preserves only anonymous dated arithmetic and state facts; older destroyed purchases without those facts are explicitly reported as incomplete historical obligations. Outbound notices, provider integration, unused-entitlement settlement and broader renewal authority remain unproved.

pay.retail.settle records an already completed external cash refund and cancels an unused finite membership. It takes the same patient and membership identifiers and transition authorization fields, plus settlementAmountCents, settlementReference, settlementEvidence and cashReturned: true. The amount must equal the original cash purchase price multiplied by unused visits and divided by all purchased visits, rounded once to cents. Cancel any booked assigned visits before settlement. The record atomically cancels and settles once, preserves the original receipt, and leaves actual attendance intact. It rejects gift-funded memberships and representative assertions. Ledger adjustments and the cash refund, deposit reconciliation, dated obligations, portal notice and accounting preparation retain the same amount; archive restore and approved destruction preserve their relevant facts. CT RL-104 approves this recorded-cash default with riders, without certifying completion. Balm initiates no provider refund and does not verify an entered cash refund.

The owner can select Review eligible retail originals in the patient’s retention panel. retention.retail.preview takes clientId and returns a digest-bound inventory of eligible retail groups. retention.retail.destroy requires that previewId, digest and confirm: true. This destroys only the reviewed retail originals and transition evidence; the patient, clinical records and other purchases remain. Gift funding and its redemptions stay together, as do a membership and its renewals. The latest event in each connected group extends that group’s applicable retention period. Clinical deadlines, the documented adult and minor rules, payer and practice requirements, legal holds, unused value and booked assignments continue to protect affected records. A newer unrelated retail purchase does not extend an older group’s deadline.

Approval expires after fifteen minutes; any inventory, authority, hold or policy change requires a fresh review. A full-patient preview cannot authorize retail-only destruction, or the reverse. Anonymous dated accounting and covered-visit facts survive; deleting a package receipt never makes its covered visit billable again. Opaque transaction fingerprints prevent replay of retired receipt and cash-settlement references without retaining their private text. Older archives cannot restore the retired originals against the current erasure authority or its later journal. A fresh destination without that journal still has unverified erasure history. Independent clinical destruction while newer retail remains, detailed provider custody and complete membership lifecycle handling remain unfinished.

pay.retail.authorize is an owner-only configuration command. It takes a named active reception or billing staffId, an explicit expiresAt no later than seven days away, a recorded reason and confirm: true. That person may then use the existing sale and visit-assignment forms with their own native session. To revoke the grant, pass staffId and revoke: true. Staff cannot grant authority, change membership state, cancel, renew or settle entitlements. Expiry, revocation, a changed staff version or lost owner authority refuses further sales; the same live checks run inside the write transaction. An archive excludes these grants, so a restored clinic requires fresh owner authorization. This is an adopted conservative default pending ct, rather than approval of a broader staff sales policy.

pay.retail.gift_settle restores unused gift-funded membership value only to its original patient gift. It uses the same transition authorization, exact settlementAmountCents, unique settlementReference and settlementEvidence as cash settlement, plus restoreGift: true. It requires no assertion that cash was returned. The owner reviews this action in the membership's Restore unused gift value form. The restored amount equals the original membership price allocated to its unused visits, rounded once to cents; it is not a legal refund determination. Booked assignments, wrong patient, representative assertions, mismatched cents and replay refuse. The original purchase receipt stays fixed. The portal labels restored gift value separately from a recorded cash refund. Gift liability increases, deposits show no invented bank refund, and accounting preparation credits liability. The original gift can spend restored value only once; it remains patient-bound and cannot buy another gift. Archive custody and eligible destruction preserve these dated facts. This conservative default awaits ct approval, and other non-cash settlement, provider refunds and broader authority remain unfinished.

For delegated product sales, the owner supplies taxRules with the finite grant: each rule has state, integer basis-point rate and the reviewed evidence. A delegated product sale must use those exact recorded values; an empty rule list grants no product-tax authority. The existing product form shows the first approved rule as read-only fields. Changes to the grant require a fresh sale attempt. Approval originals, including the tax basis, remain immutable archive evidence and add no authority to a restored installation.