Target Edi 997

By Alexander Georges|Updated February 27, 2026
TL;DR: This guide explains how Target's EDI 997 functional acknowledgment works, how to interpret AK1/AK2/AK5/AK9 statuses, common rejection reasons, and how to convert Target 997s into CSV for downstream systems. Use the practical step-by-step checks, real code examples, and troubleshooting patterns below to resolve Target-specific 997 issues quickly and prevent recurring chargebacks. Verify current Target program changes (effective 2025-12-14) in the Target vendor portal; Verify current requirements with retailer portal.

What This Is

This guide focuses on the X12 997 functional acknowledgment when interacting with Target's EDI environment. The 997 is not a transaction set containing business data; it is an acknowledgment that reports syntactic validation and acceptance/rejection at the interchange, functional group, and transaction set levels. For Target vendors, correctly processing and responding to 997s prevents re-sends, avoids duplicate transactions, and helps maintain compliance metrics.

You will learn how Target-specific 997s differ in practice from generic 997s, how to extract actionable fields (ISA/GS control numbers, AK1 group identifiers, AK2 transaction set IDs, AK5 accept/reject codes, and AK9 summary codes), and how to convert 997 acknowledgments into CSV rows for ERP ingestion, ticketing, or automated exception workflows. Target program information has an effective date of 2025-12-14; Verify current requirements with retailer portal.

Who This Is For

This guide targets EDI analysts, integration engineers, vendor compliance teams, and 3PLs who exchange X12 transactions with Target and need reliable, repeatable procedures to parse 997s, remediate rejections, and integrate acknowledgment data into operational systems (ERP, WMS, ticketing). If you process Target 850s/856s/810s and use automated acknowledgment handling, this guide is for you.

Key Segments Explained

  • ISA (Interchange Control Header) — The envelope for the interchange. Relevant fields: ISA13 (interchange control number), ISA11 (repetition separator in some versions), element and component delimiters. When the ISA control number does not match the IEA trailer, the interchange is corrupt and Target will reject the whole envelope.
  • GS (Functional Group Header) — Groups transaction sets of the same type (e.g., all 850s). Key fields: GS06 (group control number). If GS/GE counts or numbers mismatch, AK1/AK9 will show group-level rejects.
  • ST (Transaction Set Header) inside the original transaction — Each acknowledged transaction is referenced by its ST02 control number in an AK2 segment. The 997 does not contain business data but uses the ST identifiers to tell you which transaction sets were rejected or accepted.
  • AK1 / AK2AK1 identifies the functional group being acknowledged (AK101 functional identifier code, AK102 group control number). AK2 references individual transaction sets by transaction set ID code and transaction set control number (ST02).
  • AK5 — Transaction set level status. Codes: A = Accepted, R = Rejected, P = Partially Accepted. When AK5 is R, the following AK3 and AK4 provide error detail (segment/element positions).
  • AK9 — Group-level summary: number of transaction sets received, accepted, and rejected. AK9 complements AK5/AK2 and is the first place to detect group-level failures.

Example EDI Snippet

ISA*00*          *00*          *ZZ*SENDERID       *ZZ*TARGETID       *210214*1230*U*00401*000000905*0*T*:~
GS*FA*SENDERID*TARGETID*20210214*1230*905*X*004010~
ST*997*0001~
AK1*PO*1001~
AK2*850*0001001~
AK5*R~
AK3*PO1*4*5~
AK4*2*400*16*Invalid segment terminator~
AK2*850*0001002~
AK5*A~
AK9*R*2*1*1~
SE*8*0001~
GE*1*905~
IEA*1*000000905~

Line-by-line explanation:

  • ISA*...~ — Interchange header; ISA13 = 000000905 is the interchange control number. If this number does not match the IEA trailer, the interchange is invalid.
  • GS*FA*...*905*X*004010~ — Functional group header for functional acknowledgment (FA), group control number 905, X12 version 004010.
  • ST*997*0001~ — The 997 transaction starts; control number 0001.
  • AK1*PO*1001~ — Acknowledging a functional group of PO transaction sets (Target’s PO group control number 1001).
  • AK2*850*0001001~ — Reference to the original PO transaction set ST02 = 0001001.
  • AK5*R~ — The specific 850 transaction referenced was rejected.
  • AK3*PO1*4*5~ — Segment-level problem: segment ID PO1, position 4 in the transaction, error code 5 (segment too few elements or data invalid depending on code list).
  • AK4*2*400*16*Invalid segment terminator~ — Element-level detail: element position 2, error code 400 (implementation-specific), with human-readable explanation appended for clarity.
  • AK2*850*0001002~ — Another referenced 850 with ST02 0001002.
  • AK5*A~ — That transaction was accepted.
  • AK9*R*2*1*1~ — Group summary: status Rejected; 2 transaction sets received, 1 accepted, 1 rejected.

CSV Output Example

InterchangeControlNumber GroupControlNumber TransactionSetID STControlNumber Status ErrorSegment ErrorElementPosition ErrorCode HumanMessage
000000905 1001 850 0001001 R PO1 2 400 Invalid segment terminator
000000905 1001 850 0001002 A Accepted

Map explanation: each CSV row represents one AK2/AK5 combination (transaction set acknowledgement). Use additional rows for multiple AK4 errors per AK2 when you need verbose error tracking.

Step-by-Step Conversion Process

  1. Retrieve the 997 reliably
    1. Receive the 997 from VAN/AS2/FTP. Ensure the file transfer logged the filename and timestamp.
    2. Confirm the interchange delimiters using ISA16 (component separator), ISA11 (repetition), element separator (usually *), and segment terminator (commonly ~). If delimiters are wrong, parsing fails downstream.
  2. Validate envelope consistency
    1. Check ISA13 vs IEA01 control numbers and GS06 vs GE01. If counts or numbers mismatch, mark the entire interchange as corrupt and open a ticket with Target.
    2. Record the interchange and group control numbers in your CSV or database. These fields are your primary keys for reconciliation.
  3. Extract AK1/AK2/AK5/AK9 details
    1. For each AK1, group all following AK2 segments until the next AK1 or the 997 ends.
    2. For each AK2, capture the transaction set ID and ST control number, then capture the immediate AK5 to determine accept/reject.
    3. If AK5 equals R, capture any following AK3 / AK4 segments to provide segment/element level diagnostics.
  4. Transform to CSV/DB rows
    1. Create one row per AK2+AK5. Include AK4 details as separate columns or additional rows depending on your workflow.
    2. Include a normalized status column mapping X12 codes A, R, P to human-readable statuses (Accepted, Rejected, Partially Accepted).
  5. Trigger remediation workflows
    1. If AK5=R, look up the original transaction (using ST control number and internal correlation) and open a defect ticket with the transaction details and AK4 diagnostics.
    2. If AK9 indicates group-level rejection, escalate to EDI Ops and include full interchange payload for debugging.
  6. Close loop and re-transmit
    1. After correction, re-create the corrected transaction set, generate a new ST control number, and send it. Log the original rejected ST control number and reason in your ticket for audit trails.
    2. Use PlainEDI validation before sending to reduce rejections; PlainEDI validates delimiters, control number consistency, and common schema rules.

Common Errors and Fixes

  • Error: ISA/IEA control number mismatch — Symptom: Parser throws control mismatch or IEA count error. Fix: Reconstruct the interchange from the source to correct or re-request the interchange. Ensure your envelope builder increments ISA13 and IEA01 consistently. Reason: Manual edits or truncated transfers change the control numbers.
  • Error: AK5=R with AK3 referencing segment PO1 — Symptom: 997 shows segment-level reject for PO1. Fix: Inspect the original PO for PO1 element counts and mandatory elements (quantity, unit price). Validate against Target's 850 implementation guide. Reason: Missing required elements or incorrect data types.
  • Error: AK4 reports element position with code 16 or 400 — Symptom: Element-level syntax error; element fails format or length checks. Fix: Compare the element contents to the X12 data element definition (e.g., numeric field with decimal must be in implied decimal format). Use understanding EDI delimiters and structure for parsing rules. Reason: Misformatted numbers, extra characters, or wrong decimal handling.
  • Error: AK9 shows group-level rejection — Symptom: AK9 status = R. Fix: Inspect all AK2/AK5 entries; if multiple AK5=R then address each transaction. If the whole group fails due to GS/GE inconsistency, repackage and resend a corrected GS/GE pair. Reason: GS/GE count mismatch or invalid group content for declared functional identifier.
  • Error: Wrong delimiters identified in ISA segment — Symptom: Parser cannot split segments correctly, resulting in unreadable payload. Fix: Read ISA16 and ISA11 for separators, then re-parse using those characters. Use how to validate EDI files before sending to check delimiters pre-send. Reason: Sender uses non-standard terminators or file transfer changes characters (e.g., CR/LF substitution).
  • Error: Duplicate ST control numbers causing Target to reject — Symptom: AK5=R with a duplication error. Fix: Ensure ST02 is unique per ST within the GS. Implement ST control number sequencing in your EDI generator. Use PlainEDI pre-send validation to detect duplicates automatically.
  • Error: Version or functional ID mismatch — Symptom: Target rejects because declared GS functional ID does not match transaction content (e.g., GS*PO but payload is 810). Fix: Ensure the GS01 functional identifier matches the transaction set types inside the group and that the version in GS08/GS09 is correct. Reason: Incorrect packaging or outbound mapping errors.

Related Resources

FAQ Section

Q: What does an AK5 code of R mean in a Target 997?

AK5 code R means the referenced transaction set was rejected. The 997 should include AK3/AK4 segments that provide segment and element-level error details. Use those AK3/AK4 pointers to find the offending segment and element in the original transaction and correct formatting, required data, or sequencing issues. After correction, resend the transaction with a new ST control number. PlainEDI can validate those elements before sending to reduce rejections; visit PlainEDI.

Q: How do I correlate a 997 rejection to my original file?

Correlate using the ISA control number, GS group control number, and ST control number. The AK1 contains the group control number and AK2 contains the ST control number. Keep a log of outgoing ISA/GS/ST numbers and file names so you can match the 997 references back to the original file quickly.

Q: What is the significance of AK9 returning R with counts?

AK9 provides the summary at the functional group level. If AK9 returns R and shows counts where received > accepted, then one or more transaction sets in the group failed. Drill into AK2 and AK5 pairs to identify specific rejected STs. AK9 is the earliest indicator of widespread problems in a sent group.

Q: Target 997 contains human-readable messages in AK4; can I rely on those?

Human-readable text in AK4 is implementation-specific and helpful for troubleshooting, but authoritative diagnostics are the AK3 and AK4 numeric codes and positions. Use the readable text for quick triage, but always verify using the segment IDs and element positions referenced by AK3/AK4. PlainEDI's parser can extract both codified and text diagnostics when converting to CSV.

Q: My parser fails because delimiters are different in the ISA. How to handle this?

Read the delimiter characters from the ISA header: element separator is the character immediately after ISA, component separator is ISA16, and segment terminator is the actual character terminating segments (often last character of the ISA line). Configure your parser dynamically based on those values before tokenizing the interchange. See understanding EDI X12 delimiters and structure for examples.

Q: Are there penalties for repeated 997 rejections with Target?

Retailers, including Target, enforce penalties for compliance failures such as ASN accuracy and on-time/in-full (OTIF) non-compliance. Check Target’s vendor portal for current penalty policy. The guide data above is effective as of 2025-12-14; Verify current requirements with retailer portal. Best practice: maintain low error rates by validating files with PlainEDI and tracking rejections as KPIs.

Q: Can a single 997 contain both accepted and rejected transaction sets?

Yes. A 997 commonly contains multiple AK2/AK5 pairs where some transactions are accepted and others rejected. Each AK2 references an individual ST; each corresponding AK5 gives that ST’s status. The AK9 summarizes the entire group.

Q: How should I structure my CSV when AK4 lists multiple element errors?

Options: 1) Create one CSV row per AK2/AK5 and include concatenated AK4 error descriptions in a single column; 2) Create one CSV row per AK4 error, repeating the AK2 context fields for each error (this makes downstream analytics easier). Choose based on your ticketing or ERP ingestion needs; provide ST and group control numbers in every row for traceability.

CTA

Ready to validate and convert Target 997s automatically? Upload your 997 file to PlainEDI to parse delimiters, extract AK1/AK2/AK5/AK9 details, and produce CSV output for your ERP or exception system. PlainEDI’s validation prevents common 997 triggers and accelerates remediation.

Appendix: Note on Target program updates — Effective date of referenced Target program information: 2025-12-14. Verify current requirements with retailer portal.