X12 835 Health Care Claim Payment/Advice

The 835 is the HIPAA electronic remittance advice (ERA). A payer sends it to a provider to explain how each claim was paid, adjusted or denied, and it usually accompanies an EFT payment.

BPR carries the payment amount and method, TRN the trace number that links the 835 to the EFT, and each CLP loop reports one claim with its CAS adjustments and SVC service line payments. Provider-level adjustments sit in PLB at the end.

At a glance

Standard
X12 HIPAA
Implementation guide
005010X221A1
Functional group
HP (GS01)
Sent by
Payer to provider or billing service
Responses
999
ediFabric .NET template
TS835 in EdiFabric.Templates.Hipaa
OpenEDI definition
View 835 in the spec library

835 structure

The full X12 835 layout from its OpenEDI definition, the same model ediFabric uses to parse, validate and generate it: 5 loops and 53 segment positions, in file order. Loops are shaded and their segments indented; Max use is how many times a segment or loop may repeat.

Segment / loop Name Usage Max use
STTransaction Set HeaderRequired1
BPRFinancial InformationRequired1
TRNReassociation Trace NumberRequired1
CURForeign Currency InformationSituational1
Any orderThe loops below can appear in any orderSituational1
REFReceiver IdentificationSituational1
REFVersion IdentificationSituational1
DTMProduction DateSituational1
Any orderThe loops below can appear in any orderRequired1
Loop 1000APayer IdentificationRequired1
N1Payer IdentificationRequired1
N3Payer AddressRequired1
N4Payer City State ZIP CodeRequired1
REFAdditional Payer IdentificationSituational4
Any orderThe loops below can appear in any orderRequired1
PERPayer Business Contact InformationSituational1
PERPayer Technical Contact InformationRequired>1
PERPayer WEB SiteSituational1
Loop 1000BPayee IdentificationRequired1
N1Payee IdentificationRequired1
N3Payee AddressSituational1
N4Payee City State ZIP CodeSituational1
REFPayee Additional IdentificationSituational>1
RDMRemittance Delivery MethodSituational1
Loop 2000Header NumberSituational>1
LXHeader NumberRequired1
TS3Provider Summary InformationSituational1
TS2Provider Supplemental Summary InformationSituational1
Loop 2100Claim Payment InformationRequired>1
CLPClaim Payment InformationRequired1
CASClaims AdjustmentSituational99
Any orderThe loops below can appear in any orderRequired1
NM1Patient NameRequired1
NM1Insured NameSituational1
NM1Corrected Patient Insured NameSituational1
NM1Service Provider NameSituational1
NM1Crossover Carrier NameSituational1
NM1Corrected Priority Payer NameSituational1
NM1Other Subscriber NameSituational1
MIAInpatient Adjudication InformationSituational1
MOAOutpatient Adjudication InformationSituational1
Any orderThe loops below can appear in any orderSituational1
REFOther Claim Related IdentificationSituational5
REFRendering Provider IdentificationSituational10
Any orderThe loops below can appear in any orderSituational1
DTMStatement Fromor to DateSituational2
DTMCoverage Expiration DateSituational1
DTMClaim Received DateSituational1
PERClaim Contact InformationSituational2
AMTClaim Supplemental InformationSituational13
QTYClaim Supplemental Information QuantitySituational14
Loop 2110Service Payment InformationSituational999
SVCService Payment InformationRequired1
DTMService DateSituational2
CASService AdjustmentSituational99
Any orderThe loops below can appear in any orderSituational1
REFService IdentificationSituational8
REFLine Item Control NumberSituational1
REFRendering Provider InformationSituational10
REFHealth Care Policy IdentificationSituational5
AMTService Supplemental AmountSituational9
QTYService Supplemental QuantitySituational6
LQHealth Care Remark CodesSituational99
PLBProvider AdjustmentSituational>1
SETransaction Set TrailerRequired1

Usage follows the 005010X221A1 implementation guide: Required segments must be sent, Situational ones only when the guide's condition applies. Trading partners often add their own rules in companion guides - ediFabric templates can be adjusted to match. Open the element-level definition in the EdiNation spec library.

Sample 835 file

A remittance for one payment with claim-level and service-level adjustments. Paste it into EdiNation to see every element named and validated.

ISA*00*          *00*          *ZZ*1234567        *ZZ*11111          *170508*1141*^*00501*000000101*1*P*:~
GS*HC*XXXXXXX*XXXXX*20170617*1741*101*X*005010X221A1~
ST*835*0001~
BPR*I*34.00*C*CHK************20050318~
TRN*1*0063158ABC*1566339911~
REF*EV*030240928~
DTM*405*20050318~
N1*PR*YOUR TAX DOLLARS AT WORK~
N3*481A00 DEER RUN ROAD~
N4*WEST PALM BCH*FL*11114~
PER*BL*JOHN WAYNE*TE*8005551212*EX*123~
N1*PE*ATONEWITHHEALTH*FI*3UR334563~
N3*3501 JOHNSON STREET~
N4*SUNSHINE*FL*12345~
REF*PQ*11861~
LX*1~
CLP*0001000055*2*541*34**12*50650619501~
NM1*QC*1*BURCK*RAYMOND*W***MI*987654321~
NM1*82*2*PROFESSIONAL TEST 1*****BS*34426~
DTM*232*20050202~
DTM*233*20050202~
SVC*HC:55669*541*34*1~
DTM*472*20050202~
CAS*OA*23*516~
CAS*OA*94*-9~
REF*1B*44280~
AMT*B6*550~
SE*26*0001~
GE*1*101~
IEA*1*000000101~

The same 835 as JSON

ediFabric turns every loop, segment and element into a named field. This is the transaction from the sample, in the JSON that ediFabric Native and Cloud return and accept.

{
  "ST": {
    "TransactionSetIdentifierCode_01": "835",
    "TransactionSetControlNumber_02": "0001"
  },
  "BPR_FinancialInformation": {
    "TransactionHandlingCode_01": "I",
    "TotalPremiumPaymentAmount_02": "34.00",
    "CreditorDebitFlagCode_03": "C",
    "PaymentMethodCode_04": "CHK",
    "CheckIssueorEFTEffectiveDate_16": "20050318"
  },
  "TRN_ReassociationTraceNumber": {
    "TraceTypeCode_01": "1",
    "CurrentTransactionTraceNumber_02": "0063158ABC",
    "OriginatingCompanyIdentifier_03": "1566339911"
  },
  "AllREF": {
    "REF_ReceiverIdentification": {
      "ReferenceIdentificationQualifier_01": "EV",
      "MemberGrouporPolicyNumber_02": "030240928"
    }
  },
  "DTM_ProductionDate": {
    "DateTimeQualifier_01": "405",
    "Date_02": "20050318"
  },
  "AllN1": {
    "Loop1000A": {
      "N1_PayerIdentification": {
        "EntityIdentifierCode_01": "PR",
        "PremiumPayerName_02": "YOUR TAX DOLLARS AT WORK"
      },
      "N3_PayerAddress": {
        "ResponseContactAddressLine_01": "481A00 DEER RUN ROAD"
      },
      "N4_PayerCity_State_ZIPCode": {
        "AdditionalPatientInformationContactCityName_01": "WEST PALM BCH",
        "AdditionalPatientInformationContactStateCode_02": "FL",
        "AdditionalPatientInformationContactPostalZoneorZIPCode_03": "11114"
      },
      "AllPER": {
        "PER_PayerTechnicalContactInformation": [
          {
            "ContactFunctionCode_01": "BL",
            "ResponseContactName_02": "JOHN WAYNE",
            "CommunicationNumberQualifier_03": "TE",
            "ResponseContactCommunicationNumber_04": "8005551212",
            "CommunicationNumberQualifier_05": "EX",
            "ResponseContactCommunicationNumber_06": "123"
          }
        ]
      }
    },
    "Loop1000B": {
      "N1_PayeeIdentification": {
        "EntityIdentifierCode_01": "PE",
        "PremiumPayerName_02": "ATONEWITHHEALTH",
        "IdentificationCodeQualifier_03": "FI",
        "IntermediaryBankIdentifier_04": "3UR334563"
      },
      "N3_PayeeAddress": {
        "ResponseContactAddressLine_01": "3501 JOHNSON STREET"
      },
      "N4_PayeeCity_State_ZIPCode": {
        "AdditionalPatientInformationContactCityName_01": "SUNSHINE",
        "AdditionalPatientInformationContactStateCode_02": "FL",
        "AdditionalPatientInformationContactPostalZoneorZIPCode_03": "12345"
      },
      "REF_PayeeAdditionalIdentification": [
        {
          "ReferenceIdentificationQualifier_01": "PQ",
          "MemberGrouporPolicyNumber_02": "11861"
        }
      ]
    }
  },
  "Loop2000": [
    {
      "LX_HeaderNumber": {
        "AssignedNumber_01": "1"
      },
      "Loop2100": [
        {
          "CLP_ClaimPaymentInformation": {
            "PatientControlNumber_01": "0001000055",
            "ClaimStatusCode_02": "2",
            "TotalClaimChargeAmount_03": "541",
            "ClaimPaymentAmount_04": "34",
            "ClaimFilingIndicatorCode_06": "12",
            "PayerClaimControlNumber_07": "50650619501"
          },
          "AllNM1": {
            "NM1_PatientName": {
              "EntityIdentifierCode_01": "QC",
              "EntityTypeQualifier_02": "1",
              "ResponseContactLastorOrganizationName_03": "BURCK",
              "ResponseContactFirstName_04": "RAYMOND",
              "ResponseContactMiddleName_05": "W",
              "IdentificationCodeQualifier_08": "MI",
              "ResponseContactIdentifier_09": "987654321"
            },
            "NM1_ServiceProviderName": {
              "EntityIdentifierCode_01": "82",
              "EntityTypeQualifier_02": "2",
              "ResponseContactLastorOrganizationName_03": "PROFESSIONAL TEST 1",
              "IdentificationCodeQualifier_08": "BS",
              "ResponseContactIdentifier_09": "34426"
            }
          },
          "AllDTM": {
            "DTM_StatementFromorToDate": [
              {
                "DateTimeQualifier_01": "232",
                "Date_02": "20050202"
              },
              {
                "DateTimeQualifier_01": "233",
                "Date_02": "20050202"
              }
            ]
          },
          "Loop2110": [
            {
              "SVC_ServicePaymentInformation": {
                "CompositeMedicalProcedureIdentifier_01": {
                  "ProductorServiceIDQualifier_01": "HC",
                  "ProcedureCode_02": "55669"
                },
                "LineItemChargeAmount_02": "541",
                "MonetaryAmount_03": "34",
                "RevenueCode_04": "1"
              },
              "DTM_ServiceDate": [
                {
                  "DateTimeQualifier_01": "472",
                  "Date_02": "20050202"
                }
              ],
              "CAS_ServiceAdjustment": [
                {
                  "ClaimAdjustmentGroupCode_01": "OA",
                  "AdjustmentReasonCode_02": "23",
                  "AdjustmentAmount_03": "516"
                },
                {
                  "ClaimAdjustmentGroupCode_01": "OA",
                  "AdjustmentReasonCode_02": "94",
                  "AdjustmentAmount_03": "-9"
                }
              ],
              "AllREF": {
                "REF_RenderingProviderInformation": [
                  {
                    "ReferenceIdentificationQualifier_01": "1B",
                    "MemberGrouporPolicyNumber_02": "44280"
                  }
                ]
              },
              "AMT_ServiceSupplementalAmount": [
                {
                  "AmountQualifierCode_01": "B6",
                  "TotalClaimChargeAmount_02": "550"
                }
              ]
            }
          ]
        }
      ]
    }
  ],
  "SE": {
    "NumberofIncludedSegments_01": "26",
    "TransactionSetControlNumber_02": "0001"
  }
}

Parse and validate an 835 file

Read the file into typed objects with ediFabric .NET, convert it to JSON in process with the ediFabric Native bindings for Python, Java and C, or post it to the ediFabric Cloud REST API from any language.

using EdiFabric.Templates.Hipaa5010;

License.SetSerial("YOUR_SERIAL_KEY");

using (var stream = File.OpenRead(@"C:\edi\Payment.txt"))
using (var reader = new X12Reader(stream, "EdiFabric.Templates.Hipaa"))
{
    var items = await reader.ReadToEndAsync();
    foreach (var transaction in items.OfType<TS835>())
    {
        if (transaction.IsValid(out MessageErrorContext errors))
            Console.WriteLine($"{transaction.ST.TransactionSetControlNumber_02} is valid");
        else
            Console.WriteLine(string.Join(Environment.NewLine, errors.Flatten()));
    }
}
import json
import edifabric_x12 as ef

serial = "YOUR_SERIAL_KEY"
ef.load_library()
ef.set_serial(serial)
ef.set_map(json.dumps({"default": serial, "maps": {}}))

edi = open("Payment.txt", "rb").read()
output, offset = ef.parse(edi, ef.ParseMode.JSON_VALIDATE)
transactions = output[:offset]
report = json.loads(output[offset:])
print(report["errors_count"])
import com.edifabric.nativex12.EdiFabricX12;
import com.edifabric.nativex12.ParseMode;
import com.edifabric.nativex12.ParseResult;

String serial = "YOUR_SERIAL_KEY";
EdiFabricX12.loadLibrary();
EdiFabricX12.setSerial(serial);
EdiFabricX12.setMap("{\"default\":\"" + serial + "\",\"maps\":{}}");

String edi = Files.readString(Path.of("Payment.txt"));
ParseResult result = EdiFabricX12.parse(edi, ParseMode.JSON_VALIDATE);
System.out.println(result.getTransactions());
System.out.println(result.getReport());
#include "edifabric_x12.h"

const char *serial = "YOUR_SERIAL_KEY";
ef_parse_result result;

if (ef_load_library(NULL) != 0)
    return 1;
ef_set_serial(serial);
ef_set_map("{\"default\":\"YOUR_SERIAL_KEY\",\"maps\":{}}");

char *edi = read_file("Payment.txt", NULL);   /* helper in example_all_functions.c */
if (ef_parse(edi, EF_PARSE_JSON_VALIDATE, NULL, &result) == 0) {
    /* transactions = output[0 .. offset), report = output[offset .. length) */
    fwrite(result.output.data, 1, (size_t)result.output.length, stdout);
    ef_free(result.output.data);
}
curl -X POST 'https://api.edination.com/v2/x12/read' \
-H 'Ocp-Apim-Subscription-Key: YOUR_SERIAL_KEY' \
-H 'Content-Type: application/octet-stream' \
--data-binary '@Payment.txt'

Generate an 835 file

Populate a TS835 object in .NET, or pass JSON in the shape shown above to ediFabric Native or ediFabric Cloud, and get a valid 835 file back.

using EdiFabric.Templates.Hipaa5010;

License.SetSerial("YOUR_SERIAL_KEY");

var transaction = new TS835();

transaction.ST = new ST();
transaction.ST.TransactionSetIdentifierCode_01 = "835";
transaction.ST.TransactionSetControlNumber_02 = "0001";

transaction.BPR_FinancialInformation = new BPR_FinancialInformation_2();
transaction.BPR_FinancialInformation.TransactionHandlingCode_01 = "I";
transaction.BPR_FinancialInformation.TotalPremiumPaymentAmount_02 = "34.00";
transaction.BPR_FinancialInformation.CreditorDebitFlagCode_03 = "C";
transaction.BPR_FinancialInformation.PaymentMethodCode_04 = "CHK";
transaction.BPR_FinancialInformation.CheckIssueorEFTEffectiveDate_16 = "20050318";

transaction.TRN_ReassociationTraceNumber = new TRN_DependentTraceNumber();
transaction.TRN_ReassociationTraceNumber.TraceTypeCode_01 = "1";
transaction.TRN_ReassociationTraceNumber.CurrentTransactionTraceNumber_02 = "0063158ABC";
transaction.TRN_ReassociationTraceNumber.OriginatingCompanyIdentifier_03 = "1566339911";

//  Occurrence of REF Segments in any order
transaction.AllREF = new All_REF_835_3();

// ... set the remaining loops and segments the same way

// SegmentBuilders is in the Common project of the example repository
using (var stream = new MemoryStream())
{
    using (var writer = new X12Writer(stream))
    {
        writer.Write(SegmentBuilders.BuildIsa("1"));
        writer.Write(SegmentBuilders.BuildGs("1", "SENDER1", "RECEIVER1", "005010X221A1"));
        writer.Write(transaction);
    }
    Console.WriteLine(Encoding.UTF8.GetString(stream.ToArray()));
}
import json
import edifabric_x12 as ef

serial = "YOUR_SERIAL_KEY"
ef.load_library()
ef.set_serial(serial)
ef.set_map(json.dumps({"default": serial, "maps": {}}))

# the transactions JSON returned by ef.parse, edited or produced by your application
transactions = open("Payment.json", "rb").read()
edi = ef.build(transactions, postfix="\r\n")
print(edi)
import com.edifabric.nativex12.EdiFabricX12;

String serial = "YOUR_SERIAL_KEY";
EdiFabricX12.loadLibrary();
EdiFabricX12.setSerial(serial);
EdiFabricX12.setMap("{\"default\":\"" + serial + "\",\"maps\":{}}");

// the transactions JSON returned by parse, edited or produced by your application
String transactions = Files.readString(Path.of("Payment.json"));
String edi = EdiFabricX12.build(transactions, "\r\n");
System.out.println(edi);
#include "edifabric_x12.h"

ef_buffer edi;

if (ef_load_library(NULL) != 0)
    return 1;
ef_set_serial("YOUR_SERIAL_KEY");
ef_set_map("{\"default\":\"YOUR_SERIAL_KEY\",\"maps\":{}}");

/* the transactions JSON returned by ef_parse, edited or produced by your application */
char *transactions = read_file("Payment.json", NULL);
if (ef_build(transactions, "\r\n", &edi) == 0) {
    fwrite(edi.data, 1, (size_t)edi.length, stdout);
    ef_free(edi.data);
}
# the JSON returned by /read, edited or produced by your application
curl -X POST 'https://api.edination.com/v2/x12/write' \
-H 'Ocp-Apim-Subscription-Key: YOUR_SERIAL_KEY' \
-H 'Content-Type: application/json' \
--data-binary '@Payment.json' \
-o 'Payment.txt'

835 questions

How do I match an 835 to the bank deposit?

TRN02 is the check or EFT trace number and BPR02 the payment amount. The same trace number is sent with the ACH CCD+ payment, so the two can be reassociated automatically.

What do the CAS group codes mean?

CAS01 groups each adjustment: CO contractual obligation, PR patient responsibility, OA other adjustments, PI payer initiated reductions. CAS02 is the claim adjustment reason code (CARC).

Does an 835 always carry a payment?

No. BPR04 NON means no payment, for example when every claim was denied or the payment was sent separately. BPR01 H is notification only.

How do I parse and generate X12 835 files in .NET, Python, Java and C?

In .NET, install EdiFabric and EdiFabric.Templates.Hipaa, read the file with X12Reader into TS835 objects and write them back with X12Writer. From Python, Java or C, use ediFabric Native, which converts 835 files to JSON and JSON back to X12 inside your process. From any other language, post the file to the ediFabric Cloud REST API.

Related transactions

Parse your first 835 in five minutes

The Community plan is free forever and needs no credit card. It includes ediFabric .NET, Native and Cloud.