Amazon Edi 997

By Alexander Georges|Updated March 27, 2026
TL;DR: The Amazon EDI 997 is the X12 Functional Acknowledgment used by Amazon to confirm receipt and acceptance/rejection of inbound transaction sets (for example, 850 PO or 810 Invoice). This guide explains the 997 structure, how to read AK1–AK9 response segments, real-world troubleshooting, conversion to CSV for automated processing, and how PlainEDI validation prevents common 997-related errors. Use the step-by-step checks and code examples to diagnose and resolve Amazon 997 rejections quickly.

What This Is

This guide explains the Amazon-specific use and interpretation of the X12 997 Functional Acknowledgment. Amazon uses the 997 to tell you whether the transaction sets you sent (for example, 850 purchase orders, 856 ASNs, 810 invoices) were accepted, rejected, or accepted with errors. The 997 is not a business acknowledgment (it does not confirm the business content of the PO); instead, it confirms syntactic and basic semantic processing at the EDI interface and trading partner system level.

Understanding how to read and act on a 997 is essential for maintaining EDI compliance with Amazon. A misread 997 can leave transaction issues unresolved, causing invoice disputes, ASN non-compliance, or chargebacks. This guide provides practical diagnostics, line-by-line code examples, conversion to CSV for downstream systems, and proven fixes for the most common Amazon-related 997 rejection scenarios. It also highlights how PlainEDI helps prevent these issues through pre-send validation and clear error reports.

Who This Is For

This guide is for EDI analysts, integration engineers, vendor compliance teams, and developers who send EDI transactions to Amazon or consume 997 acknowledgments from Amazon. If you manage outbound EDI, operate an AS2/EDI VAN connection, or integrate Amazon EDI into ERP/warehouse systems, this guide provides hands-on steps to diagnose and fix 997 issues.

Key Segments Explained

  • ISA / IEA (Interchange Control Header/Trailer)

    The ISA and IEA segments wrap the full interchange. ISA contains fixed-length fields that define the sender, receiver, date/time, control number, and delimiters. The IEA contains the interchange control count and the interchange control number that must match the ISA. If Amazon returns a 997 with mismatched ISA/IEA values, Amazon's EDI gateway could reject the entire interchange.

  • GS / GE (Functional Group Header/Trailer)

    The GS and GE segments wrap a functional group (all 850s, for example). GS contains application sender/receiver codes and a group control number. The GE contains group control count and that control number. Amazon uses the GS/GE to group transaction sets; mismatched GS/GE counts cause AK9 rejection codes.

  • ST / SE (Transaction Set Header/Trailer)

    ST identifies each transaction set (for example, an individual 850). SE closes the transaction set and contains the segment count and transaction set control number that must match ST. If the segment count is wrong, Amazon reports an AK3/AK5 error pointing to the segment or element position.

  • AK1 / AK2 / AK3 / AK4 / AK5 / AK9 (Acknowledgment Structure)

    These are the core 997 segments that report status for functional groups and transaction sets.

    • AK1 identifies the functional group being acknowledged (GS values).
    • AK2 identifies the transaction set (ST values) being acknowledged.
    • AK3 pinpoints structural errors at the segment level (segment ID and position).
    • AK4 pinpoints element-level/data errors with position and error code.
    • AK5 returns a simple transaction set response code: A = Accepted, E = Accepted With Errors, R = Rejected.
    • AK9 summarizes the functional group response: A = Accepted, P = Partially Accepted, R = Rejected.

Example EDI Snippet

Below is a realistic Amazon-style 997 Functional Acknowledgment for a single GS/transaction set with an error in one data element. The code is followed by line-by-line annotations.

ISA*00*          *00*          *ZZ*SENDERID       *ZZ*AMAZON123      *210101*1253*^*00501*000000905*0*P*:~
GS*FA*SENDERID*AMAZON123*20210101*1253*905*X*005010~
ST*997*0001~
AK1*PO*905~
AK2*850*000123~
AK3*N1*04*1~
AK4*03*BADV*1~
AK5*R~
AK9*R*1*1*0~
SE*9*0001~
GE*1*905~
IEA*1*000000905~
  • ISA: Interchange header with sender SENDERID and receiver AMAZON123. Delimiters indicated (asterisk '*' field, tilde '~' segment).
  • GS: Functional group 'FA' (997) with group control number 905.
  • ST: Transaction set 997 control 0001.
  • AK1*PO*905: Acknowledge functional group for PO transaction family.
  • AK2*850*000123: Acknowledge transaction set 850 with control 000123.
  • AK3*N1*04*1: Error in segment N1 at position 4 of the transaction set; segment-level syntax error.
  • AK4*03*BADV*1: Element at position 03 contains invalid value 'BADV' (error code 1 indicates invalid content).
  • AK5*R: Transaction set rejected.
  • AK9*R*1*1*0: Functional group rejected (1 transaction received, 1 rejected, 0 accepted).
  • SE/GE/IEA: Close transaction, group, and interchange. Verify control numbers match corresponding headers.

CSV Output Example

Many downstream systems prefer a CSV representation of the 997 to feed into ticketing or ERP systems. Below is a minimal CSV mapping that captures key 997 information per acknowledged transaction set.

InterchangeControlNumber GroupControlNumber TransactionSet TransactionControlNumber TransactionStatus SegmentID SegmentPosition ElementPosition ErrorCode ErrorText
000000905 905 850 000123 Rejected N1 4 3 1 Invalid value 'BADV' in element

Step-by-Step Conversion Process

  1. Receive and isolate the 997 interchange
    1. Confirm the file contains a single ISA...IEA interchange. If multiple interchanges exist, split them for processing to preserve control numbers.
    2. Log the raw file and timestamp for audit purposes.
  2. Parse ISA/GS/ST headers and validate delimiters
    1. Read ISA element 16 for component separator and ISA element 11 for repetition separator if applicable. Confirm field and segment delimiters.
    2. Validate that ISA/IEA control numbers match and that GS/GE group control numbers match. If mismatched, mark the whole interchange for manual review.
  3. Extract AK1/AK2 pairs and map to transaction sets
    1. For each AK2 (transaction set), capture the ST control number and transaction set identifier code (e.g., 850, 856, 810).
    2. Associate AK3/AK4 details with the correct AK2 entry to identify segment/element problems.
  4. Convert each AK2 result into CSV rows
    1. Normalize AK5 values: A -> Accepted, E -> AcceptedWithErrors, R -> Rejected.
    2. For AK3/AK4 errors, produce separate CSV rows or error columns describing segment ID, position, element position, error code, and human-readable text.
  5. Push CSV to downstream systems and create tickets
    1. Send accepted rows to your EDI tracking system. For rejected or partially accepted rows, create tickets assigned to the responsible EDI or trading partner team with the CSV excerpt included.
    2. Include original interchange control and timestamps so the team can find the original EDI file quickly.
  6. Remediate and resubmit
    1. Fix structural errors (segment positions, missing mandatory segments) in your outbound transaction. For data errors, correct values per Amazon's element dictionaries and resubmit the transaction set or interchange.
    2. Use PlainEDI to validate prior to submission; PlainEDI flags ISA/GS/ST mismatches and element format errors so you avoid repeated 997 rejections.
  7. Document and prevent recurrence
    1. Track the root cause, update templates, and add validation rules. If the error was caused by an ERP mapping bug, create a code defect and schedule a patch.

Common Errors and Fixes

  • Error: AK5 = R (Transaction Set Rejected)

    Cause: Structural or data-level errors reported via AK3/AK4. Fix: Read AK3/AK4 segments to locate the segment and element positions. Correct the segment order or missing mandatory segment, or correct the element value, then resubmit. Use PlainEDI pre-send validation to catch these before sending.

  • Error: AK9 = P (Partially Accepted)

    Cause: One or more transaction sets inside a GS were rejected. Fix: Parse each AK2/AK5 pair to find which ST control numbers failed. Resend only the failed STs or split the GS into accepted and rejected sets and resubmit.

  • Error: AK3 reports segment ID and position (e.g., AK3*N1*04*1)

    Cause: Missing or misplaced mandatory segment at the indicated position. Fix: Reconstruct the ST transaction to ensure the N1 segment is present at the correct point in the hierarchy. Validate segment order against the 850/810/856 implementation guide used by Amazon.

  • Error: AK4 reports data element errors (invalid code/value)

    Cause: Element contains an invalid enumerated value or fails data type/length rules. Fix: Check the element against Amazon's code lists (for example, unit of measure, identification qualifiers). Correct mapping or implement translation tables in your EDI translator.

  • Error: ISA/IEA or GS/GE control number mismatch

    Cause: Interchange or functional group control numbers were altered or truncated by VAN/FTP processing. Fix: Ensure your EDI software preserves control numbers; confirm no character encoding or file transfer agent is breaking fixed-length ISA fields. Resend after correcting transfer settings.

  • Error Code Examples and Meaning (common AK5/AK9 codes)

    AK5 values: A = Accepted, E = Accepted With Errors, R = Rejected. AK9 values: A = Accepted, P = Partially Accepted, R = Rejected. Fix: Treat E/P as requiring review of AK3/AK4 details, then execute the fixes above.

Related Resources

FAQ Section

Q: What exactly does an Amazon 997 tell me?

The Amazon 997 is a Functional Acknowledgment that indicates whether a submitted transaction set (for example, 850, 856, 810) was received and processed at the syntactic level. It reports acceptance or rejection for the functional group (AK9) and for each transaction set within it (AK2/AK5), and it pinpoints segment- and element-level errors with AK3 and AK4 segments.

Q: How do I know if Amazon rejected my entire interchange?

Check the AK9 segment for the functional group response code. AK9*R indicates the group was rejected. If the IEA/ISA control numbers do not match or the IEA count does not match ISA, the interchange may be rejected. Review AK3/AK4 entries as they refer to the specific segments that caused the rejection.

Q: What are the most common AK4 error reasons?

AK4 reports element-level errors such as invalid code values, missing required elements, data too long/short, or incorrect data formats. The AK4 details include element position and an error code. Correct the element value or adjust the translator mapping, then resubmit the corrected transaction.

Q: Can I automatically reprocess transactions that were partially accepted?

Yes. For AK9*P (Partially Accepted), use the AK2/AK5 list to identify which ST control numbers were rejected. Resubmit only the failed transaction sets after fixing the errors. Ensure that control numbers are unique and correctly sequenced per your trading partner agreement.

Q: How does PlainEDI help with 997 issues?

PlainEDI validates ISA/GS/ST structure, delimiter settings, segment counts, and element formats pre-send. PlainEDI’s validation prevents many common causes of 997 rejections (AK3/AK4). Use PlainEDI to get a detailed error report and CSV conversion that saves time troubleshooting after a 997 is received.

Q: What should I do when ISA control numbers differ between my sent file and Amazon’s 997?

If ISA/IEA control numbers differ, treat this as a transfer or truncation error. Check your VAN or AS2 agent to ensure fixed-width ISA fields are preserved. Correct the transfer settings and resend. Log both interchange versions for audit and reconciliation.

Q: Where can I find the mapping for Amazon-specific segment requirements?

Amazon publishes implementation guides and trading partner requirements in their vendor portal. Because Amazon updates requirements, verify the effective date of any guide. For implementation mapping, reference Amazon’s vendor documentation and use validation tools such as PlainEDI to enforce those rules before sending.

Q: How quickly do I need to act on a rejected transaction?

Act immediately. A rejected 850 or 856 may result in failed receipts, delayed invoicing, or compliance exceptions. Resolve the 997 errors, resubmit corrected transactions, and keep an audit trail. Retailers like Amazon enforce compliance; check the vendor portal for current penalty policies and deadlines.

Practical Case Studies

Case Study 1: Missing PO Number in 850 — A vendor sent an 850 where the PO1 segment inadvertently omitted the PO number due to a mapping bug. Amazon returned a 997 with AK3 pointing to the PO1 segment and AK4 indicating the missing required element. The fix involved updating the ERP-to-EDI map to include PO number, revalidating with PlainEDI, and resending the corrected 850. This eliminated repeat failures and prevented invoice cut-off delays.

Case Study 2: Truncated ISA by FTP — A supplier used an FTP client that wrapped lines and truncated the fixed-width ISA element, changing the ISA control number. Amazon's 997 showed mismatched ISA/IEA numbers. The supplier switched to an AS2 adapter and validated the ISA line as a fixed-width record, which resolved the mismatch and subsequent rejections.

Best Practices and Prevention

  • Validate before you send: use tools like PlainEDI to check delimiters, control numbers, mandatory segments, and element formats.
  • Keep control number sequencing strict: ensure ISA/GS/ST control numbers are unique and incremented per your trading partner agreement.
  • Automate CSV conversion: map AK2/AK3/AK4 fields to ticketing/ERPs so errors automatically generate remediation tasks.
  • Version control EDI maps: changes to translation scripts should be tested in a sandbox to avoid repeat production errors.
  • Monitor acknowledgments: implement an automated watcher that flags AK5=R or AK9=P within minutes of receipt.

Final Notes and Compliance

Retailers, including Amazon, enforce compliance and may impose penalties for repeated EDI failures such as ASN inaccuracies or missing invoices. Check Amazon’s vendor portal for the latest compliance program details and effective dates for any penalty updates. Do not assume penalty amounts—verify current requirements with Amazon's official portal.

This guide is focused on diagnosing and fixing common Amazon 997 scenarios and converting 997 content for operational use. For deeper reading on 997 handling and troubleshooting alternatives, see the linked resources above including reading 997 functional acknowledgments and resolving 997 rejection codes.

When you are ready to validate and upload corrected EDI files, use PlainEDI to catch errors before submission and to convert 997s to CSV for your ticketing system.

Take action: Upload your EDI file for validation and automated 997 parsing at PlainEDI.