Skip to main content

Rygen Help Center

EDI Specs

EDI specs enable the definition of the agreed-upon structure and rules of the EDI documents that trading partners exchange. They define the structure of an EDI document, including the transaction set code, version, and the structure of the document message. EDI specs are used automatically whenever you use an EDI File Processor to process an EDI Document. The correct spec is determined using a combination of the trading partner, transaction set code, and version. EDI File Processors then use the relevant spec to validate and map the EDI document to/from the canonical model defined in the spec.

Each EDI Spec is associated with a specific EDI Template which serves as the starting point for the spec.

EDI specs can be edited and customized to meet a trading partner's specific needs. For example, when a spec validates an EDI document, it converts the EDI document into the canonical model defined in the spec. So, the ANSI X12 formatted EDI is transformed into a human-readable JSON structure with a structure and property names as defined in the EDI spec. Other X1 components, such as translators, can further process and transform the document.

Conversely, when an EDI Spec is used to generate an ANSI X12-compliant EDI document, users translate their source documents into a representation that matches the canonical model defined in the EDI Spec. This enables the spec to transform the canonical representation of the EDI document into the ANSI X12 format expected by the trading partner.

The EDI Specs page is where you can view and add your EDI specs.

  1. On the EDI Specs page, view the list of EDI specs.

Search for an EDI spec
  1. On the EDI Specs page, you can search for a specific EDI spec using the default search fields.

    edi_spec_search.png
  1. In the top right corner of the page, select New EDI Spec.

    new_edi_spec.png
  2. On the EDI Spec Details page, enter the EDI spec information

  3. In the top right corner of the page, select Save.

See the "New EDI Spec Field Descriptions" below for more information about the EDI spec fields.

New EDI Spec Field Descriptions

Section and Field

Description

EDI Spec Details

Name

Enter a unique name for the EDI spec.

Trading Partner

The trading partner associated with the EDI spec.

EDI Type

The EDI document standard: EDIFACT or ANSI X12.

EDI Transaction Set Code

The X12 transaction set code that identifies the type of EDI document.

Note

This value cannot be edited after you save it.

EDI Version

The X12 version of the EDI document.

Note

If you don't enter an X12 version, X1 will set it to 4010 by default.

Note

Entering the transaction set code and X12 version automatically loads the structure of the EDI document from the related EDI Template. This enables you to create a new EDI Spec for a specific transaction set and X12 version and have the structure of the EDI document automatically populated. You can then change your EDI spec to match the specific requirements of the trading partner you're working with.

Note

This value cannot be edited after you save it.

Terminator

The character used to terminate segments in the EDI document. This is typically a tilde ~ character.

Separator

The character used to separate elements in the segments in the EDI document. This is typically an asterisk * character.

Composite Separator

The character used to separate composite elements in the segments in the EDI document. This is typically a colon : character.

Usage Indicator

How the EDI spec will function: Production or Test

  • Production - The EDI spec is applied in a production environment.

  • Test - The EDI spec is used for testing purposes. You can test the spec with parsing, validating, and mapping EDI to your canonical model, as well as generating EDI from a JSON document.

Map Data Elements?

The EDI Spec will automatically map to an EDI Data Element when being parsed, or to an EDI Element code when being generated.

Document Spec

The Document Spec of an EDI Spec is the container for the EDI components that comprise the EDI Document.

The Document Spec is created automatically from the related EDI template and can be further customized to meet the specific needs of the trading partner. See the Add Child entry below in this table.

Test Document

Enter or upload an EDI or JSON document for testing.

Note

After you enter or upload the test document, you can test it by selecting Test in the top right corner of the page.

The Test Result dialog box displays to inform you if the test passed or failed. If the tests pass, select View Output to view the translated document.

  1. On the Document Specs tab, drag and drop the document specs to arrange them in any order you want.

    Note

    Optionally, you can select context_menu_icon.png next to a document spec, and then select either Add Before or Add After to arrange it.

  2. In the top right corner of the page, select Save.

A segment contains elements and can occur one or more times in a sequence.

  1. At the bottom of the Document Spec tab, select Add Child. A new loop entry displays by default in the Document Spec section.

    Note

    In this procedure, you'll be changing the default loop entry to a segment entry.

  2. Select expand_icon.png next to the new loop.

  3. Enter the segment information.

  4. Select collapse_icon.png to collapse the new segment information.

  5. In the top right corner of the page, select Save.

See the "New Segment (EDI Spec) Field Descriptions" below for more information about the new segment fields.

New Segment (EDI Spec) Field Descriptions

Field

Description

ID

Select a unique ID for the segment.

This ID is used to reference the segment in the EDI document. It should match the ID as defined in the ANSI X12 standard as well as that of the EDI file that will be processed.

Name

Select the "canonical" name for the segment.

This name is used to map to and from the ANSI-compliant EDI and is used by translators when translating to and from EDI format.

Type

This is set to loop by default.

Select the drop-down arrow, and select segment.

Min

The minimum number of times the segment can occur in a sequence.

Max

The maximum number of times the segment can occur in a sequence.

Is required?

Determines if the segment is required or not.

Note

If the segment is required, it must occur at least one time regardless of the minimum value.

An element contains the data of the EDI document and can only occur within a segment. Elements can occur only one time and their min/max values determine the length of the data in the element.

  1. On the Document Spec tab, select expand_icon.png next to a segment to expand it. The Child Components list displays for the segment.

  2. At the bottom of the Child Components list, select Add Child. The new element entry displays in the Child Components list.

  3. Select expand_icon.png next to the new element.

  4. Enter the element information.

  5. Select collapse_icon.png to collapse the new element information.

  6. In the top right corner of the page, select Save.

See the "New Element (EDI Spec) Field Descriptions" below for more information about the new element fields.

New Element (EDI Spec) Field Descriptions

Field

Description

ID

Optional: Select a unique ID for the element.

This ID is used to reference any EDI Data Elements that the data should be validated against.

If you provide an ID, X1 validates the data in the element against the list of valid codes for the element. If the data in the element isn't found in the list of valid codes, the EDI document is rejected with an error that notifies the sending party that the value is not valid for the data element.

Name

Select the "canonical" name for the element.

This name is used by translators when translating to and from EDI format.

Type

This is set to element by default.

Min

The minimum length of the data in the element.

Max

The maximum length of the data in the element.

Is required?

Determines if the element is required or not.

You can optionally add conditions to an element.

Conditions specify if and when the element must have data or is allowed based on other elements in the segment.

  1. On the Document Spec tab, select expand_icon.png next to a segment to expand it. The Child Components list displays the elements for the segment.

  2. In the Child Components list for the segment, select expand_icon.png next to an element.

  3. In the Child Components list for the element, select Add Child. The new condition entry displays in the Child Components list.

  4. Select expand_icon.png next to the new condition.

  5. Enter the conditions.

  6. In the top right corner of the page, select Save.

See the "New Condition (EDI Spec) Field Descriptions" below for more information about the new condition fields.

New Condition (EDI Spec) Field Descriptions

Field

Description

Element At

Enter the condition.

The condition requires the index (1-based) of the element in the segment when to apply the condition and what the condition is.

Exists?

Determines if the element at the index must exist or not.

Requirement

  • Required - If the condition is required then select Yes on the Is required (must have data) option for the element. your adding this condition to.

  • Allowed - If the condition is allowed then select Yes on the Is required (can have data) option for the element. your adding this condition to.

A loop contains other loops and segments and can occur one or more times in a sequence.

  1. At the bottom of the Document Spec tab, select Add Child. A new loop entry displays by default in the Document Spec section.

  2. Select expand_icon.png next to the new loop.

  3. Enter the loop information.

  4. In the top right corner of the page, select Save.

See the "New Loop (EDI Specs) Field Descriptions" below for more information about the new loop fields.

New Loop (EDI Specs) Field Descriptions

Field

Description

ID

Optional: Select a unique ID for the loop.

This ID should match the ANSI X12 standard, if provided.

Name

Select the "canonical" name for the loop.

This name is used by translators when translating to and from EDI format.

Type

This is already set to loop by default.

Min

The minimum number of times the loop can recur (the number of loops) in a sequence.

Max

The maximum number of times the loop can recur (the number of loops) in a sequence.

Is required?

Determines if the loop is required or not.

Note

If the loop is required, it must occur at least one time regardless of the minimum value.

  1. On the Document Spec tab, next to a document spec, select context_menu_icon.png, and select Remove.

  2. In the top right corner of the page, select Save.

  1. Next to an EDI spec, select delete_icon.png. The Delete EDI Spec dialog box displays.

  2. Select Delete.

    Note

    After you delete an EDI spec, if an EDI that matches the transaction set code and X12 version of the deleted spec is received, the system won't be able to validate the EDI document, so it'll throw an error.