> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# EDI API

> Trading partners, inbound and outbound X12 and EDIFACT, labels, reconciliation and deductions — 116 endpoints on edi.stateset.com, generated from the server's own OpenAPI.

The EDI API runs retailer and 3PL document exchange for one tenant: configure a trading partner,
process what they send you, generate what you owe them — an 856 ship notice, an 810 invoice, the
labels and packing slips a shipment needs — and reconcile what actually happened against what the
documents said.

|          |                                                                      |
| -------- | -------------------------------------------------------------------- |
| Base URL | `https://edi.stateset.com/v1`                                        |
| Auth     | `Authorization: Bearer <tenant API key>` on every endpoint           |
| Spec     | `GET /api-docs/openapi.json` — the server publishes its own document |

<Note>
  This reference is generated from the document the running server publishes — version 0.4.0. The
  same 116 operations are exposed as [117 MCP tools](/stateset-edi/mcp-server) for agents, so a
  call here and a tool call there hit the same handler.
</Note>

## Where to start

<CardGroup cols={2}>
  <Card title="Register a partner" icon="handshake" href="/api-reference/edi/partners/v1-adapters-list">
    A retailer or 3PL, its identifiers, its transport, and the overlays that adapt each transaction
    set to what that partner actually accepts.
  </Card>

  <Card title="Generate an 856" icon="truck" href="/api-reference/edi/outbound/v1-commercial-invoice-by-create">
    Ship notices, invoices, POs and the rest — ten X12 sets and the EDIFACT INVOIC and DESADV, each
    validated against the partner's profile before it leaves.
  </Card>

  <Card title="Process an inbound document" icon="inbox" href="/api-reference/edi/inbound/v1-as1-inbound-create">
    Raw X12 or EDIFACT in, a parsed, validated document out — with AS1/AS2 ingress helpers for
    partners who deliver that way.
  </Card>

  <Card title="Reconcile and recover" icon="scale-balanced" href="/api-reference/edi/operations/v1-analytics-export-list">
    Lifecycle traces, business reconciliation, the status board, and the deductions workflow that
    turns a short-pay into evidence and a dispute.
  </Card>
</CardGroup>

## How the pieces fit

1. **Partners** hold the contract: who they are, how documents reach them, and which retailer
   profile and certification pack apply.
2. **Inbound** turns what a partner sends into documents you can act on; **outbound** turns your
   orders and shipments into documents they will accept.
3. **Operations** is everything after the wire — evidence bundles, replay, reconciliation, delivery
   status, dead-letter handling, and deductions.

<Tip>
  Run the sandbox flow before a live partner sees a document. The MCP server's
  `edi_demo_order_to_invoice_flow` tool walks an 850 through 997, labels, 856 and 810 to a retailer
  997 acceptance, end to end, against your configuration — see the
  [EDI MCP server](/stateset-edi/mcp-server). There is no single REST endpoint for the whole flow.
</Tip>

## Related

* [StateSet EDI](/stateset-edi/overview) — what the engine does and why
* [Transaction sets](/stateset-edi/transaction-sets) — every document, with what each carries
* [Transports](/stateset-edi/transports) — AS2, SFTP, VAN and API delivery
* [EDI MCP server](/stateset-edi/mcp-server) — the same surface as agent tools
