Documentation

How to translate EDI files

Article author
Admin
  • Updated

Translate EDI resources with the HTTP POST Method

In order to translate from EDI or translate to EDI use the following resources with the POST method:

  1. Read EDI file into JSON

    You can read two resources, X12 files and EDIFACT files/streams. To do so, execute HTTP POST to the resource URL, with the request body being the file to translate included as form-data content.

      1. URL: https://api.edination.com/v2/x12/read
      2. Header: Ocp-Apim-Subscription-Key: {API key}
      3. Request: X12 file as form-data
      4. Response: Array of X12Interchange
      1. URL: https://api.edination.com/v2/edifact/read
      2. Header: Ocp-Apim-Subscription-Key: {API key}
      3. Request: EDIFACT file as form-data
      4. Response: Array of EdifactInterchange

    The response will contain an array of EDI interchanges, encoded in application/json format.

    Example with Postman:

    translate-x12-to-json.png

  2. Write JSON to EDI file

    Again, you can write out two resources, X12 and EDIFACT. Execute HTTP POST to the resource URL, the request body must contain a single EDI interchange, included as application/json content.

      1. URL: https://api.edination.com/v2/x12/write
      2. Header: Ocp-Apim-Subscription-Key: {API key}
      3. Request: X12Interchange
      4. Response: X12 file as application/octet-stream
      1. URL: https://api.edination.com/v2/edifact/write
      2. Header: Ocp-Apim-Subscription-Key: {API key}
      3. Request: EdifactInterchange
      4. Response: EDIFACT file as application/octet-stream

    The response will contain an EDI interchange, encoded in application/octet-stream format.

    Example with Postman:

    translate-json-to-x12.png

Share this:

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.