How to Transfer CSV Files to a Partner Using Anypoint Partner Manager

By accuTrust • Published: March 30, 2026

Overview

Anypoint Partner Manager (APM) is MuleSoft's comprehensive solution for managing B2B integrations with trading partners. While it's renowned for EDI message handling, APM also excels at processing structured data formats like CSV files. This guide walks you through setting up secure CSV file transfers to partners using APM's message flows, data mapping, and transport protocols.

Prerequisites

Before starting, ensure you have:

Step 1: Set Up Partner Profile

Partner profiles in APM define your trading relationships and contain all necessary configuration details.

  1. Log into Anypoint Platform and navigate to Partner Manager
  2. Click "Partners" and select "Create Partner"
  3. Enter partner details: Identifier Type, Identifier Value
  4. Select Identifier Type as Reference Type and value as your partner's identifier
Anypoint Partner Manager Partner Profile Setup Screen
Figure 1: Creating a new partner profile in Anypoint Partner Manager

Step 2: Configure Endpoints for sending CSV file to partner

Endpoints in APM define the communication points for sending and receiving messages.

  1. Select Partners in left side tab
  2. Select the Partner Created
  3. Go to Endpoints and click on New Endpoint
APM Endpoints New Endpoint screenshot
Figure: Endpoints page where you can add a New Endpoint in Anypoint Partner Manager
  1. Define the partner endpoint(your target FTP Server where you will send the files)
  2. Configure partner endpoint details:
    • Owner: Should be a partner
    • Usage: Select Send to Partner
    • Protocol: Select FTP
    • Filename Pattern: Give ${Bus}
    • Configure other settings as per your environment (credentials, FTP host, port, etc.)
APM Endpoints New Endpoint screenshot
Figure: Endpoints page where you can add a New Endpoint in Anypoint Partner Manager
APM Endpoints New Endpoint screenshot
Figure: Endpoints page where you can add a New Endpoint in Anypoint Partner Manager
APM Endpoints New Endpoint screenshot
Figure: Endpoints page where you can add a New Endpoint in Anypoint Partner Manager
APM Endpoints New Endpoint screenshot
Figure: Endpoints page where you can add a New Endpoint in Anypoint Partner Manager

Step 3: Create your host endpoint

Host Endpoint is a source from where you will send your files to partners.

  1. Select Host in left side tab
  2. Go to Endpoints and click on New Endpoint
APM Endpoints New Endpoint screenshot
Figure: Endpoints page where you can add a New Endpoint in Anypoint Partner Manager
    • Owner: Should be a host
    • Usage: Select Source at Host
    • Protocol: Select FTP
    • Configure other settings as per your environment (credentials, FTP host, port, etc.)
    • Give Source directory path, file name pattern and archival path
APM Endpoints New Endpoint screenshot
Figure: Endpoints page where you can add a New Endpoint in Anypoint Partner Manager
APM Endpoints New Endpoint screenshot
Figure: Endpoints page where you can add a New Endpoint in Anypoint Partner Manager
APM Endpoints New Endpoint screenshot
Figure: Endpoints page where you can add a New Endpoint in Anypoint Partner Manager
APM Endpoints New Endpoint screenshot
Figure: Endpoints page where you can add a New Endpoint in Anypoint Partner Manager

Step 4: Create Source and Target Message Types

Source and Target Message Types are used to define the structure and format of the data being exchanged.

  1. Click on Host Profile on the left side tab
  2. Go to Message Types
  3. Click on New Message Type
APM Endpoints New Endpoint screenshot
Figure: Endpoints page where you can add a New Endpoint in Anypoint Partner Manager

First let's create source at host message type

  1. Usage: Select source at Host
  2. Format: Select CSV
  3. Leave separator character, quote character and escape character as default
  4. Message Type Identifier: Give the name you want
  5. Reference type identifier and attributes mapping: Pass host reference type identifier and map the attributes accordingly as per below example(change the values as per your requirements)
  6. %dw 2.0
    output application/json
    ---
    {
        "partnerReferenceId": "abc",
        "hostReferenceId": "xyz"
    }

save the file as dwl and attach as per below screenshot

APM Endpoints New Endpoint screenshot
Figure: Endpoints page where you can add a New Endpoint in Anypoint Partner Manager
APM Endpoints New Endpoint screenshot
Figure: Endpoints page where you can add a New Endpoint in Anypoint Partner Manager

Now let's create target message type

  1. Usage: Select Send To Partners
  2. Format: Select CSV
  3. Message Type Identifier: Give the name as per your requirements
APM Endpoints New Endpoint screenshot
Figure: Endpoints page where you can add a New Endpoint in Anypoint Partner Manager

Step 5: Create Message Mappings

Message mappings define how data is transformed between the source and target message types.

  1. On the left side of APM tab, select Maps
  2. Click on New Map
  3. Select Send to Partner from drop down list
  4. Provide the map name as per your requirenment
APM Endpoints New Endpoint screenshot
Figure: Endpoints page where you can add a New Endpoint in Anypoint Partner Manager

This is the place where you need to pass your dataweave script using which you want to transform incoming data.

  1. Give Source Message Type
  2. Provide dwl script, in my case I have passed as is (in case of no transformation needed)
    %dw 2.0
    output application/json
    ---
    payload
  3. Select Target Message Type
APM Endpoints New Endpoint screenshot
Figure: Endpoints page where you can add a New Endpoint in Anypoint Partner Manager

Step 6: Create Message Flow

Message mappings define how data is transformed between the source and target message types.

  1. On the left side of APM tab, select Message Flows
  2. Click on New Message Flow
  3. Select Send to Partner from drop down list
  4. Select your Partner
  5. Select a Map which you have created
  6. Select your Source Endpoint
  7. Select your Source Message Type
  8. Select your Source and Target Reference IDs
  9. Select your dwl mapping
  10. Select your target message type
  11. Select your target endpoint
APM Endpoints New Endpoint screenshot
Figure: Endpoints page where you can add a New Endpoint in Anypoint Partner Manager
APM Endpoints New Endpoint screenshot
Figure: Endpoints page where you can add a New Endpoint in Anypoint Partner Manager

Step 7: Testing

Deploy and Test your message flow.

  1. Once Message Flow is created, click on deploy button
  2. You will be able to see new application is being deployed in Runtime Manager
  3. Create the file at source FTP location and it will be transferred to the target location by Anypoint Partner Manager

Best Practices

Conclusion

Anypoint Partner Manager simplifies CSV file transfers to partners by providing a unified platform for configuration, mapping, and secure transport. By following this guide, you can establish reliable B2B data exchanges that scale with your business needs. For complex integrations or custom requirements, consider consulting MuleSoft experts to optimize your partner communications.

Back to Blogs