Translate between JSON and EDI with modern, machine-readable EDI specifications
Imagine you’ve switched cell phone providers and you receive your first bill. Though you’ve never seen an invoice from this cell phone provider before, you can quickly ‘parse’ out the relevant details – the total, the due date, your address, how many units of data you’ve consumed, and so on.
But what if you had to create an invoice in this exact format – from scratch? How would you know which fields were required, what order to put them in, and details like whether to use the full name of states or just the abbreviation?
Stedi Guides uses the popular, open-source JSON Schema format, giving developers a familiar way to ensure that their JSON payloads have all the information required to create a valid EDI file.
Features of EDI Translate
- Read and write any X12 EDI transaction.
- Validate EDI documents automatically against trading partner specifications.
- Seamlessly integrate with your own tech stack – or build your end-to-end EDI workflow on Stedi.
How EDI Translate works
EDI Translate makes EDI integrations a lot simpler, taking the EDI format out of the equation and enabling you to work with JSON. Behind the scenes, the nuances of EDI are handled for you to ensure every transaction meets your or your trading partners’ requirements.
Using EDI Translate
You need three pieces of data to generate EDI:
- A Stedi
guideId
that refers to the trading partner specification. For more information, see Creating a Stedi Guide. - A JSON payload that conforms to the JSON Schema of your guide. If you need help creating this payload, you can use Stedi Mappings to map your internal format to the guide’s JSON Schema.
- The X12 envelope data, including interchange control header and functional group headers. Here is an example:
const envelope = {
interchangeHeader: {
senderQualifier: "ZZ",
senderId,
receiverQualifier: "14",
receiverId,
date: format(documentDate, "yyyy-MM-dd"),
time: format(documentDate, "HH:mm"),
controlNumber,
usageIndicatorCode,
},
groupHeader: {
functionalIdentifierCode,
applicationSenderCode: "WRITEDEMO",
applicationReceiverCode: "072271711TMS",
date: format(documentDate, "yyyy-MM-dd"),
time: format(documentDate, "HH:mm:ss"),
controlNumber,
},
};
Once you have these three inputs, you can call the EDI Translate API.
// Translate the Guide schema-based JSON to X12 EDI
const translation = await translateJsonToEdi(mapResult.content, guideId, envelope);
{
"output": "ISA*00* *00* *ZZ*AMERCHANT *14*ANOTHERMERCH *220915*0218*U*00501*000000001*0*T*>~GS*OW*WRITEDEMO*072271711TMS*20220915*021828*000000001*X*005010~ST*850*000000001~BEG*00*DS*365465413**20220830~REF*CO*ACME-4567~REF*ZZ*Thank you for your business~PER*OC*Marvin Acme*TE*973-555-1212*EM*marvin@acme.com~TD5****ZZ*FHD~N1*ST*Wile E Coyote*92*123~N3*111 Canyon Court~N4*Phoenix*AZ*85001*US~PO1*item-1*0008*EA*400**VC*VND1234567*SK*ACM/8900-400~PID*F****400 pound anvil~PO1*item-2*0004*EA*125**VC*VND000111222*SK*ACM/1100-001~PID*F****Detonator~CTT*2~AMT*TT*3700~SE*16*000000001~GE*1*000000001~IEA*1*000000001~"
}
guideId
.{
"input": "ISA*00* *00* *ZZ*ANOTHERMERCH *14*AMERCHANT *220914*2022*U*00501*000001746*0*T*>~\nGS*PR*072271711TMS*READDEMO*20220914*202222*000001746*X*005010~\nST*855*0001~\nBAK*00*AD*365465413*20220914*****20220913~\nREF*CO*ACME-4567~\nN1*SE*Marvin Acme*92*DROPSHIP CUSTOMER~\nN3*123 Main Street~\nN4*Fairfield*NJ*07004*US~\nN1*ST*Wile E Coyote*92*DROPSHIP CUSTOMER~\nN3*111 Canyon Court~\nN4*Phoenix*AZ*85001*US~\nPO1*item-1*8*EA*400**VC*VND1234567*SK*ACM/8900-400~\nPID*F****400 pound anvil~\nACK*IA*8*EA~\nPO1*item-2*4*EA*125**VC*VND000111222*SK*ACM/1100-001~\nPID*F****Detonator~\nACK*IA*4*EA~\nCTT*2~\nSE*17*0001~\nGE*1*000001746~\nIEA*1*000001746~",
"guideId": "01GEJBYTQCHWK59PKANTKKGJXM"
}
EDI Translate API is now generally available
Did you know? You can build an end-to-end EDI integration on Stedi. Capture EDI specifications from your trading partner in a Stedi Guide, convert data between JSON and EDI using EDI Translate, transform data between schemas using Stedi Mappings, handle transmission of EDI files with your trading partners using Stedi SFTP (backed by Stedi Buckets), and orchestrate API calls and business logic with Stedi Functions. Use Stash as a reliable key-value store to keep track of transactions, reference lookup tables, and more.
EDI Translate can convert any incoming X12 EDI document into JSON and JSON into EDI, so you can work with the familiar JSON format. Use EDI Translate with Stedi Guides to validate incoming and outgoing EDI documents against your trading partner specifications.
Define EDI requirements easily using a no-code visual interface. The output is an artifact that can be used to share interactive documentation, or for parsing, generating, or validating X12 EDI documents.
Get blog posts delivered to your inbox.