Costco Edi 850

By Alexander Georges|Updated June 23, 2026
TL;DR: This guide explains how to read, validate, convert, and troubleshoot Costco EDI 850 purchase orders (effective 2026-05-31), with practical parsing steps, real EDI examples, CSV mapping, and Costco-specific compliance notes. Use the step-by-step procedures and validation checks to avoid common rejections and chargebacks; use PlainEDI to validate and upload EDI 850s for immediate error reporting.

What This Is

This guide is a comprehensive, practical walkthrough for processing Costco EDI 850 purchase orders (X12 850). It explains the structure and the critical segments you will parse, the conversion to CSV or ERP-ready formats, and the compliance checks most vendors must perform for Costco as of the program update effective 2026-05-31.

The guide focuses on the real-world problems vendors face: delimiter and ISA/GS header issues, missing PO1 fields, unit-of-measure mismatches, and Costco-specific requirements such as pack quantity and ASN expectations. You will get concrete code examples with line-by-line explanations, a conversion example to CSV, and a set of step-by-step procedures to convert and validate EDI 850 POs reliably.

Who This Is For

This guide is for EDI developers, integration specialists, EDI analysts, and operations staff at vendors and 3PLs who receive Costco 850 purchase orders and need to parse, convert, or integrate them into downstream systems such as ERP, WMS, or accounting platforms.

Key Segments Explained

  • BEG (Beginning Segment for Purchase Order)

    The BEG segment contains the Purchase Order type, PO number, and PO date. For Costco 850s you must extract BEG02 (PO Number) and BEG03 (PO Date) and ensure PO dates are in CCYYMMDD format. If BEG02 is empty or contains filler, the PO will fail downstream matching.

  • N1 / N3 / N4 (Name and Address Loops)

    The N1 loop identifies trading partners: Costco (N1*BY or N1*ST), vendor bill-to, and ship-to locations. N3 is street address and N4 is city/state/ZIP. Map N1/03 (identification code) and N1/04 (ID qualifier) correctly. Costly errors occur when the supplier uses vendor-assigned GLN vs. Costco-assigned location codes—validate the N1 ID against your vendor master.

  • PO1 (Baseline Item Data)

    PO1 is the line-item segment: PO101 (line item number), PO102 (quantity), PO103 (unit of measure), PO104 (unit price), and PO106-PO108 (product identifiers like UPC/GTIN/Buyer Part). For Costco you must pay attention to PO102 and PO103 (units and UOM) because Costco enforces pack quantity and UOM matching to expected cartons or eaches.

  • REF (Reference Identification)

    REF segments carry important cross-references such as the buyer's internal reference, vendor order numbers, or promotion codes. Common REF qualifiers in Costco POs include REF*IA (invoice/account number references) and REF*PO (alternate PO). Always capture REF01 and REF02 for audit trails.

  • CTT / SE (Transaction Totals and Transaction Set Trailer)

    CTT gives line item counts and summary quantities; SE closes the ST transaction with a segment count and transaction control number. Validate CTT01 equals the number of PO1 segments processed and that SE segment count matches your parsed segment count. Discrepancies lead to 997 functional acknowledgment rejects.

Example EDI Snippet

ISA*00*          *00*          *ZZ*SENDERID       *12*COSTCOID      *210531*1234*U*00401*000000905*0*T*:~
GS*PO*SENDERID*COSTCOID*20210531*1234*905*X*004010~
ST*850*0001~
BEG*00*NE*4500123456**20210531~
REF*IA*INV12345~
N1*BY*COSTCO WHOLESALE*92*000123456~
N1*ST*Costco Warehouse 123*92*000987654~
PO1*1*24*EA*12.50**BP*123456789012*VP*ABC-123~
PID*F****20LB BAG OF BLUEBERRIES~
CTT*1~
SE*10*0001~
GE*1*905~
IEA*1*000000905~

Line-by-line explanation:

  • ISA* — Interchange header; identify sender, receiver, date/time, control number, and delimiters. Ensure the element separator (here '*') and segment terminator (here '~') are recognized by your parser.
  • GS*PO* — Functional group header for purchase orders (PO). GS06/GS07 contain group control number; GS08 indicates the version (004010).
  • ST*850*0001 — Transaction set header. ST02 is transaction control number; preserve for SE matching.
  • BEG*00*NE*4500123456**20210531 — PO type 'NE' (new order), PO number 4500123456 in BEG03, PO date in BEG05.
  • REF*IA*INV12345 — Reference ID type IA with value INV12345.
  • N1*BY*COSTCO WHOLESALE*92*000123456 — 'BY' buyer identifier with Costco's location code in N104.
  • PO1*1*24*EA*12.50**BP*123456789012*VP*ABC-123 — Line 1: 24 units, UOM EA, unit price 12.50, buyer product ID (BP) UPC 123456789012 and vendor part (VP) ABC-123.
  • PID*F****20LB BAG OF BLUEBERRIES — Free-form item description.
  • CTT*1 — One line item reported; validates with PO1 count.
  • SE*10*0001 — 10 segments in the ST transaction, control number 0001; this must match parsed count.

CSV Output Example

PO_Number PO_Date Line_Number Qty UOM Unit_Price Buyer_Product_ID Vendor_Part Item_Description Ship_To_ID
4500123456 2021-05-31 1 24 EA 12.50 123456789012 ABC-123 20LB BAG OF BLUEBERRIES 000987654

Step-by-Step Conversion Process

  1. Receive and inspect the raw interchange
    1. Open the raw file in a binary-safe editor to detect the segment terminator (commonly ~, , or ' ) and element separator (commonly * or |).
    2. Confirm ISA delimiters: ISA is fixed-width and the last character of the ISA segment indicates the component element separator. Read ISA16 for subelement separator and ISA11 for repetition separator (if present).
    3. Use PlainEDI to upload the raw interchange and run an initial syntax validation; PlainEDI flags delimiter mismatches immediately.
  2. Validate ISA/GS/ST hierarchical integrity
    1. Ensure the ISA control number matches IEA control number and GS control number matches GE control number.
    2. Check the GS functional ID equals 'PO' for 850 and ST transaction set ID equals '850'.
    3. Reject or quarantine files with mismatched counts; generate a 997 if you act as a trading partner that issues acknowledgments. Use reading 997 functional acknowledgments guidance to interpret rejections.
  3. Parse header and master data
    1. Extract BEG02 (PO type), BEG03 (PO number), BEG05 (PO date). Normalize PO date to ISO (YYYY-MM-DD).
    2. Parse N1 loops to identify buyer (Costco), ship-to location, and bill-to if present. Match these codes to your vendor master to resolve ASN routing and warehouse mapping.
    3. Use REF segments to capture internal cross-references and buyer-supplied order comments.
  4. Parse and normalize PO1 line items
    1. For each PO1 extract PO101 (line sequence), PO102 (ordered quantity), PO103 (UOM), PO104 (unit price), and ID qualifiers such as PO106-PO108 for BP/UP/VP types.
    2. Normalize UOMs to your system standard (e.g., EA, CT, PK). If Costco expects carton-level ordering and you only support each-level invoicing, calculate carton-to-each conversions and flag for manual review.
    3. Validate the product identifiers against your item master using buyer GTIN or buyer part numbers; if there is no match, tag a resolution task.
  5. Apply Costco-specific business rules
    1. Enforce pack quantity and UOM rules in PO1 to avoid ASN inaccuracies. Costco enforces pack-level consistency effective 2026-05-31; ensure your mapping retains PO1 PO102 and PO103 exactly as sent.
    2. Check for required REF or PO-level notes specified by Costco vendor documentation—use the Costco EDI requirements guide for specifics.
  6. Convert to CSV/ERP format
    1. Define CSV headers that match your ERP fields. Use the mapping table in this guide as a template.
    2. Export all PO1 lines as separate CSV rows with replicated PO header fields, or aggregate lines if your ERP requires order-level rows.
    3. Run a final validation pass to ensure CTT line count equals the number of PO1 lines exported, and SE segment count equals parsed segment count before transmitting the 997 acknowledgment if required.
  7. Automate validation and exception handling
    1. Deploy automations to route exceptions (e.g., missing product IDs, UOM mismatches) to a human queue with the original EDI snippet attached.
    2. Use PlainEDI continuous validation to catch syntax and specific Costco compliance issues early in the feed before ERP ingestion.

Common Errors and Fixes

  • Error: ISA/IEA control number mismatch — Symptom: IEA reports a different control number than ISA. Fix: Recompute interchange control numbers or re-send with the correct ISA13 and IEA02 values. Validate using an ISA/IEA pairing tool such as PlainEDI.
  • Error: 997 functional acknowledgment rejects with AK2 segment — Symptom: AK2 indicates ST-level rejection. Fix: Inspect AK3/AK4 details for malformed segment or element. Correct the element format in the identified segment (commonly BEG or PO1) and re-send. See resolving 997 rejection codes for code meanings.
  • Error: PO1 UOM mismatch vs. vendor master — Symptom: Your system receives PO102/PO103 that do not match expected pack sizes. Fix: Implement UOM mapping rules and convert when allowed. If Costco requires carton-level ordering, hold the order for manual confirmation and record an exception.
  • Error: Missing buyer product identifier (BP/UP) — Symptom: PO1 lacks a buyer GTIN. Fix: Attempt to match on vendor part (VP) or consult the REF segments. Create a follow-up process with the buyer contact identified in N1 to request the missing identifier.
  • Error: SE segment reported wrong segment count — Symptom: Trading partner sends SE count that does not match parsed segments. Fix: Recalculate segment count programmatically and either correct the SE before ingestion or reject and request corrected EDI. Always maintain the original ST control number.
  • Error: Address mapping failure for N1/N4 — Symptom: Cannot match N104 location ID to your warehouse. Fix: Maintain a synced location mapping file keyed by Costco's N104 values. When new locations appear, follow your vendor onboarding process to add them and notify internal logistics.

Related Resources

Common Costco Compliance Notes (Penalties and Best Practices)

Costco enforces compliance on EDI transactions with program updates effective 2026-05-31. Retailers including Costco impose penalties for non-compliance that typically include chargebacks for OTIF (On-Time In-Full) failures, ASN inaccuracies, and incorrect invoice matching. Verify exact penalty amounts and current policy via your Costco vendor portal; these policies are under the 2026-05-31 program update. Maintain ASN and PO packing accuracy to avoid chargebacks.

Best practices to avoid penalties:

  • Validate PO pack quantities and UOMs before shipping.
  • Send ASNs that reflect PO1 and carton-level details exactly.
  • Use automated validation (for example, PlainEDI) to catch syntax and business-rule failures before fulfillment.

Case Studies and Real-World Examples

Case study A — Vendor A received a Costco 850 where PO1 quantities were listed in 'CT' cartons but their ERP expected 'EA'. The automated converter incorrectly split cartons into eaches causing invoicing and ASN mismatch. Resolution: Implemented UOM mapping and a pre-processing rule that converts carton-based POs to EA only after verifying item pack count from the item master. After adding this validation, Vendor A reduced ASN mismatch chargebacks by eliminating unit conversion errors.

Case study B — A 3PL ingesting direct Costco POs failed because the N1 ship-to ID did not match the 3PL location mapping. The 3PL updated their N1 mapping table and added an alert when unknown N1 IDs appear. The alert included the raw N1 segment and a link to create a ticket in the WMS. Over 30 days, this reduced manual exception handling time by 60% for Costco POs.

FAQ

Q: What is the required transaction set for Costco PO transmissions?

Costco uses the X12 850 transaction set for purchase orders. Ensure the GS functional identifier is 'PO' and ST02 is '850'. Validate versions specified in GS08 (commonly 004010 or a later agreed-upon version).

Q: How do I handle UOM conversions for Costco POs?

Do not perform automatic UOM conversions without checking the item master pack quantity. If the PO UOM is 'CT' (carton) and your system is each-based, convert using the item pack-size (e.g., 12 EA per CT). Record the original PO1 UOM in a separate field for auditability.

Q: The 997 indicates an AK4 invalid element in PO1. What next?

Read the AK4 for element position and value. Correct the identified PO1 element (for example, PO103 UOM or PO104 price). Re-transmit the corrected ST850. Use the AK3/AK4 detail to pinpoint the exact segment and element position.

Q: What Costco-specific fields should I always capture from the 850?

Always capture BEG03 (PO number), BEG05 (PO date), N1-N4 (ship-to and bill-to), PO1 qualifiers (BP/UP/VP), REF segments for buyer notes, and CTT line count. These fields support ASN generation and invoice matching.

Q: Does Costco enforce specific ASN requirements tied to the 850?

Costco enforces ASN accuracy as part of fulfillment compliance; ASNs must reflect the PO1 pack and quantity information. Non-conforming ASNs can lead to chargebacks under Costco's 2026-05-31 program update. Confirm ASN requirements in the Costco EDI requirements guide and on the vendor portal.

Q: How can I prevent SE segment count errors?

Count segments programmatically as you parse the ST...SE block. Include only segments that belong to the transaction set. If you generate EDI, compute SE segment count at the time of creation to avoid off-by-one errors.

Q: When should I generate a 997 acknowledgment for a Costco PO?

Generate a 997 if your trading partner agreement requires functional acknowledgments. Issue a 997 to confirm syntactic acceptance. If the 997 reports AK5 rejection codes, repair the syntax or element errors and re-transmit.

Q: How does PlainEDI help with Costco 850 validation?

PlainEDI validates X12 syntax (ISA/GS/ST/SE counts), highlights missing required segments (e.g., BEG or PO1), and checks CTT/SE segment counts. Use PlainEDI to pre-validate files and to prevent avoidable rejections and compliance breaches.

Final Notes and Call to Action

Processing Costco EDI 850s reliably requires strict attention to ISA/GS element integrity, accurate PO1 parsing, UOM/pack consistency, and alignment with Costco's vendor requirements effective 2026-05-31. Use automated validation to catch syntax and business-rule issues early and maintain an up-to-date mapping of Costco location IDs in your system to avoid fulfillment errors and chargebacks.

To validate your Costco 850 files now and get instant error reports, upload your EDI files to PlainEDI. PlainEDI’s validation will flag IDX-level syntax issues, CTT/SE mismatches, and many Costco-specific compliance checks before you ingest to ERP or send ASN files.