# 2s EDIFACT Parser

> 2s EDIFACT Parser is a paid API for AI agents from 2s.io, paid per call via x402, $0.0018/call, status unknown (last checked 2026-10-10).

Parses raw UN/EDIFACT interchange text into structured JSON, extracting messages, segments, parties, and document metadata

## Facts

- Endpoint: POST https://2s.io/api/edi/edifact?utm_source=zero.xyz
- Price: $0.0018/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/2s-edifact-parser-52af387f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_kpWpcJwsqFU_ieb1kI8Yt

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability 2s-edifact-parser-52af387f -d '<json body>'
```

Example prompt: 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'

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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.

## Output

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.

## Example request

```json
{
 "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'"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "edi": {
   "type": "string",
   "description": "Raw UN/EDIFACT interchange text (optional UNA, then UNB/UNH…)."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/2s-edifact-parser-52af387f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 2s.io](https://www.zero.xyz/host/2s.io/llms.txt)
