Blog

    Stripe Connect for a Healthcare Platform: Patient Payments and Provider Payouts on One Ledger

    By GauravDecember 2, 20269 mins read
    On this page

    Stripe Connect on a healthcare platform turns one patient payment into three amounts: the charge, the provider payout and the platform fee. They share one payment id, and a refund reverses all three. Stripe Connect is one product that can split a charge that way, and the ledger behind it is the real work.

    Written for leaders of multi-provider healthcare platforms, it covers the money flows, the ledger row, refunds, retries, the clinical data to keep out, and reconciliation.

    How should a healthcare platform split patient payments and provider payouts?

    A healthcare platform should record each patient payment as three legs, the patient charge, the provider payout and the platform fee, against one payment id, and treat the payment as complete only when all three exist. Agnotic Technologies uses Stripe Connect or a similar marketplace product to move the money, while the platform's ledger joins the legs.

    Splitting patient charges across providers?

    We ledger the charge, the payout, and the fee on one payment id, and we reverse all three on a refund.

    • Charge: what the patient paid, with the payer method id you already store.
    • Payout: what that provider is owed, not a later guess.
    • Fee: what the platform keeps. Zero is a number. An omitted fee is not.
    • Refund: reverse charge, payout, and fee on the same payment id. Partial refunds scale all three.

    The audit trail for a payment is the payment id, the three amounts and the operator who acted. It never includes a card number.

    What are the common mistakes with patient payments and provider payouts?

    The common mistakes are paying a provider before the charge is recorded, refunding the patient while the payout stands, and putting card or clinical details where they do not belong. Agnotic holds the ledger row until all three legs exist.

    • Refuse: provider payout before the charge is recorded.
    • Refuse: a refund of the charge that leaves the payout standing.
    • Refuse: card PAN, CVV, or full account number on the audit row.
    • Avoid: retrying a create call without an idempotency key.
    • Avoid: refunds issued in the processor dashboard, outside the ledger.

    Which Connect money flow fits a multi-provider platform?

    Destination charges fit when one charge pays one provider. Separate charges and transfers fit when one charge must pay several providers, or when the payout is settled after the charge. Both keep the charge on the platform account.

    Split patient payment: the patient is charged on the platform account under one payment id, the provider share moves to the provider's connected account as a transfer, the platform keeps its fee, and a refund reverses the charge, the transfer and the fee in proportion
    • Destination charge: the platform charges the patient, keeps its fee, and the rest moves to one connected account straight away.
    • Separate charge and transfers: the platform charges first, then creates one transfer per provider.
    • Either way: the ledger, not the processor dashboard, is where the three amounts are joined.

    Pick the flow per product, not per payment. Running both flows on one platform doubles the reconciliation rules without adding anything the patient or provider can see.

    How do you tie the charge, payout and fee to one payment id?

    Give every leg the platform's own payment id, and store each processor id against it. In Stripe, the transfer group links a charge with its transfers, and the source transaction ties a transfer to the charge that funds it.

    Stripe's Create a transfer API sends funds to a connected account. Its transfer_group string marks the transfer as part of a group, and source_transaction lets a transfer draw on a charge before those funds become available.

    • Payment id: created by the platform before the charge, and reused as the transfer group.
    • Charge leg: the processor's payment or charge id.
    • Payout leg: one transfer id per provider, each pointing back to the charge.
    • Fee leg: the amount the platform keeps, recorded even when it is zero.

    What does a split-payment ledger row hold?

    A ledger row holds amounts, ids and states, and nothing clinical. It records what moved, between which accounts and when, so finance can reconcile and support can answer a patient's question.

    • Ids: platform payment id, processor charge id, transfer ids, and refund and reversal ids.
    • Parties: a patient account reference and the provider's connected account id.
    • Amounts: charge, payout and fee in minor units with the currency, plus refunded totals per leg.
    • State: open, complete, partly refunded, refunded, or reversal failed.

    Keep the ledger append-only. A refund adds rows that reverse the legs and never edits the original charge row, so the full history of the payment stays readable.

    How should a refund reverse the payout and the fee?

    A refund should reverse the provider's transfer and the platform's fee in proportion to the refunded amount, as part of the same operation. Without that, the patient's refund comes out of the platform's balance while the provider keeps the full payout.

    Stripe's Create a refund API has reverse_transfer, which reverses the transfer in proportion to the refunded amount, and refund_application_fee, which returns the whole application fee on a full refund and a proportional share on a partial one.

    • Full refund: reverse the whole transfer and refund the whole fee.
    • Partial refund: both reverse in proportion, so the three legs keep their ratio.
    • Several providers on one charge: reverse each transfer explicitly by the share the refund covers.

    Stripe's refund reason field takes a short list of values, such as duplicate or requested by customer. Use it as written, and keep any clinical story behind a cancellation in the clinical record.

    How do you stop a retry from charging the patient twice?

    Send every create call with an idempotency key built from the platform payment id and the leg, so a retry after a timeout returns the first result instead of creating a second charge or transfer.

    Stripe supports idempotency keys so a request can be retried after a connection error without creating a second object. Stripe advises against using sensitive data, such as email addresses or personal identifiers, as keys.

    • Key: payment id plus the leg, such as the charge, the transfer for one provider, or a numbered refund.
    • Not: a patient name, email or record number.
    • Ledger: write the leg as pending before the call and complete after it, so a crash between the two is visible.

    Store the key on the ledger row as well. When support is asked whether a patient was charged twice, the key and the processor's saved response settle it in one lookup.

    What clinical data must stay out of the payment flow?

    Diagnoses, procedure codes, visit notes and anything that says why the patient was seen must stay out of processor metadata, descriptions and statement descriptors. The processor needs an amount and an account, not a reason.

    • Descriptions: a neutral service label agreed with compliance, not the visit type.
    • Metadata: the platform payment id only. Everything else is looked up in the platform's own systems.
    • Receipts: generated by the platform, where its access control already applies.

    Whether a given processor may see more is a contract and compliance question for the client's counsel, answered vendor by vendor.

    What happens when a provider leaves with payouts outstanding?

    The ledger keeps every open leg against that provider, and refunds after the provider leaves need an agreed source of funds. Recovering money already paid out to a departed provider is a finance decision, not an API call.

    • Freeze: stop new charges to that provider's account at offboarding.
    • Track: keep a list of the provider's payments that can still be refunded.
    • Decide: who funds a refund the provider can no longer cover, written down before it happens.

    A worked example: a telehealth visit refunded in part

    A worked example: a patient pays for a telehealth visit on a platform that uses destination charges. The provider's share goes to their connected account and the platform keeps its fee, all under one payment id.

    • Step 1, the platform creates the payment id and charges the patient with an idempotency key.
    • Step 2, the ledger records the charge, payout and fee, and marks the payment complete.
    • Step 3, part of the service is cancelled, and support refunds half the charge with the transfer and fee flags set.
    • Step 4, the ledger shows half of each leg reversed, and the provider's statement matches it.

    Had the transfer reversal failed, the ledger would show the payment as reversal failed and finance would own the exception. The patient's refund would still stand.

    How do you reconcile the ledger with the processor?

    Pull the processor's charges, transfers, refunds and reversals for a period, group them by the platform payment id, and compare each group with its ledger row. Any difference becomes an exception with an owner.

    • Match: every charge has its transfers and fee, and every refund has its reversals.
    • Orphan: a transfer with no charge, or a refund with no reversal. These are the cases the ledger rules exist to stop.
    • Amount: legs that do not add up to the charge minus refunds.

    Run it on a schedule finance agrees, and always before a payout report goes to providers. A provider statement built from an unreconciled ledger repeats its mistakes in writing.

    Who owns each leg of the split?

    Engineering owns the ledger code and the processor calls. Finance owns reconciliation and the decision on payouts that cannot be recovered. Provider operations owns onboarding and offboarding of connected accounts.

    • Support: issues refunds through the platform, never directly in the processor dashboard.
    • Compliance: agrees what may appear in descriptions and metadata.
    • Engineering: idempotency, retries and the alert when a leg stays pending.

    How does Agnotic post the split?

    Agnotic builds the ledger, the processor calls, the idempotency keys and the reconciliation job for the client's platform, with the processor chosen by the client. Stripe Connect is one option the same ledger design works with.

    One id, three amounts, refund reverses all

    Charge, payout, fee. A marketplace product is a label. The ledger is the work.

    Related reading on Agnotic

    Reading an ERA, card payments in a mobile app, and planning a healthcare software build.

    Sources

    Frequently Asked Questions

    No. It is one marketplace product that can split a charge. The ledger is the requirement.

    Talk to an engineer about your project

    Name the charge, the provider, and the fee. We will ledger all three on one payment id and reverse all three on a refund.

    Go deeper

    Services and solutions on this topic