Skip to main content
Version: v0.0.2

Interface: X12PremiumPayments

The top-level result returned by "./get-820.js".get820Payments. Carries the payment header (BPR), reassociation traces (TRN), the premium receiver + remitter parties (Loop 1000A / 1000B), every organization / individual remittance detail loop (Loop 2000 → RMR / ADX), and every warning surfaced during the walk.

Example

import { parseX12, get820Payments } from "@cosyte/x12";
const ix = parseX12(raw);
const tx = ix.groups[0]?.transactions.find((t) => t.st.elements[1] === "820");
if (tx !== undefined) {
const prem = get820Payments(ix.delimiters, tx);
prem.payment.totalPremiumAmount.toString();
for (const r of prem.remittances) {
r.openItems[0]?.amountPaid.toString();
}
}

Properties

payment

readonly payment: X12PremiumPaymentHeader


receiver

readonly receiver: X12PremiumParty | undefined


remittances

readonly remittances: readonly X12PremiumRemittance[]


remitter

readonly remitter: X12PremiumParty | undefined


traces

readonly traces: readonly X12PremiumTrace[]


warnings

readonly warnings: readonly X12ParseWarning[]