{
  "example": "dental \u2014 practice-financed treatment plan",
  "source": "https://amortance.com/dental",
  "note": "Synthetic data, real mechanics. Generated from the same engine the page runs, not read by it: this file fixes the inputs and the expected outputs so the numbers can be reproduced independently. verify.py does exactly that and is published beside it.",
  "order": {
    "accepted": "2026-03-01",
    "lines": [
      {
        "code": "D2740",
        "description": "Crown, porcelain/ceramic \u2014 #14",
        "fee": "1450",
        "estimated_benefit": "435",
        "patient_share": "1015"
      },
      {
        "code": "D2740",
        "description": "Crown, porcelain/ceramic \u2014 #15",
        "fee": "1450",
        "estimated_benefit": "435",
        "patient_share": "1015"
      },
      {
        "code": "D6010",
        "description": "Implant body, endosteal \u2014 #19",
        "fee": "2100",
        "estimated_benefit": "315",
        "patient_share": "1785"
      },
      {
        "code": "D0367",
        "description": "CBCT capture, both jaws",
        "fee": "260",
        "estimated_benefit": "75",
        "patient_share": "185"
      }
    ],
    "totals": {
      "fee": "5260",
      "estimated_benefit": "1260",
      "patient_share": "4000"
    }
  },
  "terms": {
    "apr": "0.0990",
    "accrual": "simple interest on outstanding principal, no compounding",
    "rounding": "half up to the cent, computed per interval, at posting",
    "allocation": "accrued interest first, then principal",
    "credit_on_over_reduction": "a reduction that takes the balance below zero settles any accrued interest first; what is left is a credit due back to the payer",
    "down_payment": {
      "on": "2026-03-01",
      "amount": "400"
    },
    "due_dates": [
      "2026-04-01",
      "2026-05-01",
      "2026-06-01",
      "2026-07-01",
      "2026-08-01",
      "2026-09-01",
      "2026-10-01",
      "2026-11-01",
      "2026-12-01",
      "2027-01-01",
      "2027-02-01",
      "2027-03-01"
    ],
    "installment_pricing": "=PMT on the balance and accrued interest as at the date of the event, at the nominal periodic rate (APR x 30 / day-count basis), over the dates that remain; the part-period before the next installment is not discounted separately",
    "on_change": "dates hold, installment moves",
    "final_installment": "instAfterEobFinal: the last payment absorbs the residual \u2014 it is the principal and accrued interest still outstanding when it falls due, not the level installment",
    "level_installment": "instAfterEobLevel: the smallest whole cent that, paid on every remaining date, retires the balance without the final payment exceeding it",
    "as_signed_schedule": "asSignedInterest and as1..asLast are the projection made at origination: twelve level installments on the due dates, interest accrued on the day count in force",
    "derivation": "ruleBalance is the principal in force for the first interval, ruleDays/ruleBasis its day count, ruleExact the unrounded product to four places and ruleResult the same figure rounded",
    "closed": "aClose/bClose: the date the balance first reaches zero"
  },
  "states": [
    {
      "policy": {
        "day_count": "30/360",
        "adjudication_effective": "date of service (2026-03-01)",
        "production_removed_effective": "POLICY FORK \u2014 both branches below"
      },
      "log": [
        {
          "on": "2026-03-01",
          "kind": "principal",
          "amount": "3600",
          "note": "amount financed = patient share 4000.00 less down payment 400.00"
        },
        {
          "on": "2026-03-01",
          "kind": "principal",
          "amount": "-870",
          "posted": "2026-04-23",
          "note": "adjudication: effective 'on', priced on 'posted'"
        },
        {
          "on": "2026-04-01",
          "kind": "payment",
          "amount": "316.33",
          "note": "installment 1"
        },
        {
          "on": "2026-05-01",
          "kind": "payment",
          "amount": "233.99",
          "note": "installment 2, repriced"
        },
        {
          "on": "2026-05-14",
          "kind": "principal",
          "amount": "238",
          "note": "D4341 added, effective date performed"
        },
        {
          "on": "2026-06-01",
          "kind": "payment",
          "amount": "258.16",
          "note": "installment 3"
        },
        {
          "on": "2026-07-01",
          "kind": "payment",
          "amount": "258.16",
          "note": "installment 4"
        },
        {
          "on": "2026-08-01",
          "kind": "payment",
          "amount": "258.16",
          "note": "installment 5"
        },
        {
          "on": "2026-09-01",
          "kind": "payment",
          "amount": "258.16",
          "note": "installment 6"
        },
        {
          "on": "2026-10-01",
          "kind": "payment",
          "amount": "258.16",
          "note": "installment 7"
        }
      ],
      "fork_on_2026-10-05": {
        "A_effective_today": {
          "effective": "2026-10-05",
          "amount": "-1785",
          "interest_charged": "124.81",
          "credit_due_patient": "533.31",
          "plan_closes": "2026-10-05"
        },
        "B_effective_at_origination": {
          "effective": "2026-03-01",
          "amount": "-1785",
          "interest_charged": "21.89",
          "credit_due_patient": "636.23",
          "plan_closes": "2026-08-01"
        }
      },
      "expected": {
        "financed": "3,600.00",
        "pay0": "316.33",
        "asSignedInterest": "195.97",
        "accruedToEob": "14.74",
        "instAfterEob": "233.99",
        "eobBalance": "2,436.19",
        "instAfterEobFinal": "217.87",
        "instAfterEobLevel": "232.59",
        "accruedAtAdd": "7.94",
        "instAfterAdd": "258.16",
        "daysToAdd": "13",
        "paidToDate": "2,241.12",
        "correctedShare": "1,583.00",
        "overCollected": "658.12",
        "forkAccrued": "1.38",
        "aInterest": "124.81",
        "aCredit": "533.31",
        "aClose": "2026-10-05",
        "aCloseMonth": "October",
        "bInterest": "21.89",
        "bCredit": "636.23",
        "bClose": "2026-08-01",
        "bCloseMonth": "August",
        "gap": "102.92",
        "gapInterest": "102.92",
        "charged1Interest": "29.70",
        "charged1Principal": "286.63",
        "charged1Balance": "3,313.37",
        "replayed1Interest": "22.52",
        "replayed1Principal": "293.81",
        "replayed1Balance": "2,436.19",
        "diff1Interest": "\u22127.18",
        "diff1Principal": "7.18",
        "diff1Balance": "\u2212877.18",
        "ruleBalance": "2,730.00",
        "ruleDays": "30",
        "ruleBasis": "360",
        "ruleExact": "22.5225",
        "ruleResult": "22.52",
        "as1Payment": "316.33",
        "as1Interest": "29.70",
        "as1Principal": "286.63",
        "as1Balance": "3,313.37",
        "as2Payment": "316.33",
        "as2Interest": "27.34",
        "as2Principal": "288.99",
        "as2Balance": "3,024.38",
        "as3Payment": "316.33",
        "as3Interest": "24.95",
        "as3Principal": "291.38",
        "as3Balance": "2,733.00",
        "asLastPayment": "316.34",
        "asLastInterest": "2.59",
        "asLastPrincipal": "313.75",
        "asLastBalance": "0.00"
      }
    },
    {
      "policy": {
        "day_count": "30/360",
        "adjudication_effective": "on receipt (2026-04-23)",
        "production_removed_effective": "POLICY FORK \u2014 both branches below"
      },
      "log": [
        {
          "on": "2026-03-01",
          "kind": "principal",
          "amount": "3600",
          "note": "amount financed = patient share 4000.00 less down payment 400.00"
        },
        {
          "on": "2026-04-23",
          "kind": "principal",
          "amount": "-870",
          "posted": "2026-04-23",
          "note": "adjudication: effective 'on', priced on 'posted'"
        },
        {
          "on": "2026-04-01",
          "kind": "payment",
          "amount": "316.33",
          "note": "installment 1"
        },
        {
          "on": "2026-05-01",
          "kind": "payment",
          "amount": "235.18",
          "note": "installment 2, repriced"
        },
        {
          "on": "2026-05-14",
          "kind": "principal",
          "amount": "238",
          "note": "D4341 added, effective date performed"
        },
        {
          "on": "2026-06-01",
          "kind": "payment",
          "amount": "259.35",
          "note": "installment 3"
        },
        {
          "on": "2026-07-01",
          "kind": "payment",
          "amount": "259.35",
          "note": "installment 4"
        },
        {
          "on": "2026-08-01",
          "kind": "payment",
          "amount": "259.35",
          "note": "installment 5"
        },
        {
          "on": "2026-09-01",
          "kind": "payment",
          "amount": "259.35",
          "note": "installment 6"
        },
        {
          "on": "2026-10-01",
          "kind": "payment",
          "amount": "259.35",
          "note": "installment 7"
        }
      ],
      "fork_on_2026-10-05": {
        "A_effective_today": {
          "effective": "2026-10-05",
          "amount": "-1785",
          "interest_charged": "137.70",
          "credit_due_patient": "527.56",
          "plan_closes": "2026-10-05"
        },
        "B_effective_at_origination": {
          "effective": "2026-03-01",
          "amount": "-1785",
          "interest_charged": "34.65",
          "credit_due_patient": "630.61",
          "plan_closes": "2026-08-01"
        }
      },
      "expected": {
        "financed": "3,600.00",
        "pay0": "316.33",
        "asSignedInterest": "195.97",
        "accruedToEob": "20.05",
        "instAfterEob": "235.18",
        "eobBalance": "2,443.37",
        "instAfterEobFinal": "219.02",
        "instAfterEobLevel": "233.77",
        "accruedAtAdd": "7.99",
        "instAfterAdd": "259.35",
        "daysToAdd": "13",
        "paidToDate": "2,248.26",
        "correctedShare": "1,583.00",
        "overCollected": "665.26",
        "forkAccrued": "1.38",
        "aInterest": "137.70",
        "aCredit": "527.56",
        "aClose": "2026-10-05",
        "aCloseMonth": "October",
        "bInterest": "34.65",
        "bCredit": "630.61",
        "bClose": "2026-08-01",
        "bCloseMonth": "August",
        "gap": "103.05",
        "gapInterest": "103.05",
        "charged1Interest": "29.70",
        "charged1Principal": "286.63",
        "charged1Balance": "3,313.37",
        "replayed1Interest": "29.70",
        "replayed1Principal": "286.63",
        "replayed1Balance": "3,313.37",
        "diff1Interest": "0.00",
        "diff1Principal": "0.00",
        "diff1Balance": "0.00",
        "ruleBalance": "3,600.00",
        "ruleDays": "30",
        "ruleBasis": "360",
        "ruleExact": "29.7000",
        "ruleResult": "29.70",
        "as1Payment": "316.33",
        "as1Interest": "29.70",
        "as1Principal": "286.63",
        "as1Balance": "3,313.37",
        "as2Payment": "316.33",
        "as2Interest": "27.34",
        "as2Principal": "288.99",
        "as2Balance": "3,024.38",
        "as3Payment": "316.33",
        "as3Interest": "24.95",
        "as3Principal": "291.38",
        "as3Balance": "2,733.00",
        "asLastPayment": "316.34",
        "asLastInterest": "2.59",
        "asLastPrincipal": "313.75",
        "asLastBalance": "0.00"
      }
    },
    {
      "policy": {
        "day_count": "actual/365",
        "adjudication_effective": "date of service (2026-03-01)",
        "production_removed_effective": "POLICY FORK \u2014 both branches below"
      },
      "log": [
        {
          "on": "2026-03-01",
          "kind": "principal",
          "amount": "3600",
          "note": "amount financed = patient share 4000.00 less down payment 400.00"
        },
        {
          "on": "2026-03-01",
          "kind": "principal",
          "amount": "-870",
          "posted": "2026-04-23",
          "note": "adjudication: effective 'on', priced on 'posted'"
        },
        {
          "on": "2026-04-01",
          "kind": "payment",
          "amount": "316.10",
          "note": "installment 1"
        },
        {
          "on": "2026-05-01",
          "kind": "payment",
          "amount": "233.88",
          "note": "installment 2, repriced"
        },
        {
          "on": "2026-05-14",
          "kind": "principal",
          "amount": "238",
          "note": "D4341 added, effective date performed"
        },
        {
          "on": "2026-06-01",
          "kind": "payment",
          "amount": "258.05",
          "note": "installment 3"
        },
        {
          "on": "2026-07-01",
          "kind": "payment",
          "amount": "258.05",
          "note": "installment 4"
        },
        {
          "on": "2026-08-01",
          "kind": "payment",
          "amount": "258.05",
          "note": "installment 5"
        },
        {
          "on": "2026-09-01",
          "kind": "payment",
          "amount": "258.05",
          "note": "installment 6"
        },
        {
          "on": "2026-10-01",
          "kind": "payment",
          "amount": "258.05",
          "note": "installment 7"
        }
      ],
      "fork_on_2026-10-05": {
        "A_effective_today": {
          "effective": "2026-10-05",
          "amount": "-1785",
          "interest_charged": "125.58",
          "credit_due_patient": "531.65",
          "plan_closes": "2026-10-05"
        },
        "B_effective_at_origination": {
          "effective": "2026-03-01",
          "amount": "-1785",
          "interest_charged": "22.08",
          "credit_due_patient": "635.15",
          "plan_closes": "2026-08-01"
        }
      },
      "expected": {
        "financed": "3,600.00",
        "pay0": "316.10",
        "asSignedInterest": "197.20",
        "accruedToEob": "14.54",
        "instAfterEob": "233.88",
        "eobBalance": "2,436.85",
        "instAfterEobFinal": "220.11",
        "instAfterEobLevel": "232.68",
        "accruedAtAdd": "7.84",
        "instAfterAdd": "258.05",
        "daysToAdd": "13",
        "paidToDate": "2,240.23",
        "correctedShare": "1,583.00",
        "overCollected": "657.23",
        "forkAccrued": "1.36",
        "aInterest": "125.58",
        "aCredit": "531.65",
        "aClose": "2026-10-05",
        "aCloseMonth": "October",
        "bInterest": "22.08",
        "bCredit": "635.15",
        "bClose": "2026-08-01",
        "bCloseMonth": "August",
        "gap": "103.50",
        "gapInterest": "103.50",
        "charged1Interest": "30.27",
        "charged1Principal": "285.83",
        "charged1Balance": "3,314.17",
        "replayed1Interest": "22.95",
        "replayed1Principal": "293.15",
        "replayed1Balance": "2,436.85",
        "diff1Interest": "\u22127.32",
        "diff1Principal": "7.32",
        "diff1Balance": "\u2212877.32",
        "ruleBalance": "2,730.00",
        "ruleDays": "31",
        "ruleBasis": "365",
        "ruleExact": "22.9544",
        "ruleResult": "22.95",
        "as1Payment": "316.10",
        "as1Interest": "30.27",
        "as1Principal": "285.83",
        "as1Balance": "3,314.17",
        "as2Payment": "316.10",
        "as2Interest": "26.97",
        "as2Principal": "289.13",
        "as2Balance": "3,025.04",
        "as3Payment": "316.10",
        "as3Interest": "25.44",
        "as3Principal": "290.66",
        "as3Balance": "2,734.38",
        "asLastPayment": "320.10",
        "asLastInterest": "2.41",
        "asLastPrincipal": "317.69",
        "asLastBalance": "0.00"
      }
    },
    {
      "policy": {
        "day_count": "actual/365",
        "adjudication_effective": "on receipt (2026-04-23)",
        "production_removed_effective": "POLICY FORK \u2014 both branches below"
      },
      "log": [
        {
          "on": "2026-03-01",
          "kind": "principal",
          "amount": "3600",
          "note": "amount financed = patient share 4000.00 less down payment 400.00"
        },
        {
          "on": "2026-04-23",
          "kind": "principal",
          "amount": "-870",
          "posted": "2026-04-23",
          "note": "adjudication: effective 'on', priced on 'posted'"
        },
        {
          "on": "2026-04-01",
          "kind": "payment",
          "amount": "316.10",
          "note": "installment 1"
        },
        {
          "on": "2026-05-01",
          "kind": "payment",
          "amount": "235.08",
          "note": "installment 2, repriced"
        },
        {
          "on": "2026-05-14",
          "kind": "principal",
          "amount": "238",
          "note": "D4341 added, effective date performed"
        },
        {
          "on": "2026-06-01",
          "kind": "payment",
          "amount": "259.24",
          "note": "installment 3"
        },
        {
          "on": "2026-07-01",
          "kind": "payment",
          "amount": "259.24",
          "note": "installment 4"
        },
        {
          "on": "2026-08-01",
          "kind": "payment",
          "amount": "259.24",
          "note": "installment 5"
        },
        {
          "on": "2026-09-01",
          "kind": "payment",
          "amount": "259.24",
          "note": "installment 6"
        },
        {
          "on": "2026-10-01",
          "kind": "payment",
          "amount": "259.24",
          "note": "installment 7"
        }
      ],
      "fork_on_2026-10-05": {
        "A_effective_today": {
          "effective": "2026-10-05",
          "amount": "-1785",
          "interest_charged": "138.53",
          "credit_due_patient": "525.85",
          "plan_closes": "2026-10-05"
        },
        "B_effective_at_origination": {
          "effective": "2026-03-01",
          "amount": "-1785",
          "interest_charged": "34.91",
          "credit_due_patient": "629.47",
          "plan_closes": "2026-08-01"
        }
      },
      "expected": {
        "financed": "3,600.00",
        "pay0": "316.10",
        "asSignedInterest": "197.20",
        "accruedToEob": "19.78",
        "instAfterEob": "235.08",
        "eobBalance": "2,444.17",
        "instAfterEobFinal": "221.22",
        "instAfterEobLevel": "233.87",
        "accruedAtAdd": "7.88",
        "instAfterAdd": "259.24",
        "daysToAdd": "13",
        "paidToDate": "2,247.38",
        "correctedShare": "1,583.00",
        "overCollected": "664.38",
        "forkAccrued": "1.36",
        "aInterest": "138.53",
        "aCredit": "525.85",
        "aClose": "2026-10-05",
        "aCloseMonth": "October",
        "bInterest": "34.91",
        "bCredit": "629.47",
        "bClose": "2026-08-01",
        "bCloseMonth": "August",
        "gap": "103.62",
        "gapInterest": "103.62",
        "charged1Interest": "30.27",
        "charged1Principal": "285.83",
        "charged1Balance": "3,314.17",
        "replayed1Interest": "30.27",
        "replayed1Principal": "285.83",
        "replayed1Balance": "3,314.17",
        "diff1Interest": "0.00",
        "diff1Principal": "0.00",
        "diff1Balance": "0.00",
        "ruleBalance": "3,600.00",
        "ruleDays": "31",
        "ruleBasis": "365",
        "ruleExact": "30.2696",
        "ruleResult": "30.27",
        "as1Payment": "316.10",
        "as1Interest": "30.27",
        "as1Principal": "285.83",
        "as1Balance": "3,314.17",
        "as2Payment": "316.10",
        "as2Interest": "26.97",
        "as2Principal": "289.13",
        "as2Balance": "3,025.04",
        "as3Payment": "316.10",
        "as3Interest": "25.44",
        "as3Principal": "290.66",
        "as3Balance": "2,734.38",
        "asLastPayment": "320.10",
        "asLastInterest": "2.41",
        "asLastPrincipal": "317.69",
        "asLastBalance": "0.00"
      }
    }
  ]
}
