---
schema_version: "1"
id: 9d9bf92c9c6949d280b842f08ae0cab062a03d2701e660b778ea2919c9f16549
title: Inbound Message Routing
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/partner-manager/latest/inbound-message-routing.md
canonical_url: https://docs.mulesoft.com/partner-manager/latest/inbound-message-routing
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 1de3e44f4d711a181e3083a81e128cb67a8a5fa2cb4f2ab38c3679e75581d6da
description: MuleSoft Documentation Site
release: 2.x
latest: true
---
---
product: Partner Manager
version: 2.x
is-latest-version: true
---

# Inbound Message Routing

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Depending on the endpoint type and protocol, the successful routing of your partner’s send messages
to the configured source endpoints uses the message type ID, file-naming pattern, and content type.

## Messages That Use an AS2 Receive from Partners Endpoint

To successfully route inbound messages that use an AS2 Receive from Partners endpoint, your partner
does the following:

- For non-EDI files (JSON or XML), uses a filename that begins with `{message-type-id}_`.

  For example, if the message type is named `custom-po`, the filename must begin with `custom-po_`.

  There are no filename restrictions for EDI files.

- Sets the AS2 MIME-Type in the inbound AS2 message as follows, depending on the message type:

  - EDIFACT: `application/EDIFACT` or `text/plain`

  - JSON: `application/json`

  - X12: `application/EDI-X12` or `text/plain`

  - XML: `application/xml`

  - CSV: `text/csv`

## Messages That Use an FTP or SFTP Endpoint

The process that Partner Manager uses to route inbound messages differs depending on whether the
messages are EDIFACT or X12 EDI messages or non-EDI messages, such as CSV, JSON, or XML.

### EDI Messages

Partner Manager routes an inbound EDIFACT or X12 EDI message based on the EDI identifier, such as
ISA identifier for X12 or UNB identifier for EDIFACT, in the message content.

### Non-EDI Messages

Partner Manager routes an inbound non-EDI message, such as CSV, JSON, or XML, based on either the
associated message type or the filename:

- If you specified an associated message type in the endpoint configuration, Partner Manager routes
  the message based on that message type.

- If you didn’t specify an associated message type in the endpoint configuration, Partner Manager
  routes the message based on the filename. The filename must begin with `{message-type-id}_` and
  have an appropriate file extension:

  - `.json` for JSON files

  - `.xml` for XML files

  - `*.csv` for CSV files

For example, if the message type is named `custom-po` and it’s formatted as XML, the filename must
begin with `custom-po_` and end with `.xml`.

### Receive from Partners Endpoint

When Partner Manager deploys endpoint applications in Mule runtime, the protocol and endpoint
configurations dictate the steps the applications follow, as shown in the diagram. Next, the
document processing service routes the message via the `dps-inbound-queue`. The API replication
service receives a copy of the message via the `tracking-queue`, stores the message payload in your
storage, and updates the tracking information in Partner Manager.

[![A flowchart of the inbound message processing for AS2, HTTP, and SFTP/FTP protocols](/mulesoft/current/en-us/partner-manager/latest/_images/pm-inbound-message-routing2.png)](_images/pm-inbound-message-routing2.png)

### Document Processing

The document processing application uses the inbound message’s attributes, such as content-type
header, URL relative path, file name, and payload, to route the message, as shown in the diagram. If
Partner Manager doesn’t find a matching message flow, the transmission receives a **Failed** status
and an error message shows.

![A flowchart that depicts message flow processing and matching](/mulesoft/current/en-us/partner-manager/latest/_images/pm-dps-inbound-processing2.png)

## Messages That Use an HTTP or HTTPS Receive from Partners Endpoint

To successfully route inbound messages that use an HTTP Receive from Partners endpoint or an HTTPS
Receive from Partners endpoint, your partner does the following:

- For EDI messages (EDIFACT or X12), posts them to the base URL and sets the Content-Type value in
  the incoming HTTP request as follows, depending on the message format:

  - EDIFACT: `application/EDIFACT` or `text/plain`

  - JSON: `application/json`

  - X12: `application/EDI-X12` or `text/plain`

  - XML: `application/xml`

  - CSV: `text/csv`

- For non-EDI messages (JSON or XML), includes the message type ID in the relative path of the HTTP
  request.

  For example, suppose you have the following scenario in a CloudHub deployment:

  - The base URL of the HTTP or HTTPS Receive from Partners endpoint is
    `https://b2b-inbound-http-abcd.us-e2.cloudhub.io:443/receive1/`.

  - The expected message type ID for the inbound message is `custom-po`.

    In this case, your partner should post the message to the
    `https://b2b-inbound-http-abcd.us-e2.cloudhub.io:443/receive1/custom-po` URL.

## See Also

- [Inbound Message Flows](https://docs.mulesoft.com/partner-manager/latest/inbound-message-flows)

- [Create Inbound Message Flows](https://docs.mulesoft.com/partner-manager/latest/create-inbound-message-flow)

- [Track Transmission Activity](https://docs.mulesoft.com/partner-manager/latest/activity-tracking)
