# EDI 864 Text Message: Implementation Guide

> EDI 864 Text Message explained: BMG, MIT and MSG segments, vendor notice and invoice rejection examples, 864 vs 824, and how to make sure someone reads them.

<QuickAnswer>
The EDI 864 Text Message is the X12 transaction trading partners use to send free-form messages over an EDI connection: notices, policy changes, explanations and rejections written in prose. It carries a subject in BMG, messages opened by MIT, and lines of text in MSG. It is meant for people to read, not for systems to process.
</QuickAnswer>

**The EDI 864 is email that travels over your EDI connection.** A retailer tells you an invoice was not paid and why. A supplier announces a holiday shipping cutoff. A government buyer sends a clarification on a solicitation. None of these fit a coded document, so they arrive as an 864: a subject, a sender, and lines of plain text.

The risk is simple. Your translator accepts the 864, sends back a clean 997, and files it somewhere nobody looks. This guide covers what the 864 carries, its segments, two live examples (a retailer's invoice rejection and a supplier's shipping notice), how it compares to the 824, and how to make sure a person actually reads each one.

<EDIGuideCTA
  transactionType="864"
  headline="Send the order in the format the partner can process"
  body="When an 864 says your document was wrong, the fix usually starts with the order data. OrderSync reads orders in any format, from EDI 850s to emails and PDFs, matches customers, items and units to your catalog, and outputs valid X12 or ERP data."
/>

## What Is an EDI 864?

**An EDI 864 is the Text Message transaction set defined by the [ASC X12 standards body](https://x12.org/products/transaction-sets). Its X12 purpose statement says it gives users a way to electronically move messages, contracts, explanations and other one-time communications, and that it is intended to provide messages for people, not for computer processing.** The same statement discourages using the 864 to carry "quasi" or home-grown transaction formats. It travels in functional group `TX`.

Authoritative references for 864 work:

- The [X12 transaction set catalog](https://x12.org/products/transaction-sets) defines the 864 and its segment order
- The [Stedi X12 4010 reference](https://www.stedi.com/edi/x12-004010/864) lists the BMG, MIT and MSG segments with their element limits
- The [Defense Logistics Agency's 864 implementation convention](https://www.dla.mil/Portals/104/Documents/InformationOperations/EBS%20Supplier%20Information/DLA%20BSM%20864%20IC.pdf) is a public example of a large buyer's 864 rules, including how to reference a related transaction
- Each trading partner that sends or accepts 864s says so in its EDI requirements, along with what it uses them for

**Who sends it?** Either side. Retailers and manufacturers send notices to suppliers. Suppliers send notices to customers. Government agencies and their vendors exchange clarifications on solicitations and awards.

**Who receives it?** In theory, a person. In practice, your EDI translator, which then has to hand the text to a person.

**When is it sent?** Whenever there is something to say that no structured document covers: a rejected document explained in words, a schedule change, a new requirement, a contact change.

**Why does it matter?** Because the content is prose, no system will act on it for you. If an 864 tells you an invoice will not be paid until you correct it, the only way that gets fixed is if someone reads it.

## What 864s Are Used For

| Use | Typical sender | Example |
|---|---|---|
| **Rejections explained in prose** | Retailer, buyer AP | An invoice could not be matched to a PO, or duplicates one already received |
| **Vendor notices** | Supplier | Plant closures, holiday shipping cutoffs, new remit-to details |
| **Policy and requirement changes** | Retailer, manufacturer | New labeling rules, a change in routing contacts, a new EDI requirement date |
| **Clarifications** | Buyer or seller | Questions and answers on a quote or award, such as an [843 quote response](/guides/edi/843-response-to-request-for-quotation), referencing the related transaction |
| **Production or schedule messages** | Manufacturer | Notes that accompany planning or shipping schedules |

Which of these your partners actually send is in their EDI requirements. Many retailers have moved notices to supplier portals and email, and use the 824 for document rejections. The 864 is still common in automotive, manufacturing, government and some retail relationships.

## Interactive Example: Invoice Rejection Notice

A grocery retailer's accounts payable desk tells a food supplier why two invoices were not processed. `BMG02` gives the overall subject. Two `N1` loops name the sender (`FR`, message from, with a `PER` contact) and the recipient (`TO`, message to). Each problem gets its own `MIT` loop with a message number and subject, followed by `MSG` lines of text.

Use the **Plain English** tab for a readable summary, or click any segment to break it down element by element.

<EDISample id="864-invoice-rejection" />

Notice what the 864 does not give you: no invoice number in a coded field, no error code, no status a system can branch on. The invoice number is only in the text. That is the trade-off of a text message.

## Interactive Example: Supplier Holiday Shipping Notice

Going the other way, the food supplier tells the grocery customer its plant will not ship over Thanksgiving, when the order cutoff is, and who to call. Two `MIT` loops separate the schedule from the contact details.

<EDISample id="864-vendor-notice" />

## 864 Structure at a Glance

The 864 is one of the simplest X12 sets.

| Area | Segment | Name | Usage | Notes |
|---|---|---|---|---|
| Heading | **ST** | Transaction Set Header | Mandatory | `ST01` = `864` |
| Heading | **BMG** | Beginning Segment for Text Message | Mandatory | Purpose code and overall subject |
| Heading | **DTM** | Date/Time Reference | Optional, up to 10 | Dates relevant to the message |
| Heading loop | **N1** | Name | Optional loop, up to 200 | Sender, recipient and other parties |
| Heading loop | **N2, N3, N4** | Name and address | Optional | |
| Heading loop | **REF** | Reference Identification | Optional, up to 12 | References to related documents |
| Heading loop | **PER** | Administrative Communications Contact | Optional, up to 3 | Who to contact |
| Detail loop | **MIT** | Message Identification | Mandatory, repeats | Opens each message: number and subject |
| Detail loop | **N1 loop** | Name, address, REF, PER | Optional | Parties for this one message |
| Detail loop | **MSG** | Message Text | Mandatory, up to 100,000 per message | One line of text per segment |
| Trailer | **SE** | Transaction Set Trailer | Mandatory | Segment count and control number |

In the envelope, `GS01` is **TX**. Many partners use release 004010, and the version is set by their guide.

## Key Segments Explained

### BMG: Beginning Segment for Text Message

```
BMG*00*INVOICE REJECTION NOTICE~
```

| Element | Name | Example | What it means |
|---|---|---|---|
| **BMG01** | Transaction Set Purpose Code | `00` | `00` = original |
| **BMG02** | Description | `INVOICE REJECTION NOTICE` | The subject of the whole transaction, up to 80 characters |
| **BMG03** | Transaction Type Code | | Optional code classifying the message. Its use and values are set by the partner's guide |

`BMG02` is the closest thing the 864 has to a routing key. If your partner uses consistent subjects, you can route on them. If not, route every 864 from that partner to a person.

### DTM: Date/Time Reference

```
DTM*097*20261112*0805~
```

`DTM01` is the date qualifier (`097` = transaction creation), `DTM02` the date and `DTM03` the time. Partners use other qualifiers for effective dates or deadlines mentioned in the text.

### N1, REF and PER: Who It Is From and To

```
N1*FR*HARBOR GROCERY AP*1*069854900~
PER*IC*ACCOUNTS PAYABLE EDI DESK*TE*5035550100~
N1*TO*PINE HOLLOW FOODS*1*081234567~
```

`N101` codes `FR` (message from) and `TO` (message to) identify the two ends of the message, with an ID in `N103`/`N104` (here `1` = DUNS). `PER` gives a contact with a name and number. A `REF` in the same loop can point to a related transaction. The DLA convention, for example, requires the reference number of the related transaction when an 864 accompanies another document.

### MIT: Message Identification

```
MIT*001*INVOICE 30418 NOT PROCESSED*80~
```

| Element | Name | Example | What it means |
|---|---|---|---|
| **MIT01** | Reference Identification | `001` | The message number within this 864 |
| **MIT02** | Description | `INVOICE 30418 NOT PROCESSED` | The subject of this message, up to 80 characters |
| **MIT03** | Page Width | `80` | Maximum characters per line. Defaults to 80 |
| **MIT04** | Page Length Lines | | Maximum lines per page. Defaults to 66 |

One 864 can hold many messages. Separate topics into separate `MIT` loops so each can be routed and answered on its own.

### MSG: Message Text

```
MSG*YOUR INVOICE 30418 DATED 11/10/2026 COULD NOT BE MATCHED TO AN OPEN ORDER.~
```

| Element | Name | What it means |
|---|---|---|
| **MSG01** | Free-Form Message Text | One line of text, up to 264 characters |
| **MSG02** | Printer Carriage Control Code | Optional layout control, such as advancing lines or starting a new page |
| **MSG03** | Number | Lines to advance before printing. Requires `MSG02` |

Each `MSG` is one line. Keep lines within the `MIT03` page width and avoid the delimiter characters your interchange uses (`*`, `~` and the component separator), which will break the segment.

## EDI 864 vs 824, 997 and Email

| Document | Purpose | Machine-readable? | Typical use |
|---|---|---|---|
| **864 Text Message** | Free-form messages for people | No. The content is prose | Notices, explanations, rejections in words |
| **[824 Application Advice](/guides/edi/824-application-advice)** | Reports accepted, rejected or errored documents | Yes. Coded status in `OTI`, error codes in `TED` | Business-rule rejections of 810s, 856s and 850s |
| **[997 Functional Acknowledgment](/guides/edi/997-functional-acknowledgment)** | Confirms receipt and syntax of a functional group | Yes | Every transaction, including the 864 itself |
| **Email** | Anything | No | Most notices today |

The short version: the 824 tells your system that a document failed and which one, so the fix can be tracked. The 864 tells a person, in words. When a partner rejects documents with 864s instead of 824s, you lose the automatic link between the rejection and the document, and have to rebuild it by reading the text.

## How to Make Sure Someone Reads Your 864s

The most common 864 failure is not a mapping error. It is a message that was received, acknowledged and never seen.

1. **Route every 864 to a monitored inbox or queue.** Convert the `BMG`, `MIT` and `MSG` content into an email or ticket, with the sender and date.
2. **Route by partner and subject where you can.** An AP rejection from a retailer belongs with your billing team; a routing change belongs with shipping.
3. **Pull references out of the text.** Invoice and PO numbers in `MSG` lines are just text. Matching them to your documents, even with a simple pattern search, turns an 864 into something you can act on.
4. **Keep the original.** Store the raw 864 alongside the converted message, so you can show what the partner actually said.
5. **Answer through the channel the partner asks for.** Many partners do not accept 864s back. Their guide or the message itself says how to respond.

Rejections that are never read turn into short-pays and [EDI chargebacks](/edi-chargebacks) weeks later. Pasting a raw 864 into the [EDI inspector](/edi-inspector) lays out the subject, parties and each message as readable text.

## Common 864 Errors and How to Prevent Them

| Error | What happens | Prevention |
|---|---|---|
| **864 acknowledged but never read** | Notice ignored, problem repeats | Route every 864 to a person, not just the archive |
| **Delimiter characters inside message text** | Segment split or syntax error on the 997 | Strip or replace `*`, `~` and the component separator before sending |
| **Lines longer than 264 characters** | Element too long, syntax rejection | Wrap text into multiple `MSG` segments |
| **All topics in one `MIT` loop** | Hard to route or answer | One `MIT` per topic, with a clear subject |
| **No sender contact** | Recipient cannot follow up | Include `PER` with a name and number |
| **Structured data sent as text** | Receiver cannot process it, against the X12 purpose | Use the proper transaction set (824, 855, 865) when one exists |
| **Missing reference to the related document** | Message cannot be matched to the order or invoice | Use `REF` where the partner's guide allows, and name the document in the text |

## 864 Implementation Checklist

- Ask each partner whether it sends or accepts 864s, and for what
- Get its guide: which heading segments it uses, which `N1` codes, and whether it uses `BMG03`
- Decide where inbound 864s go: an inbox, a ticket queue, a named person per partner
- Convert `MIT` and `MSG` content into readable text, keeping line breaks
- Store the raw transaction with the converted message
- If you send 864s, wrap text to the page width and strip delimiter characters
- Confirm the 997 handling: an 864 needs a 997 like any other set

For the wider set of documents your partners may exchange, see the [EDI document types reference](/edi-document-types) and the [EDI compliance guide](/edi-compliance).

## Fewer Rejections Start With Clean Orders, With OrderSync

Many 864s are rejections, and many rejections trace back to order data: a PO number keyed wrong, an item the customer does not recognize, a unit that does not match. Orders arrive as EDI 850s, emails, PDFs and spreadsheets, and each one has to be matched correctly before it turns into an acknowledgment, a shipment and an invoice.

OrderSync reads inbound orders in any format, matches customers, items and units to your catalog, and outputs valid X12 or clean data to your ERP. Paste any 864 into the [free EDI inspector](/edi-inspector) to read it as plain text, or [book a 15-minute walkthrough](/book-call) to see your own orders processed.

## Frequently Asked Questions

<div className="not-prose">

### What is an EDI 864 used for?

The EDI 864 Text Message carries free-form messages between trading partners over an EDI connection: notices, policy changes, explanations and rejections written in prose. X12 defines it for communication meant for people to read, not for systems to process.

### What segments are in an EDI 864?

An 864 opens with BMG, which carries the purpose code and overall subject, plus optional DTM dates and N1 loops for the parties. Each message starts with an MIT segment holding a message number and subject, followed by one or more MSG segments, each holding one line of text.

### What is the difference between EDI 864 and EDI 824?

The 824 Application Advice reports that a document was accepted, rejected or had errors, using coded status and error segments a system can process. The 864 carries the same kind of news, or anything else, as plain text for a person. An 824 can be tracked automatically; an 864 has to be read.

### How long can an MSG line be in an EDI 864?

MSG01 holds up to 264 characters. MIT03 can set a page width, which defaults to 80 characters, so most senders keep each line within 80 characters and use as many MSG segments as the message needs.

### Do I need to send a 997 for an EDI 864?

Usually yes. An 864 is a transaction set like any other, and partners that require 997s expect one for it. The 997 only confirms the 864 arrived and passed syntax checks. It says nothing about whether anyone read it.

### What functional group does the EDI 864 use?

The 864 travels in functional group TX in GS01. The X12 release, commonly 004010, is set by each partner's implementation guide.

### Can I reply to an EDI 864?

Only if the partner accepts inbound 864s. Many send them one way and expect replies by email, phone or portal. The partner's EDI guide, or the contact in the PER segment of the message, tells you how to respond.

</div>
