Skip to content

SunCharts EHR API

Patient billing and payments

EHR API as of 26.11.11.41 66 operations openapi.json ↓

# Account hosted payments

GET /api/v1/billing/accounts/{id}/payments

Staff tenant-scoped attempts and reserved/available balance for a posted account. Returns environment availability separately from configured account readiness. Production disables test transactions; historical evidence remains readable.

Access OAuth 2.0 access tokenbilling.read

Parameters

Name In Type Details
id required path string (uuid)

Responses

200 Success; no payment inferred from browser return application/json
Fields object · 28
Field Type Details
available_cents integer
balance_cents integer
collection_unavailable_reason string or null Human-readable environment restriction, or null.
items array of HostedPayment
account_id string (uuid)
amount_cents integer
checkout_url string or null Null in production even for a historical open test attempt.
collection_unavailable_reason string or null Human-readable environment restriction, or null.
created_at string (date-time)
currency constant always usd
expiry_available boolean False in production; historical evidence is preserved.
id string (uuid)
ledger_recorded boolean
needs_review boolean
provider_mode any one of own_stripe, suncharts_connect
refund_available boolean False in production; historical evidence is preserved.
refunded_cents integer
status any one of creating, open, paid, expired, needs_review, refunded
test_mode constant always true
test_payments_available boolean False when ENGINE_ENVIRONMENT=production.
updated_at string (date-time)
version integer
live_payments_available constant Live card processing is not supported. always false
mode string or null
payments_enabled boolean
reserved_cents integer
test_mode constant always true
test_payments_available boolean False when ENGINE_ENVIRONMENT=production.
Example response placeholder values
{
  "available_cents": 1,
  "balance_cents": 1,
  "collection_unavailable_reason": "string",
  "items": [
    {
      "account_id": "00000000-0000-4000-8000-000000000000",
      "amount_cents": 1,
      "checkout_url": "https://app.example.test/callback",
      "collection_unavailable_reason": "string",
      "created_at": "2026-01-15T15:30:00Z",
      "currency": "usd",
      "expiry_available": true,
      "id": "00000000-0000-4000-8000-000000000000"
    }
  ],
  "live_payments_available": false,
  "mode": "string",
  "payments_enabled": true,
  "reserved_cents": 1
}
400 Invalid evidence, unavailable connection or unsupported live/payment operation
401 Authentication required
403 Owner/staff role or billing scope denied
404 Tenant-scoped resource not found
409 Stale version, reused request, reserved balance, or conflicting provider evidence
428 Current quoted If-Match required
500 Database/audit failure; database changes rolled back

Example call

curl "$EHR_URL/api/v1/billing/accounts/{id}/payments" -H "Authorization: Bearer $ACCESS_TOKEN"

# Create hosted payment

POST /api/v1/billing/accounts/{id}/payments

Billing-write staff. Reserve a bounded posted-account amount before provider I/O. Opaque UUID/generic line only; no PHI. Stable native/provider idempotency; ambiguous requests remain reserved and are not retried after 23h. Test-payment activation (enabled=true), creation, refresh, expiry and refund are blocked in production. Simulated funds cannot be reconciled into production balances.

Access OAuth 2.0 access tokenbilling.write

Parameters

Name In Type Details
id required path string (uuid)
If-Match required header string Quoted current settings/account version. Settings first save accepts "0".

Request body application/json · required

Fields HostedPaymentRequest · 2
Field Type Details
amount_cents required integer value 50–100000000
request_id required string (uuid)
Example request body placeholder values
{
  "amount_cents": 50,
  "request_id": "00000000-0000-4000-8000-000000000000"
}

Responses

200 Success; no payment inferred from browser return application/json
Fields HostedPaymentResult · 19
Field Type Details
payment HostedPayment
account_id string (uuid)
amount_cents integer
checkout_url string or null Null in production even for a historical open test attempt.
collection_unavailable_reason string or null Human-readable environment restriction, or null.
created_at string (date-time)
currency constant always usd
expiry_available boolean False in production; historical evidence is preserved.
id string (uuid)
ledger_recorded boolean
needs_review boolean
provider_mode any one of own_stripe, suncharts_connect
refund_available boolean False in production; historical evidence is preserved.
refunded_cents integer
status any one of creating, open, paid, expired, needs_review, refunded
test_mode constant always true
test_payments_available boolean False when ENGINE_ENVIRONMENT=production.
updated_at string (date-time)
version integer
Example response placeholder values
{
  "payment": {
    "account_id": "00000000-0000-4000-8000-000000000000",
    "amount_cents": 1,
    "checkout_url": "https://app.example.test/callback",
    "collection_unavailable_reason": "string",
    "created_at": "2026-01-15T15:30:00Z",
    "currency": "usd",
    "expiry_available": true,
    "id": "00000000-0000-4000-8000-000000000000"
  }
}
400 Invalid evidence, unavailable connection or unsupported live/payment operation
401 Authentication required
403 Owner/staff role or billing scope denied
404 Tenant-scoped resource not found
409 Stale version, reused request, reserved balance, or conflicting provider evidence
428 Current quoted If-Match required
500 Database/audit failure; database changes rolled back

Example call

curl -X POST "$EHR_URL/api/v1/billing/accounts/{id}/payments" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Resolve an authorized card-checkout return

GET /api/v1/billing/copay-checkouts/{id}

Authenticated staff billing-read lookup by opaque operation UUID. Tenant-scoped and audited; returns only the authorized saved operation, including its patient and appointment IDs. The return URL is not payment evidence.

Access OAuth 2.0 access tokenbilling.read

Parameters

Name In Type Details
id required path string (uuid)

Responses

200 Current durable operation state; financial effects require verified provider evidence application/json
Fields object · 18
Field Type Details
operation required HostedCopayOperation Immutable appointment/payment binding with durable reconciliation state. Receipt creation requires independently retrieved account/mode-bound captured charge evidence. Browser return and Checkout opening never count as payment.
amount_cents required integer value 50–100000000
appointment_id required string (uuid)
captured_at required string or null
channel required string `hosted` for a Stripe-hosted Checkout link, `reader` for a card payment taken on a reader. For a reader payment `last_result` says where it stands: `reader_waiting`, `reader_offline` or `reader_finishing` while open; `reader_declined`, `reader_cancelled`, `reader_timed_out`, `reader_offline`, `reader_in_use`, `reader_unavailable` or `reader_failed` once closed (`expired`). one of hosted, reader
checkout_url required string or null Available only for an open attempt permitted in this environment.
created_at required string (date-time)
currency required constant always USD
id required string (uuid)
last_result required string or null
livemode required boolean
patient_id required string (uuid)
reader_id required string or null The card reader for a reader payment.
receipt_id required string or null
refunded_cents required integer value ≥ 0
request_id required string (uuid)
status required any one of creating, open, paid, expired, needs_review, refunded
version required integer value ≥ 1
Example response placeholder values
{
  "operation": {
    "amount_cents": 50,
    "appointment_id": "00000000-0000-4000-8000-000000000000",
    "captured_at": "2026-01-15T15:30:00Z",
    "channel": "hosted",
    "checkout_url": "https://app.example.test/callback",
    "created_at": "2026-01-15T15:30:00Z",
    "currency": "USD",
    "id": "00000000-0000-4000-8000-000000000000",
    "last_result": "string",
    "livemode": true,
    "patient_id": "00000000-0000-4000-8000-000000000000",
    "reader_id": "string",
    "receipt_id": "00000000-0000-4000-8000-000000000000",
    "refunded_cents": 0,
    "request_id": "00000000-0000-4000-8000-000000000000",
    "status": "creating",
    "version": 1
  }
}
400 Invalid input or unavailable/mismatched payment mode
401 Sign in required
403 Billing permission denied
404 Tenant/patient/appointment-scoped record not found
409 Conflicting retry, pending collection, unsafe balance or over-limit history
500 Database/audit failure; mutation rolled back

Example call

curl "$EHR_URL/api/v1/billing/copay-checkouts/{id}" -H "Authorization: Bearer $ACCESS_TOKEN"

# Reconcile an existing checkout after browser return

POST /api/v1/billing/copay-checkouts/{id}/refresh

Billing-edit and native scheduling authorization are required. Retrieves only a previously bound provider session using the stored tenant/account/mode binding; never creates or retries creating a checkout. Missing session binding remains pending. Payment and refund ledger changes require independently verified provider evidence, never query parameters. Existing worker/manual retry behavior is unchanged.

Access OAuth 2.0 access tokenbilling.write

Parameters

Name In Type Details
id required path string (uuid)

Responses

200 Current durable operation state; financial effects require verified provider evidence application/json
Fields object · 18
Field Type Details
operation required HostedCopayOperation Immutable appointment/payment binding with durable reconciliation state. Receipt creation requires independently retrieved account/mode-bound captured charge evidence. Browser return and Checkout opening never count as payment.
amount_cents required integer value 50–100000000
appointment_id required string (uuid)
captured_at required string or null
channel required string `hosted` for a Stripe-hosted Checkout link, `reader` for a card payment taken on a reader. For a reader payment `last_result` says where it stands: `reader_waiting`, `reader_offline` or `reader_finishing` while open; `reader_declined`, `reader_cancelled`, `reader_timed_out`, `reader_offline`, `reader_in_use`, `reader_unavailable` or `reader_failed` once closed (`expired`). one of hosted, reader
checkout_url required string or null Available only for an open attempt permitted in this environment.
created_at required string (date-time)
currency required constant always USD
id required string (uuid)
last_result required string or null
livemode required boolean
patient_id required string (uuid)
reader_id required string or null The card reader for a reader payment.
receipt_id required string or null
refunded_cents required integer value ≥ 0
request_id required string (uuid)
status required any one of creating, open, paid, expired, needs_review, refunded
version required integer value ≥ 1
Example response placeholder values
{
  "operation": {
    "amount_cents": 50,
    "appointment_id": "00000000-0000-4000-8000-000000000000",
    "captured_at": "2026-01-15T15:30:00Z",
    "channel": "hosted",
    "checkout_url": "https://app.example.test/callback",
    "created_at": "2026-01-15T15:30:00Z",
    "currency": "USD",
    "id": "00000000-0000-4000-8000-000000000000",
    "last_result": "string",
    "livemode": true,
    "patient_id": "00000000-0000-4000-8000-000000000000",
    "reader_id": "string",
    "receipt_id": "00000000-0000-4000-8000-000000000000",
    "refunded_cents": 0,
    "request_id": "00000000-0000-4000-8000-000000000000",
    "status": "creating",
    "version": 1
  }
}
400 Invalid input or unavailable/mismatched payment mode
401 Sign in required
403 Billing permission denied
404 Tenant/patient/appointment-scoped record not found
409 Conflicting retry, pending collection, unsafe balance or over-limit history
500 Database/audit failure; mutation rolled back

Example call

curl -X POST "$EHR_URL/api/v1/billing/copay-checkouts/{id}/refresh" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Read native copay receipt copy

GET /api/v1/billing/copay-receipts/{id}

Read receipt evidence and minimal current patient/appointment identity for a print copy without clinical chart access. Original receipt is immutable; verified refunds and allocation status remain explicit.

Access OAuth 2.0 access tokenbilling.read

Parameters

Name In Type Details
id required path string (uuid)

Responses

200 Audited native billing read; no payment, invoice, allocation or provider mutation application/json
Fields BillingCopayReceiptCopy · 33
Field Type Details
context required object
appointment required object
id required string (uuid)
starts_at required string (date-time)
patient required object
family_name required string
given_name required string
mrn required string
practiceName required string
printedAt required string (date-time)
receipt required CopayReceipt Immutable receipt evidence plus current allocation/void state. Reversing an allocation does not refund funds or make the original receipt reusable.
account_ids required array of string (uuid)
actor_id required string (uuid)
allocated_cents required integer value ≥ 0
amount_cents required integer
appointment_id required string (uuid)
created_at required string (date-time)
id required string (uuid)
method required any one of cash, check, external
occurred_on required string (date)
patient_id required string (uuid)
reference required string
reversed_cents required integer value ≥ 0
voided required boolean
coverage_id string or null
coverage_snapshot Coverage or null
hosted_checkout object or null Present for processor-verified hosted receipts. Manual void/reversal is rejected; verified provider refunds govern their accounting. Test receipts cannot be allocated in production.
id string (uuid)
livemode boolean
refunded_cents integer value ≥ 0
refunded_unapplied_cents integer value ≥ 0
status any one of creating, open, paid, expired, needs_review, refunded
reason string
Example response placeholder values
{
  "context": {
    "appointment": {
      "id": "00000000-0000-4000-8000-000000000000",
      "starts_at": "2026-01-15T15:30:00Z"
    },
    "patient": {
      "family_name": "string",
      "given_name": "string",
      "mrn": "string"
    },
    "practiceName": "string",
    "printedAt": "2026-01-15T15:30:00Z"
  },
  "receipt": {
    "account_ids": [
      "00000000-0000-4000-8000-000000000000"
    ],
    "actor_id": "00000000-0000-4000-8000-000000000000",
    "allocated_cents": 0,
    "amount_cents": 1,
    "appointment_id": "00000000-0000-4000-8000-000000000000",
    "created_at": "2026-01-15T15:30:00Z",
    "id": "00000000-0000-4000-8000-000000000000",
    "method": "cash",
    "occurred_on": "2026-01-15",
    "patient_id": "00000000-0000-4000-8000-000000000000",
    "reference": "string",
    "reversed_cents": 0,
    "voided": true
  }
}
401 Sign in required
403 Native billing view or billing.read denied
404 Tenant-scoped record not found
500 Read or audit failure

Example call

curl "$EHR_URL/api/v1/billing/copay-receipts/{id}" -H "Authorization: Bearer $ACCESS_TOKEN"

# Resolve authorized invoice collection without creating a checkout

GET /api/v1/billing/invoice-checkouts/{id}

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
id required path string (uuid)

Responses

200 Authenticated tenant-scoped result application/json
Fields InvoiceCheckoutResult · 22
Field Type Details
operation required InvoiceCheckoutOperation
account_id required string (uuid)
amount_cents required integer value ≥ 0
captured_at required string (date-time) or null
channel required string `hosted` for a Stripe-hosted Checkout link, `reader` for a card payment taken on a reader. For a reader payment `last_result` says where it stands: `reader_waiting`, `reader_offline` or `reader_finishing` while open; `reader_declined`, `reader_cancelled`, `reader_timed_out`, `reader_offline`, `reader_in_use`, `reader_unavailable` or `reader_failed` once closed (`expired`). one of hosted, reader
checkout_url required string (uri) or null
created_at required string (date-time)
currency required constant always usd
id required string (uuid)
installment_number required integer
last_result required string or null
livemode required boolean
paid_entry_id required string (uuid) or null
patient_id required string (uuid)
plan_id required string (uuid)
reader_id required string or null The card reader for a reader payment.
reason required string
refunded_cents required integer value ≥ 0
request_id required string (uuid)
status required string one of creating, open, paid, expired, needs_review, refunded
unapplied_cents required integer value ≥ 0
version required integer
Example response placeholder values
{
  "operation": {
    "account_id": "00000000-0000-4000-8000-000000000000",
    "amount_cents": 0,
    "captured_at": "2026-01-15T15:30:00Z",
    "channel": "hosted",
    "checkout_url": "https://app.example.test/callback",
    "created_at": "2026-01-15T15:30:00Z",
    "currency": "usd",
    "id": "00000000-0000-4000-8000-000000000000",
    "installment_number": 1,
    "last_result": "string",
    "livemode": true,
    "paid_entry_id": "00000000-0000-4000-8000-000000000000",
    "patient_id": "00000000-0000-4000-8000-000000000000",
    "plan_id": "00000000-0000-4000-8000-000000000000",
    "reader_id": "string",
    "reason": "string",
    "refunded_cents": 0,
    "request_id": "00000000-0000-4000-8000-000000000000",
    "status": "creating",
    "unapplied_cents": 0,
    "version": 1
  }
}
403 Billing permission required
409 Responsibility, version, reservation or idempotency conflict

Example call

curl "$EHR_URL/api/v1/billing/invoice-checkouts/{id}" -H "Authorization: Bearer $ACCESS_TOKEN"

# Cancel an unfinished invoice or installment card link

POST /api/v1/billing/invoice-checkouts/{id}/cancel

Billing edit. Records the cancel request, then expires the Stripe Checkout Session through SunCharts Connect and records what really happened: `expired` with `last_result` `link_cancelled`, or `paid` when the patient completed the link in the same moment. Only a hosted card link can be cancelled here. No refund is initiated here.

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
id required path string (uuid)

Responses

200 Authenticated tenant-scoped result application/json
Fields InvoiceCheckoutResult · 22
Field Type Details
operation required InvoiceCheckoutOperation
account_id required string (uuid)
amount_cents required integer value ≥ 0
captured_at required string (date-time) or null
channel required string `hosted` for a Stripe-hosted Checkout link, `reader` for a card payment taken on a reader. For a reader payment `last_result` says where it stands: `reader_waiting`, `reader_offline` or `reader_finishing` while open; `reader_declined`, `reader_cancelled`, `reader_timed_out`, `reader_offline`, `reader_in_use`, `reader_unavailable` or `reader_failed` once closed (`expired`). one of hosted, reader
checkout_url required string (uri) or null
created_at required string (date-time)
currency required constant always usd
id required string (uuid)
installment_number required integer
last_result required string or null
livemode required boolean
paid_entry_id required string (uuid) or null
patient_id required string (uuid)
plan_id required string (uuid)
reader_id required string or null The card reader for a reader payment.
reason required string
refunded_cents required integer value ≥ 0
request_id required string (uuid)
status required string one of creating, open, paid, expired, needs_review, refunded
unapplied_cents required integer value ≥ 0
version required integer
Example response placeholder values
{
  "operation": {
    "account_id": "00000000-0000-4000-8000-000000000000",
    "amount_cents": 0,
    "captured_at": "2026-01-15T15:30:00Z",
    "channel": "hosted",
    "checkout_url": "https://app.example.test/callback",
    "created_at": "2026-01-15T15:30:00Z",
    "currency": "usd",
    "id": "00000000-0000-4000-8000-000000000000",
    "installment_number": 1,
    "last_result": "string",
    "livemode": true,
    "paid_entry_id": "00000000-0000-4000-8000-000000000000",
    "patient_id": "00000000-0000-4000-8000-000000000000",
    "plan_id": "00000000-0000-4000-8000-000000000000",
    "reader_id": "string",
    "reason": "string",
    "refunded_cents": 0,
    "request_id": "00000000-0000-4000-8000-000000000000",
    "status": "creating",
    "unapplied_cents": 0,
    "version": 1
  }
}
403 Billing permission required
409 Responsibility, version, reservation or idempotency conflict

Example call

curl -X POST "$EHR_URL/api/v1/billing/invoice-checkouts/{id}/cancel" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Cancel an invoice payment that is waiting on a card reader

POST /api/v1/billing/invoice-checkouts/{id}/reader-cancel

Billing edit. Records the cancel request, resets the reader and cancels the payment at the processor if no card was taken. If a card is being approved at that moment the payment is left alone and its real outcome is recorded. No refund is initiated here.

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
id required path string (uuid)

Responses

200 Authenticated tenant-scoped result application/json
Fields InvoiceCheckoutResult · 22
Field Type Details
operation required InvoiceCheckoutOperation
account_id required string (uuid)
amount_cents required integer value ≥ 0
captured_at required string (date-time) or null
channel required string `hosted` for a Stripe-hosted Checkout link, `reader` for a card payment taken on a reader. For a reader payment `last_result` says where it stands: `reader_waiting`, `reader_offline` or `reader_finishing` while open; `reader_declined`, `reader_cancelled`, `reader_timed_out`, `reader_offline`, `reader_in_use`, `reader_unavailable` or `reader_failed` once closed (`expired`). one of hosted, reader
checkout_url required string (uri) or null
created_at required string (date-time)
currency required constant always usd
id required string (uuid)
installment_number required integer
last_result required string or null
livemode required boolean
paid_entry_id required string (uuid) or null
patient_id required string (uuid)
plan_id required string (uuid)
reader_id required string or null The card reader for a reader payment.
reason required string
refunded_cents required integer value ≥ 0
request_id required string (uuid)
status required string one of creating, open, paid, expired, needs_review, refunded
unapplied_cents required integer value ≥ 0
version required integer
Example response placeholder values
{
  "operation": {
    "account_id": "00000000-0000-4000-8000-000000000000",
    "amount_cents": 0,
    "captured_at": "2026-01-15T15:30:00Z",
    "channel": "hosted",
    "checkout_url": "https://app.example.test/callback",
    "created_at": "2026-01-15T15:30:00Z",
    "currency": "usd",
    "id": "00000000-0000-4000-8000-000000000000",
    "installment_number": 1,
    "last_result": "string",
    "livemode": true,
    "paid_entry_id": "00000000-0000-4000-8000-000000000000",
    "patient_id": "00000000-0000-4000-8000-000000000000",
    "plan_id": "00000000-0000-4000-8000-000000000000",
    "reader_id": "string",
    "reason": "string",
    "refunded_cents": 0,
    "request_id": "00000000-0000-4000-8000-000000000000",
    "status": "creating",
    "unapplied_cents": 0,
    "version": 1
  }
}
403 Billing permission required
409 Responsibility, version, reservation or idempotency conflict

Example call

curl -X POST "$EHR_URL/api/v1/billing/invoice-checkouts/{id}/reader-cancel" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Retrieve and reconcile an already-bound session; never creates a checkout

POST /api/v1/billing/invoice-checkouts/{id}/refresh

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
id required path string (uuid)

Responses

200 Authenticated tenant-scoped result application/json
Fields InvoiceCheckoutResult · 22
Field Type Details
operation required InvoiceCheckoutOperation
account_id required string (uuid)
amount_cents required integer value ≥ 0
captured_at required string (date-time) or null
channel required string `hosted` for a Stripe-hosted Checkout link, `reader` for a card payment taken on a reader. For a reader payment `last_result` says where it stands: `reader_waiting`, `reader_offline` or `reader_finishing` while open; `reader_declined`, `reader_cancelled`, `reader_timed_out`, `reader_offline`, `reader_in_use`, `reader_unavailable` or `reader_failed` once closed (`expired`). one of hosted, reader
checkout_url required string (uri) or null
created_at required string (date-time)
currency required constant always usd
id required string (uuid)
installment_number required integer
last_result required string or null
livemode required boolean
paid_entry_id required string (uuid) or null
patient_id required string (uuid)
plan_id required string (uuid)
reader_id required string or null The card reader for a reader payment.
reason required string
refunded_cents required integer value ≥ 0
request_id required string (uuid)
status required string one of creating, open, paid, expired, needs_review, refunded
unapplied_cents required integer value ≥ 0
version required integer
Example response placeholder values
{
  "operation": {
    "account_id": "00000000-0000-4000-8000-000000000000",
    "amount_cents": 0,
    "captured_at": "2026-01-15T15:30:00Z",
    "channel": "hosted",
    "checkout_url": "https://app.example.test/callback",
    "created_at": "2026-01-15T15:30:00Z",
    "currency": "usd",
    "id": "00000000-0000-4000-8000-000000000000",
    "installment_number": 1,
    "last_result": "string",
    "livemode": true,
    "paid_entry_id": "00000000-0000-4000-8000-000000000000",
    "patient_id": "00000000-0000-4000-8000-000000000000",
    "plan_id": "00000000-0000-4000-8000-000000000000",
    "reader_id": "string",
    "reason": "string",
    "refunded_cents": 0,
    "request_id": "00000000-0000-4000-8000-000000000000",
    "status": "creating",
    "unapplied_cents": 0,
    "version": 1
  }
}
403 Billing permission required
409 Responsibility, version, reservation or idempotency conflict
503 collection_unavailable: explicit live activation is off or test collection is forbidden in production

Example call

curl -X POST "$EHR_URL/api/v1/billing/invoice-checkouts/{id}/refresh" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Read native patient invoice

GET /api/v1/billing/invoices/{id}

Read an immutable invoice without loading a clinical chart; billing view still required.

Access OAuth 2.0 access tokenbilling.read

Parameters

Name In Type Details
id required path string (uuid)

Responses

200 Audited native billing read; no payment, invoice, allocation or provider mutation application/json
Fields PatientInvoice · 40
Field Type Details
account_id required string (uuid)
account_version required integer
actor_id required string (uuid)
created_at required string (date-time)
id required string (uuid)
patient_id required string (uuid)
snapshot required PatientInvoiceSnapshot Immutable issuance snapshot. Format 2 adds itemized services, patient activity and payment/adjustment subtotals. These fields are absent in older saved snapshots; clients must show original totals with an explicit unavailable-itemization message, never rebuild old invoices from current records.
amount_due_cents required integer
credit_balance_cents required integer
currency required constant always USD
gross_charges_cents required integer
patient required object
family_name required string
given_name required string
mrn string
patient_credit_cents required integer
responsibility_cents required integer
scope required constant always at_issuance
service_date required string (date)
format_version constant always 2
patient_activity array of PatientInvoiceActivity
effect_cents integer
id string (uuid)
kind any one of payment, adjustment_credit, adjustment_debit, reversal
method string
occurred_on string (date)
reference string
reverses_id string or null
patient_adjustment_credit_cents integer
patient_payment_cents integer
practice_name string
reason string
services array of PatientInvoiceService
code required string
code_system required string
description required string
line_total_cents required integer
modifiers required string
units required integer
test_activity boolean
Example response placeholder values
{
  "account_id": "00000000-0000-4000-8000-000000000000",
  "account_version": 1,
  "actor_id": "00000000-0000-4000-8000-000000000000",
  "created_at": "2026-01-15T15:30:00Z",
  "id": "00000000-0000-4000-8000-000000000000",
  "patient_id": "00000000-0000-4000-8000-000000000000",
  "snapshot": {
    "amount_due_cents": 1,
    "credit_balance_cents": 1,
    "currency": "USD",
    "gross_charges_cents": 1,
    "patient": {
      "family_name": "string",
      "given_name": "string",
      "mrn": "string"
    },
    "patient_credit_cents": 1,
    "responsibility_cents": 1,
    "scope": "at_issuance",
    "service_date": "2026-01-15"
  }
}
401 Sign in required
403 Native billing view or billing.read denied
404 Tenant-scoped record not found
500 Read or audit failure

Example call

curl "$EHR_URL/api/v1/billing/invoices/{id}" -H "Authorization: Bearer $ACCESS_TOKEN"

# List approved membership prices

GET /api/v1/billing/membership-prices

Billing view; bounded catalog page plus durable pending price recovery. Only the initiating authorized Owner receives its original approval input.

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
after query string (uuid)

Responses

200 Fresh minimized account-bound evidence; no encounter ledger mutation application/json
Fields object · 27
Field Type Details
account_id required string
checked_at required string (date-time)
contract_version required constant always 1
creation_available required boolean
has_more required boolean
installation_id required string (uuid)
items required array of PatientMembershipPrice items ≤ 20
amount_cents required integer value 50–100000000
created_at required string (date-time)
currency required constant always usd
id required string (uuid)
interval required any one of day, week, month, year
interval_count required integer value 1–365
name required string length ≤ 100
provider_price_id required string or null
request_id required string (uuid)
status required any one of creating, active, inactive, approved, needs_review, unavailable
livemode required boolean
next_cursor required string (uuid) or null
pending_operations required array of PatientMembershipPending items ≤ 20
kind required any one of price, membership, cancel
request required object or null
request_id required string (uuid)
retry_allowed required boolean
retry_safe_until required string (date-time)
status required string
remote_tenant_id required string (uuid)
Example response placeholder values
{
  "account_id": "string",
  "checked_at": "2026-01-15T15:30:00Z",
  "contract_version": 1,
  "creation_available": true,
  "has_more": true,
  "installation_id": "00000000-0000-4000-8000-000000000000",
  "items": [
    {
      "amount_cents": 50,
      "created_at": "2026-01-15T15:30:00Z",
      "currency": "usd",
      "id": "00000000-0000-4000-8000-000000000000",
      "interval": "day",
      "interval_count": 1,
      "name": "string",
      "provider_price_id": "string",
      "request_id": "00000000-0000-4000-8000-000000000000",
      "status": "creating"
    }
  ],
  "livemode": true,
  "next_cursor": "00000000-0000-4000-8000-000000000000",
  "pending_operations": [
    {
      "kind": "price",
      "request": {},
      "request_id": "00000000-0000-4000-8000-000000000000",
      "retry_allowed": true,
      "retry_safe_until": "2026-01-15T15:30:00Z",
      "status": "string"
    }
  ],
  "remote_tenant_id": "00000000-0000-4000-8000-000000000000"
}

Example call

curl "$EHR_URL/api/v1/billing/membership-prices" -H "Authorization: Bearer $ACCESS_TOKEN"

# Approve a fixed recurring membership price

POST /api/v1/billing/membership-prices

Owner and billing create. Immutable fixed USD price/cadence and explicit approval reason. Default-off live membership gate. Same request ID recovers uncertain creation.

Access OAuth 2.0 access tokenclinical.read

Request body application/json · required

Fields object · 8
Field Type Details
amount_cents required integer value 50–100000000
approval_reason required string length 1–500
approved required constant always true
currency required constant always usd
interval required any one of day, week, month, year
interval_count required integer value 1–365
name required string length 1–100
request_id required string (uuid)
Example request body placeholder values
{
  "amount_cents": 50,
  "approval_reason": "string",
  "approved": true,
  "currency": "usd",
  "interval": "day",
  "interval_count": 1,
  "name": "string",
  "request_id": "00000000-0000-4000-8000-000000000000"
}

Responses

200 Fresh minimized account-bound evidence; no encounter ledger mutation application/json
Fields PatientMembershipPriceResponse · 20
Field Type Details
account_id required string
checked_at required string (date-time)
contract_version required constant always 1
installation_id required string (uuid)
livemode required boolean
price required PatientMembershipPrice
amount_cents required integer value 50–100000000
created_at required string (date-time)
currency required constant always usd
id required string (uuid)
interval required any one of day, week, month, year
interval_count required integer value 1–365
name required string length ≤ 100
provider_price_id required string or null
request_id required string (uuid)
status required any one of creating, active, inactive, approved, needs_review, unavailable
recovery_required required boolean
remote_tenant_id required string (uuid)
retry_allowed required boolean
retry_safe_until required string (date-time)
Example response placeholder values
{
  "account_id": "string",
  "checked_at": "2026-01-15T15:30:00Z",
  "contract_version": 1,
  "installation_id": "00000000-0000-4000-8000-000000000000",
  "livemode": true,
  "price": {
    "amount_cents": 50,
    "created_at": "2026-01-15T15:30:00Z",
    "currency": "usd",
    "id": "00000000-0000-4000-8000-000000000000",
    "interval": "day",
    "interval_count": 1,
    "name": "string",
    "provider_price_id": "string",
    "request_id": "00000000-0000-4000-8000-000000000000",
    "status": "creating"
  },
  "recovery_required": true,
  "remote_tenant_id": "00000000-0000-4000-8000-000000000000",
  "retry_allowed": true,
  "retry_safe_until": "2026-01-15T15:30:00Z"
}

Example call

curl -X POST "$EHR_URL/api/v1/billing/membership-prices" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Refresh a reserved membership price

GET /api/v1/billing/membership-prices/{id}

Read-only broker retrieval for an existing tenant-scoped local request. Never creates or retries a provider price.

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
id required path string (uuid)

Responses

200 Fresh minimized account-bound evidence; no encounter ledger mutation application/json
Fields PatientMembershipPriceResponse · 20
Field Type Details
account_id required string
checked_at required string (date-time)
contract_version required constant always 1
installation_id required string (uuid)
livemode required boolean
price required PatientMembershipPrice
amount_cents required integer value 50–100000000
created_at required string (date-time)
currency required constant always usd
id required string (uuid)
interval required any one of day, week, month, year
interval_count required integer value 1–365
name required string length ≤ 100
provider_price_id required string or null
request_id required string (uuid)
status required any one of creating, active, inactive, approved, needs_review, unavailable
recovery_required required boolean
remote_tenant_id required string (uuid)
retry_allowed required boolean
retry_safe_until required string (date-time)
Example response placeholder values
{
  "account_id": "string",
  "checked_at": "2026-01-15T15:30:00Z",
  "contract_version": 1,
  "installation_id": "00000000-0000-4000-8000-000000000000",
  "livemode": true,
  "price": {
    "amount_cents": 50,
    "created_at": "2026-01-15T15:30:00Z",
    "currency": "usd",
    "id": "00000000-0000-4000-8000-000000000000",
    "interval": "day",
    "interval_count": 1,
    "name": "string",
    "provider_price_id": "string",
    "request_id": "00000000-0000-4000-8000-000000000000",
    "status": "creating"
  },
  "recovery_required": true,
  "remote_tenant_id": "00000000-0000-4000-8000-000000000000",
  "retry_allowed": true,
  "retry_safe_until": "2026-01-15T15:30:00Z"
}

Example call

curl "$EHR_URL/api/v1/billing/membership-prices/{id}" -H "Authorization: Bearer $ACCESS_TOKEN"

# Refresh a native membership operation

GET /api/v1/billing/memberships/{id}

Retrieves an existing enrollment or cancellation by immutable local request ID. GET never retries provider writes. Retry permission is bounded to the original actor, input and nonextended deadline.

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
id required path string (uuid)

Responses

200 Fresh minimized account-bound evidence; no encounter ledger mutation application/json

Body: PatientMembershipResponse or PatientMembershipCancellation

Example response placeholder values
{
  "account_id": "string",
  "checked_at": "2026-01-15T15:30:00Z",
  "contract_version": 1,
  "installation_id": "00000000-0000-4000-8000-000000000000",
  "livemode": true,
  "membership": {
    "cancel_at_period_end": true,
    "created_at": "2026-01-15T15:30:00Z",
    "current_period_end": 1,
    "customer_id": "string",
    "price": {
      "amount_cents": 50,
      "created_at": "2026-01-15T15:30:00Z",
      "currency": "usd",
      "id": "00000000-0000-4000-8000-000000000000",
      "interval": "day",
      "interval_count": 1,
      "name": "string",
      "provider_price_id": "string",
      "request_id": "00000000-0000-4000-8000-000000000000",
      "status": "creating"
    },
    "recovery_required": true,
    "request_id": "00000000-0000-4000-8000-000000000000",
    "retry_allowed": true,
    "retry_safe_until": "2026-01-15T15:30:00Z",
    "session": {},
    "status": "creating",
    "subscription_id": "string",
    "subscription_status": "string",
    "terms": "string"
  },
  "patient_id": "00000000-0000-4000-8000-000000000000",
  "remote_tenant_id": "00000000-0000-4000-8000-000000000000"
}

Example call

curl "$EHR_URL/api/v1/billing/memberships/{id}" -H "Authorization: Bearer $ACCESS_TOKEN"

# Native billing overview

GET /api/v1/billing/overview

Native account and receipt overview. Totals cover the whole selected mode, not just a page. Only the latest invoice per account is counted; any subsequent account/ledger changes require review, so its historical amount is excluded from current open totals. Receipts may exist before charge accounts. Voided records add no collected amount; usable credit excludes reversed or held allocations and verified refunds. No claims are returned: claim policy authorization remains separate.

Access OAuth 2.0 access tokenbilling.read

Parameters

Name In Type Details
mode query string
accounts_after query string (uuid)
copays_after query string (uuid)
limit query integer
patient_id query string (uuid) Scope all aggregate totals and pages to this tenant patient, including archived charts.

Responses

200 Audited native billing read; no payment, invoice, allocation or provider mutation application/json
Fields BillingOverview · 65
Field Type Details
accounts required object
items required array of BillingOverviewAccount items ≤ 100
account_balance_cents required integer or null
created_at required string
id required string (uuid)
invoice_created_at required string or null
invoice_credit_cents required integer or null
invoice_due_cents required integer or null
invoice_id required string (uuid) or null
invoice_needs_review required boolean
mrn required string
patient_id required string (uuid)
patient_name required string
payer_name required string or null
reviewed_responsibility_cents required integer or null
service_date required string
status required string
test_activity required boolean
total_cents required integer
version required integer
next_cursor required string (uuid) or null
collection_policy required string
copays required object
items required array of BillingOverviewCopay items ≤ 100
allocated_cents required integer
amount_cents required integer
appointment_id required string (uuid)
created_at required string
hosted_operation_id required string (uuid) or null
hosted_status required string or null
id required string (uuid)
livemode required boolean or null
method required string
mrn required string
needs_review required boolean
net_received_cents required integer
occurred_on required string
patient_id required string (uuid)
patient_name required string
refunded_cents required integer
refunded_unapplied_cents required integer
reversed_cents required integer
test_activity required boolean
usable_unapplied_cents required integer
voided required boolean
next_cursor required string (uuid) or null
currency required constant always USD
invoice_policy required string
mode required string one of recorded, test
patient required BillingPatient or null
summary required object
accounts required object
accounts required integer
invoice_review_count required integer
latest_invoices required integer
open_invoice_count required integer
posted_account_balance_cents required integer
posted_gross_cents required integer
reviewed_patient_due_cents required integer
copays required object
net_received_cents required integer
receipts required integer
review_count required integer
usable_unapplied_cents required integer
void_count required integer
Example response placeholder values
{
  "accounts": {
    "items": [
      {
        "account_balance_cents": 1,
        "created_at": "string",
        "id": "00000000-0000-4000-8000-000000000000",
        "invoice_created_at": "string",
        "invoice_credit_cents": 1,
        "invoice_due_cents": 1,
        "invoice_id": "00000000-0000-4000-8000-000000000000",
        "invoice_needs_review": true,
        "mrn": "string",
        "patient_id": "00000000-0000-4000-8000-000000000000",
        "patient_name": "string",
        "payer_name": "string",
        "reviewed_responsibility_cents": 1,
        "service_date": "string",
        "status": "string",
        "test_activity": true,
        "total_cents": 1,
        "version": 1
      }
    ],
    "next_cursor": "00000000-0000-4000-8000-000000000000"
  },
  "collection_policy": "string",
  "copays": {
    "items": [
      {
        "allocated_cents": 1,
        "amount_cents": 1,
        "appointment_id": "00000000-0000-4000-8000-000000000000",
        "created_at": "string",
        "hosted_operation_id": "00000000-0000-4000-8000-000000000000",
        "hosted_status": "string",
        "id": "00000000-0000-4000-8000-000000000000",
        "livemode": true,
        "method": "string",
        "mrn": "string",
        "needs_review": true,
        "net_received_cents": 1,
        "occurred_on": "string",
        "patient_id": "00000000-0000-4000-8000-000000000000",
        "patient_name": "string",
        "refunded_cents": 1,
        "refunded_unapplied_cents": 1,
        "reversed_cents": 1,
        "test_activity": true,
        "usable_unapplied_cents": 1,
        "voided": true
      }
    ],
    "next_cursor": "00000000-0000-4000-8000-000000000000"
  },
  "currency": "USD",
  "invoice_policy": "string",
  "mode": "recorded",
  "patient": {
    "archived": true,
    "family_name": "string",
    "given_name": "string",
    "id": "00000000-0000-4000-8000-000000000000",
    "mrn": "string"
  },
  "summary": {
    "accounts": {
      "accounts": 1,
      "invoice_review_count": 1,
      "latest_invoices": 1,
      "open_invoice_count": 1,
      "posted_account_balance_cents": 1,
      "posted_gross_cents": 1,
      "reviewed_patient_due_cents": 1
    },
    "copays": {
      "net_received_cents": 1,
      "receipts": 1,
      "review_count": 1,
      "usable_unapplied_cents": 1,
      "void_count": 1
    }
  }
}
401 Sign in required
403 Native billing view or billing.read denied
404 Tenant-scoped record not found
500 Read or audit failure

Example call

curl "$EHR_URL/api/v1/billing/overview" -H "Authorization: Bearer $ACCESS_TOKEN"

# Search billing patients

GET /api/v1/billing/patients

Minimal tenant-scoped patient directory for billing-authorized staff. Includes archived patients; no clinical record access or birth dates. Search is literal and paginated.

Access OAuth 2.0 access tokenbilling.read

Parameters

Name In Type Details
q query string
after query string (uuid)
limit query integer

Responses

200 Audited native billing read; no payment, invoice, allocation or provider mutation application/json
Fields BillingPatientPage · 7
Field Type Details
items required array of BillingPatient items ≤ 100
archived required boolean
family_name required string
given_name required string
id required string (uuid)
mrn required string
next_cursor required string (uuid) or null
Example response placeholder values
{
  "items": [
    {
      "archived": true,
      "family_name": "string",
      "given_name": "string",
      "id": "00000000-0000-4000-8000-000000000000",
      "mrn": "string"
    }
  ],
  "next_cursor": "00000000-0000-4000-8000-000000000000"
}
401 Sign in required
403 Native billing view or billing.read denied
404 Tenant-scoped record not found
500 Read or audit failure

Example call

curl "$EHR_URL/api/v1/billing/patients" -H "Authorization: Bearer $ACCESS_TOKEN"

# List patient invoice history

GET /api/v1/billing/patients/{id}/invoices

All immutable native invoices for the selected tenant patient, with current review and latest-copy markers. No amounts are recomputed or changed.

Access OAuth 2.0 access tokenbilling.read

Parameters

Name In Type Details
id required path string (uuid)
mode query string
after query string (uuid)
limit query integer

Responses

200 Audited native billing read; no payment, invoice, allocation or provider mutation application/json
Fields BillingPatientInvoicePage · 55
Field Type Details
items required array of object items ≤ 100
account_id required string (uuid)
account_version required integer
actor_id required string (uuid)
created_at required string (date-time)
id required string (uuid)
patient_id required string (uuid)
snapshot required PatientInvoiceSnapshot Immutable issuance snapshot. Format 2 adds itemized services, patient activity and payment/adjustment subtotals. These fields are absent in older saved snapshots; clients must show original totals with an explicit unavailable-itemization message, never rebuild old invoices from current records.
amount_due_cents required integer
credit_balance_cents required integer
currency required constant always USD
gross_charges_cents required integer
patient required object
family_name required string
given_name required string
mrn string
patient_credit_cents required integer
responsibility_cents required integer
scope required constant always at_issuance
service_date required string (date)
format_version constant always 2
patient_activity array of PatientInvoiceActivity
effect_cents integer
id string (uuid)
kind any one of payment, adjustment_credit, adjustment_debit, reversal
method string
occurred_on string (date)
reference string
reverses_id string or null
patient_adjustment_credit_cents integer
patient_payment_cents integer
practice_name string
reason string
services array of PatientInvoiceService
code required string
code_system required string
description required string
line_total_cents required integer
modifiers required string
units required integer
test_activity boolean
account_status string
is_latest boolean
mrn string
needs_review boolean
patient_name string
test_activity boolean
mode required string one of recorded, test
next_cursor required string (uuid) or null
patient required BillingPatient
archived required boolean
family_name required string
given_name required string
id required string (uuid)
mrn required string
Example response placeholder values
{
  "items": [
    {
      "account_id": "00000000-0000-4000-8000-000000000000",
      "account_version": 1,
      "actor_id": "00000000-0000-4000-8000-000000000000",
      "created_at": "2026-01-15T15:30:00Z",
      "id": "00000000-0000-4000-8000-000000000000",
      "patient_id": "00000000-0000-4000-8000-000000000000",
      "snapshot": {
        "amount_due_cents": 1,
        "credit_balance_cents": 1,
        "currency": "USD",
        "gross_charges_cents": 1,
        "patient": {
          "family_name": null,
          "given_name": null,
          "mrn": null
        },
        "patient_credit_cents": 1,
        "responsibility_cents": 1,
        "scope": "at_issuance",
        "service_date": "2026-01-15"
      },
      "account_status": "string"
    }
  ],
  "mode": "recorded",
  "next_cursor": "00000000-0000-4000-8000-000000000000",
  "patient": {
    "archived": true,
    "family_name": "string",
    "given_name": "string",
    "id": "00000000-0000-4000-8000-000000000000",
    "mrn": "string"
  }
}
401 Sign in required
403 Native billing view or billing.read denied
404 Tenant-scoped record not found
500 Read or audit failure

Example call

curl "$EHR_URL/api/v1/billing/patients/{id}/invoices" -H "Authorization: Bearer $ACCESS_TOKEN"

# Read native memberships and pending operations

GET /api/v1/billing/patients/{id}/memberships

Billing view; exact patient/tenant/installation/account/mode and current credentials. Pages are bounded to twenty entries. Pending request inputs only belong to the authorized initiator.

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
id required path string (uuid)
after query string (uuid)

Responses

200 Fresh minimized account-bound evidence; no encounter ledger mutation application/json
Fields object · 43
Field Type Details
account_id required string
checked_at required string (date-time)
contract_version required constant always 1
creation_available required boolean
has_more required boolean
installation_id required string (uuid)
items required array of PatientMembership items ≤ 20
cancel_at_period_end required boolean or null
created_at required string (date-time)
current_period_end required integer or null
customer_id required string or null
price required PatientMembershipPrice
amount_cents required integer value 50–100000000
created_at required string (date-time)
currency required constant always usd
id required string (uuid)
interval required any one of day, week, month, year
interval_count required integer value 1–365
name required string length ≤ 100
provider_price_id required string or null
request_id required string (uuid)
status required any one of creating, active, inactive, approved, needs_review, unavailable
recovery_required required boolean
request_id required string (uuid)
retry_allowed required boolean
retry_safe_until required string (date-time)
session required object or null
status required any one of creating, open, active, pending, canceled, expired, needs_review
subscription_id required string or null
subscription_status required string or null
terms required string
cancellation_available boolean List-only capability: verified local membership mapping and current scheduling/billing-edit permission.
livemode required boolean
next_cursor required string (uuid) or null
patient_id required string (uuid)
pending_operations required array of PatientMembershipPending items ≤ 20
kind required any one of price, membership, cancel
request required object or null
request_id required string (uuid)
retry_allowed required boolean
retry_safe_until required string (date-time)
status required string
remote_tenant_id required string (uuid)
Example response placeholder values
{
  "account_id": "string",
  "checked_at": "2026-01-15T15:30:00Z",
  "contract_version": 1,
  "creation_available": true,
  "has_more": true,
  "installation_id": "00000000-0000-4000-8000-000000000000",
  "items": [
    {
      "cancel_at_period_end": true,
      "created_at": "2026-01-15T15:30:00Z",
      "current_period_end": 1,
      "customer_id": "string",
      "price": {
        "amount_cents": 50,
        "created_at": "2026-01-15T15:30:00Z",
        "currency": "usd",
        "id": "00000000-0000-4000-8000-000000000000",
        "interval": "day",
        "interval_count": 1,
        "name": "string",
        "provider_price_id": "string",
        "request_id": "00000000-0000-4000-8000-000000000000",
        "status": "creating"
      },
      "recovery_required": true,
      "request_id": "00000000-0000-4000-8000-000000000000",
      "retry_allowed": true,
      "retry_safe_until": "2026-01-15T15:30:00Z",
      "session": {},
      "status": "creating",
      "subscription_id": "string",
      "subscription_status": "string",
      "terms": "string"
    }
  ],
  "livemode": true,
  "next_cursor": "00000000-0000-4000-8000-000000000000",
  "patient_id": "00000000-0000-4000-8000-000000000000",
  "pending_operations": [
    {
      "kind": "price",
      "request": {},
      "request_id": "00000000-0000-4000-8000-000000000000",
      "retry_allowed": true,
      "retry_safe_until": "2026-01-15T15:30:00Z",
      "status": "string"
    }
  ],
  "remote_tenant_id": "00000000-0000-4000-8000-000000000000"
}

Example call

curl "$EHR_URL/api/v1/billing/patients/{id}/memberships" -H "Authorization: Bearer $ACCESS_TOKEN"

# Start hosted membership enrollment

POST /api/v1/billing/patients/{id}/memberships

Scheduling role and billing create, active patient, explicit consent. Hosted Checkout separately records patient recurring authorization against immutable approved price and terms. Does not change encounter invoices or ledger.

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
id required path string (uuid)

Request body application/json · required

Fields object · 3
Field Type Details
consent required constant always true
price_id required string (uuid)
request_id required string (uuid)
Example request body placeholder values
{
  "consent": true,
  "price_id": "00000000-0000-4000-8000-000000000000",
  "request_id": "00000000-0000-4000-8000-000000000000"
}

Responses

200 Fresh minimized account-bound evidence; no encounter ledger mutation application/json
Fields PatientMembershipResponse · 33
Field Type Details
account_id required string
checked_at required string (date-time)
contract_version required constant always 1
installation_id required string (uuid)
livemode required boolean
membership required PatientMembership
cancel_at_period_end required boolean or null
created_at required string (date-time)
current_period_end required integer or null
customer_id required string or null
price required PatientMembershipPrice
amount_cents required integer value 50–100000000
created_at required string (date-time)
currency required constant always usd
id required string (uuid)
interval required any one of day, week, month, year
interval_count required integer value 1–365
name required string length ≤ 100
provider_price_id required string or null
request_id required string (uuid)
status required any one of creating, active, inactive, approved, needs_review, unavailable
recovery_required required boolean
request_id required string (uuid)
retry_allowed required boolean
retry_safe_until required string (date-time)
session required object or null
status required any one of creating, open, active, pending, canceled, expired, needs_review
subscription_id required string or null
subscription_status required string or null
terms required string
cancellation_available boolean List-only capability: verified local membership mapping and current scheduling/billing-edit permission.
patient_id required string (uuid)
remote_tenant_id required string (uuid)
Example response placeholder values
{
  "account_id": "string",
  "checked_at": "2026-01-15T15:30:00Z",
  "contract_version": 1,
  "installation_id": "00000000-0000-4000-8000-000000000000",
  "livemode": true,
  "membership": {
    "cancel_at_period_end": true,
    "created_at": "2026-01-15T15:30:00Z",
    "current_period_end": 1,
    "customer_id": "string",
    "price": {
      "amount_cents": 50,
      "created_at": "2026-01-15T15:30:00Z",
      "currency": "usd",
      "id": "00000000-0000-4000-8000-000000000000",
      "interval": "day",
      "interval_count": 1,
      "name": "string",
      "provider_price_id": "string",
      "request_id": "00000000-0000-4000-8000-000000000000",
      "status": "creating"
    },
    "recovery_required": true,
    "request_id": "00000000-0000-4000-8000-000000000000",
    "retry_allowed": true,
    "retry_safe_until": "2026-01-15T15:30:00Z",
    "session": {},
    "status": "creating",
    "subscription_id": "string",
    "subscription_status": "string",
    "terms": "string"
  },
  "patient_id": "00000000-0000-4000-8000-000000000000",
  "remote_tenant_id": "00000000-0000-4000-8000-000000000000"
}

Example call

curl -X POST "$EHR_URL/api/v1/billing/patients/{id}/memberships" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Schedule native membership cancellation

POST /api/v1/billing/patients/{id}/memberships/{subscription}/cancel-at-period-end

Scheduling role and billing edit; verified native subscription mapping required. Stable request ID; cancels only at period end with no proration or refund. No new collection flag is enabled.

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
id required path string (uuid)
subscription required path string

Request body application/json · required

Fields object · 2
Field Type Details
expected_cancel_at_period_end required constant always false
request_id required string (uuid)
Example request body placeholder values
{
  "expected_cancel_at_period_end": false,
  "request_id": "00000000-0000-4000-8000-000000000000"
}

Responses

200 Fresh minimized account-bound evidence; no encounter ledger mutation application/json
Fields PatientMembershipCancellation · 14
Field Type Details
account_id required string
checked_at required string (date-time)
contract_version required constant always 1
installation_id required string (uuid)
livemode required boolean
membership_request_id required string (uuid)
patient_id required string (uuid)
recovery_required required boolean
remote_tenant_id required string (uuid)
request_id required string (uuid)
retry_allowed required boolean
retry_safe_until required string (date-time)
status required any one of scheduled, canceled, pending, needs_review
subscription required object Sanitized subscription from this verified native membership.
Example response placeholder values
{
  "account_id": "string",
  "checked_at": "2026-01-15T15:30:00Z",
  "contract_version": 1,
  "installation_id": "00000000-0000-4000-8000-000000000000",
  "livemode": true,
  "membership_request_id": "00000000-0000-4000-8000-000000000000",
  "patient_id": "00000000-0000-4000-8000-000000000000",
  "recovery_required": true,
  "remote_tenant_id": "00000000-0000-4000-8000-000000000000",
  "request_id": "00000000-0000-4000-8000-000000000000",
  "retry_allowed": true,
  "retry_safe_until": "2026-01-15T15:30:00Z",
  "status": "scheduled",
  "subscription": {}
}

Example call

curl -X POST "$EHR_URL/api/v1/billing/patients/{id}/memberships/{subscription}/cancel-at-period-end" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Read patient payment sources once across encounters

GET /api/v1/billing/patients/{id}/payment-history

Billing view permission. Allocations and managed-payment ledger links are excluded from standalone entries so each collection appears once. Copay receipts, legacy test account-checkout attempts and directly recorded patient payments retain their evidence and status. Null received amounts mean unverified, not zero. Reversed, void and needs-review states remain visible. Read-only history does not move money or recompute liability.

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
id required path string (uuid)
mode query string
after query string Opaque kind:uuid cursor from the previous response
limit query integer

Responses

200 Patient-scoped payment history application/json
Fields object · 19
Field Type Details
currency required constant always USD
items required array of object
account_id string or null
appointment_id string or null
created_at string (date-time)
id string (uuid)
kind any one of copay, account_payment, recorded_payment, invoice_checkout
ledger_recorded boolean
receipt_id string or null
received_cents integer or null
reference string or null
refunded_cents integer
status string
test_activity boolean
unapplied_cents integer
visit_id string or null
mode required string
next_cursor required string or null
patient_id required string (uuid)
Example response placeholder values
{
  "currency": "USD",
  "items": [
    {
      "account_id": "00000000-0000-4000-8000-000000000000",
      "appointment_id": "00000000-0000-4000-8000-000000000000",
      "created_at": "2026-01-15T15:30:00Z",
      "id": "00000000-0000-4000-8000-000000000000",
      "kind": "copay",
      "ledger_recorded": true,
      "receipt_id": "00000000-0000-4000-8000-000000000000",
      "received_cents": 1
    }
  ],
  "mode": "string",
  "next_cursor": "string",
  "patient_id": "00000000-0000-4000-8000-000000000000"
}

Example call

curl "$EHR_URL/api/v1/billing/patients/{id}/payment-history" -H "Authorization: Bearer $ACCESS_TOKEN"

# Read this patient’s verified Stripe profile

GET /api/v1/billing/patients/{id}/payment-profile

Billing view permission required. Server binds tenant, patient, installation, Stripe account/mode and credential revision. GET never creates a customer. Returns masked card summaries, separately recorded Stripe invoices/subscriptions and an unresolved local setup reference. Independent pages contain at most twenty entries. Unavailable sections have null data. No provider credentials or clinical details. No-store.

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
id required path string (uuid)
methods_after query string
invoices_after query string
subscriptions_after query string

Responses

200 Verified profile application/json
Fields object · 13
Field Type Details
account_id required string
active_setup required object or null
checked_at required string (date-time)
contract_version required constant always 1
customer required object
installation_id required string (uuid)
invoices required object status not_created, unavailable or available; available data has items, has_more and next_cursor
livemode required boolean
patient_id required string (uuid)
payment_methods required object status not_created, unavailable or available; available data has items, has_more and next_cursor
remote_tenant_id required string (uuid)
setup_available required boolean
subscriptions required object status not_created, unavailable or available; available data has items, has_more and next_cursor
Example response placeholder values
{
  "account_id": "string",
  "active_setup": {},
  "checked_at": "2026-01-15T15:30:00Z",
  "contract_version": 1,
  "customer": {},
  "installation_id": "00000000-0000-4000-8000-000000000000",
  "invoices": {},
  "livemode": true,
  "patient_id": "00000000-0000-4000-8000-000000000000",
  "payment_methods": {},
  "remote_tenant_id": "00000000-0000-4000-8000-000000000000",
  "setup_available": true,
  "subscriptions": {}
}

Example call

curl "$EHR_URL/api/v1/billing/patients/{id}/payment-profile" -H "Authorization: Bearer $ACCESS_TOKEN"

# Reserve explicitly consented hosted card setup

POST /api/v1/billing/patients/{id}/payment-setups

Billing create plus scheduling role required. Reserves exact patient/account/mode/installation/credentials and consent actor before broker I/O. The Stripe page shows the practice wording for later charges; the setup is stored with `consent_scope` `later_charges`, its `consent_version` and, once the processor confirms the card, `consent_recorded_at`. Cards saved earlier keep `patient_present` and cannot be charged later. Saving a card does not authorize recurring charges. Retry only the same request UUID within the bounded 23-hour window; unknown outcomes remain reserved. No card fields or financial ledger mutation. Return URL is generated server-side.

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
id required path string (uuid)

Request body application/json · required

Fields object · 2
Field Type Details
consent required constant always true
request_id required string (uuid)
Example request body placeholder values
{
  "consent": true,
  "request_id": "00000000-0000-4000-8000-000000000000"
}

Responses

200 Fresh minimized provider evidence; never a payment or ledger entry application/json
Fields PatientPaymentSetup · 16
Field Type Details
account_id required string
checked_at required string (date-time)
contract_version required constant always 1
customer_id required string or null
installation_id required string (uuid)
livemode required boolean
patient_id required string (uuid)
recovery_required required boolean
remote_tenant_id required string (uuid)
request_id required string (uuid)
retry_allowed required boolean
retry_safe_until required string (date-time)
session required object or null Verified hosted Checkout ID/URL, SetupIntent ID/status and payment method ID only. No card credentials.
status required string one of creating, open, pending, succeeded, expired, needs_review
error string
provider_status string Local recovery response only: no broker setup reservation found. This is not verified payment-method evidence. one of not_found
Example response placeholder values
{
  "account_id": "string",
  "checked_at": "2026-01-15T15:30:00Z",
  "contract_version": 1,
  "customer_id": "string",
  "installation_id": "00000000-0000-4000-8000-000000000000",
  "livemode": true,
  "patient_id": "00000000-0000-4000-8000-000000000000",
  "recovery_required": true,
  "remote_tenant_id": "00000000-0000-4000-8000-000000000000",
  "request_id": "00000000-0000-4000-8000-000000000000",
  "retry_allowed": true,
  "retry_safe_until": "2026-01-15T15:30:00Z",
  "session": {},
  "status": "creating"
}

Example call

curl -X POST "$EHR_URL/api/v1/billing/patients/{id}/payment-setups" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# List finite invoice-bound plans and reviewed invoice eligibility

GET /api/v1/billing/patients/{patient}/installment-plans

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
patient required path string (uuid)

Responses

200 Authenticated tenant-scoped result application/json
Fields PatientInstallmentPlanList · 67
Field Type Details
availability required object
available required boolean
livemode required boolean or null
reason required string or null
eligible_invoices required array of PatientInstallmentPreview
account_id required string (uuid)
account_version required integer
autopay required constant always false
blocked_reason required string or null
currency required constant always usd
eligible required boolean
installments required array of object
amount_cents required integer value ≥ 0
due_on required string (date)
number required integer
invoice_created_at required string (date-time)
invoice_id required string (uuid)
livemode required boolean
patient_credit_cents required integer
remaining_cents required integer value ≥ 0
responsibility_cents required integer value ≥ 0
items required array of PatientInstallmentPlan
account_id required string (uuid)
attempts required array of InvoiceCheckoutOperation
account_id required string (uuid)
amount_cents required integer value ≥ 0
captured_at required string (date-time) or null
channel required string `hosted` for a Stripe-hosted Checkout link, `reader` for a card payment taken on a reader. For a reader payment `last_result` says where it stands: `reader_waiting`, `reader_offline` or `reader_finishing` while open; `reader_declined`, `reader_cancelled`, `reader_timed_out`, `reader_offline`, `reader_in_use`, `reader_unavailable` or `reader_failed` once closed (`expired`). one of hosted, reader
checkout_url required string (uri) or null
created_at required string (date-time)
currency required constant always usd
id required string (uuid)
installment_number required integer
last_result required string or null
livemode required boolean
paid_entry_id required string (uuid) or null
patient_id required string (uuid)
plan_id required string (uuid)
reader_id required string or null The card reader for a reader payment.
reason required string
refunded_cents required integer value ≥ 0
request_id required string (uuid)
status required string one of creating, open, paid, expired, needs_review, refunded
unapplied_cents required integer value ≥ 0
version required integer
autopay required constant always false
blocked_reason required string or null
created_at required string (date-time)
id required string (uuid)
installments required array of PatientInstallmentCollectionItem
amount_cents required integer value ≥ 0
collected_cents required integer value ≥ 0
collectible_cents required integer value ≥ 0
due_on required string (date)
number required integer
status required string one of complete, pending
invoice_id required string (uuid)
livemode required boolean
patient_credit_cents required integer value ≥ 0
patient_id required string (uuid)
reason required string
remaining_cents required integer value ≥ 0
request_id required string (uuid)
responsibility_cents required integer value ≥ 0
status required string one of active, complete, needs_review
total_cents required integer value ≥ 0
version required integer
Example response placeholder values
{
  "availability": {
    "available": true,
    "livemode": true,
    "reason": "string"
  },
  "eligible_invoices": [
    {
      "account_id": "00000000-0000-4000-8000-000000000000",
      "account_version": 1,
      "autopay": false,
      "blocked_reason": "string",
      "currency": "usd",
      "eligible": true,
      "installments": [
        {
          "amount_cents": null,
          "due_on": null,
          "number": null
        }
      ],
      "invoice_created_at": "2026-01-15T15:30:00Z",
      "invoice_id": "00000000-0000-4000-8000-000000000000",
      "livemode": true,
      "patient_credit_cents": 1,
      "remaining_cents": 0,
      "responsibility_cents": 0
    }
  ],
  "items": [
    {
      "account_id": "00000000-0000-4000-8000-000000000000",
      "attempts": [
        {
          "account_id": null,
          "amount_cents": null,
          "captured_at": null,
          "channel": "hosted",
          "checkout_url": null,
          "created_at": null,
          "currency": "usd",
          "id": null,
          "installment_number": null,
          "last_result": null,
          "livemode": null,
          "paid_entry_id": null,
          "patient_id": null,
          "plan_id": null,
          "reader_id": null,
          "reason": null,
          "refunded_cents": null,
          "request_id": null,
          "status": "creating",
          "unapplied_cents": null,
          "version": null
        }
      ],
      "autopay": false,
      "blocked_reason": "string",
      "created_at": "2026-01-15T15:30:00Z",
      "id": "00000000-0000-4000-8000-000000000000",
      "installments": [
        {
          "amount_cents": null,
          "collected_cents": null,
          "collectible_cents": null,
          "due_on": null,
          "number": null,
          "status": "complete"
        }
      ],
      "invoice_id": "00000000-0000-4000-8000-000000000000",
      "livemode": true,
      "patient_credit_cents": 0,
      "patient_id": "00000000-0000-4000-8000-000000000000",
      "reason": "string",
      "remaining_cents": 0,
      "request_id": "00000000-0000-4000-8000-000000000000",
      "responsibility_cents": 0,
      "status": "active",
      "total_cents": 0,
      "version": 1
    }
  ]
}
403 Billing permission required
409 Responsibility, version, reservation or idempotency conflict

Example call

curl "$EHR_URL/api/v1/billing/patients/{patient}/installment-plans" -H "Authorization: Bearer $ACCESS_TOKEN"

# Create an immutable finite patient-present installment agreement

POST /api/v1/billing/patients/{patient}/installment-plans

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
If-Match required header string Quoted current account version for plan creation, or plan version for checkout.
patient required path string (uuid)

Request body application/json · required

Fields PatientInstallmentCreateRequest · 8
Field Type Details
consent required boolean one of true
installments required array of PatientInstallmentScheduleItem items 1–60
amount_cents required integer value 50–100000000
due_on required string (date)
invoice_id required string (uuid)
livemode required boolean
reason required string length 1–1000
request_id required string (uuid)
Example request body placeholder values
{
  "consent": true,
  "installments": [
    {
      "amount_cents": 50,
      "due_on": "2026-01-15"
    }
  ],
  "invoice_id": "00000000-0000-4000-8000-000000000000",
  "livemode": true,
  "reason": "string",
  "request_id": "00000000-0000-4000-8000-000000000000"
}

Responses

200 Authenticated tenant-scoped result application/json
Fields PatientInstallmentPlan · 45
Field Type Details
account_id required string (uuid)
attempts required array of InvoiceCheckoutOperation
account_id required string (uuid)
amount_cents required integer value ≥ 0
captured_at required string (date-time) or null
channel required string `hosted` for a Stripe-hosted Checkout link, `reader` for a card payment taken on a reader. For a reader payment `last_result` says where it stands: `reader_waiting`, `reader_offline` or `reader_finishing` while open; `reader_declined`, `reader_cancelled`, `reader_timed_out`, `reader_offline`, `reader_in_use`, `reader_unavailable` or `reader_failed` once closed (`expired`). one of hosted, reader
checkout_url required string (uri) or null
created_at required string (date-time)
currency required constant always usd
id required string (uuid)
installment_number required integer
last_result required string or null
livemode required boolean
paid_entry_id required string (uuid) or null
patient_id required string (uuid)
plan_id required string (uuid)
reader_id required string or null The card reader for a reader payment.
reason required string
refunded_cents required integer value ≥ 0
request_id required string (uuid)
status required string one of creating, open, paid, expired, needs_review, refunded
unapplied_cents required integer value ≥ 0
version required integer
autopay required constant always false
blocked_reason required string or null
created_at required string (date-time)
id required string (uuid)
installments required array of PatientInstallmentCollectionItem
amount_cents required integer value ≥ 0
collected_cents required integer value ≥ 0
collectible_cents required integer value ≥ 0
due_on required string (date)
number required integer
status required string one of complete, pending
invoice_id required string (uuid)
livemode required boolean
patient_credit_cents required integer value ≥ 0
patient_id required string (uuid)
reason required string
remaining_cents required integer value ≥ 0
request_id required string (uuid)
responsibility_cents required integer value ≥ 0
status required string one of active, complete, needs_review
total_cents required integer value ≥ 0
version required integer
Example response placeholder values
{
  "account_id": "00000000-0000-4000-8000-000000000000",
  "attempts": [
    {
      "account_id": "00000000-0000-4000-8000-000000000000",
      "amount_cents": 0,
      "captured_at": "2026-01-15T15:30:00Z",
      "channel": "hosted",
      "checkout_url": "https://app.example.test/callback",
      "created_at": "2026-01-15T15:30:00Z",
      "currency": "usd",
      "id": "00000000-0000-4000-8000-000000000000",
      "installment_number": 1,
      "last_result": "string",
      "livemode": true,
      "paid_entry_id": "00000000-0000-4000-8000-000000000000",
      "patient_id": "00000000-0000-4000-8000-000000000000",
      "plan_id": "00000000-0000-4000-8000-000000000000",
      "reader_id": "string",
      "reason": "string",
      "refunded_cents": 0,
      "request_id": "00000000-0000-4000-8000-000000000000",
      "status": "creating",
      "unapplied_cents": 0,
      "version": 1
    }
  ],
  "autopay": false,
  "blocked_reason": "string",
  "created_at": "2026-01-15T15:30:00Z",
  "id": "00000000-0000-4000-8000-000000000000",
  "installments": [
    {
      "amount_cents": 0,
      "collected_cents": 0,
      "collectible_cents": 0,
      "due_on": "2026-01-15",
      "number": 1,
      "status": "complete"
    }
  ],
  "invoice_id": "00000000-0000-4000-8000-000000000000",
  "livemode": true,
  "patient_credit_cents": 0,
  "patient_id": "00000000-0000-4000-8000-000000000000",
  "reason": "string",
  "remaining_cents": 0,
  "request_id": "00000000-0000-4000-8000-000000000000",
  "responsibility_cents": 0,
  "status": "active",
  "total_cents": 0,
  "version": 1
}
403 Billing permission required
409 Responsibility, version, reservation or idempotency conflict

Example call

curl -X POST "$EHR_URL/api/v1/billing/patients/{patient}/installment-plans" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Validate exact finite schedule against current reviewed patient responsibility

POST /api/v1/billing/patients/{patient}/installment-plans/preview

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
patient required path string (uuid)

Request body application/json · required

Fields PatientInstallmentPreviewRequest · 5
Field Type Details
installments required array of PatientInstallmentScheduleItem items 1–60
amount_cents required integer value 50–100000000
due_on required string (date)
invoice_id required string (uuid)
livemode required boolean
Example request body placeholder values
{
  "installments": [
    {
      "amount_cents": 50,
      "due_on": "2026-01-15"
    }
  ],
  "invoice_id": "00000000-0000-4000-8000-000000000000",
  "livemode": true
}

Responses

200 Authenticated tenant-scoped result application/json
Fields PatientInstallmentPreview · 16
Field Type Details
account_id required string (uuid)
account_version required integer
autopay required constant always false
blocked_reason required string or null
currency required constant always usd
eligible required boolean
installments required array of object
amount_cents required integer value ≥ 0
due_on required string (date)
number required integer
invoice_created_at required string (date-time)
invoice_id required string (uuid)
livemode required boolean
patient_credit_cents required integer
remaining_cents required integer value ≥ 0
responsibility_cents required integer value ≥ 0
Example response placeholder values
{
  "account_id": "00000000-0000-4000-8000-000000000000",
  "account_version": 1,
  "autopay": false,
  "blocked_reason": "string",
  "currency": "usd",
  "eligible": true,
  "installments": [
    {
      "amount_cents": 0,
      "due_on": "2026-01-15",
      "number": 1
    }
  ],
  "invoice_created_at": "2026-01-15T15:30:00Z",
  "invoice_id": "00000000-0000-4000-8000-000000000000",
  "livemode": true,
  "patient_credit_cents": 1,
  "remaining_cents": 0,
  "responsibility_cents": 0
}
403 Billing permission required
409 Responsibility, version, reservation or idempotency conflict

Example call

curl -X POST "$EHR_URL/api/v1/billing/patients/{patient}/installment-plans/preview" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Read invoice-bound plan, current eligibility and collection evidence

GET /api/v1/billing/patients/{patient}/installment-plans/{plan}

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
patient required path string (uuid)
plan required path string (uuid)

Responses

200 Authenticated tenant-scoped result application/json
Fields PatientInstallmentPlan · 45
Field Type Details
account_id required string (uuid)
attempts required array of InvoiceCheckoutOperation
account_id required string (uuid)
amount_cents required integer value ≥ 0
captured_at required string (date-time) or null
channel required string `hosted` for a Stripe-hosted Checkout link, `reader` for a card payment taken on a reader. For a reader payment `last_result` says where it stands: `reader_waiting`, `reader_offline` or `reader_finishing` while open; `reader_declined`, `reader_cancelled`, `reader_timed_out`, `reader_offline`, `reader_in_use`, `reader_unavailable` or `reader_failed` once closed (`expired`). one of hosted, reader
checkout_url required string (uri) or null
created_at required string (date-time)
currency required constant always usd
id required string (uuid)
installment_number required integer
last_result required string or null
livemode required boolean
paid_entry_id required string (uuid) or null
patient_id required string (uuid)
plan_id required string (uuid)
reader_id required string or null The card reader for a reader payment.
reason required string
refunded_cents required integer value ≥ 0
request_id required string (uuid)
status required string one of creating, open, paid, expired, needs_review, refunded
unapplied_cents required integer value ≥ 0
version required integer
autopay required constant always false
blocked_reason required string or null
created_at required string (date-time)
id required string (uuid)
installments required array of PatientInstallmentCollectionItem
amount_cents required integer value ≥ 0
collected_cents required integer value ≥ 0
collectible_cents required integer value ≥ 0
due_on required string (date)
number required integer
status required string one of complete, pending
invoice_id required string (uuid)
livemode required boolean
patient_credit_cents required integer value ≥ 0
patient_id required string (uuid)
reason required string
remaining_cents required integer value ≥ 0
request_id required string (uuid)
responsibility_cents required integer value ≥ 0
status required string one of active, complete, needs_review
total_cents required integer value ≥ 0
version required integer
Example response placeholder values
{
  "account_id": "00000000-0000-4000-8000-000000000000",
  "attempts": [
    {
      "account_id": "00000000-0000-4000-8000-000000000000",
      "amount_cents": 0,
      "captured_at": "2026-01-15T15:30:00Z",
      "channel": "hosted",
      "checkout_url": "https://app.example.test/callback",
      "created_at": "2026-01-15T15:30:00Z",
      "currency": "usd",
      "id": "00000000-0000-4000-8000-000000000000",
      "installment_number": 1,
      "last_result": "string",
      "livemode": true,
      "paid_entry_id": "00000000-0000-4000-8000-000000000000",
      "patient_id": "00000000-0000-4000-8000-000000000000",
      "plan_id": "00000000-0000-4000-8000-000000000000",
      "reader_id": "string",
      "reason": "string",
      "refunded_cents": 0,
      "request_id": "00000000-0000-4000-8000-000000000000",
      "status": "creating",
      "unapplied_cents": 0,
      "version": 1
    }
  ],
  "autopay": false,
  "blocked_reason": "string",
  "created_at": "2026-01-15T15:30:00Z",
  "id": "00000000-0000-4000-8000-000000000000",
  "installments": [
    {
      "amount_cents": 0,
      "collected_cents": 0,
      "collectible_cents": 0,
      "due_on": "2026-01-15",
      "number": 1,
      "status": "complete"
    }
  ],
  "invoice_id": "00000000-0000-4000-8000-000000000000",
  "livemode": true,
  "patient_credit_cents": 0,
  "patient_id": "00000000-0000-4000-8000-000000000000",
  "reason": "string",
  "remaining_cents": 0,
  "request_id": "00000000-0000-4000-8000-000000000000",
  "responsibility_cents": 0,
  "status": "active",
  "total_cents": 0,
  "version": 1
}
403 Billing permission required
409 Responsibility, version, reservation or idempotency conflict

Example call

curl "$EHR_URL/api/v1/billing/patients/{patient}/installment-plans/{plan}" -H "Authorization: Bearer $ACCESS_TOKEN"

# Explicit patient-present checkout for the exact displayed collectible amount

POST /api/v1/billing/patients/{patient}/installment-plans/{plan}/installments/{number}/checkout

With `reader_id` the amount is taken on that card reader instead of a hosted Checkout link; the same reservation, binding, guards and paid rule apply.

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
If-Match required header string Quoted current account version for plan creation, or plan version for checkout.
patient required path string (uuid)
plan required path string (uuid)
number required path integer

Request body application/json · required

Fields PatientInstallmentCheckoutRequest · 5
Field Type Details
amount_cents required integer value 50–100000000
patient_present required boolean one of true
reason required string length 1–1000
request_id required string (uuid)
reader_id string A card reader from GET /api/v1/billing/payments/readers. When present the payment is taken on that reader instead of a Stripe-hosted Checkout link. pattern ^tmr_[A-Za-z0-9]+$
Example request body placeholder values
{
  "amount_cents": 50,
  "patient_present": true,
  "reason": "string",
  "request_id": "00000000-0000-4000-8000-000000000000",
  "reader_id": "string"
}

Responses

200 Authenticated tenant-scoped result application/json
Fields PatientInstallmentCheckoutResult · 68
Field Type Details
operation required InvoiceCheckoutOperation
account_id required string (uuid)
amount_cents required integer value ≥ 0
captured_at required string (date-time) or null
channel required string `hosted` for a Stripe-hosted Checkout link, `reader` for a card payment taken on a reader. For a reader payment `last_result` says where it stands: `reader_waiting`, `reader_offline` or `reader_finishing` while open; `reader_declined`, `reader_cancelled`, `reader_timed_out`, `reader_offline`, `reader_in_use`, `reader_unavailable` or `reader_failed` once closed (`expired`). one of hosted, reader
checkout_url required string (uri) or null
created_at required string (date-time)
currency required constant always usd
id required string (uuid)
installment_number required integer
last_result required string or null
livemode required boolean
paid_entry_id required string (uuid) or null
patient_id required string (uuid)
plan_id required string (uuid)
reader_id required string or null The card reader for a reader payment.
reason required string
refunded_cents required integer value ≥ 0
request_id required string (uuid)
status required string one of creating, open, paid, expired, needs_review, refunded
unapplied_cents required integer value ≥ 0
version required integer
plan required PatientInstallmentPlan
account_id required string (uuid)
attempts required array of InvoiceCheckoutOperation
account_id required string (uuid)
amount_cents required integer value ≥ 0
captured_at required string (date-time) or null
channel required string `hosted` for a Stripe-hosted Checkout link, `reader` for a card payment taken on a reader. For a reader payment `last_result` says where it stands: `reader_waiting`, `reader_offline` or `reader_finishing` while open; `reader_declined`, `reader_cancelled`, `reader_timed_out`, `reader_offline`, `reader_in_use`, `reader_unavailable` or `reader_failed` once closed (`expired`). one of hosted, reader
checkout_url required string (uri) or null
created_at required string (date-time)
currency required constant always usd
id required string (uuid)
installment_number required integer
last_result required string or null
livemode required boolean
paid_entry_id required string (uuid) or null
patient_id required string (uuid)
plan_id required string (uuid)
reader_id required string or null The card reader for a reader payment.
reason required string
refunded_cents required integer value ≥ 0
request_id required string (uuid)
status required string one of creating, open, paid, expired, needs_review, refunded
unapplied_cents required integer value ≥ 0
version required integer
autopay required constant always false
blocked_reason required string or null
created_at required string (date-time)
id required string (uuid)
installments required array of PatientInstallmentCollectionItem
amount_cents required integer value ≥ 0
collected_cents required integer value ≥ 0
collectible_cents required integer value ≥ 0
due_on required string (date)
number required integer
status required string one of complete, pending
invoice_id required string (uuid)
livemode required boolean
patient_credit_cents required integer value ≥ 0
patient_id required string (uuid)
reason required string
remaining_cents required integer value ≥ 0
request_id required string (uuid)
responsibility_cents required integer value ≥ 0
status required string one of active, complete, needs_review
total_cents required integer value ≥ 0
version required integer
Example response placeholder values
{
  "operation": {
    "account_id": "00000000-0000-4000-8000-000000000000",
    "amount_cents": 0,
    "captured_at": "2026-01-15T15:30:00Z",
    "channel": "hosted",
    "checkout_url": "https://app.example.test/callback",
    "created_at": "2026-01-15T15:30:00Z",
    "currency": "usd",
    "id": "00000000-0000-4000-8000-000000000000",
    "installment_number": 1,
    "last_result": "string",
    "livemode": true,
    "paid_entry_id": "00000000-0000-4000-8000-000000000000",
    "patient_id": "00000000-0000-4000-8000-000000000000",
    "plan_id": "00000000-0000-4000-8000-000000000000",
    "reader_id": "string",
    "reason": "string",
    "refunded_cents": 0,
    "request_id": "00000000-0000-4000-8000-000000000000",
    "status": "creating",
    "unapplied_cents": 0,
    "version": 1
  },
  "plan": {
    "account_id": "00000000-0000-4000-8000-000000000000",
    "attempts": [
      {
        "account_id": "00000000-0000-4000-8000-000000000000",
        "amount_cents": 0,
        "captured_at": "2026-01-15T15:30:00Z",
        "channel": "hosted",
        "checkout_url": "https://app.example.test/callback",
        "created_at": "2026-01-15T15:30:00Z",
        "currency": "usd",
        "id": "00000000-0000-4000-8000-000000000000",
        "installment_number": 1,
        "last_result": "string",
        "livemode": true,
        "paid_entry_id": "00000000-0000-4000-8000-000000000000",
        "patient_id": "00000000-0000-4000-8000-000000000000",
        "plan_id": "00000000-0000-4000-8000-000000000000",
        "reader_id": "string",
        "reason": "string",
        "refunded_cents": 0,
        "request_id": "00000000-0000-4000-8000-000000000000",
        "status": "creating",
        "unapplied_cents": 0,
        "version": 1
      }
    ],
    "autopay": false,
    "blocked_reason": "string",
    "created_at": "2026-01-15T15:30:00Z",
    "id": "00000000-0000-4000-8000-000000000000",
    "installments": [
      {
        "amount_cents": 0,
        "collected_cents": 0,
        "collectible_cents": 0,
        "due_on": "2026-01-15",
        "number": 1,
        "status": "complete"
      }
    ],
    "invoice_id": "00000000-0000-4000-8000-000000000000",
    "livemode": true,
    "patient_credit_cents": 0,
    "patient_id": "00000000-0000-4000-8000-000000000000",
    "reason": "string",
    "remaining_cents": 0,
    "request_id": "00000000-0000-4000-8000-000000000000",
    "responsibility_cents": 0,
    "status": "active",
    "total_cents": 0,
    "version": 1
  }
}
403 Billing permission required
409 Responsibility, version, reservation or idempotency conflict
503 collection_unavailable: explicit live activation is off or test collection is forbidden in production

Example call

curl -X POST "$EHR_URL/api/v1/billing/patients/{patient}/installment-plans/{plan}/installments/{number}/checkout" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Charge a reviewed invoice balance to a card on file

POST /api/v1/billing/patients/{patient}/invoices/{invoice}/saved-card-charge

Billing create. Charges the whole remaining reviewed balance of an invoice without a payment plan to a card the patient saved with consent to later charges. The balance becomes a one-payment plan and the charge is an invoice card attempt with `channel` `saved_card`, posted by the same code as hosted checkout and reader payments. A card saved for in-person use is refused with 409 before anything is saved. The result is `paid`, or `expired` with `last_result` `saved_card_declined`, `saved_card_needs_patient`, `saved_card_not_eligible` or `saved_card_unavailable`. Retrying the same `request_id` never charges twice.

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
patient required path string (uuid)
invoice required path string (uuid)

Request body application/json · required

Fields object · 3
Field Type Details
amount_cents required integer value 50–100000000
request_id required string (uuid)
saved_card_setup_id required string (uuid)
Example request body placeholder values
{
  "amount_cents": 50,
  "request_id": "00000000-0000-4000-8000-000000000000",
  "saved_card_setup_id": "00000000-0000-4000-8000-000000000000"
}

Responses

200 Authenticated tenant-scoped result application/json
Fields InvoiceCheckoutResult · 22
Field Type Details
operation required InvoiceCheckoutOperation
account_id required string (uuid)
amount_cents required integer value ≥ 0
captured_at required string (date-time) or null
channel required string `hosted` for a Stripe-hosted Checkout link, `reader` for a card payment taken on a reader. For a reader payment `last_result` says where it stands: `reader_waiting`, `reader_offline` or `reader_finishing` while open; `reader_declined`, `reader_cancelled`, `reader_timed_out`, `reader_offline`, `reader_in_use`, `reader_unavailable` or `reader_failed` once closed (`expired`). one of hosted, reader
checkout_url required string (uri) or null
created_at required string (date-time)
currency required constant always usd
id required string (uuid)
installment_number required integer
last_result required string or null
livemode required boolean
paid_entry_id required string (uuid) or null
patient_id required string (uuid)
plan_id required string (uuid)
reader_id required string or null The card reader for a reader payment.
reason required string
refunded_cents required integer value ≥ 0
request_id required string (uuid)
status required string one of creating, open, paid, expired, needs_review, refunded
unapplied_cents required integer value ≥ 0
version required integer
Example response placeholder values
{
  "operation": {
    "account_id": "00000000-0000-4000-8000-000000000000",
    "amount_cents": 0,
    "captured_at": "2026-01-15T15:30:00Z",
    "channel": "hosted",
    "checkout_url": "https://app.example.test/callback",
    "created_at": "2026-01-15T15:30:00Z",
    "currency": "usd",
    "id": "00000000-0000-4000-8000-000000000000",
    "installment_number": 1,
    "last_result": "string",
    "livemode": true,
    "paid_entry_id": "00000000-0000-4000-8000-000000000000",
    "patient_id": "00000000-0000-4000-8000-000000000000",
    "plan_id": "00000000-0000-4000-8000-000000000000",
    "reader_id": "string",
    "reason": "string",
    "refunded_cents": 0,
    "request_id": "00000000-0000-4000-8000-000000000000",
    "status": "creating",
    "unapplied_cents": 0,
    "version": 1
  }
}
403 Billing permission required
409 Responsibility, version, reservation or idempotency conflict

Example call

curl -X POST "$EHR_URL/api/v1/billing/patients/{patient}/invoices/{invoice}/saved-card-charge" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Verify an existing hosted card setup

GET /api/v1/billing/payment-setups/{id}

Billing view required. Resolves only the reserved patient/account/credentials, retrieves existing provider evidence and updates the audited local projection. Never creates a customer, setup or payment. A browser return is not proof of completion.

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
id required path string (uuid)

Responses

200 Fresh minimized provider evidence; never a payment or ledger entry application/json
Fields PatientPaymentSetup · 16
Field Type Details
account_id required string
checked_at required string (date-time)
contract_version required constant always 1
customer_id required string or null
installation_id required string (uuid)
livemode required boolean
patient_id required string (uuid)
recovery_required required boolean
remote_tenant_id required string (uuid)
request_id required string (uuid)
retry_allowed required boolean
retry_safe_until required string (date-time)
session required object or null Verified hosted Checkout ID/URL, SetupIntent ID/status and payment method ID only. No card credentials.
status required string one of creating, open, pending, succeeded, expired, needs_review
error string
provider_status string Local recovery response only: no broker setup reservation found. This is not verified payment-method evidence. one of not_found
Example response placeholder values
{
  "account_id": "string",
  "checked_at": "2026-01-15T15:30:00Z",
  "contract_version": 1,
  "customer_id": "string",
  "installation_id": "00000000-0000-4000-8000-000000000000",
  "livemode": true,
  "patient_id": "00000000-0000-4000-8000-000000000000",
  "recovery_required": true,
  "remote_tenant_id": "00000000-0000-4000-8000-000000000000",
  "request_id": "00000000-0000-4000-8000-000000000000",
  "retry_allowed": true,
  "retry_safe_until": "2026-01-15T15:30:00Z",
  "session": {},
  "status": "creating"
}

Example call

curl "$EHR_URL/api/v1/billing/payment-setups/{id}" -H "Authorization: Bearer $ACCESS_TOKEN"

# Cancel an unfinished hosted card setup link

POST /api/v1/billing/payment-setups/{id}/cancel

Billing edit plus scheduling role required. Records who cancelled and when, expires the Stripe Checkout Session through SunCharts Connect and stores what really happened: `expired` with `cancelled` true, or `succeeded` when the patient saved the card in the same moment. Another card setup can be started as soon as this one is `expired`. Never creates a customer, setup or payment.

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
id required path string (uuid)

Responses

200 Fresh minimized provider evidence; never a payment or ledger entry application/json
Fields PatientPaymentSetup · 16
Field Type Details
account_id required string
checked_at required string (date-time)
contract_version required constant always 1
customer_id required string or null
installation_id required string (uuid)
livemode required boolean
patient_id required string (uuid)
recovery_required required boolean
remote_tenant_id required string (uuid)
request_id required string (uuid)
retry_allowed required boolean
retry_safe_until required string (date-time)
session required object or null Verified hosted Checkout ID/URL, SetupIntent ID/status and payment method ID only. No card credentials.
status required string one of creating, open, pending, succeeded, expired, needs_review
error string
provider_status string Local recovery response only: no broker setup reservation found. This is not verified payment-method evidence. one of not_found
Example response placeholder values
{
  "account_id": "string",
  "checked_at": "2026-01-15T15:30:00Z",
  "contract_version": 1,
  "customer_id": "string",
  "installation_id": "00000000-0000-4000-8000-000000000000",
  "livemode": true,
  "patient_id": "00000000-0000-4000-8000-000000000000",
  "recovery_required": true,
  "remote_tenant_id": "00000000-0000-4000-8000-000000000000",
  "request_id": "00000000-0000-4000-8000-000000000000",
  "retry_allowed": true,
  "retry_safe_until": "2026-01-15T15:30:00Z",
  "session": {},
  "status": "creating"
}

Example call

curl -X POST "$EHR_URL/api/v1/billing/payment-setups/{id}/cancel" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Read the connected Stripe account summary

GET /api/v1/billing/payments/operations

Owner-only, including existing authorized delegated-owner sessions. Read-only Connect broker calls bound to the current installation, tenant, Stripe account/mode and credential revision. Returns available/pending balances, capability readiness and latest ten payment/payout records with timestamps. Unavailable sections have status unavailable and data null; an empty successful list is distinct. No customer or card/bank data, Stripe invoice totals or provider URLs. This does not enable collection or reconcile patient balances. Response is no-store; stale/revoked identity or connection fails closed.

Access OAuth 2.0 access tokenclinical.read

Responses

200 Versioned sanitized account activity application/json
Fields object · 22
Field Type Details
account required object
card_payments_active boolean
charges_enabled boolean
details_submitted boolean
payouts_enabled boolean
account_id required string pattern ^acct_[A-Za-z0-9_]+$
balance required object
data required object or null
status required string one of available, unavailable
checked_at required string (date-time)
contract_version required constant always 1
installation_id required string (uuid)
limit required constant always 10
livemode required boolean
payments required object
data required object or null
status required string one of available, unavailable
payouts required object
data required object or null
status required string one of available, unavailable
remote_tenant_id required string (uuid)
setting_version required integer
Example response placeholder values
{
  "account": {
    "card_payments_active": true,
    "charges_enabled": true,
    "details_submitted": true,
    "payouts_enabled": true
  },
  "account_id": "string",
  "balance": {
    "data": {},
    "status": "available"
  },
  "checked_at": "2026-01-15T15:30:00Z",
  "contract_version": 1,
  "installation_id": "00000000-0000-4000-8000-000000000000",
  "limit": 10,
  "livemode": true,
  "payments": {
    "data": {},
    "status": "available"
  },
  "payouts": {
    "data": {},
    "status": "available"
  },
  "remote_tenant_id": "00000000-0000-4000-8000-000000000000",
  "setting_version": 1
}
400 Provider unavailable or response could not be verified
403 Owner permission required
409 Account setup or binding changed; refresh required

Example call

curl "$EHR_URL/api/v1/billing/payments/operations" -H "Authorization: Bearer $ACCESS_TOKEN"

# List the practice's card readers

GET /api/v1/billing/payments/readers

Owner, clinician and front desk staff. Asks SunCharts Connect for the Stripe readers registered for the practice's connected payment account, bound to the current installation, tenant and Stripe account/mode. `status` is `ready`, `not_connected` when payment account setup is not finished, or `unavailable` when a production practice is bound to a test account. `can_manage` says whether this staff member may add, rename or remove readers. `payments_available` says whether a card payment can be taken on a reader in this environment and payment mode. `practice_code` is present only for a test account outside production and is the Stripe code for a practice reader. Takes no payment. Response is no-store.

Access OAuth 2.0 access tokenclinical.read

Responses

200 The practice's card readers application/json
Fields object · 10
Field Type Details
can_manage required boolean
readers required array of CardReader
busy required boolean The reader is taking a payment right now.
id required string
model required string
name required string The name the practice gave this reader.
online required boolean
status required string one of ready, not_connected, unavailable
payments_available boolean
practice_code string
Example response placeholder values
{
  "can_manage": true,
  "readers": [
    {
      "busy": true,
      "id": "string",
      "model": "string",
      "name": "string",
      "online": true
    }
  ],
  "status": "ready",
  "payments_available": true,
  "practice_code": "string"
}
400 Invalid input, or the reader code was not accepted
401 Sign in required
403 Not permitted for this staff member
404 Reader not found for this practice
409 Payment setup is not finished, the practice address is missing, or the reader is taking a payment
500 Database/audit failure

Example call

curl "$EHR_URL/api/v1/billing/payments/readers" -H "Authorization: Bearer $ACCESS_TOKEN"

# Add a card reader

POST /api/v1/billing/payments/readers

Owner-only; staff with a custom access policy also need billing edit. Registers the reader that is showing `code` with the practice's connected payment account and gives it `name`. SunCharts Connect creates the practice's reader location on first use from the business address Stripe already holds. The same `request_id` never registers twice. A practice reader code is accepted only for a test account outside production. Takes no payment.

Access OAuth 2.0 access tokenclinical.read

Request body application/json · required

Fields object · 3
Field Type Details
code required string The code shown on the reader's screen. length 1–64
name required string length 1–60
request_id required string (uuid)
Example request body placeholder values
{
  "code": "string",
  "name": "string",
  "request_id": "00000000-0000-4000-8000-000000000000"
}

Responses

200 The reader that was added application/json
Fields object · 6
Field Type Details
reader required CardReader
busy required boolean The reader is taking a payment right now.
id required string
model required string
name required string The name the practice gave this reader.
online required boolean
Example response placeholder values
{
  "reader": {
    "busy": true,
    "id": "string",
    "model": "string",
    "name": "string",
    "online": true
  }
}
400 Invalid input, or the reader code was not accepted
401 Sign in required
403 Not permitted for this staff member
404 Reader not found for this practice
409 Payment setup is not finished, the practice address is missing, or the reader is taking a payment
500 Database/audit failure

Example call

curl -X POST "$EHR_URL/api/v1/billing/payments/readers" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Open card reader ordering for the practice owner

POST /api/v1/billing/payments/readers/hardware-session

Owner-only, including existing authorized delegated-owner sessions; staff with a custom access policy also need billing edit. Asks SunCharts Connect for a short-lived Stripe session limited to the Terminal hardware shop and the practice's hardware orders, bound to the current installation, tenant, Stripe account/mode and credential revision. Readers are ordered from, shipped by and billed by Stripe. Takes no payment and changes no patient balance. `status` is `ready` (with the values the browser passes to Stripe Connect.js), `not_connected` when the practice has not finished payment account setup, or `unavailable` when reader ordering is not set up on SunCharts Connect. The session secret is never stored, logged or audited. Response is no-store; stale/revoked identity or connection fails closed.

Access OAuth 2.0 access tokenclinical.read

Responses

200 Reader ordering state for this practice application/json
Fields object · 4
Field Type Details
status required string one of ready, not_connected, unavailable
client_secret string Present only when status is ready. Short-lived; pass to Stripe Connect.js and do not store.
livemode boolean Present only when status is ready.
publishable_key string Present only when status is ready. pattern ^pk_(test|live)_[A-Za-z0-9_]+$
Example response placeholder values
{
  "status": "ready",
  "client_secret": "string",
  "livemode": true,
  "publishable_key": "string"
}
400 SunCharts Connect or Stripe did not confirm the request; nothing was ordered
401 Authentication required
403 Practice owner access required
409 Payment account changed while the request was in progress
500 Read or audit failure

Example call

curl -X POST "$EHR_URL/api/v1/billing/payments/readers/hardware-session" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Rename a card reader

PUT /api/v1/billing/payments/readers/{reader}

Owner-only; staff with a custom access policy also need billing edit. Only a reader registered for this practice can be renamed.

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
reader required path string

Request body application/json · required

Fields object · 1
Field Type Details
name required string length 1–60
Example request body placeholder values
{
  "name": "string"
}

Responses

200 The renamed reader application/json
Fields object · 6
Field Type Details
reader required CardReader
busy required boolean The reader is taking a payment right now.
id required string
model required string
name required string The name the practice gave this reader.
online required boolean
Example response placeholder values
{
  "reader": {
    "busy": true,
    "id": "string",
    "model": "string",
    "name": "string",
    "online": true
  }
}
400 Invalid input, or the reader code was not accepted
401 Sign in required
403 Not permitted for this staff member
404 Reader not found for this practice
409 Payment setup is not finished, the practice address is missing, or the reader is taking a payment
500 Database/audit failure

Example call

curl -X PUT "$EHR_URL/api/v1/billing/payments/readers/{reader}" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Remove a card reader

DELETE /api/v1/billing/payments/readers/{reader}

Owner-only; staff with a custom access policy also need billing delete. Only a reader registered for this practice can be removed, and not while it is taking a payment.

Access OAuth 2.0 access tokenclinical.read

Parameters

Name In Type Details
reader required path string

Responses

200 The reader was removed application/json
Fields object · 1
Field Type Details
removed required boolean
Example response placeholder values
{
  "removed": true
}
400 Invalid input, or the reader code was not accepted
401 Sign in required
403 Not permitted for this staff member
404 Reader not found for this practice
409 Payment setup is not finished, the practice address is missing, or the reader is taking a payment
500 Database/audit failure

Example call

curl -X DELETE "$EHR_URL/api/v1/billing/payments/readers/{reader}" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Read payment settings

GET /api/v1/billing/payments/settings

Owner-only redacted configuration and key-storage/Connect availability status. Never returns credentials. Returns environment availability separately from configured account readiness. Production disables test transactions; historical evidence remains readable.

Access OAuth 2.0 access tokenbilling.read

Responses

200 Success; no payment inferred from browser return application/json
Fields object · 12
Field Type Details
broker_available boolean A valid payment broker origin is configured; this does not establish payment account readiness.
collection_unavailable_reason string or null Human-readable environment restriction, or null.
connect_available boolean
connect_portal_url string or null Verified Connect clinic-scoped continuation URL derived from the paired connection, available independently of the last Stripe readiness refresh.
credential_storage_ready boolean
hosted_copays_live_enabled boolean EHR operator gate for the distinct appointment hosted-copay protocol. Account readiness and the Connect gate are also required; does not enable legacy posted-account live payments.
live_payments_available constant Live card processing is not supported. always false
native_setup_url string or null Verified Connect clinic-scoped continuation URL derived from the paired connection, available independently of the last Stripe readiness refresh.
setting PaymentSettings or null
test_mode_only constant always true
test_payments_available boolean False when ENGINE_ENVIRONMENT=production.
webhook_base string (uri)
Example response placeholder values
{
  "broker_available": true,
  "collection_unavailable_reason": "string",
  "connect_available": true,
  "connect_portal_url": "https://app.example.test/callback",
  "credential_storage_ready": true,
  "hosted_copays_live_enabled": true,
  "live_payments_available": false,
  "native_setup_url": "https://app.example.test/callback"
}
400 Invalid evidence, unavailable connection or unsupported live/payment operation
401 Authentication required
403 Owner/staff role or billing scope denied
404 Tenant-scoped resource not found
409 Stale version, reused request, reserved balance, or conflicting provider evidence
428 Current quoted If-Match required
500 Database/audit failure; database changes rolled back

Example call

curl "$EHR_URL/api/v1/billing/payments/settings" -H "Authorization: Bearer $ACCESS_TOKEN"

# Save payment settings

PUT /api/v1/billing/payments/settings

Owner-only encrypted credentials. Saved changes disable collection and invalidate verification. Immutable credential revisions remain pinned to existing attempts.

Access OAuth 2.0 access tokenbilling.write

Parameters

Name In Type Details
If-Match required header string Quoted current settings/account version. Settings first save accepts "0".

Request body application/json · required

Fields PaymentSettingsInput · 5
Field Type Details
mode required any one of own_stripe, suncharts_connect
api_key string Own account test-only sk_test_ or rk_test_ credential; blank preserves saved same-mode credential.
broker_token string pattern ^scp_inst_[A-Za-z0-9_-]+$
installation_id string (uuid)
webhook_secret string
Example request body placeholder values
{
  "mode": "own_stripe",
  "api_key": "string",
  "broker_token": "string",
  "installation_id": "00000000-0000-4000-8000-000000000000",
  "webhook_secret": "string"
}

Responses

200 Success; no payment inferred from browser return application/json
Fields PaymentSettings · 17
Field Type Details
card_payments_active boolean True only after a bound provider status explicitly confirms the Stripe card_payments capability is active. General charges_enabled alone is insufficient. Existing settings default false until refreshed.
charges_enabled boolean Last verified processor account capability evidence; distinct from environment collection availability.
credentials_configured constant always true
details_submitted boolean Last verified processor account capability evidence; distinct from environment collection availability.
enabled boolean
id string (uuid)
last_test_at string or null
last_test_result string or null Includes live_connection_verified when the bound live account was authenticated for display only; this is not live payment activation.
mode any one of own_stripe, suncharts_connect
onboarding_url string or null Only verified broker origin + actual owner setup path. Does not grant anonymous financial onboarding.
payouts_enabled boolean Last verified processor account capability evidence; distinct from environment collection availability.
provider_account_id string or null
requirements_currently_due array of string
requirements_past_due array of string
test_mode constant always true
verified boolean
version integer
Example response placeholder values
{
  "card_payments_active": true,
  "charges_enabled": true,
  "credentials_configured": true,
  "details_submitted": true,
  "enabled": true,
  "id": "00000000-0000-4000-8000-000000000000",
  "last_test_at": "2026-01-15T15:30:00Z",
  "last_test_result": "string"
}
400 Invalid evidence, unavailable connection or unsupported live/payment operation
401 Authentication required
403 Owner/staff role or billing scope denied
404 Tenant-scoped resource not found
409 Stale version, reused request, reserved balance, or conflicting provider evidence
428 Current quoted If-Match required
500 Database/audit failure; database changes rolled back

Example call

curl -X PUT "$EHR_URL/api/v1/billing/payments/settings" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Activate test payments

POST /api/v1/billing/payments/settings/activation

Owner-only explicit test-collection enable/disable after verified account test. Existing attempt reconciliation remains available. Test-payment activation (enabled=true), creation, refresh, expiry and refund are blocked in production. Simulated funds cannot be reconciled into production balances.

Access OAuth 2.0 access tokenbilling.write

Parameters

Name In Type Details
If-Match required header string Quoted current settings/account version. Settings first save accepts "0".

Request body application/json · required

Fields object · 1
Field Type Details
enabled required boolean
Example request body placeholder values
{
  "enabled": true
}

Responses

200 Success; no payment inferred from browser return application/json
Fields PaymentSettings · 17
Field Type Details
card_payments_active boolean True only after a bound provider status explicitly confirms the Stripe card_payments capability is active. General charges_enabled alone is insufficient. Existing settings default false until refreshed.
charges_enabled boolean Last verified processor account capability evidence; distinct from environment collection availability.
credentials_configured constant always true
details_submitted boolean Last verified processor account capability evidence; distinct from environment collection availability.
enabled boolean
id string (uuid)
last_test_at string or null
last_test_result string or null Includes live_connection_verified when the bound live account was authenticated for display only; this is not live payment activation.
mode any one of own_stripe, suncharts_connect
onboarding_url string or null Only verified broker origin + actual owner setup path. Does not grant anonymous financial onboarding.
payouts_enabled boolean Last verified processor account capability evidence; distinct from environment collection availability.
provider_account_id string or null
requirements_currently_due array of string
requirements_past_due array of string
test_mode constant always true
verified boolean
version integer
Example response placeholder values
{
  "card_payments_active": true,
  "charges_enabled": true,
  "credentials_configured": true,
  "details_submitted": true,
  "enabled": true,
  "id": "00000000-0000-4000-8000-000000000000",
  "last_test_at": "2026-01-15T15:30:00Z",
  "last_test_result": "string"
}
400 Invalid evidence, unavailable connection or unsupported live/payment operation
401 Authentication required
403 Owner/staff role or billing scope denied
404 Tenant-scoped resource not found
409 Stale version, reused request, reserved balance, or conflicting provider evidence
428 Current quoted If-Match required
500 Database/audit failure; database changes rolled back

Example call

curl -X POST "$EHR_URL/api/v1/billing/payments/settings/activation" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Test payment settings

POST /api/v1/billing/payments/settings/test

Owner-only fixed Stripe /v1/account or authenticated broker status query. Broker status must match the installation and remote tenant. A correctly bound live account may supply readiness display evidence but never enables live collection. Test readiness requires test-mode charges and business details complete. Does not create a payment.

Access OAuth 2.0 access tokenbilling.write

Parameters

Name In Type Details
If-Match required header string Quoted current settings/account version. Settings first save accepts "0".

Responses

200 Success; no payment inferred from browser return application/json
Fields object · 22
Field Type Details
authenticated boolean
live_payment_enabled constant always false
processor_livemode boolean or null Broker processor account mode when present. True permits readiness display only; live_payment_enabled remains false and ready is false for live accounts.
ready boolean
setting PaymentSettings
card_payments_active boolean True only after a bound provider status explicitly confirms the Stripe card_payments capability is active. General charges_enabled alone is insufficient. Existing settings default false until refreshed.
charges_enabled boolean Last verified processor account capability evidence; distinct from environment collection availability.
credentials_configured constant always true
details_submitted boolean Last verified processor account capability evidence; distinct from environment collection availability.
enabled boolean
id string (uuid)
last_test_at string or null
last_test_result string or null Includes live_connection_verified when the bound live account was authenticated for display only; this is not live payment activation.
mode any one of own_stripe, suncharts_connect
onboarding_url string or null Only verified broker origin + actual owner setup path. Does not grant anonymous financial onboarding.
payouts_enabled boolean Last verified processor account capability evidence; distinct from environment collection availability.
provider_account_id string or null
requirements_currently_due array of string
requirements_past_due array of string
test_mode constant always true
verified boolean
version integer
Example response placeholder values
{
  "authenticated": true,
  "live_payment_enabled": false,
  "processor_livemode": true,
  "ready": true,
  "setting": {
    "card_payments_active": true,
    "charges_enabled": true,
    "credentials_configured": true,
    "details_submitted": true,
    "enabled": true,
    "id": "00000000-0000-4000-8000-000000000000",
    "last_test_at": "2026-01-15T15:30:00Z",
    "last_test_result": "string"
  }
}
400 Invalid evidence, unavailable connection or unsupported live/payment operation
401 Authentication required
403 Owner/staff role or billing scope denied
404 Tenant-scoped resource not found
409 Stale version, reused request, reserved balance, or conflicting provider evidence
428 Current quoted If-Match required
500 Database/audit failure; database changes rolled back

Example call

curl -X POST "$EHR_URL/api/v1/billing/payments/settings/test" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Read hosted payment

GET /api/v1/billing/payments/{id}

Read tenant-scoped payment state, immutable history and redacted refund request states.

Access OAuth 2.0 access tokenbilling.read

Parameters

Name In Type Details
id required path string (uuid)

Responses

200 Success; no payment inferred from browser return application/json
Fields object · 21
Field Type Details
events array of object
payment HostedPayment
account_id string (uuid)
amount_cents integer
checkout_url string or null Null in production even for a historical open test attempt.
collection_unavailable_reason string or null Human-readable environment restriction, or null.
created_at string (date-time)
currency constant always usd
expiry_available boolean False in production; historical evidence is preserved.
id string (uuid)
ledger_recorded boolean
needs_review boolean
provider_mode any one of own_stripe, suncharts_connect
refund_available boolean False in production; historical evidence is preserved.
refunded_cents integer
status any one of creating, open, paid, expired, needs_review, refunded
test_mode constant always true
test_payments_available boolean False when ENGINE_ENVIRONMENT=production.
updated_at string (date-time)
version integer
refund_requests array of object
Example response placeholder values
{
  "events": [
    {}
  ],
  "payment": {
    "account_id": "00000000-0000-4000-8000-000000000000",
    "amount_cents": 1,
    "checkout_url": "https://app.example.test/callback",
    "collection_unavailable_reason": "string",
    "created_at": "2026-01-15T15:30:00Z",
    "currency": "usd",
    "expiry_available": true,
    "id": "00000000-0000-4000-8000-000000000000"
  },
  "refund_requests": [
    {}
  ]
}
400 Invalid evidence, unavailable connection or unsupported live/payment operation
401 Authentication required
403 Owner/staff role or billing scope denied
404 Tenant-scoped resource not found
409 Stale version, reused request, reserved balance, or conflicting provider evidence
428 Current quoted If-Match required
500 Database/audit failure; database changes rolled back

Example call

curl "$EHR_URL/api/v1/billing/payments/{id}" -H "Authorization: Bearer $ACCESS_TOKEN"

# Expire hosted payment

POST /api/v1/billing/payments/{id}/expire

Expire an own-account open Checkout Session. Broker contract does not support this operation. Test-payment activation (enabled=true), creation, refresh, expiry and refund are blocked in production. Simulated funds cannot be reconciled into production balances.

Access OAuth 2.0 access tokenbilling.write

Parameters

Name In Type Details
id required path string (uuid)

Responses

200 Success; no payment inferred from browser return application/json
Fields HostedPaymentResult · 19
Field Type Details
payment HostedPayment
account_id string (uuid)
amount_cents integer
checkout_url string or null Null in production even for a historical open test attempt.
collection_unavailable_reason string or null Human-readable environment restriction, or null.
created_at string (date-time)
currency constant always usd
expiry_available boolean False in production; historical evidence is preserved.
id string (uuid)
ledger_recorded boolean
needs_review boolean
provider_mode any one of own_stripe, suncharts_connect
refund_available boolean False in production; historical evidence is preserved.
refunded_cents integer
status any one of creating, open, paid, expired, needs_review, refunded
test_mode constant always true
test_payments_available boolean False when ENGINE_ENVIRONMENT=production.
updated_at string (date-time)
version integer
Example response placeholder values
{
  "payment": {
    "account_id": "00000000-0000-4000-8000-000000000000",
    "amount_cents": 1,
    "checkout_url": "https://app.example.test/callback",
    "collection_unavailable_reason": "string",
    "created_at": "2026-01-15T15:30:00Z",
    "currency": "usd",
    "expiry_available": true,
    "id": "00000000-0000-4000-8000-000000000000"
  }
}
400 Invalid evidence, unavailable connection or unsupported live/payment operation
401 Authentication required
403 Owner/staff role or billing scope denied
404 Tenant-scoped resource not found
409 Stale version, reused request, reserved balance, or conflicting provider evidence
428 Current quoted If-Match required
500 Database/audit failure; database changes rolled back

Example call

curl -X POST "$EHR_URL/api/v1/billing/payments/{id}/expire" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Refresh hosted payment

POST /api/v1/billing/payments/{id}/refresh

Retrieve exact test session, expanded payment intent and charge; post paid/refund deltas exactly once. Retry original uncertain creation only within safe idempotency window. Test-payment activation (enabled=true), creation, refresh, expiry and refund are blocked in production. Simulated funds cannot be reconciled into production balances.

Access OAuth 2.0 access tokenbilling.write

Parameters

Name In Type Details
id required path string (uuid)

Responses

200 Success; no payment inferred from browser return application/json
Fields HostedPaymentResult · 19
Field Type Details
payment HostedPayment
account_id string (uuid)
amount_cents integer
checkout_url string or null Null in production even for a historical open test attempt.
collection_unavailable_reason string or null Human-readable environment restriction, or null.
created_at string (date-time)
currency constant always usd
expiry_available boolean False in production; historical evidence is preserved.
id string (uuid)
ledger_recorded boolean
needs_review boolean
provider_mode any one of own_stripe, suncharts_connect
refund_available boolean False in production; historical evidence is preserved.
refunded_cents integer
status any one of creating, open, paid, expired, needs_review, refunded
test_mode constant always true
test_payments_available boolean False when ENGINE_ENVIRONMENT=production.
updated_at string (date-time)
version integer
Example response placeholder values
{
  "payment": {
    "account_id": "00000000-0000-4000-8000-000000000000",
    "amount_cents": 1,
    "checkout_url": "https://app.example.test/callback",
    "collection_unavailable_reason": "string",
    "created_at": "2026-01-15T15:30:00Z",
    "currency": "usd",
    "expiry_available": true,
    "id": "00000000-0000-4000-8000-000000000000"
  }
}
400 Invalid evidence, unavailable connection or unsupported live/payment operation
401 Authentication required
403 Owner/staff role or billing scope denied
404 Tenant-scoped resource not found
409 Stale version, reused request, reserved balance, or conflicting provider evidence
428 Current quoted If-Match required
500 Database/audit failure; database changes rolled back

Example call

curl -X POST "$EHR_URL/api/v1/billing/payments/{id}/refresh" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Refund hosted payment

POST /api/v1/billing/payments/{id}/refunds

Own-account only. Stable idempotent refund request; cumulative verified provider refund evidence controls ledger entries. Pending and confirmed-but-unreconciled requests hold additional refund capacity. Test-payment activation (enabled=true), creation, refresh, expiry and refund are blocked in production. Simulated funds cannot be reconciled into production balances.

Access OAuth 2.0 access tokenbilling.write

Parameters

Name In Type Details
id required path string (uuid)

Request body application/json · required

Fields PaymentRefundRequest · 2
Field Type Details
amount_cents required integer value 1–100000000
request_id required string (uuid)
Example request body placeholder values
{
  "amount_cents": 1,
  "request_id": "00000000-0000-4000-8000-000000000000"
}

Responses

200 Success; no payment inferred from browser return application/json
Fields object · 20
Field Type Details
payment HostedPayment
account_id string (uuid)
amount_cents integer
checkout_url string or null Null in production even for a historical open test attempt.
collection_unavailable_reason string or null Human-readable environment restriction, or null.
created_at string (date-time)
currency constant always usd
expiry_available boolean False in production; historical evidence is preserved.
id string (uuid)
ledger_recorded boolean
needs_review boolean
provider_mode any one of own_stripe, suncharts_connect
refund_available boolean False in production; historical evidence is preserved.
refunded_cents integer
status any one of creating, open, paid, expired, needs_review, refunded
test_mode constant always true
test_payments_available boolean False when ENGINE_ENVIRONMENT=production.
updated_at string (date-time)
version integer
refund_confirmed boolean
Example response placeholder values
{
  "payment": {
    "account_id": "00000000-0000-4000-8000-000000000000",
    "amount_cents": 1,
    "checkout_url": "https://app.example.test/callback",
    "collection_unavailable_reason": "string",
    "created_at": "2026-01-15T15:30:00Z",
    "currency": "usd",
    "expiry_available": true,
    "id": "00000000-0000-4000-8000-000000000000"
  },
  "refund_confirmed": true
}
400 Invalid evidence, unavailable connection or unsupported live/payment operation
401 Authentication required
403 Owner/staff role or billing scope denied
404 Tenant-scoped resource not found
409 Stale version, reused request, reserved balance, or conflicting provider evidence
428 Current quoted If-Match required
500 Database/audit failure; database changes rolled back

Example call

curl -X POST "$EHR_URL/api/v1/billing/payments/{id}/refunds" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# List appointment card attempts and collection availability

GET /api/v1/patients/{p}/appointments/{a}/copay-checkouts

Billing-read staff. Returns at most 100 attempts; excessive history requires review rather than silent truncation. Availability is verified against configured account readiness and environment gates.

Access OAuth 2.0 access tokenbilling.read

Parameters

Name In Type Details
p required path string (uuid)
a required path string (uuid)

Responses

200 Current durable operation state; financial effects require verified provider evidence application/json
Fields object · 22
Field Type Details
availability required object
available required boolean
livemode required boolean or null
reason required string or null
items required array of HostedCopayOperation items ≤ 100
amount_cents required integer value 50–100000000
appointment_id required string (uuid)
captured_at required string or null
channel required string `hosted` for a Stripe-hosted Checkout link, `reader` for a card payment taken on a reader. For a reader payment `last_result` says where it stands: `reader_waiting`, `reader_offline` or `reader_finishing` while open; `reader_declined`, `reader_cancelled`, `reader_timed_out`, `reader_offline`, `reader_in_use`, `reader_unavailable` or `reader_failed` once closed (`expired`). one of hosted, reader
checkout_url required string or null Available only for an open attempt permitted in this environment.
created_at required string (date-time)
currency required constant always USD
id required string (uuid)
last_result required string or null
livemode required boolean
patient_id required string (uuid)
reader_id required string or null The card reader for a reader payment.
receipt_id required string or null
refunded_cents required integer value ≥ 0
request_id required string (uuid)
status required any one of creating, open, paid, expired, needs_review, refunded
version required integer value ≥ 1
Example response placeholder values
{
  "availability": {
    "available": true,
    "livemode": true,
    "reason": "string"
  },
  "items": [
    {
      "amount_cents": 50,
      "appointment_id": "00000000-0000-4000-8000-000000000000",
      "captured_at": "2026-01-15T15:30:00Z",
      "channel": "hosted",
      "checkout_url": "https://app.example.test/callback",
      "created_at": "2026-01-15T15:30:00Z",
      "currency": "USD",
      "id": "00000000-0000-4000-8000-000000000000",
      "last_result": "string",
      "livemode": true,
      "patient_id": "00000000-0000-4000-8000-000000000000",
      "reader_id": "string",
      "receipt_id": "00000000-0000-4000-8000-000000000000",
      "refunded_cents": 0,
      "request_id": "00000000-0000-4000-8000-000000000000",
      "status": "creating",
      "version": 1
    }
  ]
}
400 Invalid input or unavailable/mismatched payment mode
401 Sign in required
403 Billing permission denied
404 Tenant/patient/appointment-scoped record not found
409 Conflicting retry, pending collection, unsafe balance or over-limit history
500 Database/audit failure; mutation rolled back

Example call

curl "$EHR_URL/api/v1/patients/{p}/appointments/{a}/copay-checkouts" -H "Authorization: Bearer $ACCESS_TOKEN"

# Collect an appointment copay with Stripe-hosted Checkout

POST /api/v1/patients/{p}/appointments/{a}/copay-checkouts

Billing-write staff. Reserve a same-patient appointment attempt before provider I/O. Binds installation, credential revision, Stripe account, mode, amount and optional coverage snapshot immutably. Exact request retry returns the original attempt; conflicting reuse fails. Test mode is blocked in production. Live mode requires both the EHR and Connect operator gates. Pending/uncertain attempts retain their identity; recovery retries only within the verified 23-hour window. This can precede encounter charges. With `reader_id` the copay is taken on that card reader instead: the same reservation, binding and paid rule apply, the attempt has `channel` `reader`, and it closes by itself if the card is declined, the payment is cancelled, or no card is presented within five minutes.

Access OAuth 2.0 access tokenbilling.write

Parameters

Name In Type Details
p required path string (uuid)
a required path string (uuid)

Request body application/json · required

Fields HostedCopayInput · 6
Field Type Details
amount_cents required integer value 50–100000000
livemode required boolean
reason required string length 1–1000
request_id required string (uuid)
coverage_id string or null
reader_id string A card reader from GET /api/v1/billing/payments/readers. When present the payment is taken on that reader instead of a Stripe-hosted Checkout link. pattern ^tmr_[A-Za-z0-9]+$
Example request body placeholder values
{
  "amount_cents": 50,
  "livemode": true,
  "reason": "string",
  "request_id": "00000000-0000-4000-8000-000000000000",
  "coverage_id": "00000000-0000-4000-8000-000000000000",
  "reader_id": "string"
}

Responses

200 Current durable operation state; financial effects require verified provider evidence application/json
Fields object · 18
Field Type Details
operation required HostedCopayOperation Immutable appointment/payment binding with durable reconciliation state. Receipt creation requires independently retrieved account/mode-bound captured charge evidence. Browser return and Checkout opening never count as payment.
amount_cents required integer value 50–100000000
appointment_id required string (uuid)
captured_at required string or null
channel required string `hosted` for a Stripe-hosted Checkout link, `reader` for a card payment taken on a reader. For a reader payment `last_result` says where it stands: `reader_waiting`, `reader_offline` or `reader_finishing` while open; `reader_declined`, `reader_cancelled`, `reader_timed_out`, `reader_offline`, `reader_in_use`, `reader_unavailable` or `reader_failed` once closed (`expired`). one of hosted, reader
checkout_url required string or null Available only for an open attempt permitted in this environment.
created_at required string (date-time)
currency required constant always USD
id required string (uuid)
last_result required string or null
livemode required boolean
patient_id required string (uuid)
reader_id required string or null The card reader for a reader payment.
receipt_id required string or null
refunded_cents required integer value ≥ 0
request_id required string (uuid)
status required any one of creating, open, paid, expired, needs_review, refunded
version required integer value ≥ 1
Example response placeholder values
{
  "operation": {
    "amount_cents": 50,
    "appointment_id": "00000000-0000-4000-8000-000000000000",
    "captured_at": "2026-01-15T15:30:00Z",
    "channel": "hosted",
    "checkout_url": "https://app.example.test/callback",
    "created_at": "2026-01-15T15:30:00Z",
    "currency": "USD",
    "id": "00000000-0000-4000-8000-000000000000",
    "last_result": "string",
    "livemode": true,
    "patient_id": "00000000-0000-4000-8000-000000000000",
    "reader_id": "string",
    "receipt_id": "00000000-0000-4000-8000-000000000000",
    "refunded_cents": 0,
    "request_id": "00000000-0000-4000-8000-000000000000",
    "status": "creating",
    "version": 1
  }
}
400 Invalid input or unavailable/mismatched payment mode
401 Sign in required
403 Billing permission denied
404 Tenant/patient/appointment-scoped record not found
409 Conflicting retry, pending collection, unsafe balance or over-limit history
500 Database/audit failure; mutation rolled back

Example call

curl -X POST "$EHR_URL/api/v1/patients/{p}/appointments/{a}/copay-checkouts" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Read an appointment card attempt

GET /api/v1/patients/{p}/appointments/{a}/copay-checkouts/{id}

Tenant, patient and appointment scoped. Does not reconcile or infer payment from a browser return.

Access OAuth 2.0 access tokenbilling.read

Parameters

Name In Type Details
p required path string (uuid)
a required path string (uuid)
id required path string (uuid)

Responses

200 Current durable operation state; financial effects require verified provider evidence application/json
Fields object · 18
Field Type Details
operation required HostedCopayOperation Immutable appointment/payment binding with durable reconciliation state. Receipt creation requires independently retrieved account/mode-bound captured charge evidence. Browser return and Checkout opening never count as payment.
amount_cents required integer value 50–100000000
appointment_id required string (uuid)
captured_at required string or null
channel required string `hosted` for a Stripe-hosted Checkout link, `reader` for a card payment taken on a reader. For a reader payment `last_result` says where it stands: `reader_waiting`, `reader_offline` or `reader_finishing` while open; `reader_declined`, `reader_cancelled`, `reader_timed_out`, `reader_offline`, `reader_in_use`, `reader_unavailable` or `reader_failed` once closed (`expired`). one of hosted, reader
checkout_url required string or null Available only for an open attempt permitted in this environment.
created_at required string (date-time)
currency required constant always USD
id required string (uuid)
last_result required string or null
livemode required boolean
patient_id required string (uuid)
reader_id required string or null The card reader for a reader payment.
receipt_id required string or null
refunded_cents required integer value ≥ 0
request_id required string (uuid)
status required any one of creating, open, paid, expired, needs_review, refunded
version required integer value ≥ 1
Example response placeholder values
{
  "operation": {
    "amount_cents": 50,
    "appointment_id": "00000000-0000-4000-8000-000000000000",
    "captured_at": "2026-01-15T15:30:00Z",
    "channel": "hosted",
    "checkout_url": "https://app.example.test/callback",
    "created_at": "2026-01-15T15:30:00Z",
    "currency": "USD",
    "id": "00000000-0000-4000-8000-000000000000",
    "last_result": "string",
    "livemode": true,
    "patient_id": "00000000-0000-4000-8000-000000000000",
    "reader_id": "string",
    "receipt_id": "00000000-0000-4000-8000-000000000000",
    "refunded_cents": 0,
    "request_id": "00000000-0000-4000-8000-000000000000",
    "status": "creating",
    "version": 1
  }
}
400 Invalid input or unavailable/mismatched payment mode
401 Sign in required
403 Billing permission denied
404 Tenant/patient/appointment-scoped record not found
409 Conflicting retry, pending collection, unsafe balance or over-limit history
500 Database/audit failure; mutation rolled back

Example call

curl "$EHR_URL/api/v1/patients/{p}/appointments/{a}/copay-checkouts/{id}" -H "Authorization: Bearer $ACCESS_TOKEN"

# Cancel a copay that is waiting on a card reader

POST /api/v1/patients/{p}/appointments/{a}/copay-checkouts/{id}/reader-cancel

Billing-write staff. Records the cancel request, resets the reader and cancels the payment at the processor if no card was taken. If a card is being approved at that moment the payment is left alone and its real outcome is recorded: `open` with `last_result` `reader_finishing`, then `paid` or `expired`. A reader payment also closes by itself when the card is declined, the patient cancels on the reader, or no card is presented within five minutes. No refund is initiated here.

Access OAuth 2.0 access tokenbilling.write

Parameters

Name In Type Details
p required path string (uuid)
a required path string (uuid)
id required path string (uuid)

Responses

200 Current durable operation state; financial effects require verified provider evidence application/json
Fields object · 18
Field Type Details
operation required HostedCopayOperation Immutable appointment/payment binding with durable reconciliation state. Receipt creation requires independently retrieved account/mode-bound captured charge evidence. Browser return and Checkout opening never count as payment.
amount_cents required integer value 50–100000000
appointment_id required string (uuid)
captured_at required string or null
channel required string `hosted` for a Stripe-hosted Checkout link, `reader` for a card payment taken on a reader. For a reader payment `last_result` says where it stands: `reader_waiting`, `reader_offline` or `reader_finishing` while open; `reader_declined`, `reader_cancelled`, `reader_timed_out`, `reader_offline`, `reader_in_use`, `reader_unavailable` or `reader_failed` once closed (`expired`). one of hosted, reader
checkout_url required string or null Available only for an open attempt permitted in this environment.
created_at required string (date-time)
currency required constant always USD
id required string (uuid)
last_result required string or null
livemode required boolean
patient_id required string (uuid)
reader_id required string or null The card reader for a reader payment.
receipt_id required string or null
refunded_cents required integer value ≥ 0
request_id required string (uuid)
status required any one of creating, open, paid, expired, needs_review, refunded
version required integer value ≥ 1
Example response placeholder values
{
  "operation": {
    "amount_cents": 50,
    "appointment_id": "00000000-0000-4000-8000-000000000000",
    "captured_at": "2026-01-15T15:30:00Z",
    "channel": "hosted",
    "checkout_url": "https://app.example.test/callback",
    "created_at": "2026-01-15T15:30:00Z",
    "currency": "USD",
    "id": "00000000-0000-4000-8000-000000000000",
    "last_result": "string",
    "livemode": true,
    "patient_id": "00000000-0000-4000-8000-000000000000",
    "reader_id": "string",
    "receipt_id": "00000000-0000-4000-8000-000000000000",
    "refunded_cents": 0,
    "request_id": "00000000-0000-4000-8000-000000000000",
    "status": "creating",
    "version": 1
  }
}
400 Invalid input or unavailable/mismatched payment mode
401 Sign in required
403 Billing permission denied
404 Tenant/patient/appointment-scoped record not found
409 Conflicting retry, pending collection, unsafe balance or over-limit history
500 Database/audit failure; mutation rolled back

Example call

curl -X POST "$EHR_URL/api/v1/patients/{p}/appointments/{a}/copay-checkouts/{id}/reader-cancel" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Retrieve and reconcile the original card attempt

POST /api/v1/patients/{p}/appointments/{a}/copay-checkouts/{id}/refresh

Billing-write staff. Uses the original immutable broker/account/mode binding. Confirmed captured funds create one receipt; allocations and cumulative refund deltas commit with audit atomically. Disputed, inconsistent, ambiguous or unsupported evidence enters review. The background worker also reconciles due attempts without an open browser. No refund is initiated here.

Access OAuth 2.0 access tokenbilling.write

Parameters

Name In Type Details
p required path string (uuid)
a required path string (uuid)
id required path string (uuid)

Responses

200 Current durable operation state; financial effects require verified provider evidence application/json
Fields object · 18
Field Type Details
operation required HostedCopayOperation Immutable appointment/payment binding with durable reconciliation state. Receipt creation requires independently retrieved account/mode-bound captured charge evidence. Browser return and Checkout opening never count as payment.
amount_cents required integer value 50–100000000
appointment_id required string (uuid)
captured_at required string or null
channel required string `hosted` for a Stripe-hosted Checkout link, `reader` for a card payment taken on a reader. For a reader payment `last_result` says where it stands: `reader_waiting`, `reader_offline` or `reader_finishing` while open; `reader_declined`, `reader_cancelled`, `reader_timed_out`, `reader_offline`, `reader_in_use`, `reader_unavailable` or `reader_failed` once closed (`expired`). one of hosted, reader
checkout_url required string or null Available only for an open attempt permitted in this environment.
created_at required string (date-time)
currency required constant always USD
id required string (uuid)
last_result required string or null
livemode required boolean
patient_id required string (uuid)
reader_id required string or null The card reader for a reader payment.
receipt_id required string or null
refunded_cents required integer value ≥ 0
request_id required string (uuid)
status required any one of creating, open, paid, expired, needs_review, refunded
version required integer value ≥ 1
Example response placeholder values
{
  "operation": {
    "amount_cents": 50,
    "appointment_id": "00000000-0000-4000-8000-000000000000",
    "captured_at": "2026-01-15T15:30:00Z",
    "channel": "hosted",
    "checkout_url": "https://app.example.test/callback",
    "created_at": "2026-01-15T15:30:00Z",
    "currency": "USD",
    "id": "00000000-0000-4000-8000-000000000000",
    "last_result": "string",
    "livemode": true,
    "patient_id": "00000000-0000-4000-8000-000000000000",
    "reader_id": "string",
    "receipt_id": "00000000-0000-4000-8000-000000000000",
    "refunded_cents": 0,
    "request_id": "00000000-0000-4000-8000-000000000000",
    "status": "creating",
    "version": 1
  }
}
400 Invalid input or unavailable/mismatched payment mode
401 Sign in required
403 Billing permission denied
404 Tenant/patient/appointment-scoped record not found
409 Conflicting retry, pending collection, unsafe balance or over-limit history
500 Database/audit failure; mutation rolled back

Example call

curl -X POST "$EHR_URL/api/v1/patients/{p}/appointments/{a}/copay-checkouts/{id}/refresh" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Patient billing

GET /api/v1/patients/{p}/billing

Staff insurance, accounts and append-only ledger. Maximum 1000 policies/accounts and 10000 entries; explicit error rather than silent truncation. Financial values are integer USD cents. Includes appointment copay receipt evidence, which may predate an encounter or posted account.

Access OAuth 2.0 access tokenbilling.read

Parameters

Name In Type Details
p required path string (uuid)

Responses

200 Success application/json
Fields PatientBilling · 94
Field Type Details
accounts required array of BillingAccount
content required BillingAccountContent
coverage_id required string or null
currency required string one of USD
lines required array of ChargeLine items 1–100
amount_cents required integer Complete USD line total for the stated units; never multiplied by units again value 1–100000000
code required string Local code unless catalog_release_id is supplied. Canonical CPT syntax: ^[0-9]{4}[0-9FTUM]$; HCPCS: ^[A-Z][0-9]{4}$. Syntax alone does not establish catalog assignment or coverage. length 1–100
code_system required string length 1–100
description required string Nonblank, at most 10000 UTF-8 bytes. A selected catalog supplies the publisher description. length 1–10000
diagnosis_codes required array of string items ≤ 12
modifiers required string length 0–100
units required integer value 1–1000
catalog_release_id string or null Optional tenant-owned catalog release. The server resolves the code and requires it to be active and billable for the service date. Only CPT or HCPCS; code_system must exactly match the selected catalog. Uses the billing account service_date.
catalog_snapshot TerminologySelectionSnapshot Canonical catalog entry. Effective dates are the intersection of release and code dates. Syntax alone does not establish assignment, billability, coverage or licensing. ICD-10-CM permits an alphanumeric second character, including FY2027 QA0 codes; CPT supports numeric, F, T, U and M suffixes.
fee_entry_key string or null Canonical system:code:exact-modifiers key returned by the quote.
fee_override_reason string or null Required when an approved fee line amount differs from unit fee times units. length ≤ 1000
fee_schedule_id string or null
fee_snapshot PracticeFeeSnapshot Server-generated immutable approved fee evidence. Includes schedule_id, entry_key, unit_amount_cents, expected_line_amount_cents, actual_line_amount_cents, units, service_date, context, approved schedule scope/source metadata, source entry, override_reason and recorded_by. Unchanged saved line evidence survives retirement and directory changes. Supplied client snapshots are discarded.
notes required string length 0–2000
service_date required string (date)
visit_id required string or null
fee_context PracticeFeeContext or null Optional once-per-account fee context; provider is derived from the linked visit. Required for newly selected approved fee lines.
coverage_snapshot required object or null Frozen payer and policy versions captured at local posting; no eligibility assertion
id required string (uuid)
patient_id required string (uuid)
source_history_id required string or null
status required string one of draft, posted, void
total_cents required integer value 1–1000000000
version required integer value ≥ 1
diagnosis_snapshot AccountDiagnosisSnapshot or null
claims_policy required string length 0–500
copays required array of CopayReceipt Bounded appointment receipt history with allocation and void state.
account_ids required array of string (uuid)
actor_id required string (uuid)
allocated_cents required integer value ≥ 0
amount_cents required integer
appointment_id required string (uuid)
created_at required string (date-time)
id required string (uuid)
method required any one of cash, check, external
occurred_on required string (date)
patient_id required string (uuid)
reference required string
reversed_cents required integer value ≥ 0
voided required boolean
coverage_id string or null
coverage_snapshot Coverage or null
hosted_checkout object or null Present for processor-verified hosted receipts. Manual void/reversal is rejected; verified provider refunds govern their accounting. Test receipts cannot be allocated in production.
id string (uuid)
livemode boolean
refunded_cents integer value ≥ 0
refunded_unapplied_cents integer value ≥ 0
status any one of creating, open, paid, expired, needs_review, refunded
reason string
coverages required array of Coverage
content required CoverageContent
copay_cents required integer or null value 0–100000000
effective_date required string (date)
end_date required string or null
group_number required string length 0–150
member_id required string length 1–150
notes required string length 0–2000
payer_id required string (uuid)
plan_name required string length 0–200
priority required string one of primary, secondary, tertiary
relationship required string one of self, spouse, child, other
status required string one of active, inactive, entered_in_error
subscriber_birth_date required string or null
subscriber_name required string length 1–200
verification required string one of unverified, manually_verified
id required string (uuid)
source_history_id required string or null
version required integer value ≥ 1
currency required string one of USD
entries required array of BillingEntry
account_id required string (uuid)
actor_id required string (uuid)
content required BillingEntryContent Stored ledger content, including server-attributed receipt or provider evidence. Unlike NewBillingEntry, it is not accepted as a write payload.
amount_cents required integer or null value 1–1000000000
kind required string one of payment, adjustment_credit, adjustment_debit, reversal
method required string one of cash, check, external, other, none
occurred_on required string (date)
party required string one of patient, insurer, other
reason required string length 1–1000
reference required string length 0–200
copay_receipt_id string (uuid) Server-assigned source receipt for an automatic appointment copay allocation.
request_id string (uuid)
reverses_id string or null
created_at required string (date-time)
effect_cents required integer value -1000000000–1000000000
id required string (uuid)
kind required string one of payment, adjustment_credit, adjustment_debit, reversal
reverses_id required string or null
payment_policy required string length 0–500
Example response placeholder values
{
  "accounts": [
    {
      "content": {
        "coverage_id": "00000000-0000-4000-8000-000000000000",
        "currency": "USD",
        "lines": [],
        "notes": "string",
        "service_date": "2026-01-15",
        "visit_id": "00000000-0000-4000-8000-000000000000",
        "fee_context": {
          "facility_id": null,
          "setting": "facility"
        }
      },
      "coverage_snapshot": {},
      "id": "00000000-0000-4000-8000-000000000000",
      "patient_id": "00000000-0000-4000-8000-000000000000",
      "source_history_id": "00000000-0000-4000-8000-000000000000",
      "status": "draft",
      "total_cents": 1,
      "version": 1
    }
  ],
  "claims_policy": "string",
  "copays": [
    {
      "account_ids": [
        "00000000-0000-4000-8000-000000000000"
      ],
      "actor_id": "00000000-0000-4000-8000-000000000000",
      "allocated_cents": 0,
      "amount_cents": 1,
      "appointment_id": "00000000-0000-4000-8000-000000000000",
      "created_at": "2026-01-15T15:30:00Z",
      "id": "00000000-0000-4000-8000-000000000000",
      "method": "cash",
      "occurred_on": "2026-01-15",
      "patient_id": "00000000-0000-4000-8000-000000000000",
      "reference": "string",
      "reversed_cents": 0,
      "voided": true
    }
  ],
  "coverages": [
    {
      "content": {
        "copay_cents": 0,
        "effective_date": "2026-01-15",
        "end_date": "2026-01-15",
        "group_number": "string",
        "member_id": "string",
        "notes": "string",
        "payer_id": "00000000-0000-4000-8000-000000000000",
        "plan_name": "string",
        "priority": "primary",
        "relationship": "self",
        "status": "active",
        "subscriber_birth_date": "2026-01-15",
        "subscriber_name": "string",
        "verification": "unverified"
      },
      "id": "00000000-0000-4000-8000-000000000000",
      "source_history_id": "00000000-0000-4000-8000-000000000000",
      "version": 1
    }
  ],
  "currency": "USD",
  "entries": [
    {
      "account_id": "00000000-0000-4000-8000-000000000000",
      "actor_id": "00000000-0000-4000-8000-000000000000",
      "content": {
        "amount_cents": 1,
        "kind": "payment",
        "method": "cash",
        "occurred_on": "2026-01-15",
        "party": "patient",
        "reason": "string",
        "reference": "string",
        "copay_receipt_id": "00000000-0000-4000-8000-000000000000"
      },
      "created_at": "2026-01-15T15:30:00Z",
      "effect_cents": -1000000000,
      "id": "00000000-0000-4000-8000-000000000000",
      "kind": "payment",
      "reverses_id": "00000000-0000-4000-8000-000000000000"
    }
  ],
  "payment_policy": "string"
}
400 Invalid mapping or values
401 Sign in required
403 Role or billing scope denied
404 Tenant/patient scoped record not found
409 Stale version, duplicate source, conflicting coverage or balance
428 Current quoted If-Match required
500 Database/audit failure; no partial mutation committed

Example call

curl "$EHR_URL/api/v1/patients/{p}/billing" -H "Authorization: Bearer $ACCESS_TOKEN"

# Create billing account

POST /api/v1/patients/{p}/billing/accounts

Draft linked to native visit or reviewed billing history; one nonvoid account per native visit. Charge amounts are complete line totals.

Access OAuth 2.0 access tokenbilling.write

Parameters

Name In Type Details
p required path string (uuid)

Request body application/json · required

Fields NewBillingAccount · 39
Field Type Details
content required BillingAccountContent
coverage_id required string or null
currency required string one of USD
lines required array of ChargeLine items 1–100
amount_cents required integer Complete USD line total for the stated units; never multiplied by units again value 1–100000000
code required string Local code unless catalog_release_id is supplied. Canonical CPT syntax: ^[0-9]{4}[0-9FTUM]$; HCPCS: ^[A-Z][0-9]{4}$. Syntax alone does not establish catalog assignment or coverage. length 1–100
code_system required string length 1–100
description required string Nonblank, at most 10000 UTF-8 bytes. A selected catalog supplies the publisher description. length 1–10000
diagnosis_codes required array of string items ≤ 12
modifiers required string length 0–100
units required integer value 1–1000
catalog_release_id string or null Optional tenant-owned catalog release. The server resolves the code and requires it to be active and billable for the service date. Only CPT or HCPCS; code_system must exactly match the selected catalog. Uses the billing account service_date.
catalog_snapshot TerminologySelectionSnapshot Canonical catalog entry. Effective dates are the intersection of release and code dates. Syntax alone does not establish assignment, billability, coverage or licensing. ICD-10-CM permits an alphanumeric second character, including FY2027 QA0 codes; CPT supports numeric, F, T, U and M suffixes.
active required boolean
billable required boolean
code required string length ≤ 8
display required string Publisher description, bounded to 10000 UTF-8 bytes.
edition required string
effective_end required string or null
effective_start required string (date)
metadata required object Publisher metadata, at most 4096 serialized UTF-8 bytes.
release_id required string (uuid)
service_date required string (date)
short_display required string or null
source_name required string
source_sha256 required string pattern ^[0-9a-f]{64}$
source_url required string (uri)
system required string one of ICD-10-CM, ICD-10-PCS, HCPCS, CPT
fee_entry_key string or null Canonical system:code:exact-modifiers key returned by the quote.
fee_override_reason string or null Required when an approved fee line amount differs from unit fee times units. length ≤ 1000
fee_schedule_id string or null
fee_snapshot PracticeFeeSnapshot Server-generated immutable approved fee evidence. Includes schedule_id, entry_key, unit_amount_cents, expected_line_amount_cents, actual_line_amount_cents, units, service_date, context, approved schedule scope/source metadata, source entry, override_reason and recorded_by. Unchanged saved line evidence survives retirement and directory changes. Supplied client snapshots are discarded.
notes required string length 0–2000
service_date required string (date)
visit_id required string or null
fee_context PracticeFeeContext or null Optional once-per-account fee context; provider is derived from the linked visit. Required for newly selected approved fee lines.
reason required string length 1–1000
request_id required string (uuid)
source_history_id string or null
Example request body placeholder values
{
  "content": {
    "coverage_id": "00000000-0000-4000-8000-000000000000",
    "currency": "USD",
    "lines": [
      {
        "amount_cents": 1,
        "code": "string",
        "code_system": "string",
        "description": "string",
        "diagnosis_codes": [],
        "modifiers": "string",
        "units": 1,
        "catalog_release_id": "00000000-0000-4000-8000-000000000000"
      }
    ],
    "notes": "string",
    "service_date": "2026-01-15",
    "visit_id": "00000000-0000-4000-8000-000000000000",
    "fee_context": {
      "facility_id": "00000000-0000-4000-8000-000000000000",
      "setting": "facility"
    }
  },
  "reason": "string",
  "request_id": "00000000-0000-4000-8000-000000000000",
  "source_history_id": "00000000-0000-4000-8000-000000000000"
}

Responses

200 Success application/json
Fields BillingAccount · 44
Field Type Details
content required BillingAccountContent
coverage_id required string or null
currency required string one of USD
lines required array of ChargeLine items 1–100
amount_cents required integer Complete USD line total for the stated units; never multiplied by units again value 1–100000000
code required string Local code unless catalog_release_id is supplied. Canonical CPT syntax: ^[0-9]{4}[0-9FTUM]$; HCPCS: ^[A-Z][0-9]{4}$. Syntax alone does not establish catalog assignment or coverage. length 1–100
code_system required string length 1–100
description required string Nonblank, at most 10000 UTF-8 bytes. A selected catalog supplies the publisher description. length 1–10000
diagnosis_codes required array of string items ≤ 12
modifiers required string length 0–100
units required integer value 1–1000
catalog_release_id string or null Optional tenant-owned catalog release. The server resolves the code and requires it to be active and billable for the service date. Only CPT or HCPCS; code_system must exactly match the selected catalog. Uses the billing account service_date.
catalog_snapshot TerminologySelectionSnapshot Canonical catalog entry. Effective dates are the intersection of release and code dates. Syntax alone does not establish assignment, billability, coverage or licensing. ICD-10-CM permits an alphanumeric second character, including FY2027 QA0 codes; CPT supports numeric, F, T, U and M suffixes.
active required boolean
billable required boolean
code required string length ≤ 8
display required string Publisher description, bounded to 10000 UTF-8 bytes.
edition required string
effective_end required string or null
effective_start required string (date)
metadata required object Publisher metadata, at most 4096 serialized UTF-8 bytes.
release_id required string (uuid)
service_date required string (date)
short_display required string or null
source_name required string
source_sha256 required string pattern ^[0-9a-f]{64}$
source_url required string (uri)
system required string one of ICD-10-CM, ICD-10-PCS, HCPCS, CPT
fee_entry_key string or null Canonical system:code:exact-modifiers key returned by the quote.
fee_override_reason string or null Required when an approved fee line amount differs from unit fee times units. length ≤ 1000
fee_schedule_id string or null
fee_snapshot PracticeFeeSnapshot Server-generated immutable approved fee evidence. Includes schedule_id, entry_key, unit_amount_cents, expected_line_amount_cents, actual_line_amount_cents, units, service_date, context, approved schedule scope/source metadata, source entry, override_reason and recorded_by. Unchanged saved line evidence survives retirement and directory changes. Supplied client snapshots are discarded.
notes required string length 0–2000
service_date required string (date)
visit_id required string or null
fee_context PracticeFeeContext or null Optional once-per-account fee context; provider is derived from the linked visit. Required for newly selected approved fee lines.
coverage_snapshot required object or null Frozen payer and policy versions captured at local posting; no eligibility assertion
id required string (uuid)
patient_id required string (uuid)
source_history_id required string or null
status required string one of draft, posted, void
total_cents required integer value 1–1000000000
version required integer value ≥ 1
diagnosis_snapshot AccountDiagnosisSnapshot or null
Example response placeholder values
{
  "content": {
    "coverage_id": "00000000-0000-4000-8000-000000000000",
    "currency": "USD",
    "lines": [
      {
        "amount_cents": 1,
        "code": "string",
        "code_system": "string",
        "description": "string",
        "diagnosis_codes": [],
        "modifiers": "string",
        "units": 1,
        "catalog_release_id": "00000000-0000-4000-8000-000000000000"
      }
    ],
    "notes": "string",
    "service_date": "2026-01-15",
    "visit_id": "00000000-0000-4000-8000-000000000000",
    "fee_context": {
      "facility_id": "00000000-0000-4000-8000-000000000000",
      "setting": "facility"
    }
  },
  "coverage_snapshot": {},
  "id": "00000000-0000-4000-8000-000000000000",
  "patient_id": "00000000-0000-4000-8000-000000000000",
  "source_history_id": "00000000-0000-4000-8000-000000000000",
  "status": "draft",
  "total_cents": 1,
  "version": 1
}
400 Invalid mapping or values
401 Sign in required
403 Role or billing scope denied
404 Tenant/patient scoped record not found
409 Stale version, duplicate source, conflicting coverage or balance
428 Current quoted If-Match required
500 Database/audit failure; no partial mutation committed

Example call

curl -X POST "$EHR_URL/api/v1/patients/{p}/billing/accounts" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Create claim

POST /api/v1/patients/{p}/billing/accounts/{account}/claims

Create idempotent draft from a posted insured account. Optional source history must belong to this patient. Replacement/void request requires an eligible parent and reviewed payer control. A corrected original may link a rejected parent with no payer control number; no payer ID is fabricated.

Access OAuth 2.0 access tokenbilling.write

Parameters

Name In Type Details
p required path string (uuid)
account required path string (uuid)
If-Match required header string Quoted current account version for claim creation; current claim or remittance version for subsequent mutations

Request body application/json · required

Fields NewClaim · 42
Field Type Details
content required ClaimContent
billing_address required string length ≤ 1000
billing_npi required string length ≤ 10
billing_provider_name required string length ≤ 200
diagnosis_codes required array of string items ≤ 12
external_control_number required string length ≤ 100
line_diagnosis_pointers required array of array of integer items ≤ 100
notes required string length ≤ 2000
patient_address required string length ≤ 1000
place_of_service required string length ≤ 2
rendering_npi required string length ≤ 10
subscriber_address required string length ≤ 1000
subscriber_birth_date required string or null
tax_id required string length ≤ 9
frequency required any one of original, replacement, void_request
reason required string length 1–1000
request_id required string (uuid)
coordination SecondaryCoordinationRequest Explicit original secondary preparation on the same posted account. parent_id identifies its adjudicated primary claim. Requires current native delivered primary details and active posted primary ERA (CLP1; CLP19 crossover refused), same services, active effective secondary coverage and reviewed paid units/crossover/payer timing. No ledger mutation. Corrections inherit frozen coordination from the secondary parent.
coverage_id required string (uuid)
coverage_version required integer value ≥ 1
crossover_reference required string length 1–1000
not_forwarded_confirmed required constant always true
paid_units required array of integer items 1–100
payer_timing_reviewed required constant always true
primary_claim_version required integer value ≥ 1
remittance_id required string (uuid)
remittance_version required integer value ≥ 1
row_index required integer value ≥ 0
crossover CrossoverTrackingRequest Reviewed received-secondary835 crossover linkage, mutually exclusive with coordination and source_history_id; frequency original, parent_id exact adjudicated primary. Requires current posted primary CLP19 and delivered primary details, current effective secondary coverage, and a staged/reconciled unbound original835 with exact payer, N1 PE XX billing NPI, original control, payer claim number, DTM472 service date, ordered service controls/codes/modifiers/charges and balanced paid/CAS. Secondary CLP2/20/4 supported. Creates tracking-only submitted record with frozen source evidence and external-control alias, never an outbound submission or ledger posting. Existing active same-payer originals and active source bindings block duplicates.
coverage_id required string (uuid)
coverage_version required integer value ≥ 1
linkage_confirmed required constant always true
linkage_reference required string length 1–1000
primary_claim_version required integer value ≥ 1
primary_remittance_id required string (uuid)
primary_remittance_version required integer value ≥ 1
primary_row_index required integer value ≥ 0
secondary_remittance_id required string (uuid)
secondary_remittance_version required integer value ≥ 1
secondary_row_index required integer value ≥ 0
parent_id string or null
source_history_id string or null
Example request body placeholder values
{
  "content": {
    "billing_address": "string",
    "billing_npi": "string",
    "billing_provider_name": "string",
    "diagnosis_codes": [
      "string"
    ],
    "external_control_number": "string",
    "line_diagnosis_pointers": [
      [
        1
      ]
    ],
    "notes": "string",
    "patient_address": "string",
    "place_of_service": "string",
    "rendering_npi": "string",
    "subscriber_address": "string",
    "subscriber_birth_date": "2026-01-15",
    "tax_id": "string"
  },
  "frequency": "original",
  "reason": "string",
  "request_id": "00000000-0000-4000-8000-000000000000",
  "coordination": {
    "coverage_id": "00000000-0000-4000-8000-000000000000",
    "coverage_version": 1,
    "crossover_reference": "string",
    "not_forwarded_confirmed": true,
    "paid_units": [
      1
    ],
    "payer_timing_reviewed": true,
    "primary_claim_version": 1,
    "remittance_id": "00000000-0000-4000-8000-000000000000",
    "remittance_version": 1,
    "row_index": 0
  },
  "crossover": {
    "coverage_id": "00000000-0000-4000-8000-000000000000",
    "coverage_version": 1,
    "linkage_confirmed": true,
    "linkage_reference": "string",
    "primary_claim_version": 1,
    "primary_remittance_id": "00000000-0000-4000-8000-000000000000",
    "primary_remittance_version": 1,
    "primary_row_index": 0,
    "secondary_remittance_id": "00000000-0000-4000-8000-000000000000",
    "secondary_remittance_version": 1,
    "secondary_row_index": 0
  },
  "parent_id": "00000000-0000-4000-8000-000000000000",
  "source_history_id": "00000000-0000-4000-8000-000000000000"
}

Responses

200 Success application/json
Fields Claim · 46
Field Type Details
account_id required string (uuid)
content required ClaimContent
billing_address required string length ≤ 1000
billing_npi required string length ≤ 10
billing_provider_name required string length ≤ 200
diagnosis_codes required array of string items ≤ 12
external_control_number required string length ≤ 100
line_diagnosis_pointers required array of array of integer items ≤ 100
notes required string length ≤ 2000
patient_address required string length ≤ 1000
place_of_service required string length ≤ 2
rendering_npi required string length ≤ 10
subscriber_address required string length ≤ 1000
subscriber_birth_date required string or null
tax_id required string length ≤ 9
control_number required string length ≤ 100
frequency required any one of original, replacement, void_request
id required string (uuid)
parent_id required string or null
patient_id required string (uuid)
payer_control_number required string length ≤ 150
payer_id required string (uuid)
snapshot required object
account required BillingAccount
content required BillingAccountContent
coverage_id required string or null
currency required string one of USD
lines required array of ChargeLine items 1–100
notes required string length 0–2000
service_date required string (date)
visit_id required string or null
fee_context PracticeFeeContext or null Optional once-per-account fee context; provider is derived from the linked visit. Required for newly selected approved fee lines.
coverage_snapshot required object or null Frozen payer and policy versions captured at local posting; no eligibility assertion
id required string (uuid)
patient_id required string (uuid)
source_history_id required string or null
status required string one of draft, posted, void
total_cents required integer value 1–1000000000
version required integer value ≥ 1
diagnosis_snapshot AccountDiagnosisSnapshot or null
patient required object Frozen patient demographic evidence
coordination_of_benefits object Frozen primary coverage/details/adjudication/source, reviewed paid units and previously posted primary credits. Optional crossover object binds received secondary remittance id/version/row/hash, payee NPI, trace/date and row evidence. Presence of crossover makes the claim tracking-only with no packet, CMS1500, 837 or delivery.
financial_summary object Ledger totals frozen at claim creation, including combined account balance; not an automatic patient responsibility determination.
source_history_id required string or null
status required any For received crossover tracking, submitted means received secondary response linked for review; no outbound delivery is implied. Adjudicated follows reviewed ERA posting; void may follow reviewed withdrawal. one of draft, ready, submitted, accepted, rejected, adjudicated, void
version required integer value ≥ 1
Example response placeholder values
{
  "account_id": "00000000-0000-4000-8000-000000000000",
  "content": {
    "billing_address": "string",
    "billing_npi": "string",
    "billing_provider_name": "string",
    "diagnosis_codes": [
      "string"
    ],
    "external_control_number": "string",
    "line_diagnosis_pointers": [
      [
        1
      ]
    ],
    "notes": "string",
    "patient_address": "string",
    "place_of_service": "string",
    "rendering_npi": "string",
    "subscriber_address": "string",
    "subscriber_birth_date": "2026-01-15",
    "tax_id": "string"
  },
  "control_number": "string",
  "frequency": "original",
  "id": "00000000-0000-4000-8000-000000000000",
  "parent_id": "00000000-0000-4000-8000-000000000000",
  "patient_id": "00000000-0000-4000-8000-000000000000",
  "payer_control_number": "string",
  "payer_id": "00000000-0000-4000-8000-000000000000",
  "snapshot": {
    "account": {
      "content": {
        "coverage_id": "00000000-0000-4000-8000-000000000000",
        "currency": "USD",
        "lines": [],
        "notes": "string",
        "service_date": "2026-01-15",
        "visit_id": "00000000-0000-4000-8000-000000000000",
        "fee_context": {
          "facility_id": null,
          "setting": "facility"
        }
      },
      "coverage_snapshot": {},
      "id": "00000000-0000-4000-8000-000000000000",
      "patient_id": "00000000-0000-4000-8000-000000000000",
      "source_history_id": "00000000-0000-4000-8000-000000000000",
      "status": "draft",
      "total_cents": 1,
      "version": 1
    },
    "patient": {},
    "coordination_of_benefits": {},
    "financial_summary": {}
  },
  "source_history_id": "00000000-0000-4000-8000-000000000000",
  "status": "draft",
  "version": 1
}
400 Invalid values or unsupported shape
401 Sign in required
403 Role or billing scope denied
404 Tenant/patient scoped record not found
409 Stale review, duplicate evidence, incompatible lifecycle or unsafe balance
428 Current quoted If-Match required
500 Database/audit failure; transaction rolled back

Example call

curl -X POST "$EHR_URL/api/v1/patients/{p}/billing/accounts/{account}/claims" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Edit billing account

PUT /api/v1/patients/{p}/billing/accounts/{id}

Edit current draft only. Server recomputes totals and validates patient/visit/coverage links.

Access OAuth 2.0 access tokenbilling.write

Parameters

Name In Type Details
p required path string (uuid)
id required path string (uuid)
If-Match required header string Quoted current resource version

Request body application/json · required

Fields EditBillingAccount · 37
Field Type Details
content required BillingAccountContent
coverage_id required string or null
currency required string one of USD
lines required array of ChargeLine items 1–100
amount_cents required integer Complete USD line total for the stated units; never multiplied by units again value 1–100000000
code required string Local code unless catalog_release_id is supplied. Canonical CPT syntax: ^[0-9]{4}[0-9FTUM]$; HCPCS: ^[A-Z][0-9]{4}$. Syntax alone does not establish catalog assignment or coverage. length 1–100
code_system required string length 1–100
description required string Nonblank, at most 10000 UTF-8 bytes. A selected catalog supplies the publisher description. length 1–10000
diagnosis_codes required array of string items ≤ 12
modifiers required string length 0–100
units required integer value 1–1000
catalog_release_id string or null Optional tenant-owned catalog release. The server resolves the code and requires it to be active and billable for the service date. Only CPT or HCPCS; code_system must exactly match the selected catalog. Uses the billing account service_date.
catalog_snapshot TerminologySelectionSnapshot Canonical catalog entry. Effective dates are the intersection of release and code dates. Syntax alone does not establish assignment, billability, coverage or licensing. ICD-10-CM permits an alphanumeric second character, including FY2027 QA0 codes; CPT supports numeric, F, T, U and M suffixes.
active required boolean
billable required boolean
code required string length ≤ 8
display required string Publisher description, bounded to 10000 UTF-8 bytes.
edition required string
effective_end required string or null
effective_start required string (date)
metadata required object Publisher metadata, at most 4096 serialized UTF-8 bytes.
release_id required string (uuid)
service_date required string (date)
short_display required string or null
source_name required string
source_sha256 required string pattern ^[0-9a-f]{64}$
source_url required string (uri)
system required string one of ICD-10-CM, ICD-10-PCS, HCPCS, CPT
fee_entry_key string or null Canonical system:code:exact-modifiers key returned by the quote.
fee_override_reason string or null Required when an approved fee line amount differs from unit fee times units. length ≤ 1000
fee_schedule_id string or null
fee_snapshot PracticeFeeSnapshot Server-generated immutable approved fee evidence. Includes schedule_id, entry_key, unit_amount_cents, expected_line_amount_cents, actual_line_amount_cents, units, service_date, context, approved schedule scope/source metadata, source entry, override_reason and recorded_by. Unchanged saved line evidence survives retirement and directory changes. Supplied client snapshots are discarded.
notes required string length 0–2000
service_date required string (date)
visit_id required string or null
fee_context PracticeFeeContext or null Optional once-per-account fee context; provider is derived from the linked visit. Required for newly selected approved fee lines.
reason required string length 1–1000
Example request body placeholder values
{
  "content": {
    "coverage_id": "00000000-0000-4000-8000-000000000000",
    "currency": "USD",
    "lines": [
      {
        "amount_cents": 1,
        "code": "string",
        "code_system": "string",
        "description": "string",
        "diagnosis_codes": [],
        "modifiers": "string",
        "units": 1,
        "catalog_release_id": "00000000-0000-4000-8000-000000000000"
      }
    ],
    "notes": "string",
    "service_date": "2026-01-15",
    "visit_id": "00000000-0000-4000-8000-000000000000",
    "fee_context": {
      "facility_id": "00000000-0000-4000-8000-000000000000",
      "setting": "facility"
    }
  },
  "reason": "string"
}

Responses

200 Success application/json
Fields BillingAccount · 44
Field Type Details
content required BillingAccountContent
coverage_id required string or null
currency required string one of USD
lines required array of ChargeLine items 1–100
amount_cents required integer Complete USD line total for the stated units; never multiplied by units again value 1–100000000
code required string Local code unless catalog_release_id is supplied. Canonical CPT syntax: ^[0-9]{4}[0-9FTUM]$; HCPCS: ^[A-Z][0-9]{4}$. Syntax alone does not establish catalog assignment or coverage. length 1–100
code_system required string length 1–100
description required string Nonblank, at most 10000 UTF-8 bytes. A selected catalog supplies the publisher description. length 1–10000
diagnosis_codes required array of string items ≤ 12
modifiers required string length 0–100
units required integer value 1–1000
catalog_release_id string or null Optional tenant-owned catalog release. The server resolves the code and requires it to be active and billable for the service date. Only CPT or HCPCS; code_system must exactly match the selected catalog. Uses the billing account service_date.
catalog_snapshot TerminologySelectionSnapshot Canonical catalog entry. Effective dates are the intersection of release and code dates. Syntax alone does not establish assignment, billability, coverage or licensing. ICD-10-CM permits an alphanumeric second character, including FY2027 QA0 codes; CPT supports numeric, F, T, U and M suffixes.
active required boolean
billable required boolean
code required string length ≤ 8
display required string Publisher description, bounded to 10000 UTF-8 bytes.
edition required string
effective_end required string or null
effective_start required string (date)
metadata required object Publisher metadata, at most 4096 serialized UTF-8 bytes.
release_id required string (uuid)
service_date required string (date)
short_display required string or null
source_name required string
source_sha256 required string pattern ^[0-9a-f]{64}$
source_url required string (uri)
system required string one of ICD-10-CM, ICD-10-PCS, HCPCS, CPT
fee_entry_key string or null Canonical system:code:exact-modifiers key returned by the quote.
fee_override_reason string or null Required when an approved fee line amount differs from unit fee times units. length ≤ 1000
fee_schedule_id string or null
fee_snapshot PracticeFeeSnapshot Server-generated immutable approved fee evidence. Includes schedule_id, entry_key, unit_amount_cents, expected_line_amount_cents, actual_line_amount_cents, units, service_date, context, approved schedule scope/source metadata, source entry, override_reason and recorded_by. Unchanged saved line evidence survives retirement and directory changes. Supplied client snapshots are discarded.
notes required string length 0–2000
service_date required string (date)
visit_id required string or null
fee_context PracticeFeeContext or null Optional once-per-account fee context; provider is derived from the linked visit. Required for newly selected approved fee lines.
coverage_snapshot required object or null Frozen payer and policy versions captured at local posting; no eligibility assertion
id required string (uuid)
patient_id required string (uuid)
source_history_id required string or null
status required string one of draft, posted, void
total_cents required integer value 1–1000000000
version required integer value ≥ 1
diagnosis_snapshot AccountDiagnosisSnapshot or null
Example response placeholder values
{
  "content": {
    "coverage_id": "00000000-0000-4000-8000-000000000000",
    "currency": "USD",
    "lines": [
      {
        "amount_cents": 1,
        "code": "string",
        "code_system": "string",
        "description": "string",
        "diagnosis_codes": [],
        "modifiers": "string",
        "units": 1,
        "catalog_release_id": "00000000-0000-4000-8000-000000000000"
      }
    ],
    "notes": "string",
    "service_date": "2026-01-15",
    "visit_id": "00000000-0000-4000-8000-000000000000",
    "fee_context": {
      "facility_id": "00000000-0000-4000-8000-000000000000",
      "setting": "facility"
    }
  },
  "coverage_snapshot": {},
  "id": "00000000-0000-4000-8000-000000000000",
  "patient_id": "00000000-0000-4000-8000-000000000000",
  "source_history_id": "00000000-0000-4000-8000-000000000000",
  "status": "draft",
  "total_cents": 1,
  "version": 1
}
400 Invalid mapping or values
401 Sign in required
403 Role or billing scope denied
404 Tenant/patient scoped record not found
409 Stale version, duplicate source, conflicting coverage or balance
428 Current quoted If-Match required
500 Database/audit failure; no partial mutation committed

Example call

curl -X PUT "$EHR_URL/api/v1/patients/{p}/billing/accounts/{id}" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Billing account action

POST /api/v1/patients/{p}/billing/accounts/{id}/actions

Post or void draft. Posting native visit billing requires a signed visit, validates coverage dates and freezes charge/payer/policy versions. Posting is local accounting only.

Access OAuth 2.0 access tokenbilling.write

Parameters

Name In Type Details
p required path string (uuid)
id required path string (uuid)
If-Match required header string Quoted current resource version

Request body application/json · required

Fields BillingAction · 2
Field Type Details
action required string one of post, void
reason required string length 1–1000
Example request body placeholder values
{
  "action": "post",
  "reason": "string"
}

Responses

200 Success application/json
Fields BillingAccount · 44
Field Type Details
content required BillingAccountContent
coverage_id required string or null
currency required string one of USD
lines required array of ChargeLine items 1–100
amount_cents required integer Complete USD line total for the stated units; never multiplied by units again value 1–100000000
code required string Local code unless catalog_release_id is supplied. Canonical CPT syntax: ^[0-9]{4}[0-9FTUM]$; HCPCS: ^[A-Z][0-9]{4}$. Syntax alone does not establish catalog assignment or coverage. length 1–100
code_system required string length 1–100
description required string Nonblank, at most 10000 UTF-8 bytes. A selected catalog supplies the publisher description. length 1–10000
diagnosis_codes required array of string items ≤ 12
modifiers required string length 0–100
units required integer value 1–1000
catalog_release_id string or null Optional tenant-owned catalog release. The server resolves the code and requires it to be active and billable for the service date. Only CPT or HCPCS; code_system must exactly match the selected catalog. Uses the billing account service_date.
catalog_snapshot TerminologySelectionSnapshot Canonical catalog entry. Effective dates are the intersection of release and code dates. Syntax alone does not establish assignment, billability, coverage or licensing. ICD-10-CM permits an alphanumeric second character, including FY2027 QA0 codes; CPT supports numeric, F, T, U and M suffixes.
active required boolean
billable required boolean
code required string length ≤ 8
display required string Publisher description, bounded to 10000 UTF-8 bytes.
edition required string
effective_end required string or null
effective_start required string (date)
metadata required object Publisher metadata, at most 4096 serialized UTF-8 bytes.
release_id required string (uuid)
service_date required string (date)
short_display required string or null
source_name required string
source_sha256 required string pattern ^[0-9a-f]{64}$
source_url required string (uri)
system required string one of ICD-10-CM, ICD-10-PCS, HCPCS, CPT
fee_entry_key string or null Canonical system:code:exact-modifiers key returned by the quote.
fee_override_reason string or null Required when an approved fee line amount differs from unit fee times units. length ≤ 1000
fee_schedule_id string or null
fee_snapshot PracticeFeeSnapshot Server-generated immutable approved fee evidence. Includes schedule_id, entry_key, unit_amount_cents, expected_line_amount_cents, actual_line_amount_cents, units, service_date, context, approved schedule scope/source metadata, source entry, override_reason and recorded_by. Unchanged saved line evidence survives retirement and directory changes. Supplied client snapshots are discarded.
notes required string length 0–2000
service_date required string (date)
visit_id required string or null
fee_context PracticeFeeContext or null Optional once-per-account fee context; provider is derived from the linked visit. Required for newly selected approved fee lines.
coverage_snapshot required object or null Frozen payer and policy versions captured at local posting; no eligibility assertion
id required string (uuid)
patient_id required string (uuid)
source_history_id required string or null
status required string one of draft, posted, void
total_cents required integer value 1–1000000000
version required integer value ≥ 1
diagnosis_snapshot AccountDiagnosisSnapshot or null
Example response placeholder values
{
  "content": {
    "coverage_id": "00000000-0000-4000-8000-000000000000",
    "currency": "USD",
    "lines": [
      {
        "amount_cents": 1,
        "code": "string",
        "code_system": "string",
        "description": "string",
        "diagnosis_codes": [],
        "modifiers": "string",
        "units": 1,
        "catalog_release_id": "00000000-0000-4000-8000-000000000000"
      }
    ],
    "notes": "string",
    "service_date": "2026-01-15",
    "visit_id": "00000000-0000-4000-8000-000000000000",
    "fee_context": {
      "facility_id": "00000000-0000-4000-8000-000000000000",
      "setting": "facility"
    }
  },
  "coverage_snapshot": {},
  "id": "00000000-0000-4000-8000-000000000000",
  "patient_id": "00000000-0000-4000-8000-000000000000",
  "source_history_id": "00000000-0000-4000-8000-000000000000",
  "status": "draft",
  "total_cents": 1,
  "version": 1
}
400 Invalid mapping or values
401 Sign in required
403 Role or billing scope denied
404 Tenant/patient scoped record not found
409 Stale version, duplicate source, conflicting coverage or balance
428 Current quoted If-Match required
500 Database/audit failure; no partial mutation committed

Example call

curl -X POST "$EHR_URL/api/v1/patients/{p}/billing/accounts/{id}/actions" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Apply available appointment copay credit

POST /api/v1/patients/{p}/billing/accounts/{id}/copays/apply

Billing-write staff and current posted account version required. Only unvoided, unreversed receipts for the account encounter appointment apply. Allocation is bounded by the remaining account balance after pending processor reservations. Already allocated cents are never applied twice; any ledger reversal excludes the receipt from automatic reuse. Positive allocation advances the account version. No external funds move.

Access OAuth 2.0 access tokenbilling.write

Parameters

Name In Type Details
p required path string (uuid)
id required path string (uuid)
If-Match required header string Quoted current posted account version.

Responses

200 Success application/json
Fields object · 1
Field Type Details
applied_cents required integer value ≥ 0
Example response placeholder values
{
  "applied_cents": 0
}
400 Invalid values or unsupported shape
401 Sign in required
403 Role or billing scope denied
404 Tenant/patient scoped record not found
409 Stale review, duplicate evidence, incompatible lifecycle or unsafe balance
428 Current quoted If-Match required
500 Database/audit failure; transaction rolled back

Example call

curl -X POST "$EHR_URL/api/v1/patients/{p}/billing/accounts/{id}/copays/apply" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Record billing entry

POST /api/v1/patients/{p}/billing/accounts/{id}/entries

Record manual payment/credit/debit/reversal against current posted account. No funds move. Exact request_id retries return the original entry despite the old version; conflicting reuse fails. Reversal amount is derived from one unreversed original. Reject overpayment/negative balance. Insurer payments require frozen coverage.

Access OAuth 2.0 access tokenbilling.write

Parameters

Name In Type Details
p required path string (uuid)
id required path string (uuid)
If-Match required header string Quoted current resource version

Request body application/json · required

Fields NewBillingEntry · 9
Field Type Details
amount_cents required integer or null value 1–1000000000
kind required string one of payment, adjustment_credit, adjustment_debit, reversal
method required string one of cash, check, external, other, none
occurred_on required string (date)
party required string one of patient, insurer, other
reason required string length 1–1000
reference required string length 0–200
request_id required string (uuid)
reverses_id required string or null
Example request body placeholder values
{
  "amount_cents": 1,
  "kind": "payment",
  "method": "cash",
  "occurred_on": "2026-01-15",
  "party": "patient",
  "reason": "string",
  "reference": "string",
  "request_id": "00000000-0000-4000-8000-000000000000",
  "reverses_id": "00000000-0000-4000-8000-000000000000"
}

Responses

200 Success application/json
Fields object · 31
Field Type Details
account required BillingAccount
content required BillingAccountContent
coverage_id required string or null
currency required string one of USD
lines required array of ChargeLine items 1–100
amount_cents required integer Complete USD line total for the stated units; never multiplied by units again value 1–100000000
code required string Local code unless catalog_release_id is supplied. Canonical CPT syntax: ^[0-9]{4}[0-9FTUM]$; HCPCS: ^[A-Z][0-9]{4}$. Syntax alone does not establish catalog assignment or coverage. length 1–100
code_system required string length 1–100
description required string Nonblank, at most 10000 UTF-8 bytes. A selected catalog supplies the publisher description. length 1–10000
diagnosis_codes required array of string items ≤ 12
modifiers required string length 0–100
units required integer value 1–1000
catalog_release_id string or null Optional tenant-owned catalog release. The server resolves the code and requires it to be active and billable for the service date. Only CPT or HCPCS; code_system must exactly match the selected catalog. Uses the billing account service_date.
catalog_snapshot TerminologySelectionSnapshot Canonical catalog entry. Effective dates are the intersection of release and code dates. Syntax alone does not establish assignment, billability, coverage or licensing. ICD-10-CM permits an alphanumeric second character, including FY2027 QA0 codes; CPT supports numeric, F, T, U and M suffixes.
fee_entry_key string or null Canonical system:code:exact-modifiers key returned by the quote.
fee_override_reason string or null Required when an approved fee line amount differs from unit fee times units. length ≤ 1000
fee_schedule_id string or null
fee_snapshot PracticeFeeSnapshot Server-generated immutable approved fee evidence. Includes schedule_id, entry_key, unit_amount_cents, expected_line_amount_cents, actual_line_amount_cents, units, service_date, context, approved schedule scope/source metadata, source entry, override_reason and recorded_by. Unchanged saved line evidence survives retirement and directory changes. Supplied client snapshots are discarded.
notes required string length 0–2000
service_date required string (date)
visit_id required string or null
fee_context PracticeFeeContext or null Optional once-per-account fee context; provider is derived from the linked visit. Required for newly selected approved fee lines.
coverage_snapshot required object or null Frozen payer and policy versions captured at local posting; no eligibility assertion
id required string (uuid)
patient_id required string (uuid)
source_history_id required string or null
status required string one of draft, posted, void
total_cents required integer value 1–1000000000
version required integer value ≥ 1
diagnosis_snapshot AccountDiagnosisSnapshot or null
id required string (uuid)
Example response placeholder values
{
  "account": {
    "content": {
      "coverage_id": "00000000-0000-4000-8000-000000000000",
      "currency": "USD",
      "lines": [
        {
          "amount_cents": null,
          "code": null,
          "code_system": null,
          "description": null,
          "diagnosis_codes": null,
          "modifiers": null,
          "units": null,
          "catalog_release_id": null
        }
      ],
      "notes": "string",
      "service_date": "2026-01-15",
      "visit_id": "00000000-0000-4000-8000-000000000000",
      "fee_context": {
        "facility_id": "00000000-0000-4000-8000-000000000000",
        "setting": "facility"
      }
    },
    "coverage_snapshot": {},
    "id": "00000000-0000-4000-8000-000000000000",
    "patient_id": "00000000-0000-4000-8000-000000000000",
    "source_history_id": "00000000-0000-4000-8000-000000000000",
    "status": "draft",
    "total_cents": 1,
    "version": 1
  },
  "id": "00000000-0000-4000-8000-000000000000"
}
400 Invalid mapping or values
401 Sign in required
403 Role or billing scope denied
404 Tenant/patient scoped record not found
409 Stale version, duplicate source, conflicting coverage or balance
428 Current quoted If-Match required
500 Database/audit failure; no partial mutation committed

Example call

curl -X POST "$EHR_URL/api/v1/patients/{p}/billing/accounts/{id}/entries" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Billing account history

GET /api/v1/patients/{p}/billing/accounts/{id}/history

Append-only account versions, including ledger changes.

Access OAuth 2.0 access tokenbilling.read

Parameters

Name In Type Details
p required path string (uuid)
id required path string (uuid)

Responses

200 Success application/json
Fields BillingHistory · 6
Field Type Details
items required array of object
actor_id required string (uuid)
created_at required string (date-time)
reason required string length 1–1000
snapshot required object
version required integer
Example response placeholder values
{
  "items": [
    {
      "actor_id": "00000000-0000-4000-8000-000000000000",
      "created_at": "2026-01-15T15:30:00Z",
      "reason": "string",
      "snapshot": {},
      "version": 1
    }
  ]
}
400 Invalid mapping or values
401 Sign in required
403 Role or billing scope denied
404 Tenant/patient scoped record not found
409 Stale version, duplicate source, conflicting coverage or balance
428 Current quoted If-Match required
500 Database/audit failure; no partial mutation committed

Example call

curl "$EHR_URL/api/v1/patients/{p}/billing/accounts/{id}/history" -H "Authorization: Bearer $ACCESS_TOKEN"

# List immutable patient invoice snapshots for a tenant-scoped account

GET /api/v1/patients/{p}/billing/accounts/{id}/invoices

Access OAuth 2.0 access tokenbilling.read

Parameters

Name In Type Details
p required path string (uuid)
id required path string (uuid)

Responses

200 Up to 100 immutable snapshots; old snapshots retain their original shape application/json
Fields object · 41
Field Type Details
items required array of PatientInvoice items ≤ 100
account_id required string (uuid)
account_version required integer
actor_id required string (uuid)
created_at required string (date-time)
id required string (uuid)
patient_id required string (uuid)
snapshot required PatientInvoiceSnapshot Immutable issuance snapshot. Format 2 adds itemized services, patient activity and payment/adjustment subtotals. These fields are absent in older saved snapshots; clients must show original totals with an explicit unavailable-itemization message, never rebuild old invoices from current records.
amount_due_cents required integer
credit_balance_cents required integer
currency required constant always USD
gross_charges_cents required integer
patient required object
family_name required string
given_name required string
mrn string
patient_credit_cents required integer
responsibility_cents required integer
scope required constant always at_issuance
service_date required string (date)
format_version constant always 2
patient_activity array of PatientInvoiceActivity
effect_cents integer
id string (uuid)
kind any one of payment, adjustment_credit, adjustment_debit, reversal
method string
occurred_on string (date)
reference string
reverses_id string or null
patient_adjustment_credit_cents integer
patient_payment_cents integer
practice_name string
reason string
services array of PatientInvoiceService
code required string
code_system required string
description required string
line_total_cents required integer
modifiers required string
units required integer
test_activity boolean
Example response placeholder values
{
  "items": [
    {
      "account_id": "00000000-0000-4000-8000-000000000000",
      "account_version": 1,
      "actor_id": "00000000-0000-4000-8000-000000000000",
      "created_at": "2026-01-15T15:30:00Z",
      "id": "00000000-0000-4000-8000-000000000000",
      "patient_id": "00000000-0000-4000-8000-000000000000",
      "snapshot": {
        "amount_due_cents": 1,
        "credit_balance_cents": 1,
        "currency": "USD",
        "gross_charges_cents": 1,
        "patient": {
          "family_name": null,
          "given_name": null,
          "mrn": null
        },
        "patient_credit_cents": 1,
        "responsibility_cents": 1,
        "scope": "at_issuance",
        "service_date": "2026-01-15"
      }
    }
  ]
}

Example call

curl "$EHR_URL/api/v1/patients/{p}/billing/accounts/{id}/invoices" -H "Authorization: Bearer $ACCESS_TOKEN"

# Save reviewed patient responsibility less net patient ledger credits without collecting payment

POST /api/v1/patients/{p}/billing/accounts/{id}/invoices

Billing-write staff. Requires a posted account and its current quoted If-Match. Reviewed responsibility must be between zero and gross charges, excluding insurer responsibility. Net patient ledger payments, credits, reversals and confirmed refunds determine amount due and credit balance. Freeze service lines and patient payment activity at issuance; do not recompute older snapshots. Never moves funds, emails an invoice, or submits insurance.

Access OAuth 2.0 access tokenbilling.write

Parameters

Name In Type Details
p required path string (uuid)
id required path string (uuid)
If-Match required header string

Request body application/json · required

Fields object · 3
Field Type Details
reason required string length 1–1000
request_id required string (uuid)
responsibility_cents required integer value 0–1000000000
Example request body placeholder values
{
  "reason": "string",
  "request_id": "00000000-0000-4000-8000-000000000000",
  "responsibility_cents": 0
}

Responses

200 Immutable itemized snapshot; exact retries return the original application/json
Fields PatientInvoice · 40
Field Type Details
account_id required string (uuid)
account_version required integer
actor_id required string (uuid)
created_at required string (date-time)
id required string (uuid)
patient_id required string (uuid)
snapshot required PatientInvoiceSnapshot Immutable issuance snapshot. Format 2 adds itemized services, patient activity and payment/adjustment subtotals. These fields are absent in older saved snapshots; clients must show original totals with an explicit unavailable-itemization message, never rebuild old invoices from current records.
amount_due_cents required integer
credit_balance_cents required integer
currency required constant always USD
gross_charges_cents required integer
patient required object
family_name required string
given_name required string
mrn string
patient_credit_cents required integer
responsibility_cents required integer
scope required constant always at_issuance
service_date required string (date)
format_version constant always 2
patient_activity array of PatientInvoiceActivity
effect_cents integer
id string (uuid)
kind any one of payment, adjustment_credit, adjustment_debit, reversal
method string
occurred_on string (date)
reference string
reverses_id string or null
patient_adjustment_credit_cents integer
patient_payment_cents integer
practice_name string
reason string
services array of PatientInvoiceService
code required string
code_system required string
description required string
line_total_cents required integer
modifiers required string
units required integer
test_activity boolean
Example response placeholder values
{
  "account_id": "00000000-0000-4000-8000-000000000000",
  "account_version": 1,
  "actor_id": "00000000-0000-4000-8000-000000000000",
  "created_at": "2026-01-15T15:30:00Z",
  "id": "00000000-0000-4000-8000-000000000000",
  "patient_id": "00000000-0000-4000-8000-000000000000",
  "snapshot": {
    "amount_due_cents": 1,
    "credit_balance_cents": 1,
    "currency": "USD",
    "gross_charges_cents": 1,
    "patient": {
      "family_name": "string",
      "given_name": "string",
      "mrn": "string"
    },
    "patient_credit_cents": 1,
    "responsibility_cents": 1,
    "scope": "at_issuance",
    "service_date": "2026-01-15"
  }
}
409 Account changed, unposted account, or reused request with different content

Example call

curl -X POST "$EHR_URL/api/v1/patients/{p}/billing/accounts/{id}/invoices" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Record an already received appointment copay

POST /api/v1/patients/{p}/billing/copays

Owner, clinician or front desk with billing write authority. Requires a same-patient appointment, excluding cancelled/canceled/no_show. Coverage is optional and tenant/patient scoped. Works before an encounter or posted account exists. Matching posted encounter charges receive available credit atomically; otherwise credit remains unapplied. A tenant-scoped request UUID with identical input returns the same receipt; differing input conflicts. Audited receipt and allocation commit together.

Access OAuth 2.0 access tokenbilling.write

Parameters

Name In Type Details
p required path string (uuid)

Request body application/json · required

Fields CopayReceiptInput · 9
Field Type Details
amount_cents required integer value 1–100000000
appointment_id required string (uuid)
method required string one of cash, check, external
occurred_on required string (date)
reason required string length 1–1000
received_confirmed required constant always true
reference required string length ≤ 200
request_id required string (uuid)
coverage_id string or null
Example request body placeholder values
{
  "amount_cents": 1,
  "appointment_id": "00000000-0000-4000-8000-000000000000",
  "method": "cash",
  "occurred_on": "2026-01-15",
  "reason": "string",
  "received_confirmed": true,
  "reference": "string",
  "request_id": "00000000-0000-4000-8000-000000000000"
}

Responses

200 Success application/json
Fields CopayReceipt · 22
Field Type Details
account_ids required array of string (uuid)
actor_id required string (uuid)
allocated_cents required integer value ≥ 0
amount_cents required integer
appointment_id required string (uuid)
created_at required string (date-time)
id required string (uuid)
method required any one of cash, check, external
occurred_on required string (date)
patient_id required string (uuid)
reference required string
reversed_cents required integer value ≥ 0
voided required boolean
coverage_id string or null
coverage_snapshot Coverage or null
hosted_checkout object or null Present for processor-verified hosted receipts. Manual void/reversal is rejected; verified provider refunds govern their accounting. Test receipts cannot be allocated in production.
id string (uuid)
livemode boolean
refunded_cents integer value ≥ 0
refunded_unapplied_cents integer value ≥ 0
status any one of creating, open, paid, expired, needs_review, refunded
reason string
Example response placeholder values
{
  "account_ids": [
    "00000000-0000-4000-8000-000000000000"
  ],
  "actor_id": "00000000-0000-4000-8000-000000000000",
  "allocated_cents": 0,
  "amount_cents": 1,
  "appointment_id": "00000000-0000-4000-8000-000000000000",
  "created_at": "2026-01-15T15:30:00Z",
  "id": "00000000-0000-4000-8000-000000000000",
  "method": "cash",
  "occurred_on": "2026-01-15",
  "patient_id": "00000000-0000-4000-8000-000000000000",
  "reference": "string",
  "reversed_cents": 0,
  "voided": true
}
400 Invalid values or unsupported shape
401 Sign in required
403 Role or billing scope denied
404 Tenant/patient scoped record not found
409 Stale review, duplicate evidence, incompatible lifecycle or unsafe balance
428 Current quoted If-Match required
500 Database/audit failure; transaction rolled back

Example call

curl -X POST "$EHR_URL/api/v1/patients/{p}/billing/copays" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Void an unallocated receipt record

POST /api/v1/patients/{p}/billing/copays/{id}/void

Billing-write staff. Append a void record only if the receipt has never been allocated. Repeated voids retain the original void record. Allocated receipts require ledger correction instead. This does not refund funds and never deletes the original receipt.

Access OAuth 2.0 access tokenbilling.write

Parameters

Name In Type Details
p required path string (uuid)
id required path string (uuid)

Request body application/json · required

Fields CopayVoidInput · 1
Field Type Details
reason required string length 1–1000
Example request body placeholder values
{
  "reason": "string"
}

Responses

200 Success application/json
Fields object · 1
Field Type Details
voided required constant always true
Example response placeholder values
{
  "voided": true
}
400 Invalid values or unsupported shape
401 Sign in required
403 Role or billing scope denied
404 Tenant/patient scoped record not found
409 Stale review, duplicate evidence, incompatible lifecycle or unsafe balance
428 Current quoted If-Match required
500 Database/audit failure; transaction rolled back

Example call

curl -X POST "$EHR_URL/api/v1/patients/{p}/billing/copays/{id}/void" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Create coverage

POST /api/v1/patients/{p}/coverages

Owner/clinician/front-desk; inclusive effective dates and nonoverlapping active priority. Manual review is not electronic eligibility.

Access OAuth 2.0 access tokenbilling.write

Parameters

Name In Type Details
p required path string (uuid)

Request body application/json · required

Fields NewCoverage · 18
Field Type Details
content required CoverageContent
copay_cents required integer or null value 0–100000000
effective_date required string (date)
end_date required string or null
group_number required string length 0–150
member_id required string length 1–150
notes required string length 0–2000
payer_id required string (uuid)
plan_name required string length 0–200
priority required string one of primary, secondary, tertiary
relationship required string one of self, spouse, child, other
status required string one of active, inactive, entered_in_error
subscriber_birth_date required string or null
subscriber_name required string length 1–200
verification required string one of unverified, manually_verified
reason required string length 1–1000
request_id required string (uuid)
source_history_id string or null
Example request body placeholder values
{
  "content": {
    "copay_cents": 0,
    "effective_date": "2026-01-15",
    "end_date": "2026-01-15",
    "group_number": "string",
    "member_id": "string",
    "notes": "string",
    "payer_id": "00000000-0000-4000-8000-000000000000",
    "plan_name": "string",
    "priority": "primary",
    "relationship": "self",
    "status": "active",
    "subscriber_birth_date": "2026-01-15",
    "subscriber_name": "string",
    "verification": "unverified"
  },
  "reason": "string",
  "request_id": "00000000-0000-4000-8000-000000000000",
  "source_history_id": "00000000-0000-4000-8000-000000000000"
}

Responses

200 Success application/json
Fields Coverage · 18
Field Type Details
content required CoverageContent
copay_cents required integer or null value 0–100000000
effective_date required string (date)
end_date required string or null
group_number required string length 0–150
member_id required string length 1–150
notes required string length 0–2000
payer_id required string (uuid)
plan_name required string length 0–200
priority required string one of primary, secondary, tertiary
relationship required string one of self, spouse, child, other
status required string one of active, inactive, entered_in_error
subscriber_birth_date required string or null
subscriber_name required string length 1–200
verification required string one of unverified, manually_verified
id required string (uuid)
source_history_id required string or null
version required integer value ≥ 1
Example response placeholder values
{
  "content": {
    "copay_cents": 0,
    "effective_date": "2026-01-15",
    "end_date": "2026-01-15",
    "group_number": "string",
    "member_id": "string",
    "notes": "string",
    "payer_id": "00000000-0000-4000-8000-000000000000",
    "plan_name": "string",
    "priority": "primary",
    "relationship": "self",
    "status": "active",
    "subscriber_birth_date": "2026-01-15",
    "subscriber_name": "string",
    "verification": "unverified"
  },
  "id": "00000000-0000-4000-8000-000000000000",
  "source_history_id": "00000000-0000-4000-8000-000000000000",
  "version": 1
}
400 Invalid mapping or values
401 Sign in required
403 Role or billing scope denied
404 Tenant/patient scoped record not found
409 Stale version, duplicate source, conflicting coverage or balance
428 Current quoted If-Match required
500 Database/audit failure; no partial mutation committed

Example call

curl -X POST "$EHR_URL/api/v1/patients/{p}/coverages" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Edit coverage

PUT /api/v1/patients/{p}/coverages/{id}

Versioned replacement; existing posted snapshots remain immutable.

Access OAuth 2.0 access tokenbilling.write

Parameters

Name In Type Details
p required path string (uuid)
id required path string (uuid)
If-Match required header string Quoted current resource version

Request body application/json · required

Fields EditCoverage · 16
Field Type Details
content required CoverageContent
copay_cents required integer or null value 0–100000000
effective_date required string (date)
end_date required string or null
group_number required string length 0–150
member_id required string length 1–150
notes required string length 0–2000
payer_id required string (uuid)
plan_name required string length 0–200
priority required string one of primary, secondary, tertiary
relationship required string one of self, spouse, child, other
status required string one of active, inactive, entered_in_error
subscriber_birth_date required string or null
subscriber_name required string length 1–200
verification required string one of unverified, manually_verified
reason required string length 1–1000
Example request body placeholder values
{
  "content": {
    "copay_cents": 0,
    "effective_date": "2026-01-15",
    "end_date": "2026-01-15",
    "group_number": "string",
    "member_id": "string",
    "notes": "string",
    "payer_id": "00000000-0000-4000-8000-000000000000",
    "plan_name": "string",
    "priority": "primary",
    "relationship": "self",
    "status": "active",
    "subscriber_birth_date": "2026-01-15",
    "subscriber_name": "string",
    "verification": "unverified"
  },
  "reason": "string"
}

Responses

200 Success application/json
Fields Coverage · 18
Field Type Details
content required CoverageContent
copay_cents required integer or null value 0–100000000
effective_date required string (date)
end_date required string or null
group_number required string length 0–150
member_id required string length 1–150
notes required string length 0–2000
payer_id required string (uuid)
plan_name required string length 0–200
priority required string one of primary, secondary, tertiary
relationship required string one of self, spouse, child, other
status required string one of active, inactive, entered_in_error
subscriber_birth_date required string or null
subscriber_name required string length 1–200
verification required string one of unverified, manually_verified
id required string (uuid)
source_history_id required string or null
version required integer value ≥ 1
Example response placeholder values
{
  "content": {
    "copay_cents": 0,
    "effective_date": "2026-01-15",
    "end_date": "2026-01-15",
    "group_number": "string",
    "member_id": "string",
    "notes": "string",
    "payer_id": "00000000-0000-4000-8000-000000000000",
    "plan_name": "string",
    "priority": "primary",
    "relationship": "self",
    "status": "active",
    "subscriber_birth_date": "2026-01-15",
    "subscriber_name": "string",
    "verification": "unverified"
  },
  "id": "00000000-0000-4000-8000-000000000000",
  "source_history_id": "00000000-0000-4000-8000-000000000000",
  "version": 1
}
400 Invalid mapping or values
401 Sign in required
403 Role or billing scope denied
404 Tenant/patient scoped record not found
409 Stale version, duplicate source, conflicting coverage or balance
428 Current quoted If-Match required
500 Database/audit failure; no partial mutation committed

Example call

curl -X PUT "$EHR_URL/api/v1/patients/{p}/coverages/{id}" -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d @body.json

# Coverage history

GET /api/v1/patients/{p}/coverages/{id}/history

Attributed coverage snapshots.

Access OAuth 2.0 access tokenbilling.read

Parameters

Name In Type Details
p required path string (uuid)
id required path string (uuid)

Responses

200 Success application/json
Fields BillingHistory · 6
Field Type Details
items required array of object
actor_id required string (uuid)
created_at required string (date-time)
reason required string length 1–1000
snapshot required object
version required integer
Example response placeholder values
{
  "items": [
    {
      "actor_id": "00000000-0000-4000-8000-000000000000",
      "created_at": "2026-01-15T15:30:00Z",
      "reason": "string",
      "snapshot": {},
      "version": 1
    }
  ]
}
400 Invalid mapping or values
401 Sign in required
403 Role or billing scope denied
404 Tenant/patient scoped record not found
409 Stale version, duplicate source, conflicting coverage or balance
428 Current quoted If-Match required
500 Database/audit failure; no partial mutation committed

Example call

curl "$EHR_URL/api/v1/patients/{p}/coverages/{id}/history" -H "Authorization: Bearer $ACCESS_TOKEN"