Home /  Getting Started / 

Deploy a simple EDI flow

The Stedi bootstrap repository lets you quickly deploy a reference implementation that receives and sends EDI documents. It shows how Stedi products work together in an end-to-end flow.
Your EDI integration may differ from this reference implementation. Book time with our technical team to get both a customized integration plan and onboarding support free of cost.

Deploy bootstrap

Follow the instructions in the bootstrap repository to deploy and test the bootstrap implementation.

Bootstrap overview

The implementation uses several Stedi products to store, receive, translate, and send EDI documents.

Inbound EDI

The bootstrap workflow uses the following process to handle incoming EDI:

  1. You upload EDI documents to a Stedi bucket in your account. Buckets provide unlimited file storage.
    A trading partner could also add files to the bucket using Stedi SFTP. SFTP provides access to an SFTP endpoint that Stedi hosts.
  2. The bucket sends a notification when it receives new documents.

  3. The notification invokes a Stedi function called [edi-inbound](https://github.com/Stedi-Demos/bootstrap/tree/main/src/functions/edi/inbound) that contains custom code for the workflow. A Stedi function has access to all the resources in your Stedi account.
  4. The function extracts the sender ID (ISA-06) and the receiver ID (ISA-08) from the EDI message. It then uses those IDs to retrieve the partnership information related to those two trading partners from Stedi Stash.
    The partnership information contains an ID for a Stedi guide. Stedi guides map EDI fields to JSON fields for a particular transaction set.
  5. The function sends the EDI data and the Stedi guide ID to EDI Translate API, which validates the EDI data and converts it into JSON.
  6. The function sends the JSON document to an external endpoint or system outside of Stedi, such as a custom endpoint, an ERP system, or cloud storage. You can configure a webhook for testing.

Outbound EDI

The bootstrap workflow uses the following process to produce outgoing EDI:

  1. You manually invoke a function called edi-outbound. For testing, you do this in your Stedi account UI.
    You could also call this function manually using the Stedi CLI. When you call the function, you need to pass in a JSON object containing a sending partner ID, a receiving partner ID, and a payload. The bootstrap repository contains an example payload.
  2. The function uses the sending partner ID and receiving partner ID to retrieve partner profiles for both the sender and receiver from Stedi Stash. As with the inbound workflow, the partnership information contains a Stedi guide ID.

  3. The function generates control numbers required in the ISA, GS, and ST segments of the EDI message. Control numbers for ISA and GS must be unique across messages, so the workflow uses Stedi Stash to track them.
  4. The function uses the control numbers and the information in each partner profile to construct the ISA and GS envelopes.

  5. The function passes the guide ID and the JSON to EDI Translate, which translates the data to X12 EDI.

  6. The function sends the completed EDI document to a Stedi bucket.

Customize the bootstrap workflow

The base bootstrap workflow relies on you to manually add EDI test files and manually trigger the edi-outbound function. It also uses fictional trading partner data to mimic the EDI exchange process between businesses.

To create a fully functional EDI integration, trading partners must be able to securely send and receive EDI documents from one another. In order to configure an EDI integration using the boostrap workflow, you also need to create the following resources:

  • Partner profiles for both you and your trading partners (senders and receivers)
  • Partnerships defining the relationship between you and your partners
  • Stash lookup entries for each partner that map their EDI identifiers to their partner profile

This section explains how to edit resources in the bootstrap workflow to exchange EDI files with real trading partners. It also explains how to map the JSON output from EDI Translate into a custom schema for your internal system and add mappings to the bootstrap's Stash keyspace.

Free, custom set-up

Working together helps us understand what Stedi customers need and helps get your integration into production as quickly as possible. Contact us for a free, custom set-up that includes the following support:

  • Help customizing the bootstrap workflows for your use cases
  • Help deploying the bootstrap architecture to your Stedi account
  • Best practices for designing a scalable Stedi integration
  • EDI experts to answer your questions
  • Live troubleshooting over Slack or video call
Visit Building a Stedi integration for an overview of the steps to build a custom integration.

Update your partner profile

In the following instructions, you'll need to replace values between < and > with the values that are relevant to your trading partner.
ValueDescription
YOUR_NAMEThe name of your business. This is only used for display purposes and is not included in EDI messages.
ACKNOWLEDGMENT_REQUESTIndicates if you want to receive TA1 acknowledgments in response to EDI messages your trading partner sends. Corresponds to ISA-14. See the list of possible values.
GS_APPLICATION_IDIdentifies you in GS segments. Corresponds to GS-02, if you’re the sender, or to GS-03, if you’re the receiver. May be equal to ISA_ID.
ISA_IDIdentifies you in ISA segments. Corresponds to ISA-06, if you’re the sender, or to ISA-08, if you’re the receiver.
ID_QUALIFIERThe type of ID used in ISA_ID, e.g. DUNS number, Health Industry Number, or custom number. Corresponds to ISA-05, if you’re the sender, or to ISA-07, if you’re the receiver. See the list of possible values.
  1. Using the Stedi UI, go to Stash.
  2. Open the keyspace called partners-configuration.
  3. Edit the key called profile|this-is-me and change the value to the following:
{
 "id": "this-is-me",
 "partnerName": "<YOUR_NAME>",
 "acknowledgementRequestedCode": "<ACKNOWLEDGMENT_REQUEST>",
 "partnerApplicationId": "<GS_APPLICATION_ID>",
 "partnerInterchangeId": "<ISA_ID",
 "partnerInterchangeQualifier": "<ID_QUALIFIER>"
}

Add a partner profile for your trading partners

In the following instructions, you’ll need to replace values between < and > with the values that are relevant to your trading partner.
ValueDescription
WORKFLOW_PARTNER_IDThe unique ID you want to assign to your trading partner. This ID is used by the bootstrap workflow. It’s not used in EDI messages.
PARTNER_NAMEThe display name of your trading partner. This is for your convenience and is not included in EDI messages.
ACKNOWLEDGMENT_REQUESTIndicates if your trading partner wants to receive TA1 acknowledgments in response to EDI messages you send. Corresponds to ISA-14. See the list of possible values.
GS_APPLICATION_IDIdentifies your trading partner in GS segments. Corresponds to GS-02, if your trading partner is the sender, or to GS-03, if your trading partner is the receiver. May be equal to ISA_PARTNER_ID.
ISA_PARTNER_IDIdentifies your trading partner in ISA segments. Corresponds to ISA-06, if your trading partner is the sender, or to ISA-08, if your trading partner is the receiver.
PARTNER_ID_QUALIFIERThe type of ID used in ISA_PARTNER_ID, e.g. DUNS number, Health Industry Number, or custom number. Corresponds to ISA-05, if your trading partner is the sender, or to ISA-07, if your trading partner is the receiver. See the list of possible values.
SEND_DESCRIPTIONA description that tells you what type of document you’re sending to whom. This is for your convenience and is not included in EDI messages.
SEND_GUIDE_IDThe Stedi guide you want to use to create outbound EDI messages.
BUCKET_NAMEThe name of the bucket where outbound messages are stored. Your trading partner can pick up your EDI messages here.
USAGE_INDICATOR_CODEIndicates if messages are test messages or production messages. Corresponds to ISA-15. See the list of possible values.
RECEIVE_DESCRIPTIONA description that tells you what type of document you’re receiving from whom. This is for your convenience and is not included in EDI messages.
DESTINATION_URLThe URL of your trading partner’s API endpoint. The workflow will send EDI messages there.
RECEIVE_GUIDE_IDThe Stedi guide you want to use to parse and validate inbound EDI messages.
MAPPING_ID(Optional) The Stedi mapping you want to apply to the JSON input before translating (for outbound EDI messages) or after translating (for inbound EDI messages)
  1. Using the Stedi UI, go to Stash.
  2. Open the keyspace called partners-configuration.
  3. Add a key called profile|<WORKFLOW_PARTNER_ID> with the following value:
{
 "id": "<WORKFLOW_PARTNER_ID>",
 "partnerName": "<PARTNER_NAME>",
 "acknowledgementRequestedCode": "<ACKNOWLEDGMENT_REQUEST>",
 "partnerApplicationId": "<GS_APPLICATION_ID>",
 "partnerInterchangeId": "<ISA_PARTNER_ID>",
 "partnerInterchangeQualifier": "<PARTNER_ID_QUALIFIER>"
}
  1. Add a key called lookup|ISA|<PARTNER_ID_QUALIFIER>/<ISA_PARTNER_ID> with the following value:
{
 "partnerId": "<WORKFLOW_PARTNER_ID>"
}
  1. Add a key called partnership|this-is-me|<WORKFLOW_PARTNER_ID> with the following value:
{
 "transactionSets": [
   {
     "description": "<SEND_DESCRIPTION>",
     "destinations": [
       {
         "destination": {
           "bucketName": "<BUCKET_NAME>",
           "path": "trading_partners/<WORKFLOW_PARTNER_ID>/outbound",
           "type": "bucket"
         }
       }
     ],
     "guideId": "<SEND_GUIDE_ID>",
     "receivingPartnerId": "<WORKFLOW_PARTNER_ID>",
     "sendingPartnerId": "this-is-me",
     "usageIndicatorCode": "<USAGE_INDICATOR_CODE>"
   },
   {
     "description": "<RECEIVE_DESCRIPTION>",
     "destinations": [
       {
         "destination": {
           "type": "webhook",
           "url": "<DESTINATION_URL>"
         }
       }
     ],
     "guideId": "<RECEIVE_GUIDE_ID>",
     "receivingPartnerId": "this-is-me",
     "sendingPartnerId": "<WORKFLOW_PARTNER_ID>",
     "usageIndicatorCode": "<USAGE_INDICATOR_CODE>"
   }
 ]
}

Map inbound messages to a custom JSON shape

You can use Stedi Mappings to translate inbound EDI messages to a custom JSON shape. The bootstrap workflow can automatically apply the mapping to any inbound message. You just need to provide it with the ID of your mapping.
  1. Using the Stedi UI, go to Stash.
  2. Open the keyspace called partners-configuration.
  3. Edit the partnership that has the configuration for the inbound messages.
  4. In the value for that configuration, find the transaction set related to messages you receive. (The one where receivingPartnerId is this-is-me.)
  5. Add a key mappingId with the value set to your mapping ID. Add it to the object inside the destinations array on the same level as the key destination. For example:
{
 "transactionSets": [
   {
     "description": "<SEND_DESCRIPTION>",
     "destinations": [
       {
         "destination": {
           "bucketName": "<BUCKET_NAME>",
           "path": "trading_partners/<WORKFLOW_PARTNER_ID>/outbound",
           "type": "bucket"
         }
       }
     ],
     "guideId": "<SEND_GUIDE_ID>",
     "receivingPartnerId": "<WORKFLOW_PARTNER_ID>",
     "sendingPartnerId": "this-is-me",
     "usageIndicatorCode": "<USAGE_INDICATOR_CODE>"
   },
   {
     "description": "<RECEIVE_DESCRIPTION>",
     "destinations": [
       {
         "destination": {
           "type": "webhook",
           "url": "<DESTINATION_URL>"
         },
         "mappingId": "01GPXEHSDA5VY0GWMYM74HZP3H"
       }
     ],
     "guideId": "<RECEIVE_GUIDE_ID>",
     "receivingPartnerId": "this-is-me",
     "sendingPartnerId": "<WORKFLOW_PARTNER_ID>",
     "usageIndicatorCode": "<USAGE_INDICATOR_CODE>"
   }
 ]
}

Map outbound custom JSON to EDI-like shape

You can use Stedi Mappings to translate custom JSON shapes to outbound EDI messages. The bootstrap workflow can automatically apply the mapping to any outbound message. You just need to provide it with the ID of your mapping.
  1. Using the Stedi UI, go to Stash.
  2. Open the keyspace called partners-configuration.
  3. Edit the partnership that has the configuration for the outbound messages.
  4. In the value for that configuration, find the transaction set related to messages you send. (The one where sendingPartnerId is this-is-me.)
  5. Add a key mappingId with the value set to your mapping ID. Add it to the object inside the destinations array on the same level as the key destination. For example:
{
 "transactionSets": [
   {
     "description": "<SEND_DESCRIPTION>",
     "destinations": [
       {
         "destination": {
           "bucketName": "<BUCKET_NAME>",
           "path": "trading_partners/<WORKFLOW_PARTNER_ID>/outbound",
           "type": "bucket"
         },
         "mappingId": "01GPXEHSDA5VY0GWMYM74HZP3H"
       }
     ],
     "guideId": "<SEND_GUIDE_ID>",
     "receivingPartnerId": "<WORKFLOW_PARTNER_ID>",
     "sendingPartnerId": "this-is-me",
     "usageIndicatorCode": "<USAGE_INDICATOR_CODE>"
   },
   {
     "description": "<RECEIVE_DESCRIPTION>",
     "destinations": [
       {
         "destination": {
           "type": "webhook",
           "url": "<DESTINATION_URL>"
         }
       }
     ],
     "guideId": "<RECEIVE_GUIDE_ID>",
     "receivingPartnerId": "this-is-me",
     "sendingPartnerId": "<WORKFLOW_PARTNER_ID>",
     "usageIndicatorCode": "<USAGE_INDICATOR_CODE>"
   }
 ]
}

Automatically send 997 functional acknowledgments in response to inbound documents

The edi-inbound function can automatically send basic 997 functional acknowledgments in response to documents that have been received from your trading partner. Enabling this feature requires the following two changes in the partnership configuration:
  1. Using the Stedi UI, go to Stash.
  2. Open the keyspace called partners-configuration.
  3. Edit the partnership that has the configuration for the inbound messages you would like to send acknowledgments for.
  4. In the value for that configuration, find the transaction set related to messages you receive. (The one where receivingPartnerId is this-is-me.)
  5. Add a key acknowledgmentConfig with the value set to an object that has a single key acknowledgmentType set to 997 (this is the only type of acknowledgment that is supported).
  6. Additionally, add a new transaction set for the 997 acknowledgments to indicate the destination that these documents should be written to. For example:
{
 "transactionSets": [
   {
     "description": "<SEND_DESCRIPTION>",
     "destinations": [
       {
         "destination": {
           "bucketName": "<BUCKET_NAME>",
           "path": "trading_partners/<WORKFLOW_PARTNER_ID>/outbound",
           "type": "bucket"
         }
       }
     ],
     "guideId": "<SEND_GUIDE_ID>",
     "receivingPartnerId": "<WORKFLOW_PARTNER_ID>",
     "sendingPartnerId": "this-is-me",
     "usageIndicatorCode": "<USAGE_INDICATOR_CODE>"
   },
   {
     "acknowledgmentConfig": {
       "acknowledgmentType": "997"
     },
     "description": "<RECEIVE_DESCRIPTION>",
     "destinations": [
       {
         "destination": {
           "type": "webhook",
           "url": "<DESTINATION_URL>"
         }
       }
     ],
     "guideId": "<RECEIVE_GUIDE_ID>",
     "receivingPartnerId": "this-is-me",
     "sendingPartnerId": "<WORKFLOW_PARTNER_ID>",
     "usageIndicatorCode": "<USAGE_INDICATOR_CODE>"
   },
   {
     "description": "Outbound 997 Acknowledgments",
     "destinations": [
       {
         "destination": {
           "bucketName": "<BUCKET_NAME>",
           "path": "trading_partners/<WORKFLOW_PARTNER_ID>/outbound",
           "type": "bucket"
         }
       }
     ],
     "transactionSetIdentifier": "997",
     "usageIndicatorCode": "<USAGE_INDICATOR_CODE>"
   }
 ]
}

Send and receive documents with SFTP

The bootstrap repository reads inbound messages from the SFTP bucket and it writes outbound messages to SFTP. However, it doesn’t set up any SFTP users for you. You’ll need to create a user for each of your trading partners and send them the credentials. You can do so using the Stedi SFTP UI.
The bootstrap workflow automatically processes inbound messages. When the bootstrap workflow writes an outbound message to SFTP, it considers its work done. However, your trading partner still needs to pick up the message, so be sure to tell them to check the SFTP endpoint regularly.
Deploy bootstrapBootstrap overviewCustomize the bootstrap workflow