---
title: Message Linkage
slug: eprescribing/guide/message-linkage
docTags: 
createdAt: 2026-06-23T15:48:50.069Z
---

# Message Linkage Overview

Message linkage requirements and best practices are described in the table below. There are four key fields that are used to link messages together, and this linkage allows a software system to connect related messages to each other. For example, on an RxRenewalRequest the prescribing system needs to find the original NewRx to which the pharmacy is referring. This linkage should be done in an automated manner.

**S.210:** Customers shall support the scenarios in the Message Linkage section of this guide.

:::hint{type="info"}
**Note:&#x20;**&#x4E;CPDP refers to message linkage as trace number.
:::

✅ **Quality Check**: Ensure electronic transactions are populated with the correct traceable elements for message linking when available. When this information is not included, human intervention is introduced which brings an additional risk of transcription/matching errors.

:::Paragraph{indent="1"}
**MessageID** – The unique number assigned to each message. This ID initiates the electronic linking of subsequent message types.
:::

:::Paragraph{indent="1"}
**RelatesToMessageID** – The MessageID of the most recent and relevant message in the workflow.
:::

:::Paragraph{indent="1"}
**RxReferenceNumber** – The prescription number assigned by pharmacy system. This number should be populated on pharmacy-initiated messages. RxReferenceNumber must be populated on RxRenewalRequest, RxRenewalResponse, RxChangeRequest, and RxChangeResponse.
:::

:::Paragraph{indent="1"}
**PrescriberOrderNumber** – The prescription number created by the prescribing system. PrescriberOrderNumber must be populated on all fillable messages. For other message types if PrescriberOrderNumber is available, it should be sent.
:::

:::Paragraph{indent="1"}
The PrescriberOrderNumber or the RxReferenceNumber should be used as the primary criteria for matching messages. If it cannot be used, the following data in the message should be used:
:::

:::Paragraph{listStyleType="disc" indent="2"}
RelatesToMessageID
:::

:::Paragraph{listStyleType="disc" indent="2"}
Patient demographics
:::

:::Paragraph{listStyleType="disc" indent="2"}
Medication information
:::

:::Paragraph{listStyleType="disc" indent="2"}
Prescriber information
:::

:::Paragraph{listStyleType="disc" indent="2"}
Pharmacy information
:::

### Message Linkage Example

::::hint{type="info"}
:::Paragraph{indent="1"}
**Note:&#x20;**&#x54;he following table is an example of message linking. This example is not all inclusive and the same methodology applies to other message types.
:::
::::

|                                               | **NewRx**                                   | **RxRenewal**<br />**Request**              | **RxRenewal**<br />**Request**<br />**FollowUp**<br />**Request** | **RxRenewal**<br />**Response**             | **(2nd RxRenewal**<br />**Request)**        |
| --------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ----------------------------------------------------------------- | ------------------------------------------- | ------------------------------------------- |
| **MessageID**                                 | 12345                                       | 444333                                      | 555222                                                            | 888333                                      | 89999                                       |
| **RelatesTo**<br />**MessageID**              | N/A\*                                       | 12345\*\*                                   | 444333                                                            | 555222                                      | 888333                                      |
| **Prescriber**<br />**Order**<br />**Number** | RX123                                       | RX123                                       | RX123                                                             | RX897                                       | RX897                                       |
| ****                                          | **Status/**<br />**Error/**<br />**Verify** | **Status/**<br />**Error/**<br />**Verify** | **Status/**<br />**Error/**<br />**Verify**                       | **Status/**<br />**Error/**<br />**Verify** | **Status/**<br />**Error/**<br />**Verify** |
| **MessageID**                                 | 888                                         | 77777                                       | 999999                                                            | 555555                                      | 111111                                      |
| **RelatesTo**<br />**MessageID**              | 12345                                       | 444333                                      | 555222                                                            | 888333                                      | 89999                                       |

:::hint{type="info"}
**Notes**:

\* For customers sending a NewRx following a BenefitResponse (either On-Demand Formulary or Real-Time Prescription Benefit, whichever is later in the workflow), populate the RelatesToMessageID with the MessageID from the BenefitResponse. The only exceptions for this are for NewRx that is following:

- a NewRxRequest
- a NewRx following a CancelRxResponse in the LTPAC environment

\*\* Surescripts encourages the use of electronic prescribing messages but also acknowledges situations where alternative means of communication are necessary. Messages sent electronically will contain a MessageID which is later used in the RelatesToMessageID field of subsequent/related messages. However, in instances where there is no MessageID (e.g., original message sent by fax), the RelatesToMessageID will not be available to send in electronic messages that follow. In these instances, additional matching logic is needed to support subsequent workflows such as RxFill, RxRenewal, Resupply, RxChange, and CancelRx.
:::

### Long Term and Post Acute Care Message Linkage Example

:::hint{type="info"}
**Note:&#x20;**&#x54;he following table is an example of Prescribing System Initiated Change Process message linking.
:::

|                       | **NewRx**               | **CancelRx**            | **NewRx**               |
| --------------------- | ----------------------- | ----------------------- | ----------------------- |
| MessageID             | 12345                   | 444333                  | 888333                  |
| RelatesToMessageID    | N/A                     | 12345                   | 12345                   |
| PrescriberOrderNumber | RX123                   | RX123                   | RX123A                  |
|                       | **Status/Error/Verify** | **Status/Error/Verify** | **Status/Error/Verify** |
| MessageID             | 888                     | 77777                   | 555555                  |
| RelatesToMessageID    | 12345                   | 444333                  | 888333                  |

