Codepackr / edi / EDI Template & Sample Generator

EDI Template & Sample Generator

Generate customizable ANSI X12 (850, 810, 856, 204, 214, 820) and EDIFACT (ORDERS, INVOIC, DESADV) documents.

Client-Side Execution & Privacy Guarantee

This utility executes 100% locally in your web browser. Your inputs, tokens, queries, and data payloads are never transmitted to any external server or backend.

Creating realistic EDI test files by hand is slow and error-prone. The EDI Template & Sample Generator produces complete, well-formed ANSI X12 and UN/EDIFACT documents that already contain correct envelope structures, segment counts, and matching control numbers.

You choose the transaction set, supply trading-partner identifiers, purchase-order numbers, and line-item details, and the generator assembles a ready-to-parse interchange. All processing stays in the browser; nothing is uploaded.

X12 Envelope Construction

Every generated X12 document begins with a fixed-length ISA segment that is exactly 106 characters, including the segment terminator. Sender and receiver IDs are left-justified and space-padded to 15 characters. The interchange control number in ISA13 is mirrored in IEA02, and the functional-group control number in GS06 is mirrored in GE02.

Transaction-set control numbers (ST02/SE02) and segment counts (SE01) are calculated automatically so the document passes basic structural checks in any compliant parser. Authorization and security fields default to empty padded values when not supplied.

Supported Transaction Sets

Supported X12 sets include 850 Purchase Order, 810 Invoice, 856 Ship Notice/Manifest, 204 Motor Carrier Load Tender, 214 Transportation Carrier Shipment Status, and 820 Payment Order/Remittance Advice. For EDIFACT the generator produces ORDERS, INVOIC, and DESADV messages under the D96A or D01B syntax.

Each template includes the minimum mandatory segments required by the standard (for example BEG and PO1 for an 850, BGM and LIN for an ORDERS) plus common optional segments such as N1 loops and DTM date references. You can add further optional segments after generation if a partner implementation guide demands them.

Customization and Determinism

Partner IDs, purchase-order numbers, quantities, unit prices, and dates are supplied by the user and inserted into the appropriate elements. Default values are used only when a field is left blank, so the same inputs always produce the same output.

The generator does not invent business data beyond what is needed to keep the document syntactically valid. You remain in full control of every meaningful element, making the samples suitable for regression tests and partner onboarding checklists.

When to use this tool

  • Create a known-good 850 to test an inbound order parser.
  • Produce matching 856 and 810 documents that share the same PO number.
  • Generate EDIFACT ORDERS samples for partners outside North America.
  • Build training data sets without exposing live production files.
  • Verify that a new trading-partner profile accepts standard envelopes.

How to use the EDI Template & Sample Generator

  1. Select the standard (X12 or EDIFACT) and the document type.
  2. Enter sender and receiver identifiers; they are padded automatically for X12.
  3. Supply a purchase-order number, date, and one or more line items.
  4. Optionally add ship-to or bill-to names and addresses.
  5. Click Generate. The complete interchange appears instantly.
  6. Copy the result or download it as a .edi file.
  7. Feed the sample into the EDI validator or formatter for further inspection.

Worked examples

Minimal X12 850

Input
Type: 850, Sender: ACME, Receiver: RETAIL, PO: PO12345, Date: 20241112, Line: 1 qty 10 EA price 5.00 VP SKU100
Output
ISA*00*          *00*          *ZZ*ACME           *ZZ*RETAIL         *241112*0000*U*00401*000000001*0*P*>~GS*PO*ACME*RETAIL*20241112*0000*1*X*004010~ST*850*0001~BEG*00*SA*PO12345**20241112~PO1*1*10*EA*5**VP*SKU100~SE*4*0001~GE*1*1~IEA*1*000000001~

ISA is exactly 106 characters. Control numbers match. Segment count in SE01 is correct.

Simple EDIFACT ORDERS

Input
Type: ORDERS, Sender: ACME, Receiver: RETAIL, PO: PO12345
Output
UNA:+.? 'UNB+UNOA:2+ACME+RETAIL+241112:0000+1'UNH+1+ORDERS:D:96A:UN'BGM+220+PO12345+9'UNT+3+1'UNZ+1+1'

UNA service string is present. Message reference and interchange reference are consistent.

Common mistakes and tips

  • Always verify the generated ISA length is 106 characters before sending to a strict parser.
  • Use the same PO number across 850, 855, 856, and 810 samples when testing a full order lifecycle.
  • Space-padding of sender/receiver IDs is mandatory in X12; the generator performs it automatically.
  • Generated files are minimal; add optional segments only after the core structure validates.
  • Control numbers start at 1 by default; change them if your test suite expects a different sequence.

Frequently asked questions

Are the generated documents valid against the official X12 or EDIFACT schemas?

They contain all mandatory segments and correct control numbers, so they pass structural validation. Partner-specific implementation guides may require additional optional segments.

Can I generate more than one line item?

Yes. Add as many PO1 (or LIN) rows as needed; the segment count and loop structure are updated automatically.

Does the tool support custom delimiters?

X12 defaults to * and ~ ; EDIFACT defaults to the UNA set. You can change them after generation with the delimiter converter if a partner requires different characters.

Is any data sent to a server?

No. Generation happens entirely in the browser. Partner IDs and PO numbers never leave your machine.

Can I use the samples with the lifecycle reconciliation tool?

Yes. Generate an 850, then an 856 and 810 that share the same PO number, and load all three into the reconciliation viewer.