StediDOCS
GuidesAPI Reference

EDI Core

EDI Core translates EDI documents to JEDI and vice versa. JEDI is a JSON representation of EDI data and is usually easier to work with, because most modern programming languages and tools have built-in support for JSON.

EDI Core also validates the documents during translation. It will check them against the standard X12 specifications or against a specification of your own.

Demonstration

You can paste an EDI document into the Terminal and it will be translated to JEDI. Here's an EDI document you can experiment with.

ISA*00*          *00*          *ZZ*               *ZZ*               *210902*1200*/*00801*123456789*1*T*:~
GS*SO*00*00*20210902*1200*987654321*X*008010~
ST*326*0000~
SE*2*0000~
GE*1*987654321~
IEA*1*123456789~

It also works the other way around. Select JEDI to EDI and paste your JEDI document into the text field. Here's a document for you to try.

{
  "interchanges": [
    {
      "groups": [
        {
          "transaction_sets": [
            {
              "heading": {
                "010_ST": {
                  "01": "810",
                  "02": "0000"
                },
                "020_BIG": {
                  "01": "20210902",
                  "02": "AB01010101"
                }
              },
              "summary": {
                "010_TDS": {
                  "01": "999"
                },
                "080_SE": {
                  "01": "4",
                  "02": "0000"
                }
              }
            }
          ],
          "GS": {
            "01": "IN",
            "02": "00",
            "03": "00",
            "04": "20210902",
            "05": "1200",
            "06": "987654321",
            "07": "X",
            "08": "004010"
          },
          "GE": {
            "01": "1",
            "02": "987654321"
          }
        }
      ],
      "delimiters": {
        "element": "*",
        "segment": "~",
        "sub_element": ":"
      },
      "ISA": {
        "10": "1200",
        "11": "U",
        "12": "00401",
        "13": "123456789",
        "14": "1",
        "15": "T",
        "16": ":",
        "01": "00",
        "02": "          ",
        "03": "00",
        "04": "          ",
        "05": "ZZ",
        "06": "               ",
        "07": "ZZ",
        "08": "               ",
        "09": "210902"
      },
      "IEA": {
        "01": "1",
        "02": "123456789"
      }
    }
  ]
}

Any validation error will show up in red in the input document. Hover over the offending element to get more information.

Using the API

The EDI Core API allows you to do translation and validation programmatically. Make sure you have set up an API key and that you include the key in the Authorization header when you make a request.

Translation

To translate a document, you need three pieces of information.

  • The document you want to translate.
  • The format of that document.
  • The format you want to translate to.

You have two options when it comes to document format: edi and jedi@1.0.

POST https://edi-core.stedi.com/2021-06-05/translate
Authorization: Key your_api_key_here
Content-Type: application/json

{
  "input": "ISA*00*          *00*          *ZZ*               *ZZ*               *210902*1200*U*00401*123456789*1*T*:~GS*IN*00*00*20210902*1200*987654321*X*004010~ST*810*0000~BIG*20210902*AB01010101~TDS*999~SE*4*0000~GE*1*987654321~IEA*1*123456789~",
  "input_format": "edi",
  "output_format": "jedi@1.0"
}
curl --location --request POST "https://edi-core.stedi.com/2021-06-05/translate" --header "Content-Type: application/json" --data-raw '{"input": "ISA*00*          *00*          *ZZ*               *ZZ*               *210902*1200*U*00401*123456789*1*T*:~GS*IN*00*00*20210902*1200*987654321*X*004010~ST*810*0000~BIG*20210902*AB01010101~TDS*999~SE*4*0000~GE*1*987654321~IEA*1*123456789~","input_format": "edi", "output_format": "jedi@1.0"}' --header "Authorization: Key your_api_key_here"

The API will return a JSON object, which has a field output that contains the translated document.

{
  "code": "valid",
  "output": {
    "interchanges": [
      {
        "groups": [
          {
            "transaction_sets": [
              {
                "heading": {
                  "010_ST": {
                    "01": "810",
                    "02": "0000"
                  },
                  "020_BIG": {
                    "01": "20210902",
                    "02": "AB01010101"
                  }
                },
                "summary": {
                  "010_TDS": {
                    "01": "999"
                  },
                  "080_SE": {
                    "01": "4",
                    "02": "0000"
                  }
                }
              }
            ],
            "GS": {
              "01": "IN",
              "02": "00",
              "03": "00",
              "04": "20210902",
              "05": "1200",
              "06": "987654321",
              "07": "X",
              "08": "004010"
            },
            "GE": {
              "01": "1",
              "02": "987654321"
            }
          }
        ],
        "delimiters": {
          "element": "*",
          "segment": "~",
          "sub_element": ":"
        },
        "ISA": {
          "10": "1200",
          "11": "U",
          "12": "00401",
          "13": "123456789",
          "14": "1",
          "15": "T",
          "16": ":",
          "01": "00",
          "02": "          ",
          "03": "00",
          "04": "          ",
          "05": "ZZ",
          "06": "               ",
          "07": "ZZ",
          "08": "               ",
          "09": "210902"
        },
        "IEA": {
          "01": "1",
          "02": "123456789"
        }
      }
    ]
  }
}

Note that EDI is always represented as a string and JEDI is always represented as JSON. That's why the output in the example above is a JSON object. It's also true when you translate the other way around, so if you translate from JEDI to EDI, you need to provide the input as a JSON object, not as a string.

Validation

The response from the API will include validation information. To know if validation succeeded, you can look at the code field.

CodeDescription
validThe document passed validation.
translation_failureThe document is malformed. For example, the JSON is missing a curly brace, or the EDI doesn't include an ISA header.
invalidThe document violates the X12 specification.

If the document fails validation, the response will also include an errors field that gives you more information about what went wrong.

Even if a document is invalid, the translation is still included in the response. Only if the document is malformed, and therefore can't be parsed, will the translation be absent.

Validate using a custom specification

By default, EDI Core validates your documents using the standard X12 transaction sets. However, you can also use a specification published by your trading partner, or create a specification of your own. All you need is the ID of the specification.

  • If you want to validate against a published specification, select your supplier, click on the specification you want, select the version from the dropdown list next to the search box, then copy the ID of that version.

  • If you want to validate against your own specification, you can get the ID by going to Specifications in the Terminal. Click on the specification you want to use and from the list of versions, copy the ID.

You can send that ID to the API as part of the validation_options field.

POST https://edi-core.stedi.com/2021-06-05/translate
Authorization: Key your_api_key_here
Content-Type: application/json

{
  "input": "ISA*00*          *00*          *ZZ*               *ZZ*               *210902*1200*U*00401*123456789*1*T*:~GS*IN*00*00*20210902*1200*987654321*X*004010~ST*810*0000~BIG*20210902*AB01010101~TDS*999~SE*4*0000~GE*1*987654321~IEA*1*123456789~",
  "input_format": "edi",
  "output_format": "jedi@1.0",
  "validation_options": {
    "validation_type": "specification",
    "validation_id": "01FAJW8S4NSWGZ96VMSED25BRF"
  }
}
curl --location --request POST "https://edi-core.stedi.com/2021-06-05/translate" --header "Content-Type: application/json" --data-raw '{"input": "ISA*00*          *00*          *ZZ*               *ZZ*               *210902*1200*U*00401*123456789*1*T*:~GS*IN*00*00*20210902*1200*987654321*X*004010~ST*810*0000~BIG*20210902*AB01010101~TDS*999~SE*4*0000~GE*1*987654321~IEA*1*123456789~","input_format": "edi","output_format": "jedi@1.0","validation_options": { "validation_type": "base", "validation_id": "01FAJW8S4NSWGZ96VMSED25BRF" }}' --header "Authorization: Key your_api_key_here"

Override EDI delimiters

A JEDI document contains information on which delimiters to use when converting it to EDI. If you want, you can override these delimiters when you call the API.

POST https://edi-core.stedi.com/2021-06-05/translate
Authorization: Key your_api_key_here
Content-Type: application/json

{
  "input": {"input": {"interchanges": [{"groups": [{"transaction_sets": [{"heading": {"0100_ST": {"01": "326","02": "0000"},"1100_SE": {"01": "2","02": "0000"}}}],"GS": {"01": "SO","02": "00","03": "00","04": "20210902","05": "1200","06": "987654321","07": "X","08": "008010"},"GE": {"01": "1","02": "987654321"}}],"delimiters": {"element": "*","segment": "~","sub_element": ":","repetition": "/"},"ISA": {"10": "1200","11": "/","12": "00801","13": "123456789","14": "1","15": "T","16": ":","01": "00","02": "          ","03": "00","04": "          ","05": "ZZ","06": "               ","07": "ZZ","08": "               ","09": "210902"},"IEA": {"01": "1","02": "123456789"}}]}},
  "input_format": "edi",
  "output_format": "jedi@1.0",
  "output_options": {
    "delimiters": {
      "element": "+",
      "segment": "`",
      "repetition": "=",
      "sub_element": ":"
    }
  }
}
curl --location --request POST "https://edi-core.stedi.com/2021-06-05/translate" --header "Content-Type: application/json" --data-raw '{"input": {"input": {"interchanges": [{"groups": [{"transaction_sets": [{"heading": {"0100_ST": {"01": "326","02": "0000"},"1100_SE": {"01": "2","02": "0000"}}}],"GS": {"01": "SO","02": "00","03": "00","04": "20210902","05": "1200","06": "987654321","07": "X","08": "008010"},"GE": {"01": "1","02": "987654321"}}],"delimiters": {"element": "*","segment": "~","sub_element": ":","repetition": "/"},"ISA": {"10": "1200","11": "/","12": "00801","13": "123456789","14": "1","15": "T","16": ":","01": "00","02": "          ","03": "00","04": "          ","05": "ZZ","06": "               ","07": "ZZ","08": "               ","09": "210902"},"IEA": {"01": "1","02": "123456789"}}]}},"input_format": "edi","output_format": "jedi@1.0","output_options": {"delimiters": {"element": "+","segment": "`","repetition": "=","sub_element": ":"}}}' --header "Authorization: Key your_api_key_here"

API Reference

DemonstrationUsing the APITranslationValidationValidate using a custom specificationOverride EDI delimiters