Costco Edi 820
What This Is
This guide is a comprehensive, practical reference for processing Costco EDI 820 files (Payment Order/Remittance Advice). It focuses on how Costco sends remittance details, what segments and elements you must parse, and how to convert those details into CSV rows suitable for accounting systems or ERP imports. It explains why common errors occur, not just how to fix them, so you can prevent recurring failures.
Costco vendor program details relevant to EDI were last updated on 2026-05-31. Because that update is more than 30 days old, verify current requirements with the Costco vendor portal. This guide covers X12 820 structure, real-world processing examples, and step-by-step conversion workflows you can implement immediately. Use PlainEDI to validate files and automate many of these checks.
Who This Is For
This guide targets EDI specialists, accounts receivable staff, developers integrating remittance data with ERPs (QuickBooks, NetSuite, SAP), and 3PL/finance teams handling Costco payments and remittance reconciliation.
Key Segments Explained
Below are the EDI 820 segments you will see and why each matters for Costco remittance processing.
- ISA / IEA (Interchange Control Header/Trailer)
The ISA header establishes interchange-level delimiters and control numbers. For 820 processing, validate ISA13 (interchange control number) against the IEA01 to ensure the interchange is complete. If ISA control numbers do not match, drop processing and request a retransmit.
- GS / GE (Functional Group Header/Trailer)
GS identifies the group functional code ('RA' for remittance advice in some implementations, but for 820 GS01 is typically 'RA' or 'PR' variations may occur). Confirm GS02 (application sender's code) and GS03 (application receiver's code) match your trading-partner identifiers and validate GE01/GE02 counts.
- ST / SE (Transaction Set Header/Trailer)
ST marks the start of the 820 transaction set. Check ST02 and SE01 counts. The ST/SE count mismatch is the most common parsing error that breaks downstream CSV conversion because parsers stop at an unexpected end-of-transaction.
- BPR (Beginning Segment for Payment Order/Remittance Advice)
BPR contains payment amount, currency, payment method, and bank account details. BPR elements you must extract for reconciliation include BPR02 (monetary amount), BPR03 (credit/debit indicator), BPR04 (payment method code), and BPR12-BPR14 (financial institution routing). Missing or malformed BPR elements cause payment matching errors in ERP systems.
- TRN (Reassociation Trace Number)
TRN02 (reference identification) is the remittance reference used to match payments to invoices. For Costco EDI 820, TRN values are often the payment batch ID or the Costco check/EFT trace. If TRN is absent or duplicated, reconciliation fails or duplicates payments.
- N1 / N2 / N3 / N4 (Name and Address)
N1 identifies payor/payee entities. For remittance, you will get N1*PR (Payer) and N1*PE (Payee) or N1*RI depending on trading-partner implementation. Parse N1 segments to populate vendor IDs and remit-to addresses.
- RMR (Remittance Advice Accounts Receivable Open Item Reference)
RMR identifies invoice-level details: RMR02 (invoice number), RMR03 (invoice date), RMR04 (invoice amount), RMR05 (applied amount). For CSV export, map one RMR per row to represent invoice-level application of payment amounts.
Example EDI Snippet
Below is a compact real-world 820 example with annotated line-by-line explanation. This snippet is intentionally simplified for readability while preserving key fields used for conversion and validation.
ISA*00* *00* *ZZ*COSTCO *ZZ*VENDORID *210701*1700*U*00401*000000905*0*T*:~
GS*RA*COSTCO*VENDORID*20210701*1700*905*X*004010~
ST*820*0001~
BPR*C*12345.00*C*ACH*CTX*01*111000025*DA*123456789*1234567890**01*222000111*DA*987654321*20210701~
TRN*1*PAY123456*20210701001~
N1*PR*COSTCO WHOLESALE~
N1*PE*VENDOR COMPANY*92*VEND123~
RMR*IV*INV1001*20210601*500.00*500.00~
RMR*IV*INV1002*20210605*450.00*450.00~
SE*10*0001~
GE*1*905~
IEA*1*000000905~
Line-by-line explanation:
ISA*— Interchange header with delimiters and control number000000905.GS*RA*— Functional group for remittance advice; confirms partner IDs and group control905.ST*820*0001— Start transaction set 820 with control0001.BPR*C*12345.00*...— Payment of 12,345.00 via ACH; BPR fields include sending/receiving bank routing and account info (masked here).TRN*1*PAY123456*20210701001— Reassociation trace number and reference ID used for reconciliation.N1*PR*— Payer name: COSTCO WHOLESALE.N1*PE*— Payee (your company) with internal vendor IDVEND123.RMR*IV*INV1001*...*500.00*500.00— Applied payment for invoice INV1001 for 500.00.SE*,GE*,IEA*— Transaction, group, and interchange trailers closing counts and control numbers.
CSV Output Example
The most useful CSV layout for AP reconciliation lists one applied invoice per row with payment header fields repeated. Below table maps the EDI fields from the example to CSV columns.
| CSV Column | EDI Source (segment.element) | Example Value |
|---|---|---|
| PaymentDate | BPR.16 (or TRN date if present) | 20210701 |
| PaymentAmount | BPR.02 | 12345.00 |
| PaymentMethod | BPR.04 | ACH |
| PayerName | N1(PR).02 | COSTCO WHOLESALE |
| PayeeID | N1(PE).04 | VEND123 |
| RemitRef | TRN.02 | PAY123456 |
| InvoiceNumber | RMR.02 | INV1001 |
| InvoiceDate | RMR.03 | 20210601 |
| InvoiceAmount | RMR.04 | 500.00 |
| AppliedAmount | RMR.05 | 500.00 |
Step-by-Step Conversion Process
-
Receive and Pre-Validate
- Confirm transport integrity (AS2/FTP/ VAN) and that the file is complete.
- Validate ISA/IEA control numbers: check ISA13 equals IEA02 and IEA01 equals count of interchanges.
- Run PlainEDI validation to detect delimiter mismatches and common structure errors before parsing. PlainEDI flags ISA/GS/ST mismatches automatically.
-
Parse Interchange and Functional Group
- Extract ISA delimiters (element separator, component separator, segment terminator) from ISA header — do not assume standard characters.
- Validate GS/GE group control count matches number of ST/SE transactions within the group.
-
Normalize Transaction-Level Data
- For each ST..SE transaction, extract BPR, TRN, N1, and each RMR segment.
- Normalize monetary formats: remove thousands separators, ensure two decimal places, and standardize date formats to YYYY-MM-DD or YYYYMMDD based on target CSV schema.
- If multiple RMR segments exist, create multiple CSV rows where the payment header fields repeat.
-
Validate Business Rules
- Match TRN and BPR amounts against your bank statement or remittance batch for reconciliation. Flag if sum(RMR.applied) != BPR.amount.
- Confirm payee N1 identifier matches your system vendor ID. If not, use REF segments to find alternate vendor reference or create an exception record.
-
Generate CSV and Reconciliation Report
- Map fields to CSV columns (see table above). Include metadata columns: ISA control, GS control, ST control, file received timestamp.
- Run totals check: CSV total applied amount against BPR. Create a reconciliation report that lists mismatches and unmatched invoices.
-
Automate Exceptions and Acknowledgments
- Load exceptions into your AP queue for manual review. Auto-close items where invoice numbers and amounts fully match.
- When applicable, generate 997 functional acknowledgments and return them to Costco per agreed-upon SLA. Use reading 997 guidance to interpret acknowledgments.
-
Archive and Audit
- Archive original EDI files with timestamps and generated CSV for audit trails.
- Store parsed JSON or database records for faster reprocessing and troubleshooting.
Common Errors and Fixes
These errors occur frequently when trading with large retailers such as Costco. Each item contains the symptom, root cause explanation, and step-by-step fix.
- Error: ISA/IEA control number mismatch
Cause: Interchange not closed or truncated during transfer. Fix: Reject the interchange, request retransmit, validate ASA/AS2 receipts. Use PlainEDI to detect early.
- Error: ST/SE segment count mismatch (SE01 value wrong)
Cause: Downstream process removed segments or counted components incorrectly. Fix: Recompute SE01 as number of included segments between ST and SE, correct the file, and request resubmit if the sender produced the original file.
- Error: Missing BPR bank account/routing (BPR12-BPR14)
Cause: Sender omitted sensitive account details for security. Fix: Use the TRN reference to reconcile with bank remittance; request secure supplementary file if account details are required for ERP posting.
- Error: Duplicate TRN reference (TRN02 duplicate)
Cause: Sender reused payment trace number across batches. Fix: Treat duplicates as exceptions; compare ISA/GSTimestamp for uniqueness. Contact Costco EDI support with the TRN list and timestamps (cite effective update 2026-05-31 in communications).
- Error: RMR invoice not found in AP system
Cause: Invoice number formatting mismatch (leading zeros, prefixes). Fix: Implement normalization rules (strip non-alphanumeric characters, standardize case). Create mapping table for common transformations.
- Error: Sum of RMR.applied != BPR amount
Cause: Partial payments, discounts, fees, or missing RMR segments. Fix: Reconcile using additional AMT or REF segments, if present. If still mismatched, create exception and investigate with Costco remittance support.
- Error: Delimiter errors (unexpected segment terminator)
Cause: Non-standard characters inserted by email or transport. Fix: Read delimiters from ISA element definitions and rebuild segments accordingly. Use robust parsing libraries or PlainEDI to detect delimiter anomalies.
Related Resources
- costco-edi-810 — Costco invoice (810) processing reference to match invoices to 820 payments.
- costco-edi-requirements — List of general Costco EDI requirements and onboarding steps.
- understanding-edi-x12-delimiters-and-structure — Explanation of ISA-level delimiters and parsing techniques.
- reading-997-functional-acknowledgments — How to read and act on 997 acknowledgments for 820 transactions.
- integrating-edi-with-erp-systems — Best practices for mapping EDI fields into ERP posting routines.
Case Studies and Real-World Examples
Case Study 1 — Partial Payment Handling
A vendor received an 820 where BPR indicated a payment of 10,000.00 but RMR segments applied to invoices totaled 9,700.00. Root cause: Costco applied a processing fee that was sent in an AMT segment rather than an RMR. Fix: Update parser to also extract AMT segments (AMT*F*300.00) and sum with RMR applied values. After adding AMT, totals matched and reconciliation automated.
Case Study 2 — Vendor ID Mismatch
A vendor used vendor legacy ID VEND-OLD in their AP system. Costco sent N1*PE with code VENDNEW. Root cause: trading partner mapping not updated. Fix: Create a vendor alias table and update onboarding documentation. For future exchanges, validate vendor identifiers using N1*PE. Use PlainEDI validations to flag vendor ID mismatches during ingest.
Troubleshooting Tips & Best Practices
- Always read delimiters from ISA segment; do not hard-code separators.
- Store the original EDI file and parsed JSON; reparse with different rules if errors occur.
- Keep an audit trail linking bank statement entries to BPR/TRN values for each EDI file.
- Automate basic validations (ISA/GS/ST counts, mandatory elements like BPR/TRN/RMR) and route exceptions to human review.
- Use PlainEDI early in the pipeline to catch structural errors and reduce manual triage time.
FAQ
Q: What is a Costco EDI 820 and why do I receive it?
Costco EDI 820 is the X12 Payment Order/Remittance Advice transaction set used to communicate payment details and invoice-level applications. You receive it to reconcile payments from Costco to your invoices.
Q: Which segments in 820 are required for reconciliation?
Key segments include ISA/GS/ST for structure, BPR for payment amount/method, TRN for payment trace reference, N1 for payer/payee identification, and RMR for invoice-level application. Ensure these segments are present and correctly populated for automated reconciliation.
Q: How do I handle multiple RMR lines in one 820?
Generate one CSV row per RMR segment with repeated payment header fields (PaymentDate, PaymentAmount, PaymentMethod, PayerName, PayeeID, RemitRef). This ensures invoice-level posting in your ERP.
Q: What should I do if BPR amount does not equal sum of RMR applied amounts?
Check for AMT segments for fees or discounts, check for negative RMR lines representing returns, and validate with bank statement. If unresolved, create an exception and contact Costco EDI support. Reference the Costco program update dated 2026-05-31 in communications and verify current requirements with the retailer portal.
Q: How can I prevent ST/SE segment count mismatches?
Implement parser logic that counts segments between ST and SE rather than trusting SE01. Use PlainEDI to flag mismatches before converting to CSV and request a corrected retransmit for inbound partner errors.
Q: Are there penalties for incorrect EDI 820 handling with Costco?
Retailers enforce penalties for compliance failures. Penalty types include chargebacks for incorrect remittance posting, OTIF-style compliance deductions, and ASN/invoice accuracy penalties. Check Costco vendor portal for current penalty thresholds and effective dates; this guide references Costco EDI program details last updated 2026-05-31 and recommends verifying current policies on the portal.
Q: What information should I include when contacting Costco EDI support?
Include ISA/GS/ST control numbers, file receipt timestamp, TRN reference(s), sample RMR invoice numbers, and reconciliation totals. Cite the file's control numbers and the update effective date (2026-05-31) where relevant.
Q: Can I use an automated tool to validate and convert 820 files?
Yes. Use validation tools that read ISA delimiters, verify ISA/GS/ST counts, and validate business rules (BPR totals vs RMR totals). PlainEDI offers these validations and can export structured CSV or JSON for ERP ingestion.
Final Notes and Call to Action
This guide focused on practical, step-by-step methods for ingesting and converting Costco EDI 820 files, with real example code, CSV mapping, and common error fixes. Remember to verify Costco program requirements on the vendor portal because the referenced update was effective 2026-05-31; verify current requirements with the retailer portal.
Ready to validate and convert your Costco 820s now? Upload a file to PlainEDI to run automated structural and business-rule validations, generate CSV output, and get real-time error reports.