StarlightContact Us
Developer Guide

NCPDP to JSON

The NCPDP Telecommunication Standard is the backbone of pharmacy claims in the US. It's also a nightmare to implement. Starlight converts it all to JSON.

The NCPDP Telecom format

The NCPDP Telecommunication Standard (version D.0) is a delimiter-based binary protocol used by virtually every pharmacy in the United States to submit claims to PBMs and insurance companies. It handles billions of transactions per year.

The format uses field separators (0x1C), group separators (0x1D), and segment identifiers to encode claim data. Numeric fields use signed overpunch encoding — a legacy format where the last digit of a number encodes both the digit and the sign (positive/negative).

Every integration team building pharmacy claims software must implement this protocol from scratch: parsing segment separators, decoding overpunch fields, managing payer-specific field requirements, and maintaining switch connectivity.

Before and after Starlight

Traditional NCPDP Telecom (raw)
 AM04 C2025862 C3TSAC C699995717 D2SAMPLE123456 D3002 D402 CA JOHN CB SMITH CC19900301 CD01 CM54321 E103 D7999000001234 D81 DE00000000000 DF28 DD28 DE20260101 DJ0 DB1234567890 DRSAMPLE PM5555555555
Starlight JSON
{
  "transaction_type": "B1",
  "patient": {
    "first_name": "JOHN",
    "last_name": "SMITH",
    "date_of_birth": "19900301",
    "gender": "M",
    "zip_code": "54321"
  },
  "insurance": {
    "bin_number": "999999",
    "pcn": "TEST",
    "group_id": "GRP999999",
    "cardholder_id": "SAMPLE123456"
  },
  "prescription": {
    "rx_number": "999000001234",
    "product_id": "00000000000",
    "quantity_dispensed": "28",
    "days_supply": "28"
  }
}

What Starlight handles for you

Protocol encoding

NCPDP field/group/segment separators, header construction, version negotiation

Signed overpunch

Automatic encoding/decoding of NCPDP numeric format — you send normal numbers

Payer routing

BIN/PCN-based routing to the correct switch and PBM — no payer sheet management

Switch connectivity

Maintained connections to pharmacy claim switches — no contracts or certifications needed

Field validation

NCPDP field-level validation before submission — catch errors before they hit the PBM

Response parsing

Raw NCPDP response decoded into clean JSON with status, amounts, reject codes, and messages

Supported NCPDP transactions

Built for developers

  • Pharmacy POS/management system builders who need claims connectivity
  • Digital health startups integrating pharmacy benefits into their platform
  • PBM technology teams building modern adjudication interfaces
  • Healthcare interoperability companies bridging legacy and modern systems
  • Drug discount card and copay assistance program developers
  • Anyone who has ever stared at an NCPDP payer sheet and wanted to cry

Stop parsing NCPDP. Start shipping.

JSON in, JSON out. Your first claim in 60 seconds.