EDI documents
EDI 997 Functional Acknowledgment
The EDI 997 tells the sender of an X12 file that a functional group arrived and whether its syntax was accepted, per transaction set. It says nothing about the order, the shipment or the invoice inside. This page covers the AK segments and their codes, two samples with their counts, the envelope, and how Walmart and Kroger restrict the same document differently.
Updated
What is an EDI 997?
The EDI 997 is the X12 Functional Acknowledgment transaction set. The receiver of a functional group sends it back to the sender to report that the group arrived and whether each transaction set in it passed the syntax check: accepted, accepted with errors, or rejected. Every other document in a trading relationship, from the 850 to the 810, is answered by one.
The X12 definition sets the limit of what it confirms. The 997 reports "the results of the syntactical analysis" of the documents, and the standard "does not cover the semantic meaning of the information encoded in the transaction sets". A 997 with an A in it means the file could be read. It does not mean the purchase order will ship, the ship notice matches the truck or the invoice will be paid. Among the EDI documents a supplier handles it is the only one that goes in both directions for every exchange.
Where the 997 sits in the order-to-cash flow
Each functional group gets its own 997, sent by the party that received the group. AK101 repeats the functional identifier of the group that is being acknowledged.
| Document received | GS01 of that group | Who sends the 997 |
|---|---|---|
| 850 purchase order | PO | Supplier |
| 855 acknowledgment | PR | Buyer |
| 856 ship notice | SH | Buyer |
| 810 invoice | IN | Buyer |
| 846 inventory advice | IB | Buyer |
The 997 is one of four acknowledgments that can follow a file, each at its own level.
| Level | Acknowledgment | What it confirms |
|---|---|---|
| Transport | The signed receipt (MDN) of an AS2 transfer | The receiver got the file |
| Interchange | TA1 segment, requested with ISA14 set to 1 | ISA and IEA are valid; code A, E or R |
| Functional group | 997 | GS, GE and each ST to SE set pass the syntax check |
| Application | 824 application advice, or a document such as the 855 | The content was accepted by the receiver's system |
The 824 is the one that reports content. X12 defines it as the report of "an application system's data content edits", and Kroger returns it next to the 997 for ship notices.
The segments of a 997
A 997 has one AK1, one AK9, and between them an AK2 loop per transaction set. In X12 004010 the AK2 loop and the AK3 loop inside it can each repeat 999,999 times, and AK4 can occur 99 times per AK3. The functional identifier of a group of 997s is FA.
| Segment | Name | What it carries | What goes wrong |
|---|---|---|---|
| AK1 | Functional Group Response Header | AK101: GS01 of the group being acknowledged. AK102: its GS06 control number | A control number that matches no group you sent: the 997 cannot be tied to a file |
| AK2 | Transaction Set Response Header | AK201: ST01, such as 810. AK202: ST02 of that set | AK2 segments have to appear in the order the sets were sent |
| AK3 | Data Segment Note | AK301 segment ID, AK302 its position counted from ST as 1, AK303 loop, AK304 error code | Left out by partners that only report accept or reject |
| AK4 | Data Element Note | AK401 element position, AK402 element reference number, AK403 error code, AK404 copy of the bad value | Same as AK3 |
| AK5 | Transaction Set Response Trailer | AK501 status of the set, AK502 to AK506 up to five error codes | An E read as a rejection, and the document sent twice |
| AK9 | Functional Group Response Trailer | AK901 status of the group, AK902 sets included, AK903 sets received, AK904 sets accepted | A P read as accepted: the rejected set is never sent again |
The status and error codes
| Element | Code | Meaning |
|---|---|---|
| AK501 | A | Accepted |
| AK501 | E | Accepted but errors were noted |
| AK501 | R | Rejected |
| AK901 | A | Accepted |
| AK901 | E | Accepted, but errors were noted |
| AK901 | P | Partially accepted, at least one transaction set was rejected |
| AK901 | R | Rejected |
| AK304 | 3 | Mandatory segment missing |
| AK304 | 8 | Segment has data element errors |
| AK403 | 1 | Mandatory data element missing |
| AK403 | 5 | Data element too long |
| AK403 | 7 | Invalid code value |
| AK502 | 4 | Number of included segments does not match actual count |
| AK502 | 5 | One or more segments in error |
X12 004010 lists 6 values for AK501 and 7 for AK901; the three and four above are the ones partner guides use. The rest (M, W, X) report security failures. The standard notes that a group with A or E in AK901 counts as accepted. AK304 has 8 codes, AK403 has 10 and AK502 has 25.
Two samples, with delimiters
The first is the supplier's answer to one purchase order: group 1203, which held one 850 with control number 0001. Elements are separated by *, segments end with ~.
ST*997*0001~
AK1*PO*1203~
AK2*850*0001~
AK5*A~
AK9*A*1*1*1~
SE*6*0001~
One set included, one received, one accepted. From ST to SE there are 6 segments, so SE01 is 6.
The second is a buyer's answer to group 461, in which the supplier sent three invoices. Invoice 0002 is rejected.
ST*997*0001~
AK1*IN*461~
AK2*810*0001~
AK5*A~
AK2*810*0002~
AK3*IT1*10**8~
AK4*3*355*5*EACH~
AK5*R*5~
AK2*810*0003~
AK5*A~
AK9*P*3*3*2~
SE*12*0001~
Read it from the bottom. AK9 says 3 sets were included, 3 received and 2 accepted, so 3 minus 2 is 1 set to resend. AK5 with R and error 5 marks set 0002. AK3 points to the tenth segment of that invoice, an IT1, with error 8. AK4 names the third element of that segment, data element 355, the unit of measure, with error 5: the value EACH is too long for a field of exactly 2 characters. The ERP wrote its own unit name where the code EA belongs. There are 12 segments from ST to SE.
Invoices 0001 and 0003 are with the buyer. Only 0002 is corrected and sent again, in a new group with a new control number. Sending all three again would create two duplicate invoices at the buyer.
The envelope around it
ISA*00* *00* *ZZ*NORTHFIELD *01*123456789 *260928*1412*U*00401*000000454*0*P*>~
GS*FA*NORTHFIELD*123456789*20260928*1412*454*X*004010~
ST*997*0001~
SE*6*0001~
GE*1*454~
IEA*1*000000454~
The 997 travels in its own interchange with its own control numbers: 000000454 in ISA13 and IEA02, 454 in GS06 and GE02. Those belong to the sender of the 997. The link to the acknowledged file is inside, in AK102 (1203) and AK202 (0001). Sender and receiver are the reverse of the file being answered: the standard has the application sender's and receiver's codes of the acknowledged group exchanged in GS02 and GS03. One 997 answers one functional group, so an interchange with a group of orders and a group of order changes gets two. ISA15 is P for production and T for test, and a 997 for a test file carries T as well.
Who requires the 997, and how they differ
Both specifications below are public and were checked on 3 October 2026.
| Walmart drop ship | Kroger | |
|---|---|---|
| Version | 004010 | 005010, UCS and X12 |
| Segments used | AK1, AK2, AK5, AK9 | AK1, AK2, AK3, AK4, AK5, AK9 |
| AK501 | A, or W for rejected | A or R |
| AK901 | A or R | A, P or R |
| Rule | "The group will never be partially accepted" | A 997 "is required for EDI data interchange" |
Walmart sends and expects the 997 in both directions and names the file WMI_997FA_... over SFTP. Its guide has no AK3 or AK4, so a rejection from Walmart says which set failed and not where. Kroger reports the segment and the element, and accepts a group in part: its own sample shows nine promotion sets with eight accepted and AK9*P*9*9*8. A program that expects Kroger's P from Walmart, or looks for AK3 in a Walmart rejection, handles neither correctly. The guides: Walmart's 997 page and Kroger's 997 map. Partner specifics are under EDI with Walmart and EDI with Kroger.
What goes wrong and what it costs
- A missing 997 that nobody notices. A ship notice is sent and no 997 comes back. The file never reached the buyer, and the truck arrives without a notice on record. Kroger sets 12 hours as the point at which the vendor has to call. A missing acknowledgment has to raise an alert before that point.
- A 997 read as a business answer. The 850 is acknowledged within minutes and the buyer still waits for the 855. In the other direction, an accepted 997 for an invoice is taken as approval, and the short payment arrives with the remittance.
- P treated as A. Two of three invoices are booked at the buyer. The third stays unpaid until someone compares AK904 with AK902.
- Resending the whole group. After
AK9*P*3*3*2all three invoices go out again. The buyer now has two invoices twice. - Your own 997 not sent. The partner's order is in your ERP, and the partner's system shows the file as unacknowledged. Kroger states that a 997 is required for EDI data interchange, and partner requirements of this kind are collected under EDI compliance.
- An acknowledgment for an acknowledgment. A translator that answers every inbound group answers the 997 too. The standard forbids it.
The 997 itself carries no penalty. The cost sits in the document it should have confirmed: a ship notice that never arrived or an invoice that was never booked.
Handling the 997 on the ERP side
The 997 creates no record in the ERP. It updates the status of a document that was sent, and that status has to be kept somewhere: per outbound document the group control number, the set control number, the time sent, and the time and code of the acknowledgment.
| Event | Stored per outbound document | Follow-up |
|---|---|---|
| Sent | GS06, ST02, timestamp | Acknowledgment timer starts |
| 997 with A | AK501 and time received | None |
| 997 with E | AK501 plus AK3 and AK4 | Accepted; the mapping is corrected for the next document |
| 997 with R | AK501, AK502, AK3, AK4 | Corrected and sent again under a new control number |
| No 997 inside the window | Nothing | Alert, then a resend or a call to the partner |
ERPs have no field for this. NetSuite, Business Central and the store platforms hold the invoice or the fulfillment, not the control number it traveled under. We keep that register in the EDI integration we build and run for you. Every inbound group is answered with a 997 inside the partner's window, every outbound document is matched to the 997 that answers it, and a rejection or a missing acknowledgment is shown in the dashboard with the segment and element from AK3 and AK4. The rules that decide whether a document passes are part of EDI mapping. Tell us which partners you trade with.
Frequently asked questions
Does an EDI 997 mean my order or invoice was accepted?
No. The 997 reports the result of a syntax check on the functional group and its transaction sets. The X12 standard states that it does not report on "the ability of the receiver to comply with the request of the sender". Whether a purchase order will be shipped is answered by the 855, and whether an invoice or ship notice matches the buyer's records is reported by an 824 application advice or by a deduction.
What is the difference between a 997 and a TA1?
They acknowledge different envelope levels. The TA1 is a single segment that reports on the interchange, the ISA and IEA pair, and is sent when ISA14 of the incoming interchange is 1. The 997 is a full transaction set that reports on a functional group, the GS and GE pair, and on each transaction set inside it.
What is the difference between a 997 and a 999?
The 999 Implementation Acknowledgment first appears in X12 release 005010. It reports the result of a syntactical and relational analysis against an implemented subset of X12, where the 997 reports the syntax check only. The 999 is the acknowledgment used in healthcare transactions. Retail and distribution partners use the 997, also in version 005010.
Do I have to acknowledge a 997?
No. The standard forbids it: a 997 is never acknowledged with another 997, and a 997 is never sent to report errors in an earlier 997. That rule prevents an endless cycle of acknowledgments.
What does AK9*P mean?
Partially accepted: at least one transaction set in the functional group was rejected. AK902 gives the number of sets the group said it contained, AK903 the number received and AK904 the number accepted. AK9P332 means three sets came in and one of them has to be corrected and sent again.
How fast does a 997 have to come back?
The window is set per trading partner. Kroger tells vendors to call its EDI coordinator when an expected 997 or 824 has not come back within 12 hours after the ship notices were sent, and states that it expects to shorten that to 3 hours. For the 997 you send yourself, the partner's guide gives the deadline.
Tell us what you need
Tell us which systems you use and what needs to work better. We reply personally within one working day. We help you define the work, then agree the price and timing before you commit.
- You know the price and the timeline before you commit to anything
- We work out the connection that takes the work off your hands
- We handle the build, hosting, monitoring and maintenance
- Your team has less information to retype and fewer discrepancies to chase