Deploy a simple EDI 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
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:
-
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.
-
The bucket sends a notification when it receives new documents.
-
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. -
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.
-
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.
-
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:
-
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. -
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.
-
The function uses the control numbers and the information in each partner profile to construct the ISA and GS envelopes.
-
The function passes the guide ID and the JSON to EDI Translate, which translates the data to X12 EDI.
-
The function sends the completed EDI document to a Stedi bucket.
Customize the bootstrap workflow
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
Update your partner profile
<
and >
with the values that are relevant to your trading partner.Value | Description |
---|---|
YOUR_NAME | The name of your business. This is only used for display purposes and is not included in EDI messages. |
ACKNOWLEDGMENT_REQUEST | Indicates 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_ID | Identifies 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_ID | Identifies you in ISA segments. Corresponds to ISA-06, if you’re the sender, or to ISA-08, if you’re the receiver. |
ID_QUALIFIER | The 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. |
- Using the Stedi UI, go to Stash.
- Open the keyspace called partners-configuration.
- 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
<
and >
with the values that are relevant to your trading partner.Value | Description |
---|---|
WORKFLOW_PARTNER_ID | The 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_NAME | The display name of your trading partner. This is for your convenience and is not included in EDI messages. |
ACKNOWLEDGMENT_REQUEST | Indicates 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_ID | Identifies 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_ID | Identifies 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_QUALIFIER | The 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_DESCRIPTION | A 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_ID | The Stedi guide you want to use to create outbound EDI messages. |
BUCKET_NAME | The name of the bucket where outbound messages are stored. Your trading partner can pick up your EDI messages here. |
USAGE_INDICATOR_CODE | Indicates if messages are test messages or production messages. Corresponds to ISA-15. See the list of possible values. |
RECEIVE_DESCRIPTION | A 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_URL | The URL of your trading partner’s API endpoint. The workflow will send EDI messages there. |
RECEIVE_GUIDE_ID | The 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) |
- Using the Stedi UI, go to Stash.
- Open the keyspace called partners-configuration.
- 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>"
}
- Add a key called
lookup|ISA|<PARTNER_ID_QUALIFIER>/<ISA_PARTNER_ID>
with the following value:
{
"partnerId": "<WORKFLOW_PARTNER_ID>"
}
- 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
- Using the Stedi UI, go to Stash.
- Open the keyspace called partners-configuration.
- Edit the partnership that has the configuration for the inbound messages.
- In the value for that configuration, find the transaction set related to messages you receive. (The one where
receivingPartnerId
isthis-is-me
.) - Add a key
mappingId
with the value set to your mapping ID. Add it to the object inside thedestinations
array on the same level as the keydestination
. 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
- Using the Stedi UI, go to Stash.
- Open the keyspace called partners-configuration.
- Edit the partnership that has the configuration for the outbound messages.
- In the value for that configuration, find the transaction set related to messages you send. (The one where
sendingPartnerId
isthis-is-me
.) - Add a key
mappingId
with the value set to your mapping ID. Add it to the object inside thedestinations
array on the same level as the keydestination
. 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
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:- Using the Stedi UI, go to Stash.
- Open the keyspace called partners-configuration.
- Edit the partnership that has the configuration for the inbound messages you would like to send acknowledgments for.
- In the value for that configuration, find the transaction set related to messages you receive. (The one where
receivingPartnerId
isthis-is-me
.) - Add a key
acknowledgmentConfig
with the value set to an object that has a single keyacknowledgmentType
set to997
(this is the only type of acknowledgment that is supported). - 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>"
}
]
}