4 Formats · Same Data Model

EDI Format Reference

Field mapping tables for all four LEX wire formats — JSON-EDI, XML-EDI, ASC X12 850, and EDIFACT ORDERS. Every format carries an identical data model; only the encoding changes.

Format Overview

LEX is format-agnostic. All four wire formats carry an identical data model — only the encoding differs. For new implementations, use JSON-EDI. X12 850 and EDIFACT ORDERS are legacy bridge formats: the LEX libraries parse them automatically and convert them into a native LEX message, letting existing VAN/DMS/OEM pipelines interop with LEX without rewriting their EDI stack.

Recommended

JSON-EDI

Structured JSON with the lex root key. Native format for REST, webhook, and cloud-native integrations. Human-readable, direct library support.

Content-Type: application/json

XML-EDI

XML envelope with <lex> root element. Use for SOAP stacks, legacy middleware, and enterprise service buses.

Content-Type: application/xml

Legacy Bridge

ASC X12 850

Supported as an input on-ramp for existing VAN/DMS pipelines. parseX12() converts it to a native LEX message automatically. Not recommended for new builds.

Transaction Set: ST*850

Legacy Bridge

EDIFACT ORDERS

Supported as an input on-ramp for OEM/international EDI systems. parseEdifact() converts it to a native LEX message automatically. Not recommended for new builds.

Message: ALXLDE:D:96A:UN

JSON-EDI

Recommended format for REST, webhook, and cloud-native integrations.

Recommended

Message Envelope

JSON Path Type Required Description
lex.versionstringYesSpec version — currently 1.0.0
lex.header.messageIdUUID v4YesGlobally unique message identifier. Used for idempotency and deduplication.
lex.header.messageTypeenumYesLEAD · ASSET · ACKNOWLEDGMENT · SUBSCRIPTION · LEAD_CLOSURE
lex.header.timestampISO 8601YesUTC creation time. Must end with Z. Rejected if older than 7 days.
lex.header.senderIdstringYesAlphanumeric + hyphens. Identifies the originating organization or system.
lex.header.receiverIdstringYesTarget organization. Use BROADCAST for all subscribers.
lex.header.correlationIdUUID v4NoReferences the messageId of a prior message — typically used in ACK and CLOSURE responses.

LEAD Payload — lex.payload.lead.*

Field Type Required Notes
leadIdstringYesMax 50 chars. Recommended format: LEAD-YYYY-XXXXXX. Must be unique per sender.
statusenumYes15 values: CART · SHOPPING · EXPLORING · TRADE_IN · EXPRESSED_INTEREST · RESERVATION · APPOINTMENT_REQUEST · TEST_DRIVE_REQUESTED · TEST_DRIVE_COMPLETED · IN_NEGOTIATION · ORDER · ORDER_CONFIRMED · IN_DELIVERY · DELIVERED · ARCHIVED
sourceenumYesRETAILER_WEBSITE · RETAILER_CRM · MANUFACTURER_WEBSITE · THIRD_PARTY_PORTAL · DIRECT_CALL · SHOWROOM · SOCIAL_MEDIA · EMAIL_CAMPAIGN · REFERRAL · OTHER
customer.firstNamestringYesMax 50 chars. Hyphens and apostrophes allowed.
customer.lastNamestringYesMax 50 chars.
customer.emailstringCond.RFC 5322 format. Required unless phone is present.
customer.phonestringCond.E.164 format preferred: +13125551234. Required unless email is present.
customer.addressobjectYesSub-fields: street1 (req) · street2 · city (req) · state · postalCode (req) · country ISO 3166-1 α-2 (req)
customer.dateOfBirthdateNoISO 8601 date: YYYY-MM-DD. PII — encrypted in transit.
customer.preferencesobjectNoContact prefs: preferredContactMethod · preferredContactTime · doNotCall · doNotEmail · doNotText
desiredProductobjectYesAsset of interest. See Field Dictionary for asset-class-specific sub-fields.
tradeInobjectNoyear · make · model · vin · mileage · condition · estimatedValue · odometerStatus · titleStatus · payoffAmount · payoffCurrency · previousOwnerCount · accidentHistory · vehicleHistoryReport
financingobjectNointerestedInFinancing · preferredLoanTerm · downPaymentRange · creditTierPreference
customer.creditTierenumNoPre-qualification credit tier. Values: SUPER_PRIME · PRIME · NEAR_PRIME · SUBPRIME · DEEP_SUBPRIME · UNKNOWN
customer.fleetBuyerobjectNoFleet purchase context. Sub-fields: isFleet · fleetSize · unitsToOrder · fleetManagerName · fleetManagerEmail
desiredProduct.installedOptionsarrayNoDealer-installed or factory options requested. Each item: name (req) · source · partNumber · estimatedValue. Source enum: FACTORY · DEALER_INSTALLED · AFTERMARKET · OEM_ACCESSORY
desiredProduct.factoryOrderPreferenceenumNoWhether buyer prefers in-stock or factory-ordered unit. Values: IN_STOCK_ONLY · FACTORY_ORDER_PREFERRED · FACTORY_ORDER_ONLY · OEM_FACTORY · DEALER_STOCK_PREFERRED · EITHER
aviationLeadobjectNoAviation-specific lead context. Sub-fields: operatorCertificate · intendedUse · currentRegistryCountry · targetRegistryCountry. operatorCertificate enum: PART_91 · PART_121 · PART_135 · EASA_AOC · PRIVATE.
maritimeLeadobjectNoMaritime-specific lead context. Sub-fields: charterType · intendedTradingArea · intendedCargoType. charterType enum: BARE_BOAT · TIME_CHARTER · VOYAGE_CHARTER · DEMISE · NONE.
heavyEquipmentLeadobjectNoHeavy equipment-specific lead context. Sub-fields: attachmentCouplerStandard · jobSiteAltitude · exportLicenseRequired · exportDestinationCountry. Altitude in metres ASL — used for engine de-rating.
realEstateLeadobjectNoReal estate-specific lead context. 26 sub-fields including: buyerRepresentationAgreementStatus · exchangeType · preApprovalAmount · contingencies[] · sellerConcessionsRequested · homeWarrantyCoveredBy · occupancyStatus · saleType · firstTimeBuyer · targetClosingDate · buyerAgentLicenseNumber
technologyLeadobjectNoTechnology device/solution-specific lead context. Sub-fields: securityCertificationRequirements[] · evergreenRefreshTrigger · evergreenRefreshThresholdMonths · sustainabilityRequirements[] · conflictMineralsComplianceRequired
metadata.expirationDateISO 8601NoUTC datetime. After this date the lead is auto-transitioned to ARCHIVED.
metadata.priorityenumNoLOW · NORMAL · HIGH · URGENT
metadata.customFieldsobjectNoFreeform key-value map for implementation-specific data (e.g., salesRepId, campaignCode).
metadata.complianceobjectNoGlobal privacy consent records (GDPR, UK GDPR, CCPA, DPDPA, PIPL, LGPD, POPIA, APPI, PDPA-SG, PIPEDA, PIPA-K, PDPL, PDPA-TH, nFADP): consentRecord · gdpr · ukGdpr · ccpa · dpdp · pipl · lgpd · popia · pipeda · pdpaSg · appi · nfadp · pipaKr · pdplSa · pdpaTh

Minimal Valid Example

json-edi-lead.json (minimal) Recommended
{
  "lex": {
    "version": "1.0.0",
    "header": {
      "messageId":   "550e8400-e29b-41d4-a716-446655440000",
      "messageType": "LEAD",
      "timestamp":   "2026-03-23T14:30:00Z",
      "senderId":    "DEALER-001",
      "receiverId":  "MANUFACTURER-ABC"
    },
    "payload": {
      "lead": {
        "leadId": "LEAD-2026-001234",
        "status": "EXPRESSED_INTEREST",
        "source": "RETAILER_WEBSITE",
        "customer": {
          "firstName": "Jane",
          "lastName":  "Smith",
          "email":     "jane.smith@example.com",
          "address": {
            "street1":    "123 Main Street",
            "city":       "Springfield",
            "postalCode": "62701",
            "country":    "US"
          }
        },
        "desiredProduct": {
          "make":  "Toyota",
          "model": "Camry",
          "year":  2026
        }
      }
    }
  }
}

Cross-Format Field Map

Quick-reference for mapping the same conceptual field across all four wire formats.

LEX Field JSON-EDI XML-EDI X12 850 EDIFACT
Envelope
Message IDheader.messageId<MessageId>ISA13 (control #)UNH 0062
Timestampheader.timestamp<Timestamp>DTM*137DTM+137
Senderheader.senderId<SenderId>ISA06 / N1*01UNB S002 / NAD+BY
Receiverheader.receiverId<ReceiverId>ISA08 / N1*SHUNB S003 / NAD+SH
Lead Identity
Lead IDpayload.lead.leadId<LeadId>BEG03BGM 1004
Statuspayload.lead.status<Status>REF*LRRFF+ST
Sourcepayload.lead.source<Source>REF*LSRFF+LS
Expirymetadata.expirationDate<ExpirationDate>DTM*039DTM+039
Customer
First Namecustomer.firstName<FirstName>NM1*IL NM104NAD+DP C080
Emailcustomer.email<Email>NM1 NM108=EMCOM+EM
Phonecustomer.phone<Phone>NM1 NM108=TECOM+TE
Streetcustomer.address.street1<Street1>N3 N301NAD+DP C059
Citycustomer.address.city<City>N4 N401NAD+DP 3164
Postal Codecustomer.address.postalCode<PostalCode>N4 N403NAD+DP 3251
Asset of Interest
Make / BranddesiredProduct.make<Make>IT1 IT107 (after VC)LIN C212 element 2
ModeldesiredProduct.model<Model>IT1 IT108LIN C212 element 3
YeardesiredProduct.year<Year>IT1 IT106LIN C212 element 1
FeaturesdesiredProduct.desiredFeatures[]<Feature> (repeating)PID*F (one per feature)IMD+F+*** (one per feature)
Installed OptionsdesiredProduct.installedOptions[]<InstalledOption> (repeating)PID*F qualifier OI (one per option)IMD+F+OI (one per option)
Factory Order Pref.desiredProduct.factoryOrderPreference<FactoryOrderPreference>REF*FORFF+FO
Customer Extended
Credit Tiercustomer.creditTier<CreditTier>REF*CTRFF+CT
Fleet Buyercustomer.fleetBuyer<FleetBuyer>REF*FB / QTY*001 (fleet size)RFF+FB / QTY+1 (fleet size)
Trade-In Extended
Odometer StatustradeIn.odometerStatus<OdometerStatus>REF*OSRFF+OS
Title StatustradeIn.titleStatus<TitleStatus>REF*TSRFF+TS
Payoff AmounttradeIn.payoffAmount<PayoffAmount>PRI*PAPRI+PA
Accident HistorytradeIn.accidentHistory<AccidentHistory>REF*AH (count) + REF*AD (airbag)RFF+AH (count) + RFF+AD (airbag)
Industry Context (JSON-EDI native; X12 & EDIFACT use REF/RFF segments with LEX-defined qualifiers)
Aviation ContextaviationLead<AviationLead>REF*AV (operatorCert) + REF*IU (intendedUse)RFF+AV · RFF+IU
Maritime ContextmaritimeLead<MaritimeLead>REF*MC (charterType) + REF*TA (tradingArea)RFF+MC · RFF+TA
Heavy Equip. ContextheavyEquipmentLead<HeavyEquipmentLead>REF*AC (couplerStd) + MEA*OT*ALT (altitude)RFF+AC · MEA+OT+ALT
Real Estate ContextrealEstateLead<RealEstateLead>REF*RA (repAgreement) + REF*EX (exchangeType) + REF*PA (preApproval)RFF+RA · RFF+EX · RFF+PA
Technology ContexttechnologyLead<TechnologyLead>REF*SC (secCert) + REF*ER (evergreenTrigger)RFF+SC · RFF+ER
Custom Fields
Campaign Codemetadata.customFields.campaignCode<Field name="campaignCode">REF*PKRFF+CP
Sales Rep IDmetadata.customFields.salesRepId<Field name="salesRepId">REF*SRRFF+SR

Related Resources