How to Read EDI 997 Functional Acknowledgments
Complete guide to interpreting 997 responses, understanding error codes, and fixing rejected EDI transactions.
What is an EDI 997 Functional Acknowledgment?
The EDI 997 transaction set, also known as the Functional Acknowledgment (FA), is a response to EDI transactions you send to trading partners. It serves as a receipt, confirming that the receiving party got your EDI document (850 PO, 856 ASN, 810 Invoice, etc.) and whether it was accepted, accepted with errors, or rejected.
Think of it like a text message read receipt—but with detailed error reporting. If your transaction was rejected, the 997 tells you exactly what went wrong, which segment had the error, and which data element needs to be fixed.
Why 997s Matter
- Walmart: Requires 997s within 24 hours of receiving your EDI
- Costco: Requires 997s within 24 hours of receiving 850 POs
- Target, Home Depot, Lowe's: Mandatory 997 acknowledgments
- Failed 997s = Compliance penalties and delayed order processing
EDI 997 Structure: Understanding the Segments
All 997 Functional Acknowledgments contain these core segments: AK1, AK2, AK5, and AK9. If there are errors, you'll also see AK3 and AK4 segments with specific error details.
AK1 Segment: Functional Group Response Header
The AK1 segment confirms that an entire functional group of transactions was received. It responds to the GS (Functional Group Header) segment from your original EDI file.
- AK101 (PO): Transaction type code (PO = Purchase Order, IN = Invoice)
- AK102 (12345): Functional group control number from your original GS segment
AK2 Segment: Transaction Set Response Header
The AK2 segment acknowledges each individual transaction within the functional group. It links back to the ST (Transaction Set Header) from your original EDI file.
- AK201 (850): Transaction set identifier (850 = PO, 810 = Invoice, 856 = ASN)
- AK202 (0001): Transaction set control number from your original ST segment
AK5 Segment: Transaction Set Response Trailer
This is the most important segment—it tells you whether your transaction was accepted, accepted with errors, or rejected.
| AK501 Code | Meaning | What to Do |
|---|---|---|
| A | Accepted | ✅ Transaction processed successfully. No action needed. |
| E | Accepted But Errors Were Noted | ⚠️ Transaction accepted, but fix errors for future submissions. Check AK3/AK4 segments. |
| R | Rejected | ❌ Transaction rejected. Fix errors in AK3/AK4 segments and resend. |
AK3 Segment: Data Segment Note (Error Details)
The AK3 segment appears only when there are errors. It identifies which segment in your original EDI file has a problem.
- AK301 (N1): Segment ID code with the error (e.g., N1 = Name segment)
- AK302 (5): Segment position in the transaction (5th segment after ST)
- AK303: Loop identifier code (if applicable)
- AK304 (8): Segment syntax error code (8 = Segment has data element errors)
AK4 Segment: Data Element Note (Specific Error)
The AK4 segment appears when AK304 = 8 (segment has data element errors). It pinpoints exactly which data element is wrong.
- AK401 (2): Element position in segment (2nd data element in the segment)
- AK402 (93): Data element reference number (from X12 standard)
- AK403 (1): Data element syntax error code (1 = Mandatory data element missing)
AK9 Segment: Functional Group Response Trailer
The AK9 segment summarizes the entire functional group acknowledgment.
- AK901 (A): Functional group acknowledgment code (A = Accepted, E = Accepted with errors, R = Rejected)
- AK902 (1): Number of transaction sets included
- AK903 (1): Number of received transaction sets
- AK904 (1): Number of accepted transaction sets
Common 997 Error Codes and How to Fix Them
Most Common Error: AK403 = 1 (Mandatory Data Element Missing)
This error means you're missing a required data element in your EDI file. For example, if you send an 850 PO without a PO number in the BEG segment, you'll get this error.
Fix: Add the missing data element and resend.
AK403 Data Element Syntax Error Codes
| Code | Error Description | Common Cause | How to Fix |
|---|---|---|---|
| 1 | Mandatory data element missing | Required field left blank (e.g., missing PO number) | Add the required data element |
| 2 | Conditional required data element missing | Dependent field missing (e.g., if you send a qualifier, you must send the value) | Add the conditional field or remove the triggering element |
| 3 | Too many data elements | Extra fields in a segment (e.g., N1 segment has too many elements) | Remove extra data elements |
| 4 | Data element too short | Value doesn't meet minimum length (e.g., UPC must be 12 digits, you sent 10) | Pad with leading zeros or provide full value |
| 5 | Data element too long | Value exceeds maximum length (e.g., sending 20-character ID in a 15-char field) | Truncate or use correct field |
| 6 | Invalid character in data element | Non-numeric characters in a number field, special characters not allowed | Remove invalid characters, use only allowed values |
AK304 Segment Syntax Error Codes
These error codes appear in the AK3 segment (AK304 element) and indicate segment-level issues:
- Code 8: Segment has data element errors (most common—triggers AK4 segments)
- Code 1: Unrecognized segment ID (e.g., using a segment not in the X12 standard)
- Code 2: Unexpected segment (segment appears out of order)
- Code 3: Required segment missing (e.g., missing REF segment when required)
- Code 4: Loop occurs over maximum times (too many repetitions of a loop)
Real-World Example: Reading a Rejected 997
Let's walk through a rejected 997 for a Walmart 850 Purchase Order that had a missing ship-to location:
ISA*00* *00* *ZZ*WALMART *ZZ*VENDOR123 *251020*1430*U*00401*000012345*0*P*>~ GS*FA*WALMART*VENDOR123*20251020*1430*12345*X*004010~ ST*997*0001~ AK1*PO*12345~ AK2*850*0001~ AK3*N1*12**3~ AK5*R*2~ AK9*R*1*1*0~ SE*7*0001~ GE*1*12345~ IEA*1*000012345~
Step-by-Step Breakdown:
AK1*PO*12345~
Responding to functional group 12345 for Purchase Orders (PO)
AK2*850*0001~
Acknowledging transaction set 850 (Purchase Order) with control number 0001
AK3*N1*12**3~
Error found: The 12th segment (N1 = Name segment) is missing a required segment. AK304 = 3 means "Required segment missing."
AK5*R*2~
Result: Transaction REJECTED (R). Error code 2 in AK502.
AK9*R*1*1*0~
Summary: Functional group REJECTED. 1 transaction received, 1 processed, 0 accepted.
How to Fix This Error:
- Go to your original 850 EDI file
- Find the 12th segment after the ST segment
- Check if you're missing an N1 segment for the ship-to location
- Add the missing N1*ST segment with the ship-to details
- Resend the corrected 850 to Walmart
Example: Accepted 997 (No Errors)
Here's what a successful 997 looks like when your transaction is accepted with no errors:
ISA*00* *00* *ZZ*TARGET *ZZ*VENDOR456 *251020*1515*U*00401*000067890*0*P*>~ GS*FA*TARGET*VENDOR456*20251020*1515*67890*X*004010~ ST*997*0001~ AK1*SH*67890~ AK2*856*0002~ AK5*A~ AK9*A*1*1*1~ SE*6*0001~ GE*1*67890~ IEA*1*000067890~
What This Means:
AK1*SH*67890~
Responding to functional group 67890 for Shipment notices (SH = 856 ASN)
AK2*856*0002~
Acknowledging transaction set 856 (ASN) with control number 0002
AK5*A~
✅ Accepted (A) — No errors. No AK3 or AK4 segments present.
AK9*A*1*1*1~
✅ Functional group accepted. 1 transaction received, 1 processed, 1 accepted.
Retailer-Specific 997 Requirements
Walmart
- ✅ Send 997s within 24 hours of receiving Walmart's EDI
- ✅ Use ANSI X12 version 4010 or 5010
- ✅ Must acknowledge all 850, 846, 855 transactions
- ⚠️ Missing 997s can delay order processing
Costco
- ✅ Send 997s within 24 hours of receiving 850 POs
- ✅ Use ANSI X12 version 4010
- ✅ SPS Commerce certification required
- ⚠️ Late or missing 997s = compliance violations
Target
- ✅ 997 required for all inbound EDI (850, 846, 855)
- ✅ Use ANSI X12 version 4010
- ✅ Must send within reasonable timeframe (typically 24-48 hours)
- ⚠️ Missing 997s can trigger Perfect Order Program penalties
Home Depot
- ✅ 997 required for 850 POs
- ✅ Use ANSI X12 version 4010
- ✅ Must acknowledge receipt before sending 855 PO Acknowledgment
- ⚠️ Missing 997s delay 856 ASN processing
Lowe's
- ✅ 997 mandatory for all inbound transactions
- ✅ Use ANSI X12 version 4010 or 4030
- ✅ Must send before processing 850 PO
- ⚠️ Missing 997s can result in chargebacks
Amazon Vendor Central
- ✅ 997 required for all EDI transactions
- ✅ Use ANSI X12 version 4010
- ✅ Send within 24 hours of receiving Amazon EDI
- ⚠️ Amazon monitors 997 compliance closely
Troubleshooting 997 Errors
Problem: AK5*R (Transaction Rejected)
Possible Causes:
- Missing mandatory segments (e.g., N1 ship-to location in 850)
- Invalid segment structure or order
- Control number mismatches (ST/SE, GS/GE, ISA/IEA)
- Invalid UPC, GTIN, or GLN codes
Fix: Review AK3 and AK4 segments for specific error locations. Correct and resend.
Problem: AK5*E (Accepted with Errors)
Possible Causes:
- Non-critical data element errors (e.g., formatting issues)
- Missing optional fields that should be included
- Incorrect qualifiers or code values
Fix: Transaction processed, but fix errors for future submissions to avoid rejection.
Problem: Not Receiving 997s from Trading Partner
Possible Causes:
- Incorrect ISA sender/receiver IDs (trading partner can't route 997 back to you)
- VAN connection not properly configured
- Trading partner's system not set to send 997s
- Your EDI mailbox or AS2 endpoint not configured correctly
Fix: Contact your EDI coordinator or VAN provider to verify routing and connection settings.
Problem: 997 Shows AK304 = 8 but No AK4 Segment
Possible Cause:
The trading partner's EDI system detected data element errors but didn't provide detailed AK4 segments (this can happen with some older EDI systems).
Fix: Manually review the segment identified in AK3 (using AK301 and AK302) and check for missing or invalid data elements.
How PlainEDI Helps You Read 997s
Reading raw 997 EDI files can be tedious. PlainEDI converts 997 Functional Acknowledgments to clean CSV format, making it easy to:
- Instantly see acceptance status (AK5 codes) in an easy-to-read spreadsheet
- Identify errors quickly with AK3 and AK4 segments clearly labeled
- Track 997 responses across multiple retailers (Walmart, Target, Costco, etc.)
- Batch process hundreds of 997s and export to Excel for reporting
- Validate your outbound EDI before sending to avoid rejections
Try PlainEDI's 997 Converter
Upload your 997 EDI file and get instant CSV output with all segments, error codes, and acceptance statuses clearly labeled. Free preview available.
Convert 997 to CSV Now →Frequently Asked Questions
How quickly should I expect a 997 after sending an EDI transaction?
Most retailers send 997s within 24 hours. Some automated systems send them within minutes. If you don't receive a 997 within 48 hours, contact your trading partner's EDI coordinator.
Do I need to send a 997 for every EDI transaction I receive?
Yes, for major retailers. Walmart, Costco, Target, Home Depot, and Lowe's all require vendors to send 997 functional acknowledgments within 24 hours of receiving EDI transactions (850 POs, 846 inventory inquiries, etc.).
What happens if I get AK5*E (accepted with errors)?
The transaction was processed, but you should still fix the errors identified in the AK3/AK4 segments. Future submissions with the same errors may be rejected entirely. Think of it as a warning.
Can I resend a rejected EDI transaction?
Yes. Fix the errors identified in the 997 (using AK3 and AK4 segments), then resend the corrected EDI file with a new control number (ST02, GS06, ISA13). Never reuse control numbers.
What's the difference between a 997 and an 824?
997 = Syntax acknowledgment (confirms EDI structure is valid). 824 = Application acknowledgment (confirms business logic is valid, e.g., PO number matches retailer's system). Walmart uses both.
Do I need special software to generate 997s?
Yes, typically. Most EDI systems (SPS Commerce, TrueCommerce, etc.) automatically generate 997s. If you're building your own EDI integration, you'll need to programmatically create 997 transactions following the X12 specification.
Can PlainEDI validate my EDI before I send it?
Yes! Upload your outbound EDI file (850, 856, 810, etc.) to PlainEDI. We'll parse it and show you any structural errors before you send it to your trading partner. This helps you catch rejections early.
Summary: Mastering 997 Functional Acknowledgments
- ✅ 997s confirm receipt and acceptance of your EDI transactions
- ✅ AK5 segment tells you the result: A = Accepted, E = Accepted with errors, R = Rejected
- ✅ AK3 and AK4 segments pinpoint errors with segment IDs and data element positions
- ✅ Walmart and Costco require 997s within 24 hours—missing them = penalties
- ✅ Common error: AK403 = 1 (Mandatory data element missing)—fix by adding required fields
- ✅ Use PlainEDI to convert 997s to CSV for easy error tracking and reporting
Ready to Simplify EDI 997 Processing?
Stop manually parsing 997 files. Upload your functional acknowledgments to PlainEDI and get clean CSV output with error codes clearly labeled.