Obtain API credentials from a clearinghouse (e.g., Availity, Change Healthcare/Optum, Stedi, or similar); most provide REST APIs that accept and return X12 EDI transactions or structured JSON equivalents.
Construct the 270 eligibility inquiry with the required segments: ISA (interchange header), GS (functional group header), ST (transaction set header, type 270), BHT (beginning of hierarchical transaction), HL segments for information source (payer), subscriber, and dependent levels, EQ segment for the requested benefit type.
Include key subscriber data in NM1/DMG segments: NM1*IL (subscriber), member ID in NM1-09, and DMG for date of birth and gender; include the payer NM1*PR with the payer ID.
POST the 270 transaction to the clearinghouse API endpoint; real-time eligibility checks typically return the 271 response synchronously within seconds; batch submissions use async polling.
Parse the 271 response: locate EB segments (eligibility benefit information) which contain benefit type codes, coverage level, in/out-of-network status, co-pay, deductible, and out-of-pocket amounts; MSG segments contain human-readable notes.
Map EB-01 (eligibility benefit information code) to human-readable descriptions (e.g., '1'=Active Coverage, '6'=Inactive, 'C'=Deductible, 'G'=Out-of-Pocket) using the X12 code list.
Known gotchas
X12 EDI requires exact segment delimiters and loop structures; even minor formatting errors cause rejection with cryptic 999 acknowledgment error codes; use a validated X12 library rather than string templates.
Payer IDs in X12 270 are clearinghouse-specific routing IDs, not standard payer NPI numbers; each clearinghouse publishes its own payer ID list and the correct ID must be used for routing.
Real-time 271 responses may return 'unable to determine eligibility' rather than a definitive inactive status; always distinguish between confirmed ineligibility and an inconclusive response in application logic.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp