+
+

Create and Configure Message Types

Message types define the structure of the transactions that Anypoint Partner Manager receives or sends. You can create message types from the <host> page or the Message Flow wizard.

Create a Message Type

  1. In the navigation menu, select <host-name>.

  2. From the Message types section, click New.

  3. In the Usage drop-down list, select the message type:

  4. Click Save.
    The message type appears in the Message types section on the host page .

Receive From and Send To Partners

Inbound and outbound transactions between your organization and your trading partners typically follow JSON, EDIFACT, X12, or XML standards.

EDIFACT

Use the following settings to define EDIFACT as the protocol for the Receive from Partners or Send to Partners message type:

Setting Description Default Required

Format

The format of the message.

EDIFACT

Yes

Version

List of valid versions: D00A, D00B, D01A, D01B, D01C, D02A, D02B, D03A, D03B, D04A, D04B, D05A, D05B, D06A, D06B, D07A, D07B, D08A, D08B, D09A, D09B, D10A, D10B, D11A, D11B, D12A, D12B, D13A, D13B, D14A, D14B, D15A, D15B, D93A, D95B, D96A, D97A, D98A, D98B, D99A, D99B

None

Yes

Message type

The EDIFACT message type, such as ORDERS, DESADV, or INVOIC.

None

Yes

Schema

The EDI schema for the message type. Options include:

  • Use standard EDIFACT-<version>
    This setting applies the standard EDIFACT schema for the version and message type configured.

  • Customize
    This setting enables you to import a customized EDI schema language file, if your requirement is to make adjustments to the standard EDIFACT schema.

    When using the customized EDI schema, you can assign a custom name to the message type definition, for example, EDIFACT-d97a-ORDERS-<PartnerName>.

None

Yes

JSON or XML

Use the following settings to define JSON or XML as the protocol for the Receive From Partners or Send to Partners message type:

Setting Description Default Required

Format

The format of the message. Allowed values are JSON or XML.

Yes

Schema

The imported JSON or XSD schema file for the message type.

Yes

Message type identifier

(Receive from Partners message type only) The message identifier value used in the dynamic message routing of inbound B2B transactions. Partner Manager automatically generates a message type identifier from the schema filename. You can modify this value.

Yes

Reference identifiers and business key mappings

(Receive from Partners message type only) The uploaded DataWeave script with mapping to extract the reference identifiers and business key mappings from the payload received from the backend application for dynamic routing into the appropriate message flow.

Yes

X12 Message Type

Use the following settings to define X12 as the protocol for the Receive from Partners or Send to Partners message type:

Setting Description Default Required

Format

The format of the message.

X12

Yes

Version

List of valid versions: 3010, 3020, 3030, 3040, 3050, 3060, 3070, 4010, 4020, 4030, 4040, 4050, 4060, 5010, 5020, 5030, 5040, 5050, 6020, 6030, 6040, 6050, 7010, 7020, 7030, 7040, 7050

None

Yes

Message type

The X12 transaction set number, such as 850 for Purchase Order or 214 for Shipment Status.

None

Yes

Schema

The EDI schema for the message type. Options include:

  • Use standard X12-<version>
    This setting applies the standard X12 schema for the version and message type configured.

  • Customize
    This setting enables you to import a customized EDI schema language file, if your requirement is to make adjustments to the standard X12 schema.

    When using the customized EDI schema, you can assign a custom name to the message type definition, for example, X12-7050-204-PartnerName.

None

Yes

You can find an example of how to customize EDI schema in Anypoint Exchange.

Target at Host

The target at host application message structure defines the way in which inbound transactions are transformed and sent to your backend applications.

Use the following settings to define settings for inbound transactions:

Setting Description Default Required

Format

The selected application message structure format:

  • JSON

  • XML

None

Yes

Schema

The imported XSD or JSON schema file for the message type.

None

Yes

Name

The message type name that Partner Manager automatically generates from the schema filename, which you can later modify.

None

Yes

Source at Host

The source at host application message structure defines the way in which your backend applications transform outbound transactions and send them to your partners.

Partner Manager automatically generates a message type identifier from the schema filename. This value can be modified. The message identifier value used in the dynamic message routing for outbound B2B transactions.

Use the following settings to define JSON or XML settings for outbound EDI transactions:

Setting Description Default Required

Format

The selected application message structure format:

  • JSON

  • XML

None

Yes

Schema

The imported XSD or JSON schema file for the message type.

None

Yes

Message type identifier

Partner Manager automatically generates this identifier from the schema filename and uses it to dynamically route outbound B2B transactions. You can modify the message type identifier to ensure that it has a meaningful, generic name.

Your partner must pass this value when sending messages, files, or both to Partner Manager:

  • If you receive the payload via an HTTP-based endpoint, the message type identifier is the relative path in the HTTP request.

  • If you receive the payload via AS2 or via file-based endpoint protocols such as SFTP and FTP, the filename begins with <message-type-id>_.

See Outbound Message Routing to understand how outbound routing is performed and how your backend applications should pass the message type identifier when sending application messages to Partner Manager endpoints.

None

Yes

Reference identifiers and business key mapping

The uploaded DataWeave script with mapping to extract the reference identifiers and business key mappings from the payload received from the backend application for dynamic routing into the appropriate message flow.

None

Yes

Reference Identifiers and Business Key Mapping Example

The input to the DataWeave map is the payload that follows the schema uploaded in the definition for the Source at Host and Receive from Partner message types. The output must contain the following fields:

  • partnerReferenceId
    Required identifier that uniquely identifies the receiving partner.

  • hostReferenceId
    (Applies to Source at Host message types) Optional, except when backend systems are sending outbound transactions on behalf of different internal business units that require different mapping or sender identifiers to be set on the EDI data.

  • businessDocumentKey
    Optional key reference value, such as Order Number`or `Invoice Number.

This is an example DataWeave map for an XML payload from the backend application:

%dw 2.0
output application/json
ns ns0 http://xmlns.mulesoft.com/enterpriseobjects/finance/purchaseorder/
---
{
	partnerReferenceId: payload.ns0#PurchaseOrder.ns0#VendorName,
	hostReferenceId: payload.ns0#PurchaseOrder.ns0#LineOfBusiness,
	businessDocumentKey: payload.ns0#PurchaseOrder.ns0#PONumber
}

Generated output:

{
"partnerReferenceId": "MYTHICAL SUPPLIER, LLC",
"hostReferenceId": "NTO Retail Canada",
"businessDocumentKey": "INVOICE-005"
}

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub
Submit your feedback!
Share your thoughts to help us build the best documentation experience for you!
Take our latest survey!