---
schema_version: "1"
id: 6c9842ba5ea9524455231f517677f1481c944dd6ee2158229e77eae4d3683940
title: X12 EDI Connector 2.18 Examples
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/x12-edi-connector/2.18/x12-edi-connector-examples.md
canonical_url: https://docs.mulesoft.com/x12-edi-connector/2.18/x12-edi-connector-examples
source_site: docs.mulesoft.com
content_type: documentation
content_hash: d05ad7a18a925aa4e125f08223df7d2d02e586b349f84c4308b06b267b9fa3d2
description: MuleSoft Documentation Site
release: "2.18"
latest: false
---
---
product: X12 EDI Connector
version: 2.18
---

# X12 EDI Connector 2.18 Examples

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

Use this example to view the use case for Business-to-Business (B2B) EDI integration leveraging
Anypoint X12 Connector. This example:

- Transforms XML messages into outbound EDI X12 850 purchase order transactions

An HTTPS Listener source receives the enterprise purchase order XML messages from a backend system.
DataWeave and X12 Writes translate the XML message into an X12 v4010 850 purchase order EDI message.

- Transforms Inbound EDI X12 850 purchase orders into JSON

An HTTP Listener source receives the raw EDI X12 850 purchase order message. X12 Read and DataWeave
components pare and translate the EDI data into the JSON format.

- Generates a Functional Acknowledgment (997)

## Prerequisites

1.  Open the
    [Transform XML to EDI X12 850 purchase orders and X12 850 to JSON](https://www.mulesoft.com/exchange/org.mule.examples/b2b-demo-x12-transform/)
    example in Anypoint Studio from
    [Anypoint Exchange Examples](https://www.mulesoft.com/exchange/org.mule.examples/).

2.  Install the latest version of Anypoint X12 Connector.

## Run and Test the Outbound XML to EDI X12 850

1.  Run the application in Anypoint Studio.

2.  Test the outbound flow by using a REST Client to post a request (POST) to a JSON message to the
    URL:

`[http://localhost:8081/x12/send/enterprise-ob-purchaseorder](http://localhost:8081/x12/send/enterprise-ob-purchaseorder)`

You see the payload location under the following directory:

`src/main/resources/outbound/Enterprise-Outbound-PO.xml`

The Mule app returns the generated EDI X12 850 transaction.

## Run and Test the Inbound EDI X12 850 to JSON

1.  Test the inbound flow using a REST Client to post a request (POST) to a raw EDI X12 850 message
    to the URL:

    `[http://localhost:8081/x12/receive/4010-850](http://localhost:8081/x12/receive/4010-850)`

    You see the payload location under the following directory:

    `src/main/resources/inbound/EDI-4010-850-NTO-to-Mythical.edi`

    The app returns the translated JSON purchase order message.

    A Functional Acknowledgement (997) is generated and sent to the log.

2.  Send the message back to the trading partner via any standard protocol, such as FTP, SFTP, or
    AS2.

## See Also

- [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors)

- [Salesforce Help](https://help.salesforce.com)
