{"uid":"cap_kpWpcJwsqFU_ieb1kI8Yt","slug":"2s-edifact-parser-52af387f","name":"2s EDIFACT Parser","description":"The (most) everything API: 575+ pay-per-call endpoints for AI agents — ground-truth data, a full AI gateway, and agent infrastructure (storage, queues, watchers). USDC via x402, no signup, no API keys, and upto billing: pay actual usage, not the quote.","url":"https://2s.io/api/edi/edifact?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"edi":{"type":"string","description":"Raw UN/EDIFACT interchange text (optional UNA, then UNB/UNH…)."}}},"responseSchema":null,"example":{"request":{"edi":"UNA:+.? 'UNB+UNOA:1+SUPPLIER123+BUYER456+240115:1200+DOC001'UNH+1+INVOIC:D:96A:UN'BGM+380+INV-2024-001+9'DTM+137:20240115:102'NAD+BY+BUYER456::92++BUYER COMPANY'NAD+SU+SUPPLIER123::92++SUPPLIER COMPANY'LIN+1++ITEM-001:SA'QTY+21:100'UNT+9+1'UNZ+1+DOC001'"},"response":{"data":{"ok":true,"meta":{"delimiters":{"decimal":".","element":"+","release":"?","segment":"'","component":":","unaPresent":true},"interchange":{"date":"2024-01-15","time":"12:00","senderId":"SUPPLIER123","syntaxId":"UNOA","controlRef":"DOC001","recipientId":"BUYER456","syntaxVersion":"1","testIndicator":false,"applicationRef":null,"senderQualifier":null,"recipientQualifier":null},"messageCount":1,"segmentCount":10},"items":[{"type":"INVOIC","agency":"UN","release":"96A","summary":{"parties":[{"id":"BUYER456","name":"BUYER COMPANY","role":"BY","roleName":"Buyer"},{"id":"SUPPLIER123","name":"SUPPLIER COMPANY","role":"SU","roleName":"Supplier"}],"currency":null,"invoiceDate":"2024-01-15","totalAmount":null,"documentType":"Invoice","invoiceNumber":"INV-2024-001","lineItemCount":1},"version":"D","segments":[{"tag":"UNH","name":"Message Header","elements":["1",["INVOIC","D","96A","UN"]]},{"tag":"BGM","name":"Beginning of Message","elements":["380","INV-2024-001","9"]},{"tag":"DTM","name":"Date/Time/Period","elements":[["137","20240115","102"]]},{"tag":"NAD","name":"Name and Address","elements":["BY",["BUYER456","","92"],"","BUYER COMPANY"]},{"tag":"NAD","name":"Name and Address","elements":["SU",["SUPPLIER123","","92"],"","SUPPLIER COMPANY"]},{"tag":"LIN","name":"Line Item","elements":["1","",["ITEM-001","SA"]]},{"tag":"QTY","name":"Quantity","elements":[["21","100"]]},{"tag":"UNT","name":"Message Trailer","elements":["9","1"]}],"typeName":"Invoice","reference":"1","segmentCount":8}],"total":1,"source":{"url":"https://2s.io/edi/edifact","license":"Computed by 2s.io. UN/EDIFACT is a UN standard; this is an independent parser.","provider":"2s.io UN/EDIFACT parser"}},"meta":{"cost":{"usd":0.0018,"tier":0},"caller":"x402","version":null,"endpoint":"edi.edifact","settlement":{"txHash":"0x7929d2a72e6fd5a28194d82d60c80c5cbe7d454f900dd6b868c5629dc013422e","network":"eip155:8453","success":true}}}},"exampleRequest":{"edi":"UNA:+.? 'UNB+UNOA:1+SUPPLIER123+BUYER456+240115:1200+DOC001'UNH+1+INVOIC:D:96A:UN'BGM+380+INV-2024-001+9'DTM+137:20240115:102'NAD+BY+BUYER456::92++BUYER COMPANY'NAD+SU+SUPPLIER123::92++SUPPLIER COMPANY'LIN+1++ITEM-001:SA'QTY+21:100'UNT+9+1'UNZ+1+DOC001'"},"tags":["x402"],"displayCostAmount":"0.0018","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.0018/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0045","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0045","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_BJI4vFcs40HWIK5nQ-jG8","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.0045","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Parses raw UN/EDIFACT interchange text into structured JSON, extracting messages, segments, parties, and document metadata","exampleAgentPrompt":"Parse this UN/EDIFACT interchange for me and pull out the sender, recipient, document type, order number, and all the line item details: UNA:+.? 'UNB+UNOA:1+ACME+BUYERCORP+240115:1000+1'UNH+1+ORDERS:D:96A:UN'BGM+220+PO-99012+9'DTM+137:20240115:102'NAD+BY+BUYERCORP::92++BUYER CORP'LIN+1++ABC123:SA'QTY+21:10'UNT+7+1'UNZ+1+1'","exampleUseCases":null,"resultDescription":"Returns a JSON object with ok:true, interchange metadata (sender/recipient IDs, date, test indicator, delimiter characters, message count, segment count), and an items array where each message includes its type (e.g. ORDERS), agency, version, release, reference, segment count, a structured summary (parties with roles, order number, document date, document type, line item count), and a full segments array with tag, name, and element values for each segment.","failureModes":["Malformed or truncated EDIFACT input returns error or partial parse","Missing required UNB/UNH envelope segments may cause parse failure","Unsupported message type versions may result in reduced summary extraction","Empty or non-EDIFACT string input returns ok:false","Payment failure (402) if USDC balance insufficient"],"whenToPreferThis":"Use this endpoint when you have raw UN/EDIFACT text (common in B2B supply chain, logistics, and international trade integrations) and need to extract structured data from it without building a custom EDIFACT parser. Ideal for agents processing purchase orders, invoices, despatch advice, or other EDIFACT message types received from trading partners. Pay-per-call with no API key required makes it suitable for low-volume or ad-hoc parsing tasks.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-10T06:52:03.076Z","isFirstParty":false,"canonicalSlug":"2s-edifact-parser-52af387f"}