# Eligibility

Page: https://app.myclaimhouse.com/docs/eligibility

An eligibility check asks a patient's dental payer what coverage the patient has: whether it is active, the plan, the maximums and deductibles, what is covered by category, and the detail for the procedure codes you ask about. Claim House turns the payer's answer into one readable object that is the same for every payer.

With a test key, checks are answered by the [sandbox](https://app.myclaimhouse.com/docs/sandbox.md). Live checks are not open yet: a live key gets `503 ELIGIBILITY_UNAVAILABLE`. See [Going live](https://app.myclaimhouse.com/docs/going-live.md).

A key needs `submit` permission to run a check and `read` permission to read one.

## Run a check

[`POST /eligibility`](https://app.myclaimhouse.com/docs/api/createEligibilityCheck.md) takes the office the check is for, the payer, and the person.

With `OFFICE_ID` and `PAYER_ID` set as in the [quickstart](https://app.myclaimhouse.com/docs/quickstart.md):

```bash runnable status=200
curl "https://app.myclaimhouse.com/api/v1/eligibility" \
  -H "Authorization: Bearer $CLAIMHOUSE_KEY" \
  -H "Content-Type: application/json" \
  -d @- <<EOF
{
  "office_id": "$OFFICE_ID",
  "payer_id": "$PAYER_ID",
  "subscriber": {
    "first_name": "Sam",
    "last_name": "Sample",
    "date_of_birth": "1990-01-01",
    "member_id": "CH-MAX-NEARLY-USED",
    "group_number": "GRP-100"
  },
  "procedure_codes": ["D0120", "D2740"],
  "tenant_reference": "visit-1042"
}
EOF
```

**No `Idempotency-Key` needed.** A check only asks the payer, so unlike every other `POST` it runs without one. A repeat within 60 minutes reuses the saved answer (see [Reused answers](#reused-answers)), so running it again by mistake does not ask the payer twice or bill twice. Send an `Idempotency-Key` (a value you make up, new for each new check) when you may retry after a timeout: the retry with the same key gets the first answer, exactly as for any other request. See [Errors, retries and idempotency](https://app.myclaimhouse.com/docs/errors-and-idempotency.md#idempotency).

The service date is left out here, so it is today in the office's time zone.

- **`office_id`** is the office the check is for (`off_...`), from [List offices](https://app.myclaimhouse.com/docs/api/listOffices.md). Its mode must match the key's. Optional when your organization has exactly one office in the key's mode, test or live: that office is used. With none or several, the check is refused with a `422` naming `office_id` (listing your office IDs when there are several). See [Offices](https://app.myclaimhouse.com/docs/offices.md).
- **`payer_id`** is a Claim House payer ID (`pyr_...`), a payer ID, or an alias from the payer directory. See [Payers](https://app.myclaimhouse.com/docs/payers.md).
- **`subscriber`** is the plan holder: first name, last name, date of birth and member ID are required; the group number is optional.
- **`patient`** is only for a dependent. Leave it out when the subscriber is the person being checked. It needs a first name, last name, date of birth and `relationship` (`spouse`, `child` or `other`). Sending a patient that is the subscriber is a finding, `PATIENT_IS_SUBSCRIBER`.
- **`service_date`** is the day the treatment is planned. It defaults to today in the office's time zone, and must be within 12 months of today.
- **`procedure_codes`** are up to 10 CDT codes (`D` and four digits) to get detail for. They are stored upper case, without duplicates, so the same codes in any order are the same request.
- **`detail_level`** is `standard` (the default) or `enhanced`. Enhanced asks for every procedure row the payer returns, not only the codes you listed.
- **`tenant_reference`** is your own reference for the check (up to 255 characters). It comes back on the check, in lists and in events. Do not put patient information in it.
- **`parent_id`** is the rejected check this one corrects. See [Fix and resend](#fix-and-resend).

The request is checked before anything is sent. If anything is wrong, the reply is `422 INVALID_REQUEST` with **every** problem in `errors`, so you can fix them in one go. Nothing is recorded or billed. The finding codes are `OFFICE_NOT_FOUND`, `MODE_MISMATCH`, `PAYER_NOT_FOUND`, `PAYER_NOT_SUPPORTED_FOR_ELIGIBILITY`, `SUBSCRIBER_NAME_REQUIRED`, `SUBSCRIBER_MEMBER_ID_REQUIRED`, `DATE_OF_BIRTH_INVALID`, `DATE_OF_BIRTH_IN_FUTURE`, `PATIENT_NAME_REQUIRED`, `PATIENT_RELATIONSHIP_REQUIRED`, `PATIENT_RELATIONSHIP_INVALID`, `PATIENT_IS_SUBSCRIBER`, `SERVICE_DATE_INVALID`, `TOO_MANY_PROCEDURE_CODES`, `PROCEDURE_CODE_INVALID`, `PARENT_NOT_FOUND`, `PARENT_NOT_RESENDABLE`.

## The answer

When the payer answers (coverage is active or inactive), the reply is `200` with the check. These are the main fields; [the reference](https://app.myclaimhouse.com/docs/api/createEligibilityCheck.md) lists every one:

| Field | What it holds |
| --- | --- |
| `id` | The check's ID (`elg_...`). Read it again with [Get an eligibility check](https://app.myclaimhouse.com/docs/api/getEligibilityCheck.md). |
| `state`, `outcome` | `state` is `pending` while the check runs and `completed` when it ends. `outcome` is how it ended: `answered`, `rejected`, `payer_unavailable` or `error`. |
| `status` | The coverage: `active`, `inactive` or `unknown`. `null` when there is no answer. |
| `billing` | Whether the check was charged and why. See [Billing](#billing). |
| `cache` | `fresh`, or `hit` when an earlier answer was reused. See [Reused answers](#reused-answers). |
| `request`, `parent_id`, `request_id`, `idempotency_key`, `tenant_reference` | What was sent, the check this one corrects, and the identifiers of the request that made it. |
| `source` | Which network answered, how long it took (`latency_ms`) and when (`completed_at`). |
| `coverage_effective_date`, `coverage_termination_date`, `plan`, `network_status` | The plan's dates, its name, type, group number and benefit period, and `in_network`, `out_of_network` or `unknown`. |
| `maximums`, `deductibles` | Each with `level` (`individual` or `family`), `period`, `amount`, `used` and `remaining`, what it `applies_to`, its `network` (`in_network`, `out_of_network` or `any`) and the `categories` it is for (empty for the whole plan). |
| `coverage` | One row for each category (preventive, diagnostic, basic, endodontics, periodontics, oral surgery, major, prosthodontics, implants, orthodontics) with `percent_paid`, `out_of_network_percent_paid`, `covered`, `frequency`, `notes` and the payer's own `messages` about it. |
| `procedures` | One row for each procedure code: description, `percent_paid`, `out_of_network_percent_paid`, `covered`, `frequency`, `min_age` and `max_age`, `last_service_date`, `next_eligible_date`, a `status`, a `note` and the payer's own `messages`. |
| `plan_rules` | Missing tooth clause, waiting period, pre-authorization, coordination of benefits, and whether major services are paid on the preparation or the seat date. |
| `payer_notes` | Notes the payer sent that do not fit a field. |
| `not_returned` | The names of the values the payer did not return. |
| `rejection` | `null` for an answer. See [Rejections](#rejections). |

Money (`amount`, `used`, `remaining`) is a decimal string such as `"2000.00"`, never a floating point number. Dates are `YYYY-MM-DD`; moments are ISO 8601 with an offset.

A procedure's `frequency` has `count` per `period` (`calendar_year`, `plan_year`, `lifetime`, or months or days such as `36_months`), a `scope` (`per_tooth`, `per_quadrant`, or `null`), and `used` and `remaining` for this period when the payer gives a count. A limit the payer groups across codes (an exam limit for D0120 and D0150) shares one count.

A procedure's `status` is one of `covered_now`, `not_due_yet` (none left this period; the date, when known, is in `next_eligible_date`), `downgraded` (paid at the level of a cheaper procedure), `age_limit` and `not_covered`. It is `null` when the payer said nothing about coverage, or when the answer can't tell: for example 2 per calendar year, last done this year, and no count from the payer.

### Values that are not returned

Payers differ in what they return. A value a payer did not return is `null` in the answer, and its name is in `not_returned`, so you can tell "the payer did not say" from "the answer is zero". Try it with the sandbox member ID `CH-GENERAL-ONLY`.

## Rejections

A payer can refuse a check. Then the reply is not a `200`: it is an error that carries the check, so you always have the check's ID. The error is one of:

| Reply | When |
| --- | --- |
| `422 PAYER_REJECTED` | The payer rejected the check. `check.rejection` says why. |
| `502 PAYER_UNAVAILABLE` | The payer's system is not answering. Nothing needs to change. |
| `502 NETWORK_ERROR` | The payer network failed or its answer could not be read. |
| `500 INTERNAL` | Claim House could not complete the check. |

```json schema=check_error
{
  "error": "PAYER_REJECTED",
  "message": "The payer rejected the check. The check object says what to change, and whether resending can help.",
  "errors": [],
  "request_id": "req_...",
  "check": { "id": "elg_...", "outcome": "rejected", "rejection": { "kind": "fix_and_resend", "payer_code": "75", "reasons": ["..."] } }
}
```

`rejection.kind` tells you what to do next:

- **`fix_and_resend`**: change something and send again. Each reason names the `field` to change and the `fix`, and sometimes a `suggested_value`.
- **`payer_unavailable`**: nothing to change. Try again later.
- **`rejected`**: resending will not change it.

Each reason in `rejection.reasons` has a `code`, an `about` (whose side it is on: `subscriber`, `patient`, `provider`, `request`, `clearinghouse` or `payer`), a `field`, a `message` and a `fix`. The reason codes are `MEMBER_NOT_FOUND`, `PATIENT_IS_DEPENDENT`, `DATE_OF_BIRTH_MISMATCH`, `MEMBER_ID_INVALID`, `MEMBER_ID_DUPLICATE`, `NAME_MISMATCH`, `SERVICE_DATE_INVALID`, `REQUEST_INVALID`, `REQUEST_NOT_ACCEPTED`, `PROVIDER_NOT_ON_FILE`, `PROVIDER_NOT_ELIGIBLE`, `PATIENT_NOT_ELIGIBLE`, `PATIENT_DETAILS_REQUIRED`, `PAYER_NOT_ANSWERING`, `PAYER_REJECTED_OTHER`. `payer_code` is the payer's own code.

### Fix and resend

To correct a `fix_and_resend` rejection, send the corrected request with `parent_id` set to the rejected check's `id`. The new check carries `parent_id`, and `GET /eligibility?parent_id=<id>` lists the corrections of a check. Only a check that was rejected with something to fix can be corrected: anything else is refused with the finding `PARENT_NOT_RESENDABLE`. A resend is a new check, billed by the same rules as any other; if you send an `Idempotency-Key`, use a new one.

## Many patients at once

To check many patients together, send them as one batch with [Create an eligibility batch](https://app.myclaimhouse.com/docs/api/createEligibilityBatch.md): up to 200 check requests, each written as for `POST /eligibility`, answered at once with `202` and the batch (`elb_...`). Every check in a batch is an ordinary check, with its own `elg_...` ID, `eligibility.completed` event and billing; the batch only groups them. Read its progress and the check each item made with [Get an eligibility batch](https://app.myclaimhouse.com/docs/api/getEligibilityBatch.md), stop it with [Cancel an eligibility batch](https://app.myclaimhouse.com/docs/api/cancelEligibilityBatch.md), and get an `eligibility.batch.completed` event when it ends. In the dashboard, tick patients on the Patients list and choose Check eligibility: the batch page shows the checks finish and lists the ones that failed, which can be run again together.

## Billing

Every completed check says whether it was charged, in `billing`:

```json schema=check.billing
{ "charged": false, "state": "not_billable", "reason": "test_mode", "label": "Not billed: test mode" }
```

`billing` is `null` while the check is pending. The `reason` is one of these:

| billing.reason | What it means |
| --- | --- |
| `test_mode` | Not billed: test mode |
| `answered` | Billed: the payer answered |
| `payer_rejected` | Billed: rejected because of the member, the provider or the request |
| `payer_side_rejection` | Not billed: rejected for a reason the caller could not fix |
| `payer_unavailable` | Not billed: payer unavailable |
| `network_error` | Not billed: network error |
| `internal_error` | Not billed: Claim House could not complete it |
| `cache_hit` | Not billed: answer reused from a recent check |

In short: a check is billed when the payer answers it, or rejects it because of something the caller could have got right (the member, the provider or the request). It is free in test mode, when the payer is down, when the payer or Claim House is at fault, and when a recent answer is reused. Prices and the monthly minimum are in [Pricing and usage](https://app.myclaimhouse.com/docs/pricing.md).

## Reused answers

An identical check made within 60 minutes of one the payer answered gets the saved answer instead of a new call to the payer. "Identical" means the same organization, mode, office, payer, service date and request. The reply says so, with `cache.state: "hit"` and `cache.source_id` naming the check it was taken from, and it is not billed (`billing.reason: "cache_hit"`).

To get a fresh answer from the payer, send `Cache-Control: no-cache`:

```bash
curl "https://app.myclaimhouse.com/api/v1/eligibility" \
  -H "Authorization: Bearer $CLAIMHOUSE_KEY" \
  -H "Cache-Control: no-cache" \
  -H "Content-Type: application/json" \
  -d @request.json
```

Only an answer is reused. A rejection, an unavailable payer or an error is never reused, so a retry always asks the payer.

## Read checks

- [`GET /eligibility/{id}`](https://app.myclaimhouse.com/docs/api/getEligibilityCheck.md) reads one check: the request it was made from, and the answer or the rejection.
- [`GET /eligibility`](https://app.myclaimhouse.com/docs/api/listEligibilityChecks.md) lists checks as summaries (no request and no benefits), newest first, in pages. Filters: `office_id`, `status`, `outcome`, `created_after`, `request_id`, `idempotency_key` and `parent_id`.

```bash runnable status=200
curl "https://app.myclaimhouse.com/api/v1/eligibility?status=active&limit=5" -H "Authorization: Bearer $CLAIMHOUSE_KEY"
```

A check is seen only by the organization and in the mode that made it.

## The raw 270 and 271

Claim House asks the payer in X12: it sends a 270 eligibility request and the payer returns a 271 response. Both are kept with the check. [`GET /eligibility/{id}/x12`](https://app.myclaimhouse.com/docs/api/getEligibilityCheckX12.md) returns them, one segment per line, in an object:

```json schema=eligibility_x12
{ "object": "eligibility_x12", "check_id": "elg_...", "request": "ISA*00*...", "response": "ISA*00*...", "reused_from": null }
```

The dashboard shows the same two texts on the Raw 271 tab of a check, as Request 270 and Response 271, each with Copy and Download (`<check id>.270.x12` and `<check id>.271.x12`). Reading them takes `read` permission.

- A check that [reused an answer](#reused-answers) did not ask the payer, so it has no exchange of its own: `request` and `response` are `null`, and `reused_from` is the ID of the check whose exchange it is. Read that check to see the 270 and the 271.
- A check that is still running, or that failed before anything was sent, has no exchange either: both texts are `null` and `reused_from` is `null`. When a 270 was sent and nothing came back, `request` is there and `response` is `null`. A text longer than 262,144 characters is not kept: it is `null`, and the check keeps its answer.

In test mode the sandbox writes the 270 and 271 too. Five of its scenarios answer with the shape of a real dental 271 from a major payer, chosen by member ID: `CH-271-METLIFE`, `CH-271-UHC`, `CH-271-CIGNA`, `CH-271-AMERITAS` and `CH-271-ANTHEM`. They are fixed replays of captured responses, so every field of the answer, such as out-of-network percents, limits by category and frequencies with their last dates, is populated the way that payer sends it. See the [sandbox](https://app.myclaimhouse.com/docs/sandbox.md).

## Get told when a check completes

Register a [webhook endpoint](https://app.myclaimhouse.com/docs/events-and-webhooks.md) and Claim House sends an `eligibility.completed` event for every completed check, with the check's ID, outcome, status and billing. The event holds no patient name, date of birth or member ID: read the check by its ID for the answer.
