X12 820 Payroll Deducted and Other Group Premium Payment Last updated: 2026-09-29

The 820 in HIPAA (005010X218) is the payroll deducted and other group premium payment for insurance products. Employers and plan sponsors use it to pay health plan premiums and to say which members and coverages the payment covers.

BPR carries the payment, TRN its trace number, and ENT loops break the remittance down by organization or individual with RMR segments per premium. Health insurance exchanges use a separate 820 (005010X306) for payments to issuers.

At a glance

Standard
X12 HIPAA
Implementation guide
005010X218
Functional group
RA (GS01)
Sent by
Employer or plan sponsor to health plan
Responses
999
ediFabric .NET template
TS820 in EdiFabric.Templates.Hipaa
OpenEDI definition
View 820 in the spec library

820 structure

The full X12 820 layout from its OpenEDI definition, the same model ediFabric uses to parse, validate and generate it: 15 loops and 41 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
REFPremium Receivers Identification KeySituational>1
Any orderThe loops below can appear in any orderSituational1
DTMProcess DateSituational1
DTMDelivery DateSituational1
DTMCoverage PeriodSituational1
DTMCreation DateSituational1
Any orderThe loops below can appear in any orderRequired1
Loop 1000APremium Receiver NameRequired1
N1Premium Receiver NameRequired1
N2Premium Receiver Additional NameSituational1
N3Premium Receiver AddressSituational1
N4Premium Receiver City State ZIP CodeSituational1
RDMPremium Receiver Remittance Delivery MethodSituational1
Loop 1000BPremium Payer NameRequired1
N1Premium Payer NameRequired1
N2Premium Payer Additional NameSituational1
N3Premium Payer AddressSituational1
N4Premium Payer City State ZIP CodeSituational1
PERPremium Payer Administrative ContactSituational>1
Loop 1000CIntermediary Bank InformationSituational14
N1Intermediary Bank InformationRequired1
N2Intermediary Bank Additional NameSituational1
N3Intermediary Bank AddressSituational1
N4Intermediary Bank City State ZIP CodeSituational1
PERIntermediary Bank Administrative ContactSituational>1
Any orderThe loops below can appear in any orderSituational1
Loop 2000AOrganization Summary RemittanceSituational1
ENTOrganization Summary RemittanceRequired1
Loop 2200AOrganization Summary Remittance Level Adjustmentfor Previous PaymentSituational>1
ADXOrganization Summary Remittance Level Adjustmentfor Previous PaymentRequired1
Loop 2300AOrganization Summary Remittance DetailRequired>1
RMROrganization Summary Remittance DetailRequired1
REFReference InformationSituational>1
DTMOrganizational Coverage PeriodSituational1
Loop 2310ASummary Line ItemSituational1
IT1Summary Line ItemRequired1
Loop 2312AService Promotion Allowance Charge InformationSituational4
SACService Promotion Allowance Charge InformationRequired1
Loop 2315AMember CountSituational3
SLNMember CountRequired1
Loop 2320AOrganization Summary Remittance Level Adjustmentfor Current PaymentSituational>1
ADXOrganization Summary Remittance Level Adjustmentfor Current PaymentRequired1
Loop 2000BIndividual RemittanceSituational99999999
ENTIndividual RemittanceRequired1
Loop 2100BIndividual NameSituational>1
NM1Individual NameRequired1
Loop 2200BIndividual Premium Adjustmentfor Previous PaymentSituational>1
ADXIndividual Premium Adjustmentfor Previous PaymentRequired1
Loop 2300BIndividual Premium Remittance DetailRequired>1
RMRIndividual Premium Remittance DetailRequired1
REFReference InformationSituational>1
DTMIndividual Coverage PeriodSituational1
Loop 2320BIndividual Premium Adjustmentfor Current PaymentSituational>1
ADXIndividual Premium Adjustmentfor Current PaymentRequired1
SETransaction Set TrailerRequired1

Sample 820 file

A premium payment with remittance detail for the covered members. 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*005010X218~
ST*820*0001*005010X218~
BPR*C*19000*C*ACH*CTX*01*999999992*DA*12345678*1030449999**01*199999999*DA*98765*20070516~
TRN*1*12345*1030449999~
REF*14*12345~
N1*PE*DEF HEALTH CARE INC.*FI*012222222~
N1*PR*ABC PLASTICS*FI*123456789~
ENT*1*2L*FI*123456789~
RMR*IK*970501001*PI*16500~
IT1*1~
SLN*1**O*5*IE~
SLN*2**O*75*10~
RMR*IK*970501002*PI*250~
IT1*1~
SLN*1**O*25*IE~
SE*15*0001~
GE*1*101~
IEA*1*000000101~

The same 820 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": "820",
    "TransactionSetControlNumber_02": "0001",
    "ImplementationConventionPreference_03": "005010X218"
  },
  "BPR_FinancialInformation": {
    "TransactionHandlingCode_01": "C",
    "TotalPremiumPaymentAmount_02": "19000",
    "CreditorDebitFlagCode_03": "C",
    "PaymentMethodCode_04": "ACH",
    "PaymentFormatCode_05": "CTX",
    "DepositoryFinancialInstitutionDFIIdentificationNumberQualifier_06": "01",
    "OriginatingDepositoryFinancialInstitutionDFIIdentifier_07": "999999992",
    "AccountNumberQualifier_08": "DA",
    "SenderBankAccountNumber_09": "12345678",
    "PayerIdentifier_10": "1030449999",
    "DepositoryFinancialInstitutionDFIIdentificationNumberQualifier_12": "01",
    "ReceivingDepositoryFinancialInstitutionDFIIdentifier_13": "199999999",
    "AccountNumberQualifier_14": "DA",
    "ReceiverBankAccountNumber_15": "98765",
    "CheckIssueorEFTEffectiveDate_16": "20070516"
  },
  "TRN_ReassociationTraceNumber": {
    "TraceTypeCode_01": "1",
    "CurrentTransactionTraceNumber_02": "12345",
    "OriginatingCompanyIdentifier_03": "1030449999"
  },
  "REF_PremiumReceiversIdentificationKey": [
    {
      "ReferenceIdentificationQualifier_01": "14",
      "MemberGrouporPolicyNumber_02": "12345"
    }
  ],
  "AllN1": {
    "Loop1000A": {
      "N1_PremiumReceiver_Name": {
        "EntityIdentifierCode_01": "PE",
        "PremiumPayerName_02": "DEF HEALTH CARE INC.",
        "IdentificationCodeQualifier_03": "FI",
        "IntermediaryBankIdentifier_04": "012222222"
      }
    },
    "Loop1000B": {
      "N1_PremiumPayer_Name": {
        "EntityIdentifierCode_01": "PR",
        "PremiumPayerName_02": "ABC PLASTICS",
        "IdentificationCodeQualifier_03": "FI",
        "IntermediaryBankIdentifier_04": "123456789"
      }
    }
  },
  "AllENT": {
    "Loop2000A": {
      "ENT_OrganizationSummaryRemittance": {
        "AssignedNumber_01": "1",
        "EntityIdentifierCode_02": "2L",
        "IdentificationCodeQualifier_03": "FI",
        "ReceiversIndividualIdentifier_04": "123456789"
      },
      "Loop2300A": [
        {
          "RMR_OrganizationSummaryRemittanceDetail": {
            "ReferenceIdentificationQualifier_01": "IK",
            "InsuranceRemittanceReferenceNumber_02": "970501001",
            "PaymentActionCode_03": "PI",
            "DetailPremiumPaymentAmount_04": "16500"
          },
          "Loop2310A": {
            "IT1_SummaryLineItem": {
              "LineItemControlNumber_01": "1"
            },
            "Loop2315A": [
              {
                "SLN_MemberCount": {
                  "LineItemControlNumber_01": "1",
                  "InformationOnlyIndicator_03": "O",
                  "HeadCount_04": "5",
                  "CompositeUnitOfMeasure_05": {
                    "UnitorBasisforMeasurementCode_01": "IE"
                  }
                }
              },
              {
                "SLN_MemberCount": {
                  "LineItemControlNumber_01": "2",
                  "InformationOnlyIndicator_03": "O",
                  "HeadCount_04": "75",
                  "CompositeUnitOfMeasure_05": {
                    "UnitorBasisforMeasurementCode_01": "10"
                  }
                }
              }
            ]
          }
        },
        {
          "RMR_OrganizationSummaryRemittanceDetail": {
            "ReferenceIdentificationQualifier_01": "IK",
            "InsuranceRemittanceReferenceNumber_02": "970501002",
            "PaymentActionCode_03": "PI",
            "DetailPremiumPaymentAmount_04": "250"
          },
          "Loop2310A": {
            "IT1_SummaryLineItem": {
              "LineItemControlNumber_01": "1"
            },
            "Loop2315A": [
              {
                "SLN_MemberCount": {
                  "LineItemControlNumber_01": "1",
                  "InformationOnlyIndicator_03": "O",
                  "HeadCount_04": "25",
                  "CompositeUnitOfMeasure_05": {
                    "UnitorBasisforMeasurementCode_01": "IE"
                  }
                }
              }
            ]
          }
        }
      ]
    }
  },
  "SE": {
    "NumberofIncludedSegments_01": "15",
    "TransactionSetControlNumber_02": "0001"
  }
}

Parse and validate an 820 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\PaymentOrder.txt"))
using (var reader = new X12Reader(stream, "EdiFabric.Templates.Hipaa"))
{
    var items = await reader.ReadToEndAsync();
    foreach (var transaction in items.OfType<TS820>())
    {
        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("PaymentOrder.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("PaymentOrder.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("PaymentOrder.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 '@PaymentOrder.txt'

Generate an 820 file

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

using EdiFabric.Templates.Hipaa5010;

License.SetSerial("YOUR_SERIAL_KEY");

var transaction = new TS820();

//  Beginning of an 820 transaction set, Control number = 0001.
transaction.ST = new ST();
transaction.ST.TransactionSetIdentifierCode_01 = "820";
transaction.ST.TransactionSetControlNumber_02 = "0001";
transaction.ST.ImplementationConventionPreference_03 = "005010X218";

// ... 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", "005010X218"));
        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("PaymentOrder.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("PaymentOrder.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("PaymentOrder.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 '@PaymentOrder.json' \
-o 'PaymentOrder.txt'

Complete ediFabric .NET example

A complete C# program for the X12 820, built on TS820 in EdiFabric.Templates.Hipaa. The same code is in the ediFabric .NET examples on GitHub.

using EdiFabric.Framework.Readers;
using EdiFabric.Framework.Writers;
using EdiFabric.Templates.Hipaa5010;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using EdiFabric.Core.Model.Edi;
using EdiFabric.Core.Model.Edi.X12;
using EdiFabric.Examples.X12.Common;

namespace EdiFabric.Examples.X12.T820
{
    class Program
    {
        static void Main(string[] args)
        {
            SerialKey.Set(Common.SerialKey.Get());
            Read();
            Write();
        }

        ///
        /// Read Payment Order
        ///
        static void Read()
        {
            var ediStream = File.OpenRead(Directory.GetCurrentDirectory() + @"\..\..\..\Files\Hipaa\PaymentOrder.txt");

            List ediItems;
            using (var ediReader = new X12Reader(ediStream, "EdiFabric.Templates.Hipaa"))
                ediItems = ediReader.ReadToEnd().ToList();

            var transactions = ediItems.OfType();

            foreach (var transaction in transactions)
            {
                if (transaction.HasErrors)
                {
                    //  partially parsed
                    var errors = transaction.ErrorContext.Flatten();
                }
            }
        }

        ///
        /// Write Payment Order
        ///
        static void Write()
        {
            var transaction = BuildPaymentOrder("1");

            using (var stream = new MemoryStream())
            {
                using (var writer = new X12Writer(stream))
                {
                    writer.Write(SegmentBuilders.BuildIsa("1"));
                    writer.Write(SegmentBuilders.BuildGs("1", "SENDER1", "RECEIVER1", "005010X218"));
                    writer.Write(transaction);
                }

                var ediString = stream.LoadToString();
            }
        }

        ///
        /// Build payment order.
        /// Original from http://www.x12.org/examples/005010X218/summary-bill-payment/
        ///
        static TS820 BuildPaymentOrder(string controlNumber)
        {
            var result = new TS820();

            //  Beginning of an 820 transaction set, Control number = 0001.
            result.ST = new ST();
            result.ST.TransactionSetIdentifierCode_01 = "820";
            result.ST.TransactionSetControlNumber_02 = controlNumber.PadLeft(9, '0');
            result.ST.ImplementationConventionPreference_03 = "005010X218";

            //  Financial institution to include the remittance information with the payment of $19000 using a credit ACH CTX formatted payment.
            //  The premium payer's bank transit routing number is 999999992 and their bank account is 12345678.
            //  The premium payer's Tax ID with a leading 1 is 1030449999.
            //  The premium receiver's bank transit routing number is 199999999 and their bank account is 98765.
            //  The payment effective date is May 16, 2007.
            result.BPR_FinancialInformation = new BPR_FinancialInformation();
            result.BPR_FinancialInformation.TransactionHandlingCode_01 = "C";
            result.BPR_FinancialInformation.TotalPremiumPaymentAmount_02 = "19000";
            result.BPR_FinancialInformation.CreditorDebitFlagCode_03 = "C";
            result.BPR_FinancialInformation.PaymentMethodCode_04 = "ACH";
            result.BPR_FinancialInformation.PaymentFormatCode_05 = "CTX";
            result.BPR_FinancialInformation.DepositoryFinancialInstitutionDFIIdentificationNumberQualifier_06 = "01";
            result.BPR_FinancialInformation.OriginatingDepositoryFinancialInstitutionDFIIdentifier_07 = "999999992";
            result.BPR_FinancialInformation.AccountNumberQualifier_08 = "DA";
            result.BPR_FinancialInformation.SenderBankAccountNumber_09 = "12345678";
            result.BPR_FinancialInformation.PayerIdentifier_10 = "1030449999";
            result.BPR_FinancialInformation.DepositoryFinancialInstitutionDFIIdentificationNumberQualifier_12 = "01";
            result.BPR_FinancialInformation.ReceivingDepositoryFinancialInstitutionDFIIdentifier_13 = "199999999";
            result.BPR_FinancialInformation.AccountNumberQualifier_14 = "DA";
            result.BPR_FinancialInformation.ReceiverBankAccountNumber_15 = "98765";
            result.BPR_FinancialInformation.CheckIssueorEFTEffectiveDate_16 = "20070516";

            //  Reassociation Key provides a sender unique trace number "12345", and the sender's Tax ID number preceded by a 1.
            //  This Key is included in case the sending trace number is duplicated by another sender.
            result.TRN_ReassociationTraceNumber = new TRN_ReassociationTraceNumber();
            result.TRN_ReassociationTraceNumber.TraceTypeCode_01 = "1";
            result.TRN_ReassociationTraceNumber.CurrentTransactionTraceNumber_02 = "12345";
            result.TRN_ReassociationTraceNumber.OriginatingCompanyIdentifier_03 = "1030449999";

            //  Repeating REF
            result.REF_PremiumReceiversIdentificationKey = new List();

            //  The master account number is 12345.
            var ref1 = new REF_PremiumReceiversIdentificationKey();
            ref1.ReferenceIdentificationQualifier_01 = "14";
            ref1.MemberGrouporPolicyNumber_02 = "12345";
            result.REF_PremiumReceiversIdentificationKey.Add(ref1);

            //  Occurrence of N1 Loops in any order
            result.AllN1 = new All_N1_820();

            //  Begin 1000A Loop
            result.AllN1.Loop1000A = new Loop_1000A_820();

            //  The premium receiver's name (DEF HEALTH CARE INC) and federal Tax ID number (012222222).
            result.AllN1.Loop1000A.N1_PremiumReceiver_Name = new N1_PremiumReceiver();
            result.AllN1.Loop1000A.N1_PremiumReceiver_Name.EntityIdentifierCode_01 = "PE";
            result.AllN1.Loop1000A.N1_PremiumReceiver_Name.PremiumPayerName_02 = "DEF HEALTH CARE INC.";
            result.AllN1.Loop1000A.N1_PremiumReceiver_Name.IdentificationCodeQualifier_03 = "FI";
            result.AllN1.Loop1000A.N1_PremiumReceiver_Name.IntermediaryBankIdentifier_04 = "012222222";

            //  End 1000A Loop

            //  Begin 1000B Loop
            result.AllN1.Loop1000B = new Loop_1000B_820();

            //  The premium payer's name (ABC PLASTICS) and federal tax ID number (123456789).
            result.AllN1.Loop1000B.N1_PremiumPayer_Name = new N1_PremiumPayer();
            result.AllN1.Loop1000B.N1_PremiumPayer_Name.EntityIdentifierCode_01 = "PR";
            result.AllN1.Loop1000B.N1_PremiumPayer_Name.PremiumPayerName_02 = "ABC PLASTICS";
            result.AllN1.Loop1000B.N1_PremiumPayer_Name.IdentificationCodeQualifier_03 = "FI";
            result.AllN1.Loop1000B.N1_PremiumPayer_Name.IntermediaryBankIdentifier_04 = "123456789";

            //  End 1000B Loop

            //  Occurrence of ENT Loops in any order
            result.AllENT = new All_ENT_820();

            //  Begin 2000A Loop
            result.AllENT.Loop2000A = new Loop_2000A_820();

            //  Start of detail loop. Identifies this is a corporate entity item (summary bill payment).
            //  The premium payer's federal tax ID number (123456789).
            result.AllENT.Loop2000A.ENT_OrganizationSummaryRemittance = new ENT_OrganizationSummaryRemittance();
            result.AllENT.Loop2000A.ENT_OrganizationSummaryRemittance.AssignedNumber_01 = "1";
            result.AllENT.Loop2000A.ENT_OrganizationSummaryRemittance.EntityIdentifierCode_02 = "2L";
            result.AllENT.Loop2000A.ENT_OrganizationSummaryRemittance.IdentificationCodeQualifier_03 = "FI";
            result.AllENT.Loop2000A.ENT_OrganizationSummaryRemittance.ReceiversIndividualIdentifier_04 = "123456789";

            //  Repeating 2300 Loops
            result.AllENT.Loop2000A.Loop2300A = new List();

            //  Begin 2300A Loop 1
            var loop23001 = new Loop_2300A_820();

            //  The invoice being paid 970501001 (major medical).The amount being paid to this invoice ($16500).
            loop23001.RMR_OrganizationSummaryRemittanceDetail = new RMR_OrganizationSummaryRemittanceDetail();
            loop23001.RMR_OrganizationSummaryRemittanceDetail.ReferenceIdentificationQualifier_01 = "IK";
            loop23001.RMR_OrganizationSummaryRemittanceDetail.InsuranceRemittanceReferenceNumber_02 = "970501001";
            loop23001.RMR_OrganizationSummaryRemittanceDetail.PaymentActionCode_03 = "PI";
            loop23001.RMR_OrganizationSummaryRemittanceDetail.DetailPremiumPaymentAmount_04 = "16500";

            //  Begin 2310A Loop
            loop23001.Loop2310A = new Loop_2310A_820();

            //  Start of required member counts under a summary RMR item.
            loop23001.Loop2310A.IT1_SummaryLineItem = new IT1_SummaryLineItem();
            loop23001.Loop2310A.IT1_SummaryLineItem.LineItemControlNumber_01 = "1";

            //  Repeating 2315A Loop
            loop23001.Loop2310A.Loop2315A = new List();

            //  Begin 2315A Loop 1
            var loop2315a1 = new Loop_2315A_820();

            //  Five of the 80 employees have individual coverage.
            loop2315a1.SLN_MemberCount = new SLN_MemberCount();
            loop2315a1.SLN_MemberCount.LineItemControlNumber_01 = "1";
            loop2315a1.SLN_MemberCount.InformationOnlyIndicator_03 = "O";
            loop2315a1.SLN_MemberCount.HeadCount_04 = "5";
            loop2315a1.SLN_MemberCount.CompositeUnitOfMeasure_05 = new C001_CompositeUnitOfMeasure_4();
            loop2315a1.SLN_MemberCount.CompositeUnitOfMeasure_05.UnitorBasisforMeasurementCode_01 = "IE";

            //  End 2315A Loop 1
            loop23001.Loop2310A.Loop2315A.Add(loop2315a1);

            //  Begin 2315A Loop 2
            var loop2315a2 = new Loop_2315A_820();

            //  Seventy-five of the 80 employees have family coverage.
            loop2315a2.SLN_MemberCount = new SLN_MemberCount();
            loop2315a2.SLN_MemberCount.LineItemControlNumber_01 = "2";
            loop2315a2.SLN_MemberCount.InformationOnlyIndicator_03 = "O";
            loop2315a2.SLN_MemberCount.HeadCount_04 = "75";
            loop2315a2.SLN_MemberCount.CompositeUnitOfMeasure_05 = new C001_CompositeUnitOfMeasure_4();
            loop2315a2.SLN_MemberCount.CompositeUnitOfMeasure_05.UnitorBasisforMeasurementCode_01 = "10";

            //  End 2315A Loop 2
            loop23001.Loop2310A.Loop2315A.Add(loop2315a2);

            //  End 2310A Loop

            //  End 2300A Loop 1
            result.AllENT.Loop2000A.Loop2300A.Add(loop23001);

            //  Begin 2300A Loop 2
            var loop23002 = new Loop_2300A_820();

            //  The invoice being paid 970501002 (disability). The amount being paid to this invoice ($2500).
            loop23002.RMR_OrganizationSummaryRemittanceDetail = new RMR_OrganizationSummaryRemittanceDetail();
            loop23002.RMR_OrganizationSummaryRemittanceDetail.ReferenceIdentificationQualifier_01 = "IK";
            loop23002.RMR_OrganizationSummaryRemittanceDetail.InsuranceRemittanceReferenceNumber_02 = "970501002";
            loop23002.RMR_OrganizationSummaryRemittanceDetail.PaymentActionCode_03 = "PI";
            loop23002.RMR_OrganizationSummaryRemittanceDetail.DetailPremiumPaymentAmount_04 = "250";

            //  Begin 2310A Loop
            loop23002.Loop2310A = new Loop_2310A_820();

            //  Start of required member counts under a summary RMR item.
            loop23002.Loop2310A.IT1_SummaryLineItem = new IT1_SummaryLineItem();
            loop23002.Loop2310A.IT1_SummaryLineItem.LineItemControlNumber_01 = "1";

            //  Repeating 2315A Loop
            loop23002.Loop2310A.Loop2315A = new List();

            //  Begin 2315A Loop 1
            var loop2315a3 = new Loop_2315A_820();

            //  Twenty-five employees have disability coverage.
            loop2315a3.SLN_MemberCount = new SLN_MemberCount();
            loop2315a3.SLN_MemberCount.LineItemControlNumber_01 = "1";
            loop2315a3.SLN_MemberCount.InformationOnlyIndicator_03 = "O";
            loop2315a3.SLN_MemberCount.HeadCount_04 = "25";
            loop2315a3.SLN_MemberCount.CompositeUnitOfMeasure_05 = new C001_CompositeUnitOfMeasure_4();
            loop2315a3.SLN_MemberCount.CompositeUnitOfMeasure_05.UnitorBasisforMeasurementCode_01 = "IE";

            //  End 2315A Loop 1
            loop23002.Loop2310A.Loop2315A.Add(loop2315a3);

            //  End 2310A Loop

            //  End 2300A Loop 2
            result.AllENT.Loop2000A.Loop2300A.Add(loop23002);

            //  End 2000A Loop

            return result;
        }
    }
}

More operations in ediFabric .NET

820 questions

What is the difference between the HIPAA 820 and the 820 HIX?

005010X218 is used by employers and sponsors to pay group premiums. 005010X306 is used between health insurance exchanges and issuers for exchange-related premium payments.

How is an 820 matched with the money?

TRN02 is the trace number that also travels with the funds transfer, and BPR02 is the total amount.

Yes. The 834 enrolls the members, the 820 pays the premiums for them. Both usually come from the same employer or sponsor.

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

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

Resources

Parse your first X12 820 in five minutes

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

Sign up free Validate EDI files free