> ## Documentation Index
> Fetch the complete documentation index at: https://docs.verial.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# X12

> Clearinghouse-style X12 EDI transactions for eligibility, claims, and prior auth.

The X12 simulator stands in for a clearinghouse like Change Healthcare or Availity. It accepts X12 EDI transactions and returns the paired X12 response, covering the core eligibility, claim status, and prior-auth transaction set. The verification engine scores outbound X12 responses with `x12-response` criteria.

Supported transaction pairs:

* **270/271** — eligibility inquiry and response
* **276/277** — claim status inquiry and response
* **278** — prior authorization request and response

## How your agent connects

The X12 clearinghouse exposes a structured HTTP surface at the direct-service endpoint. Your agent submits a request body and receives the simulated clearinghouse response. During playground authoring, call `/sandboxes/{sandbox_id}/clearinghouse/*` with an organization API key.

<Note>
  Today only the 270/271 eligibility pair is wired on the HTTP surface. The
  276/277 (claim status) and 278 (prior auth) pairs are listed above for
  completeness but are not yet callable; check the [API
  reference](/api-reference/clearinghouse/check-eligibility) for the current
  shipped endpoints. The run-scoped `/v1/benchmark-runs/{id}/clearinghouse/*`
  surface is not exposed today; drive X12 interactions via the direct
  `/sandboxes/{id}/clearinghouse/*` routes during playground authoring.
</Note>

## Endpoints

| Method | Endpoint                                            | Description                                           |
| ------ | --------------------------------------------------- | ----------------------------------------------------- |
| `POST` | `/sandboxes/{sandbox_id}/clearinghouse/eligibility` | 270 eligibility inquiry; returns a 271-style response |

See [Check eligibility](/api-reference/clearinghouse/check-eligibility) for the full request/response shape.

## Driving the rollout

Submit a 270 eligibility inquiry (direct-service path):

```bash theme={null}
curl -X POST "https://api.verial.ai/sandboxes/$SANDBOX_ID/clearinghouse/eligibility" \
  -H "Authorization: Bearer $VERIAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "patient_id": "patient-123"
  }'
```

The response contains a parsed 271 structure (active coverage, copay, deductible, service type benefits) that your agent can act on.

## Configuration

The X12 simulator uses configured payer behavior (which members are active, which services are covered) from the linked dataset. At create time you supply a name and optional payer metadata:

```bash theme={null}
curl -X POST https://api.verial.ai/simulators \
  -H "Authorization: Bearer $VERIAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "Clearinghouse",
    "name": "Regional X12 Clearinghouse",
    "config": {
      "payers": ["BlueCross", "Aetna"]
    }
  }'
```

## Verification

The `x12-response` check parses the simulated X12 response (271, 277, or 278) and asserts on segment values by path. Use it to confirm the clearinghouse returned the expected coverage, status, or decision.

```json theme={null}
{
  "label": "Eligibility 271 returned active coverage",
  "weight": 1.0,
  "assertion": {
    "assert": "x12-response",
    "transaction": "271",
    "fields": [
      { "path": "EB.1", "expected": "1" },
      { "path": "EB.3", "expected": "30" }
    ]
  }
}
```

See the [Criteria concept page](/guides/concepts/criteria#x12-271-eligibility-response) for the full spec.

## Next Steps

<CardGroup cols={2}>
  <Card title="Web Portal" icon="browser" href="/guides/simulators/web-portal">
    Pair X12 with a payer portal simulator for full prior-auth workflows.
  </Card>

  <Card title="Criteria" icon="check-double" href="/guides/concepts/criteria">
    Full reference for `x12-response` assertions.
  </Card>

  <Card title="Clearinghouse API reference" icon="code" href="/api-reference/clearinghouse/check-eligibility">
    Direct-access eligibility endpoint for authoring.
  </Card>

  <Card title="Simulators overview" icon="server" href="/guides/simulators/overview">
    Lifecycle, provisioning, and configuration patterns.
  </Card>
</CardGroup>
