# 2s EDI Document Generator

> 2s EDI Document Generator is a paid API for AI agents from 2s.io, paid per call via x402, $0.0018/call, status unknown (last checked 2026-09-13).

Generates ASC X12 EDI documents (Purchase Orders 850 or Invoices 810) from structured JSON input

## Facts

- Endpoint: POST https://2s.io/api/edi/generate
- Price: $0.0018/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/2s-edi-document-generator-a7ddd6b4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_QPu9-U4-1OluFCIxiBna7

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-edi-document-generator-a7ddd6b4 -d '<json body>'
```

Example prompt: Generate an X12 EDI 850 Purchase Order for PO number PO-2024-001 dated today, from sender ID MYCOMPANY to receiver ID SUPPLIER01, with one line item: 50 each of product WIDGET-X at $12.50, for buyer warehouse 'Acme Distribution'.

## When to prefer this

Use this endpoint when you need to programmatically generate standards-compliant ASC X12 EDI 850 Purchase Orders or 810 Invoices on demand without setting up a full EDI platform, trading partner agreement, or VAN. Ideal for AI agents automating supply chain workflows, B2B order fulfillment, or invoicing with trading partners that require EDI.

## Known failure modes

- Missing required fields (e.g. no senderId or receiverId) returns a validation error
- Invalid document type (not 850 or 810) returns an error
- Malformed line items array may result in an error or incomplete EDI output
- Network or payment failure returns HTTP 402 or connectivity error
- 810 without poNumber or total may produce incomplete invoice EDI

## 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, a meta object containing the full EDI X12 string (ISA through IEA segments), segment count, and control number, plus an items array summarizing the document type, line item count, and document number. Also includes source/license metadata.

## Example request

```json
{
 "date": "20240115",
 "type": "850",
 "items": [
  {
   "uom": "EA",
   "price": 12.5,
   "quantity": 50,
   "productId": "WIDGET-X"
  }
 ],
 "parties": [
  {
   "name": "Acme Distribution",
   "role": "BY"
  },
  {
   "name": "Supplier Corp",
   "role": "SU"
  }
 ],
 "senderId": "MYCOMPANY",
 "receiverId": "SUPPLIER01",
 "documentNumber": "PO-2024-001"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "date": {
   "type": "string",
   "description": "Document date YYYYMMDD (default today)."
  },
  "type": {
   "enum": [
    "850",
    "810",
    "856"
   ],
   "type": "string",
   "description": "850 = Purchase Order, 810 = Invoice, 856 = Ship Notice/ASN."
  },
  "items": {
   "type": "array",
   "items": {
    "type": "object"
   },
   "description": "Line items (quantity, uom, price, productId)."
  },
  "total": {
   "type": "number",
   "description": "For 810: invoice total (USD)."
  },
  "parties": {
   "type": "array",
   "items": {
    "type": "object"
   },
   "description": "N1 party loops (role + name)."
  },
  "poNumber": {
   "type": "string",
   "description": "For 810: the PO being invoiced."
  },
  "senderId": {
   "type": "string",
   "description": "Sender interchange id."
  },
  "receiverId": {
   "type": "string",
   "description": "Receiver interchange id."
  },
  "documentNumber": {
   "type": "string",
   "description": "PO number (850) or invoice number (810)."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/2s-edi-document-generator-a7ddd6b4/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)
