> ## 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.

# Receive an EDI email

> Process a forwarded EDI email through the inbound pipeline. Save the mail connector’s complete JSON envelope as as1-email.json, including an actual X12…

Process a forwarded EDI email through the inbound pipeline. Save the mail connector’s complete JSON envelope as as1-email.json, including an actual X12 attachment or body and the correct partner context. Empty or illustrative text is not a valid interchange. Check the processing result and acknowledgment before treating the business document as accepted.

### Request body

`As1InboundEmail`

**attachments** `As1InboundAttachment[]`

Decoded attachments; the EDI is normally the first `application/edi-*`.

**As1InboundAttachment**

**base64** `boolean`

**content** `string`

Attachment content: base64 when `base64` is true, otherwise plain text.

**content\_type** `string`

**filename** `string`

**body** `string`

Plain-text body — the fallback EDI source when there is no attachment.

**from** `string`

Sender address, for logging/audit.

**partner\_id** `string,null`

Optional explicit partner id; when absent the ISA sender resolves it.

**subject** `string`

### Response

`object`

**success** `boolean` *required*

Fixed value: `true`.

**data** `InboundResult` *required*

**InboundResult**

**ack\_997** `string,null`

Serialized 997 interchange acknowledging what we received. `None` when the inbound interchange only contained FA groups or was rejected.

**ack\_contrl** `string,null`

Serialized EDIFACT CONTRL acknowledgment, for inbound EDIFACT interchanges.

**ack\_ta1** `string,null`

Serialized TA1 interchange rejection, when envelope validation failed.

**documents** `InboundDocument[]` *required*

**InboundDocument**

**control\_number** `string` *required*

**document\_id** `string`

The processed-document id (`GET /v1/documents/&#123;id&#125;`) recorded for this transaction set. Empty on receipts stored before it was tracked.

**error** `string,null`

**parsed** `object,null`

**reference** `string` *required*

**rejection** `array,null`

Structured, SNIP-classified guide findings: fatal errors on rejected transactions and advisory warnings on accepted transactions. The same findings the 999 reports, surfaced for operators and agents.

**status** `string` *required*

**transaction\_set** `string` *required*

**error** `string,null`

**events\_queued** `integer` *required*

Minimum: `0`.

**interchange\_acknowledgments** `InterchangeAcknowledgment[]`

Interchange-level TA1 acknowledgments received, not generated replies.

**InterchangeAcknowledgment**

**acknowledgment\_code** `string` *required*

**control\_number** `string` *required*

**date** `string` *required*

**note\_code** `string` *required*

**time** `string` *required*

**interchange\_control\_number** `string` *required*

**partner\_id** `string` *required*

**status** `string` *required*

`processed` or `interchange_rejected`.

### Status codes

| Code | Meaning |
| - | - |
| `200` | Processing result with acknowledgment |
| `403` | Partner credential named a different partner\_id |
| `404` | No partner matches the ISA sender |
| `409` | Duplicate interchange control number |
| `422` | Email carries no EDI attachment/body, or unparseable |

### Using this contract

Read the [source OpenAPI document](https://docs.stateset.com/spec/edi.json) for declared schemas and alternatives.
This page also includes documented corrections from the [spec overlays](https://github.com/stateset/docs/tree/main/spec/overlays).
Example IDs and values are illustrative; replace them with records from your workspace.

```bash cURL theme={null}
curl --silent --show-error --fail-with-body --request POST \
  --url 'https://api.edi.stateset.com/v1/as1/inbound' \
  --header "Authorization: Bearer $EDI_API_TOKEN" \
  --header 'Content-Type: application/json' \
  --data @as1-email.json
```

```json 200 theme={null}
{
  "success": true,
  "data": {
    "ack_997": "string",
    "ack_contrl": "string",
    "ack_ta1": "string",
    "documents": [
      {
        "control_number": "string",
        "document_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "error": "string",
        "parsed": {},
        "reference": "ORD-10042",
        "rejection": [
          {
            "code": "string",
            "component": 1,
            "element": 1,
            "message": "Two-person tent, green — replacement for damaged pole set.",
            "recorded_severity": "error",
            "segment": "string",
            "segment_position": 1,
            "value": "49.00",
            "severity": "string",
            "snip_level": 1,
            "suggested_fix": "string"
          }
        ],
        "status": "pending",
        "transaction_set": "string"
      }
    ],
    "error": "string",
    "events_queued": 1,
    "interchange_acknowledgments": [
      {
        "acknowledgment_code": "string",
        "control_number": "string",
        "date": "2026-08-31T14:22:05Z",
        "note_code": "string",
        "time": "string"
      }
    ],
    "interchange_control_number": "string",
    "partner_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "status": "pending"
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.