# Check eligibility (Stedi)

Operation ID: `connectors.stediEligibility`

POST /change/medicalnetwork/eligibility/v3. Returns the eligibility response shaped by :class:`StediEligibilityCheckResponse` (snake_case; large sections stay loose JSON). ``x_forwarded_for`` is routed to a header.

## Public method

`checkEligibility`

Signature: `connectors.stedi.createClient(config).checkEligibility(body)`

Return type: `Promise<StediEligibilityResponse>`

## Authentication

Classification: **AUTHENTICATED**

Schemes: `bearerAuth`

## Prerequisites

None documented.

## HTTP

`POST /connectors/stedi/check-eligibility`

## Path parameters

None.

## Query parameters

None.

## Body parameters

| Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
|---|---|---:|---|---|---|---:|---|
| `body` | [`StediCheckEligibilityRequest`](../models/StediCheckEligibilityRequest.md) | Yes |  |  |  | No |  |

Request model: [`StediCheckEligibilityRequest`](../models/StediCheckEligibilityRequest.md)

## Request example

```json
{
  "api_key": "example-api-key",
  "control_number": "+15555550123",
  "encounter": {
    "service_type_codes": [
      "30"
    ]
  },
  "mode": "sandbox",
  "provider": {
    "npi": "+15555550123",
    "organization_name": "ACME MEDICAL GROUP"
  },
  "subscriber": {
    "date_of_birth": "18800102",
    "first_name": "John",
    "last_name": "Doe",
    "member_id": "+15555550123"
  },
  "trading_partner_service_id": "00007"
}
```

## Success responses

| Status | Shape | Content type | Description |
|---|---|---|---|
| `200` | [`StediEligibilityCheckResponse`](../models/StediEligibilityCheckResponse.md) | application/json | Successful response |

## Success response examples

### 200

```json
{
  "control_number": "+15555550123",
  "errors": [
    {
      "code": "79",
      "description": "Invalid Participant Identification",
      "field": "AAA",
      "followup_action": "Please Correct and Resubmit",
      "location": "Loop 2000A",
      "possible_resolutions": "There is a problem connecting with this payer. Contact Stedi support."
    }
  ],
  "payer": {
    "aaa_errors": [
      {
        "code": "79",
        "description": "Invalid Participant Identification",
        "field": "AAA",
        "followup_action": "Please Correct and Resubmit",
        "location": "Loop 2000A",
        "possible_resolutions": "There is a problem connecting with this payer. Contact Stedi support."
      }
    ],
    "entity_identifier": "Payer",
    "entity_type": "Non-Person Entity",
    "name": "Test Payer",
    "payor_identification": "00007"
  },
  "trading_partner_service_id": "00007",
  "x12": "ISA*00*          *00*          *ZZ*STEDI          *01*117151744      *260817*1819*^*00501*853029811*0*T*`~GS*HB*STEDI*11"
}
```

## Common errors

| Status | Shape | Content type | Description |
|---|---|---|---|
| `400` | [`StandardErrorResponse`](../models/StandardErrorResponse.md) | application/json | Connector validation rejected the payload, or a required field was missing or of the wrong type. |
| `401` | [`StandardErrorResponse`](../models/StandardErrorResponse.md) | application/json | The HealthCloud bearer token is missing or invalid, or the vendor rejected the supplied connector credentials. |
| `500` | [`StandardErrorResponse`](../models/StandardErrorResponse.md) | application/json | The connector failed unexpectedly. |
| `502` | [`StandardErrorResponse`](../models/StandardErrorResponse.md) | application/json | The vendor returned an application or transport-level failure. |
| `504` | [`StandardErrorResponse`](../models/StandardErrorResponse.md) | application/json | The vendor did not respond within the connector timeout. |

## Error examples

### 400 — Invalid request

```json
{
  "error": "Invalid request"
}
```

### 401 — Authorization required

```json
{
  "error": "Authorization required"
}
```

### 500 — Internal error

```json
{
  "error": "Internal error"
}
```

### 502 — Upstream vendor error

```json
{
  "error": "Upstream vendor error"
}
```

### 504 — Upstream timeout

```json
{
  "error": "Upstream timeout"
}
```

## NodeJS / TypeScript implementation

```ts
import { HCSDK } from "@healthcloudai/hc-sdk";
import type { StediCheckEligibilityRequest } from "@healthcloudai/hc-sdk";
```

```ts
const body = {
  "api_key": "example-api-key",
  "control_number": "+15555550123",
  "encounter": {
    "service_type_codes": [
      "30"
    ]
  },
  "mode": "sandbox",
  "provider": {
    "npi": "+15555550123",
    "organization_name": "ACME MEDICAL GROUP"
  },
  "subscriber": {
    "date_of_birth": "18800102",
    "first_name": "John",
    "last_name": "Doe",
    "member_id": "+15555550123"
  },
  "trading_partner_service_id": "00007"
};

const result = await connectors.stedi.createClient(config).checkEligibility(body);
```

## cURL

```bash
curl -X POST \
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{"api_key":"example-api-key","control_number":"+15555550123","encounter":{"service_type_codes":["30"]},"mode":"sandbox","provider":{"npi":"+15555550123","organization_name":"ACME MEDICAL GROUP"},"subscriber":{"date_of_birth":"18800102","first_name":"John","last_name":"Doe","member_id":"+15555550123"},"trading_partner_service_id":"00007"}' \
  'https://dev-api-connectors.health.cloud/connectors/stedi/check-eligibility'
```

## Notes

None.

## Prepared Test Console scenario

No canonical scenario is currently associated.

## Real response

No approved real integration response is currently published. Unapproved candidates are never rendered as examples.
