Explore documentation

Explanation of Benefits

Storing and retrieving detailed benefit explanations

Set up the SDK server client to run the examples using esus. The REST examples use a session token. To run them with the SDK’s API key, send X-API-Key instead of Authorization.

What is ExplanationOfBenefit?

ExplanationOfBenefit (EOB) is the per-patient statement of how a claim was adjudicated. It combines claim details, adjudication, coverage, and payment into a single record that downstream consumers (patient portal, payer systems, accounting) can use.

API convention: the patient is a flat id (patientId) and the originating claim is a flat id (claimId); responses return them as patient and claim references. insurer, provider, claimResponse, careTeam[].provider, and insurance[].coverage use the standard FHIR reference shape. All ids are UUIDs.

Create an EOB

Required fields: type, use, patientId, insurer, provider, and outcome. status defaults to active. created is set by the server (a created value in the body is ignored).

REST
curl -X POST https://api.esus.health/fhir/ExplanationOfBenefit \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/fhir+json" \
  -d '{
    "status": "active",
    "type": {
      "coding": [{
        "system": "http://terminology.hl7.org/CodeSystem/claim-type",
        "code": "institutional"
      }]
    },
    "use": "claim",
    "patientId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "insurer": {
      "reference": "Organization/9a8b7c6d-5e4f-3210-9876-543210fedcba"
    },
    "provider": {
      "reference": "Practitioner/a7b1c2d3-e4f5-6789-abcd-ef0123456789"
    },
    "claimId": "aa11bb22-cc33-dd44-ee55-ff6677889900",
    "outcome": "complete",
    "insurance": [{
      "focal": true,
      "coverage": { "reference": "Coverage/c1a2e3d4-5b6f-7890-abcd-ef1234567890" }
    }],
    "diagnosis": [{
      "sequence": 1,
      "diagnosisCodeableConcept": {
        "coding": [{ "system": "http://hl7.org/fhir/sid/icd-10", "code": "J06.9" }]
      }
    }],
    "item": [{
      "sequence": 1,
      "productOrService": {
        "coding": [{ "system": "http://www.ama-assn.org/go/cpt", "code": "99213" }]
      },
      "adjudication": [
        { "category": { "coding": [{ "code": "submitted" }] }, "amount": { "value": 150.00, "currency": "USD" } },
        { "category": { "coding": [{ "code": "benefit" }] },   "amount": { "value": 96.00,  "currency": "USD" } }
      ]
    }],
    "total": [
      { "category": { "coding": [{ "code": "submitted" }] }, "amount": { "value": 150.00, "currency": "USD" } },
      { "category": { "coding": [{ "code": "benefit" }] },   "amount": { "value": 96.00,  "currency": "USD" } }
    ],
    "payment": {
      "date": "2026-04-25",
      "amount": { "value": 96.00, "currency": "USD" }
    }
  }'
SDK
const created = await esus.fhir.create("ExplanationOfBenefit", {
  "status": "active",
  "type": {
    "coding": [
      {
        "system": "http://terminology.hl7.org/CodeSystem/claim-type",
        "code": "institutional"
      }
    ]
  },
  "use": "claim",
  "patientId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "insurer": {
    "reference": "Organization/9a8b7c6d-5e4f-3210-9876-543210fedcba"
  },
  "provider": {
    "reference": "Practitioner/a7b1c2d3-e4f5-6789-abcd-ef0123456789"
  },
  "claimId": "aa11bb22-cc33-dd44-ee55-ff6677889900",
  "outcome": "complete",
  "insurance": [
    {
      "focal": true,
      "coverage": {
        "reference": "Coverage/c1a2e3d4-5b6f-7890-abcd-ef1234567890"
      }
    }
  ],
  "diagnosis": [
    {
      "sequence": 1,
      "diagnosisCodeableConcept": {
        "coding": [
          {
            "system": "http://hl7.org/fhir/sid/icd-10",
            "code": "J06.9"
          }
        ]
      }
    }
  ],
  "item": [
    {
      "sequence": 1,
      "productOrService": {
        "coding": [
          {
            "system": "http://www.ama-assn.org/go/cpt",
            "code": "99213"
          }
        ]
      },
      "adjudication": [
        {
          "category": {
            "coding": [
              {
                "code": "submitted"
              }
            ]
          },
          "amount": {
            "value": 150.0,
            "currency": "USD"
          }
        },
        {
          "category": {
            "coding": [
              {
                "code": "benefit"
              }
            ]
          },
          "amount": {
            "value": 96.0,
            "currency": "USD"
          }
        }
      ]
    }
  ],
  "total": [
    {
      "category": {
        "coding": [
          {
            "code": "submitted"
          }
        ]
      },
      "amount": {
        "value": 150.0,
        "currency": "USD"
      }
    },
    {
      "category": {
        "coding": [
          {
            "code": "benefit"
          }
        ]
      },
      "amount": {
        "value": 96.0,
        "currency": "USD"
      }
    }
  ],
  "payment": {
    "date": "2026-04-25",
    "amount": {
      "value": 96.0,
      "currency": "USD"
    }
  }
});

Outcome vs Status

FieldValuesMeaning
statusdraft, active, cancelled, entered-in-errorLifecycle of the record
outcomequeued, complete, partial, errorResult of adjudication reflected in this EOB
useclaim, preauthorization, predeterminationWhat this EOB explains

Typical Totals

CategoryMeaning
submittedTotal billed
eligibleTotal allowed by the payer
benefitTotal paid by the payer
deductible, copayParts of the patient’s responsibility

Retrieve Patient EOBs

ExplanationOfBenefit search supports only patient and status (exact). To narrow by date, filter on created client-side.

# All EOBs for a patient
curl "https://api.esus.health/fhir/ExplanationOfBenefit?patient=3fa85f64-5717-4562-b3fc-2c963f66afa6" \
  -H "Authorization: Bearer YOUR_TOKEN"

# A patient's active EOBs
curl "https://api.esus.health/fhir/ExplanationOfBenefit?patient=3fa85f64-5717-4562-b3fc-2c963f66afa6&status=active" \
  -H "Authorization: Bearer YOUR_TOKEN"

Patient-Friendly Rendering

Esus has no operation to render an EOB for patients. Render the structured resource (for example to a PDF) in your application, upload it with POST /files/upload, and register it as a DocumentReference for the patient.