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
readonlypayment:X12PremiumPaymentHeader
receiver
readonlyreceiver:X12PremiumParty|undefined
remittances
readonlyremittances: readonlyX12PremiumRemittance[]
remitter
readonlyremitter:X12PremiumParty|undefined
traces
readonlytraces: readonlyX12PremiumTrace[]
warnings
readonlywarnings: readonlyX12ParseWarning[]