Build the NCPDP Telecom D.0 (or current version) B1 claim request: fixed-width or variable-length segments grouped into Transaction Header (Segment ID 'AM'), Insurance (Segment ID 'AM' group B1), Patient (Segment ID 'CA'), Claim (Segment ID '07'), Pricing (Segment ID '11'), and Prescriber (Segment ID '03') segments
Populate mandatory claim fields: NCPDP Provider ID (Field 201-B1), Date of Service (401-D1 CCYYMMDD), RxNumber (402-D2), Drug NDC (407-D7 in 11-digit format), Quantity Dispensed (442-E7), Days Supply (405-D5), Compound Code (406-D6), DAW Code (408-D8), and the primary payer BIN/PCN/Group from the insurance card
Submit the request to the PBM or payer switch via HTTPS or VPN-secured TCP; the response returns a header with Response Status (Field 501-F1): 'P' for paid, 'R' for rejected, 'D' for duplicate
On a 'P' response, parse the Pricing segment response fields: Ingredient Cost Paid (506-F6), Dispensing Fee Paid (507-F7), Patient Pay Amount (505-F5), and Other Payer Amount Recognized (565-J4) for copay calculation and patient receipt
For a B2 reversal, build a new transaction with Transaction Code 'B2': reuse the original claim's BIN/PCN, Service Provider ID, Date of Service, Rx Number, and Fill Number exactly; submit within the payer's reversal window (typically up to 30 days, but varies)
Confirm reversal with response status 'P' on the B2 transaction; a 'R' reversal rejection with reject code '88' (DUR reject) or '14' (M/I Date of Service) indicates a field mismatch with the original claim
Known gotchas
The BIN/PCN combination routes the transaction to the correct PBM processor — an incorrect PCN routes to the wrong benefit plan and returns reject code '25' (non-matched group) or routes successfully but adjudicates under the wrong formulary
NDC must be submitted in 11-digit format (5-4-2 labeler-product-package) without hyphens; a 10-digit NDC that omits a leading zero in any segment will cause a drug-not-found rejection
Reversals must include the exact original fill number (Segment 'D' Field 403-D3); incrementing fill numbers for a resubmission without first reversing the original creates a duplicate claim that reduces future refill eligibility
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