API Reference
The NeutronEDI REST API exposes six processing endpoints covering both X12 and EDIFACT. All endpoints share the same authentication model, error-response format, and content negotiation.
Base URL
https://api.neutronedi.com
All endpoints live under the /api/v1/ prefix. Versioning is URL-based — we introduce breaking changes by shipping a new version, never by mutating an existing one.
Authentication
Every request must include your API key in the X-API-Key header:
X-API-Key: nedi_live_your_key_here
See Authentication for full details on key management, rotation, and rate limits.
Common headers
| Header | Value | Notes |
|---|---|---|
X-API-Key | Your API key | Required on every request |
Content-Type | application/edi-x12 or application/edifact | Required on Read/Validate requests |
Accept | application/json | Responses are always JSON |
Endpoints
POST /api/v1/read/x12
Translates a raw X12 document into structured JSON.
Request body: Raw X12 bytes. Accepts full interchanges (ISA/IEA envelopes) and handles multi-transaction files automatically.
Response: 200 OK with a JSON object containing the interchange envelope metadata and a transactions array.
curl -X POST https://api.neutronedi.com/api/v1/read/x12 \
-H "X-API-Key: $NEUTRONEDI_API_KEY" \
-H "Content-Type: application/edi-x12" \
--data-binary @input.x12POST /api/v1/read/edifact
Same as /read/x12, but for EDIFACT input. Accepts UNA/UNB envelopes and all standard message types (ORDERS, INVOIC, DESADV, and more).
POST /api/v1/write/x12
Generates an X12 document from a structured JSON input. The request body is a JSON object describing the interchange envelope and transactions; the response is a properly delimited X12 string.
Request body (example):
{
"interchange": { "sender": "YOU", "receiver": "PARTNER" },
"transaction": {
"type": "810",
"invoiceNumber": "INV-1001",
"date": "2026-04-12",
"items": [
{ "line": 1, "qty": 50, "unitPrice": "9.99", "sku": "WIDGET-A" }
],
"total": "499.50"
}
}Response: 200 OK with Content-Type: application/edi-x12 and the generated document as the body.
POST /api/v1/write/edifact
Same pattern for EDIFACT output. The transaction shape differs (message types and segments follow EDIFACT conventions), but the wrapper is the same.
POST /api/v1/validate/x12
Validates an X12 document without translating it. Returns a pass/fail result plus a detailed error list — useful for pre-flight checks before sending documents to trading partners.
Response (with errors):
{
"valid": false,
"transactionSet": "850",
"standard": "X12",
"version": "004010",
"errors": [
{
"segment": "BEG",
"position": 3,
"code": "MISSING_REQUIRED",
"message": "Element BEG03 is required but missing."
}
]
}POST /api/v1/validate/edifact
Same pattern for EDIFACT validation.
Error responses
All non-2xx responses return a JSON body:
{
"error": {
"code": "INVALID_REQUEST",
"message": "Human-readable error description",
"details": {}
}
}Common codes:
| Status | Code | Meaning |
|---|---|---|
400 | INVALID_REQUEST | Malformed request body or missing required fields |
401 | UNAUTHORIZED | Missing or invalid API key |
403 | FORBIDDEN | Key is valid but lacks permission for this operation |
422 | PARSE_ERROR | EDI document could not be parsed (structural error) |
429 | RATE_LIMITED | Monthly transaction limit exceeded or rate limit triggered |
500 | INTERNAL_ERROR | Unexpected server error — retry with exponential backoff |
Interactive docs
For an interactive OpenAPI playground, visit https://api.neutronedi.com/api/docs (powered by Scalar). The raw OpenAPI spec is available at https://api.neutronedi.com/api/v1.