Code Examples

Complete LEX message examples in all four EDI formats, plus library usage samples for every supported language.

Complete LEAD Message

A full LEAD message with customer, desired product, financing, and metadata — the most common message type. Same data in all four wire formats.

json-edi-lead.json View on GitHub ↗
{
  "lex": {
    "version": "1.0.0",
    "header": {
      "messageId":   "550e8400-e29b-41d4-a716-446655440000",
      "messageType": "LEAD",
      "timestamp":   "2026-03-28T14:30:00Z",
      "senderId":    "DEALER-001",
      "receiverId":  "MANUFACTURER-ABC"
    },
    "payload": {
      "lead": {
        "leadId": "LEAD-2026-001234",
        "status": "EXPRESSED_INTEREST",
        "source": "DEALER_WEBSITE",
        "customer": {
          "firstName": "Jane",
          "lastName":  "Smith",
          "email":     "jane.smith@example.com",
          "phone":     "+13125559876",
          "address": {
            "street1":    "123 Main Street",
            "city":       "Springfield",
            "state":      "IL",
            "postalCode": "62701",
            "country":    "US"
          },
          "preferences": {
            "preferredContactMethod": "EMAIL",
            "doNotCall":             false
          }
        },
        "desiredProduct": {
          "assetClass": "VEHICLE",
          "make":       "Toyota",
          "model":      "Camry",
          "year":       2026,
          "trim":       ["SE", "XSE"],
          "fuelType":   "HYBRID",
          "priceRange": {
            "min": 28000,
            "max": 34000,
            "currency": "USD"
          }
        },
        "financing": {
          "type":           "FINANCE",
          "downPayment":    5000,
          "loanTerm":       60,
          "currency":       "USD"
        },
        "metadata": {
          "createdAt": "2026-03-28T14:29:00Z",
          "channel":   "ONLINE"
        }
      }
    }
  }
}

ACKNOWLEDGMENT Message

Sent by the receiver in response to every LEAD message. Carries the validation result and correlates back via correlationId.

acknowledgment.json Required — Level 1
{
  "lex": {
    "version": "1.0.0",
    "header": {
      "messageId":     "ack-550e8400-0001",
      "messageType":   "ACKNOWLEDGMENT",
      "timestamp":     "2026-03-28T14:30:05Z",
      "senderId":      "MANUFACTURER-ABC",
      "receiverId":    "DEALER-001",
      "correlationId": "550e8400-e29b-41d4-a716-446655440000"
    },
    "payload": {
      "acknowledgment": {
        "status":     "ACCEPTED",
        "receivedAt": "2026-03-28T14:30:04Z",
        "validation": {
          "valid":  true,
          "errors": []
        }
      }
    }
  }
}

LEAD_CLOSURE Message

Records the final outcome of a lead — won, lost, duplicate, or abandoned. Required for Level 2 conformance.

lead-closure.json
{
  "lex": {
    "version": "1.0.0",
    "header": {
      "messageId":   "closure-7f3e9d12-0001",
      "messageType": "LEAD_CLOSURE",
      "timestamp":   "2026-04-02T09:15:00Z",
      "senderId":    "DEALER-001",
      "receiverId":  "MANUFACTURER-ABC"
    },
    "payload": {
      "closure": {
        "leadId":      "LEAD-2026-001234",
        "outcome":     "WON",
        "closedAt":    "2026-04-01T16:30:00Z",
        "finalStatus": "ORDER",
        "salePrice": {
          "amount":   31500,
          "currency": "USD"
        },
        "notes": "Customer accepted SE trim with sunroof package"
      }
    }
  }
}

API Definitions

Machine-readable API definitions for tooling integration — OpenAPI for REST endpoints, AsyncAPI for event-driven messaging.

Whitepaper

The full LEX specification whitepaper — available as a formatted PDF or as a browsable HTML document.