Costco Edi 846
What This Is
This guide covers Costco EDI 846 — the X12 transaction set used to transmit inventory inquiries and inventory advice information between trading partners. A Costco 846 typically contains inventory levels, replenishment recommendations, and date-specific quantity snapshots. Vendors rely on 846 messages to reconcile on-hand inventory at retailer locations, plan replenishment, and detect discrepancies that can affect order fulfillment.
We explain why 846 messages fail validation, how Costco-specific expectations affect mapping and conversion, and provide practical conversion patterns for converting 846 to CSV or your ERP. This guide includes live EDI snippets with line-by-line annotations, a clear CSV output example, step-by-step conversion instructions, numerous troubleshooting patterns, and references to tools such as PlainEDI to automate validation.
Who This Is For
This guide is for EDI analysts, operations leads, integration engineers, and vendor IT teams who must process Costco 846 files: either ingesting them into ERP/WMS systems or converting them to CSV for analytics and inventory reconciliation.
Key Segments Explained
Below are the primary X12 segments you will encounter in a Costco 846 and what they mean. For each segment we explain common pitfalls and what Costco typically expects.
- ISA — Interchange Control Header
The ISA is the fixed-width envelope header that defines sender/receiver IDs, element separators, and the interchange control number. Common pitfalls: incorrect ISA13 (Interchange Control Number) sequence, wrong ISA11 repetition separator, or mismatched ISA15 usage. If ISA delimiters are wrong, the entire file will be unreadable.
- GS — Functional Group Header
GS groups multiple transaction sets. Key elements: GS02 sender code, GS03 receiver code, GS06 date/time, and GS08 group control number. GS/GE mismatch or GS control values not matching interior ST/SE can cause envelope-level failures at the VAN or Costco’s EDI gateway.
- ST — Transaction Set Header
ST starts the 846 transaction. ST01 contains the transaction set identifier code (exactly “846”) and ST02 is the transaction set control number. ST/SE segment count and ST02 consistency are frequent rejection causes.
- BIA — Beginning Segment for Inventory Inquiry/Advice
BIA identifies the transaction’s purpose (e.g., “00” Original, “04” Change). Elements include BIA01 type code, BIA02 reference identification (transaction number), BIA03 date, and BIA04 time. Many downstream systems rely on BIA02 as the unique inventory file identifier; duplicates or missing BIA02 will break ingestion processes.
- LIN — Item Identification
LIN carries vendor item identifiers and qualifiers (e.g., UPC, Buyer part number). Costco often requires the GTIN/UPC (qualifier “UP” or “EN”) in a specific position. Missing or misqualified LIN elements are the most common data-level errors.
- QTY — Quantity Information
QTY indicates quantity type and the amount. QTY01 is a quantity qualifier (e.g., “33” available quantity, “36” on-hand). Quantity precision and sign errors (negative values) are common mistakes. Confirm which qualifiers Costco expects for each 846 flavor.
- DTM — Date/Time Reference
DTM supplies the date for the quantity (e.g., inventory snapshot date). Date format must be YYYYMMDD or follow specified format code. Incorrect DTM formats or missing DTM when QTY is present will invalidate the business context of the inventory data.
Example EDI Snippet
ISA*00* *00* *ZZ*VENDORID *ZZ*COSTCOID *210601*1230*U*00401*000000905*0*P*:~
GS*IB*VENDORID*COSTCOID*20210601*1230*905*X*004010~
ST*846*0001~
BIA*00*INV-905-20210601*20210601~
N1*ST*COSTCO WHOLESALE*92*12345~
LIN**UP*0012345678905*IN*ABC123~
QTY*33*150~
DTM*036*20210601~
LIN**UP*0012345678906*IN*ABC124~
QTY*33*0~
DTM*036*20210601~
SE*10*0001~
GE*1*905~
IEA*1*000000905~
Line-by-line annotation:
ISA*sets the interchange envelope; element positions must be exact width; ISA13 (000000905) is the interchange control number.GS*IB*functional group header for Inventory Advice (IB). GS06 and GS07 set date/time and group control (905).ST*846*0001~starts the 846 with control number 0001.BIA*00*INV-905-20210601*20210601~BIA01=00 original, BIA02 unique transaction id, BIA03 date.N1*ST*COSTCO WHOLESALE*92*12345~Ship-to information with qualifier 92 referencing Costco store id 12345.LIN**UP*0012345678905*IN*ABC123~LIN uses qualifier UP (UPC) and IN for vendor item number; note the double asterisk because LIN01 is typically used for assigned identification and is blank.QTY*33*150~QTY qualifier 33 indicates available quantity, value 150 units on hand.DTM*036*20210601~Inventory date qualifier 036 (scheduled date or snapshot) with YYYYMMDD format.- Trailing segments close the transaction set and envelopes:
SE,GE,IEA.
CSV Output Example
| DocumentType | TransactionID | StoreID | UPC | VendorItem | QtyType | Quantity | SnapshotDate |
|---|---|---|---|---|---|---|---|
| 846 | INV-905-20210601 | 12345 | 0012345678905 | ABC123 | 33 | 150 | 2021-06-01 |
| 846 | INV-905-20210601 | 12345 | 0012345678906 | ABC124 | 33 | 0 | 2021-06-01 |
Step-by-Step Conversion Process
-
Receive and validate the envelope
- Check ISA delimiters and fixed-width formatting. If ISA segment length is incorrect, reject file immediately.
- Validate ISA13/IEA01 control numbers match the VAN’s acknowledgment for traceability.
- Ensure GS and IEA group counts are consistent (GS08 and IEA01).
-
Verify ST/SE transaction set integrity
- Confirm ST02 matches SE02. If segment count (SE01) is incorrect, recalculate segment count and fail the set if mismatched.
- Ensure ST identifier equals 846 to guarantee the correct processing path.
-
Parse header-level business fields
- Extract BIA02 to use as CSV DocumentID or import key. If BIA02 is missing, use a composite of ISA13+GS06+ST02 but flag for manual review.
- Pull N1 segments for store identification. For Costco, N1*ST with qualifier 92 often holds the store ID; normalize numeric store IDs to remove leading zeros if required by your ERP.
-
Loop through LIN→QTY→DTM item groups
- For each LIN, extract primary product identifier (prefer UPC/GTIN). If multiple product identifiers exist, prioritize UPC for Costco compliance.
- Map QTY qualifiers (e.g., 33) to CSV QtyType column. Validate quantity is non-negative and integer; if decimals are present, check unitPrecision business rules.
- Map DTM snapshot date to CSV date column; validate format and convert to ISO date (YYYY-MM-DD).
-
Business rule validation and enrichment
- Validate that each UPC corresponds to a known vendor SKU in your master data; if unmatched, log and place in a reconciliation queue.
- Apply store-level rules: convert unit-of-measure if Costco reports cases vs. each, using REF or PO4 details if provided.
-
Output to CSV and checksum
- Emit one CSV row per LIN occurrence with normalized fields (date, UPC, quantity, store id).
- Generate a checksum file and a minimal metadata manifest (source filename, received timestamp, record count) for auditing.
-
Automate validation using PlainEDI
- Upload sample 846 files to PlainEDI to catch delimiter, missing segment, and QTY format errors before sending to Costco.
- Leverage PlainEDI’s rule engine to enforce BIA02 presence, LIN UPC qualification, and DTM date format to prevent downstream rejections.
Common Errors and Fixes
- Error: ISA control number mismatch / IEA control mismatch. Why: VAN or your system changed the control number or you reused ISA13. Fix: Reissue the interchange with a new ISA13 and ensure IEA01 matches ISA13. Re-sync your EDI counter strategy.
- Error: ST/SE transaction set count mismatch (SE01 incorrect). Why: Middleware removed or merged empty segments (e.g., suppressing empty LIN01). Fix: Recompute SE01 by counting segments between ST and SE. Ensure your EDI library preserves placeholder elements when required.
- Error: Missing or misqualified UPC in LIN segment. Why: Vendor sent vendor SKU in the wrong qualifier slot (used IN instead of UP or EN). Fix: Map the correct qualifier: LIN03 with qualifier 'UP' or 'EN' should hold GTIN/UPC. Update your mapping to accept alternate qualifiers if Costco supports them, but prioritize UPC for import.
- Error: QTY negative or decimal values rejected. Why: Source application exported case-level decimal values or used a signed data format. Fix: Normalize to integer each-units. If Costco expects cases, include unit-of-measure REF/PO4 normalization and supply both case and each values.
- Error: Incorrect DTM format or missing date qualifier. Why: Using MMDDYYYY or YYYY-DD-MM instead of YYYYMMDD. Fix: Use DTM*036*YYYYMMDD for snapshot dates (confirm qualifier with Costco). Validate dates at ingestion and reject with clear error messages for manual correction.
- Error: N1 store ID missing or wrong qualifier. Why: The N1*ST qualifier was omitted or used N1*BT/N1*ST interchangeably. Fix: Ensure N1*ST appears when transmitting store-level inventory. If store is represented in REF, map REF qualifiers accordingly and provide crosswalk documentation to Costco if required.
Related Resources
- costco edi 850 — Purchase order processing for Costco, useful when correlating inventory advice to open POs.
- costco edi 856 — ASN handling and how ASNs interplay with inventory advice.
- costco edi requirements — Consolidated Costco EDI program rules and compliance expectations.
- edi-to-csv-for-small-business-vendors — Practical CSV conversion approaches for small vendor teams processing 846 files.
- how-to-validate-edi-files-before-sending — Preflight validation checklist and automated tests you can run before sending EDI to Costco.
- reading-997-functional-acknowledgments — Use this to interpret Costco acknowledgments in response to your interchange.
FAQ Section
Q: What is the purpose of a Costco 846?
The 846 transmits inventory levels and related inventory advice from a trading partner (often the retailer or vendor) that include on-hand quantities, available quantities, and date-specific snapshots. Vendors use this data to reconcile stock levels, plan replenishment, and identify discrepancies between expected and actual inventory.
Q: Which LIN identifier should I prioritize for Costco 846?
Prioritize GTIN/UPC identifiers in LIN (qualifier 'UP' or 'EN') as Costco systems and buyer integrations typically reference UPCs for shelf-level item matching. If UPC is not provided, vendor item numbers (qualifier 'IN') are acceptable but require an internal SKU crosswalk.
Q: What are the envelope-level values that commonly cause rejections?
Common envelope rejections are caused by incorrect ISA delimiters, mismatched ISA/IEA control numbers, GS/GE mismatch, and incorrect ST/SE segment counts. These are structural issues that can prevent Costco’s EDI gateway from even parsing the 846.
Q: How do I map 846 QTY qualifiers to my ERP?
Identify the QTY01 qualifier values used in the 846 (e.g., 33 for available quantity) and create a mapping table. Ingest the numeric quantity into the corresponding ERP field (on-hand, available, reserved). Validate units-of-measure and convert cases to eaches if your ERP stores only each-level inventory.
Q: Does Costco impose penalties for 846 compliance failures?
Retailers, including Costco, enforce compliance policies that can include chargebacks for ASN/EDI inaccuracies, late or incorrect documents, and OTIF-related issues. The Costco program data used here was last updated 2026-05-31; verify current requirements with the retailer portal for exact penalty programs and amounts.
Q: Can I use a simple CSV converter to process Costco 846 files?
You can convert 846 files to CSV for manual reconciliation, but use deterministic parsing that respects X12 delimiters and segment groups. Consider automated validation to enforce business rules. You can upload files to PlainEDI to run these validations and reduce manual correction overhead.
Q: What date format should be used in DTM segments for Costco 846?
DTM dates should use YYYYMMDD when DTM02 is populated (e.g., DTM*036*20210601). Confirm the qualifier expected by the trading partner; invalid date formats will invalidate the inventory snapshot and may cause the file to be rejected.
Q: How should I handle out-of-stock (zero quantity) entries in an 846?
Include zero quantities using the appropriate QTY qualifier (33 or the qualifier specified by Costco). Flag these records in your inventory reconciliation logic as stockouts so replenishment teams can act. If the 846 uses case-level units while you need eaches, convert appropriately and document the conversion factor.
Practical Case Studies
Case Study 1 — Missing UPCs vs. Vendor SKUs: A vendor received a Costco 846 where half the LIN segments used vendor SKU (IN) instead of UPC (UP). The vendor’s ERP matched only UPCs and created hundreds of unmatched records. Solution: build a crosswalk table and implement a two-pass import: first match UPCs, then attempt vendor SKU matches and create exception reports. Use PlainEDI to assert LIN03 qualifiers and notify the vendor team when UPCs are missing before ingestion.
Case Study 2 — Date mismatch and stale inventory: A chain-wide 846 contained DTM dates from the prior business day due to an upstream export schedule issue. This led to replenishment orders misaligned with current demand. Solution: implement an automated rule to compare DTM against incoming file receive date; flag records where DTM is older than 48 hours for manual review. PlainEDI helps by validating DTM ages during pre-ingest checks.
Final Recommendations and Best Practices
- Implement strict envelope checks (ISA/GS/ST) at the earliest processing stage to fail-fast on structural issues.
- Create a robust LIN-to-SKU crosswalk maintained in your MDM to reduce unmatched items.
- Normalize QTY units and validate non-negative integer quantities.
- Log and produce a reconciliation report for every 846 import showing matched, unmatched, and flagged records for operational teams.
- Use PlainEDI for preflight validation of 846 files — it will catch many common syntactic and business-rule issues before they reach Costco.
Costco program information referenced here was last updated 2026-05-31. Verify current requirements with the retailer portal.
Call to Action
If you want to validate and convert your Costco 846 files now, upload a sample to PlainEDI to catch delimiter, segment-level, and business-rule issues before sending to Costco. PlainEDI’s validations reduce rejections and speed up reconciliation.