{"uid":"cap_18-aAhwsbGiaK-EIMY5Ws","slug":"2s-edifact-generator-826fdace","name":"2s EDIFACT Generator","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-generate","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"date":{"type":"string","description":"CCYYMMDD (default today)."},"type":{"enum":["ORDERS","INVOIC"],"type":"string","description":"ORDERS (PO) or INVOIC (invoice)."},"items":{"type":"array","items":{"type":"object"},"description":"Line items (quantity, productId, price)."},"total":{"type":"number","description":"INVOIC total."},"parties":{"type":"array","items":{"type":"object"},"description":"NAD loops (role+name)."},"senderId":{"type":"string"},"controlRef":{"type":"string"},"recipientId":{"type":"string"},"documentNumber":{"type":"string","description":"Order or invoice number."},"senderQualifier":{"type":"string","description":"Default 14 (GLN/EAN)."},"recipientQualifier":{"type":"string"}}},"responseSchema":null,"example":{"request":{"date":"20240115","type":"ORDERS","items":[{"price":5,"quantity":10,"productId":"SKU-001"},{"price":12,"quantity":5,"productId":"SKU-002"}],"parties":[{"name":"BuyerCorp","role":"BY"},{"name":"SupplierAcme","role":"SU"}],"senderId":"1234567890","controlRef":"CTRL-001","recipientId":"9876543210","documentNumber":"PO-TEST-001","senderQualifier":"14","recipientQualifier":"14"},"response":{"data":{"ok":true,"meta":{"edi":"UNA:+.? 'UNB+UNOA:2+1234567890:14+9876543210:14+240115:2146+CTRL001'UNH+1+ORDERS:D:96A:UN'BGM+220+PO-TEST-001+9'DTM+137:20240115:102'NAD+BY+++BuyerCorp'NAD+SU+++SupplierAcme'LIN+1++SKU-001:BP'QTY+21:10'PRI+AAA:5'LIN+2++SKU-002:BP'QTY+21:5'PRI+AAA:12'CNT+2:2'UNT+13+1'UNZ+1+CTRL001'"},"items":[{"controlRef":"CTRL001","segmentCount":16}],"total":1,"source":{"url":"https://2s.io/edi/edifact-generate","license":"Computed by 2s.io. UN/EDIFACT is a UN standard; this is an independent generator.","provider":"2s.io UN/EDIFACT generator"}},"meta":{"cost":{"usd":0.0018,"tier":0},"caller":"x402","version":null,"endpoint":"edi.edifact-generate","settlement":{"txHash":"0x40aea70f39b5545ce7db247204f81e7a98b8ba109a53cf773ff230573224dd8d","network":"eip155:8453","success":true}}}},"exampleRequest":{"date":"20240115","type":"ORDERS","items":[{"price":5,"quantity":10,"productId":"SKU-001"},{"price":12,"quantity":5,"productId":"SKU-002"}],"parties":[{"name":"BuyerCorp","role":"BY"},{"name":"SupplierAcme","role":"SU"}],"senderId":"1234567890","controlRef":"CTRL-001","recipientId":"9876543210","documentNumber":"PO-TEST-001","senderQualifier":"14","recipientQualifier":"14"},"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_caVlC8T2QGMCquE0XpvP9","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":"Generates UN/EDIFACT electronic data interchange messages (ORDERS purchase orders or INVOIC invoices) from structured input data","exampleAgentPrompt":"Generate a UN/EDIFACT ORDERS purchase order with document number PO-99012, sender ACME (ID 1234567890, qualifier 14), recipient BUYERCORP (ID 9876543210, qualifier 14), control ref 123456789, dated today, with two line items: 10 units of product SKU-001 at $5.00 each and 5 units of SKU-002 at $12.00 each.","exampleUseCases":null,"resultDescription":"Returns a JSON object with ok:true, a meta.edi field containing the full raw EDIFACT message string (UNA/UNB/UNH/BGM/.../UNT/UNZ segments), an items array with controlRef and segmentCount for each generated interchange, a total count, and source/license attribution.","failureModes":["Missing required senderId or recipientId returns validation error","Invalid type enum value (not ORDERS or INVOIC) causes rejection","INVOIC without total field may produce incomplete message","Malformed items array (missing quantity, productId, or price) may generate invalid segments","Payment failure (insufficient USDC) returns 402 Payment Required"],"whenToPreferThis":"Use this endpoint when you need to programmatically generate standards-compliant UN/EDIFACT messages (ORDERS or INVOIC) for B2B trading partner exchange without setting up a full EDI platform. It is ideal for AI agents automating procurement or invoicing workflows that need to produce EDI output on the fly at low per-call cost with no API key setup.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T06:59:31.990Z","isFirstParty":false}