Skip to main content
Version: v0.0.2

Function: parseTA1()

parseTA1(interchange): X12AckTA1 | undefined

Decode the first TA1 Interchange Acknowledgment on the supplied interchange. Returns the typed X12AckTA1 or undefined when the interchange has no TA1 (the common case for non-ack inbounds).

Parameters

interchange

X12Interchange

Returns

X12AckTA1 | undefined

Example

import { parseTA1, parseX12 } from "@cosyte/x12";
const ix = parseX12(rawAckBytes);
const ta1 = parseTA1(ix);
if (ta1?.ackCode === "R") {
// inbound interchange was rejected
}