PayPal Connector


The PayPal Connector facilitates connections between Mule integration and PayPal. The PayPal Connector v3.0 supports the PayPal operations described in https://developer.paypal.com/docs/classic/api/. The connector currently supports Signature API credential type of authentication.

PayPal is a service that enables you to pay, send money, and accept payments without revealing your financial information. Simply click the PayPal checkout button, log in to your PayPal account, and select your preferred payment method. Mule completes the payment process—without sharing your info with merchants and sellers.

Before You Begin

This document assumes you are familiar with Mule, Anypoint Connectors and Anypoint Studio Essentials. Review Elements in a Mule Flow and Global Elements if you are unfamiliar with these topics.

This document describes implementation examples within the context of Anypoint Studio, Mule’s graphical user interface, and includes configuration details for configuring using the XML Editor.

Compatibility Matrix

Application/Service Version

Mule Runtime

3.7.0 and later


Classic SOAP API ver 2.0

Namespace and Schema

Item Description



Schema Location


Schema Version


Installing and Configuring

You can install a connector in Anypoint Studio from Anypoint Exchange.

Updating From an Older Version

Each time an updated version of a connector is released, Anypoint studio displays a popup in the bottom right corner of you screen with the following message: Updates Available.

To upgrade to the newest version of the PayPal connector:

  1. Click the popup and check for the available updates.

  2. Select the PayPal Connector 3.0 check-box and click Next.

  3. Follow the instructions provided by the user interface.

  4. Restart Studio when prompted. After restarting, if you have several versions of the connector installed, Mule asks you for the version of the connector you like to use.

Creating a New Project

To use the PayPal connector in a Mule application project:

  1. In Studio, select File > New > Mule Project.

  2. Enter a name for your new project and leave the remaining options with their default values.

  3. If you plan to use Git, select Create a .gitignore file for the project with default ignores for Studio Projects, and then click Next.

  4. Click Finish to create the project.

Configuring the PayPal Connector Global Element

To use the PayPal Connector in your Mule application, you must configure a global PayPal element that can be used by all the PayPal connectors in the application (read more about global elements).

PayPal SOAP API relies on the authentication information being passed using SOAP headers as part of SOAP messages. The configuration supports Signature API credentials style SOAP headers. For more details on different types of authentication mechanism in PayPal please refer to PayPal Credentials.

To create a global PayPal configuration:

  1. Click the Global Elements tab at the base of the canvas.

  2. On the Global Mule Configuration Elements screen, click Create.

  3. In the Choose Global Type wizard, expand Connector Configuration, and select PayPal Connector: configuration (Signature).

  4. Click OK.

  5. Enter the global element properties:

    1. For PayPal Connector: Configuration:

      Field Description


      Alphanumeric text string that uniquely identifies the user who owns the account


      Key that plays the role of a username


      Key that plays the role of a password

      Service Address

      PayPal endpoint reference. Refer to this for PayPal endpoints.


      API Signature given by PayPal for this username

      App Id

      PayPal Application ID.

      The placeholder values refer to a configuration file placed in the src folder of your project. Learn how to configure properties. You can either enter your credentials into the global configuration properties, or reference a configuration file that contains these values. For simpler maintenance and better re-usability of your project, Mule recommends that you use a configuration file. Keeping these values in a separate file is useful if you need to deploy to different environments, such as production, development, and QA, where your access credentials differ. See Deploying to Multiple Environments for instructions on how to manage this.

  6. Click Validate Config to confirm that the parameters of your global configuration are accurate, and that Mule is able to successfully connect to PayPal.

  7. Click OK to save the global connector configurations.

Using the Connector

The PayPal Connector v3.0 is an operation-based connector, which means that when you add the connector to your flow, you need to configure a specific operation (Invoke operation) for the connector to perform. The XML element for the Invoke operation is:


After you call the Invoke operation, you can use the Service and Operation fields to select a method to execute. The PayPal connector v3.0 allows you to use all the SOAP API’s exposed by PayPal WSDL file.

Use Cases

The following are a few common use case for the PayPal Connector v5.0:

  • Read balance for the PayPal Account

  • Accept payments from merchants

  • Accept bulk payments

Refer to PayPal API reference for the possible use cases.

Adding the PayPal Connector to a Flow

  1. Create a new Mule project in Anypoint Studio.

  2. Drag the PayPal connector onto the canvas, then select it to open the properties editor.

  3. Configure the connector’s parameters:

    Field Description

    Display Name

    Enter a unique label for the connector

    Connector Configuration

    Select a global PayPal connector element from the drop-down.




    Select a Service from the drop-down.


    Select the operation to perform on the table your select.

  4. Click the blank space on the canvas to save your connector configurations.

Example Use Case

Create a Mule flow to get the balance from a PayPal account.

  1. Create a Mule Project in your Anypoint Studio.

  2. Drag an HTTP connector onto the canvas.

  3. Click the green plus symbol for Connector Configuration.

  4. Set the Host to localhost and the Port to 8081 and leave the default values for all other fields

  5. Reference the HTTP Listener Configuration global element and set the path to */getbalance:

  6. Drag the PayPal Connector v3.0 into the flow.

  7. Click the plus sign next to the Connector Configuration field.

  8. Click Validate Config to confirm that Mule can connect with PayPal. If the connection is successful, click OK to save the configurations of the global element. If unsuccessful, revise or correct any incorrect parameters, then test again.

  9. Back in the properties editor of the PayPal Connector v3.0, configure the remaining parameters:

  10. Drag a DataWeave Transform Message component between the HTTP connector and the PayPal Connector v3.0.

    %dw 1.0
    %output application/xml
    %namespace ns0 urn:ebay:api:PayPalAPI
    %namespace ns1 urn:ebay:apis:eBLBaseComponents
        ns0#GetBalanceReq: {
            ns0#GetBalanceRequest: {
                ns1#Version: inboundProperties.'http.query.params'.version
  11. Add a Logger component between the DataWeave and PayPal Connector component to log the payload.

  12. Add another Logger component after the PayPal connector component to log the response.

  13. Add a XML to JSON transformer.

  14. Save and run the project as a Mule Application.

  15. From a browser, navigate to http://localhost:8081/paypal/getbalance?version=51.

  16. Mule performs the query to get the current balance in the PayPal account associated with the user defined in the global element.

Example Code

For this code to work in Anypoint Studio, you must provide the credentials for the PayPal account. You can either replace the variables with their values in the code, or you can add a file named mule.properties in the src/main/resources folder to provide the values for each variable.

<mule xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw" xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:paypal="http://www.mulesoft.org/schema/mule/paypal" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/paypal http://www.mulesoft.org/schema/mule/paypal/current/mule-paypal.xsd
http://www.mulesoft.org/schema/mule/ee/dw http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd">
    <http:listener-config name="HTTP_Listener_Configuration" host="" port="8081" basePath="paypal" doc:name="HTTP Listener Configuration"/>
    <paypal:config name="PayPal_Connector__configuration__Signature_" username="${config.username}" password="${config.password}" serviceAddress="${config.serviceAddress}" signature="${config.signature}" appId="${config.appId}" doc:name="PayPal Connector: configuration (Signature)"/>
    <flow name="paypal-operations-form-flow">
        <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
        <parse-template location="paypal-operations-demo.html" doc:name="Parse Template"/>
        <set-property propertyName="Content-Type" value="text/html" doc:name="Property"/>
    <flow name="getbalance-flow">
        <http:listener config-ref="HTTP_Listener_Configuration" path="/getbalance" doc:name="/getbalance"/>
        <dw:transform-message doc:name="Transform Message">
            <dw:set-payload><![CDATA[%dw 1.0
%output application/xml
%namespace ns0 urn:ebay:api:PayPalAPI
%namespace ns1 urn:ebay:apis:eBLBaseComponents
    ns0#GetBalanceReq: {
        ns0#GetBalanceRequest: {
            ns1#Version: inboundProperties.'http.query.params'.version
        <logger message="Before -- #[payload]" level="INFO" doc:name="Logger"/>
        <paypal:invoke config-ref="PayPal_Connector__configuration__Signature_" type="PayPalAPI||GetBalance" doc:name="PayPal Connector Get Balance"/>
        <logger message="After -- #[payload]" level="INFO" doc:name="Logger"/>
        <json:xml-to-json-transformer doc:name="XML to JSON"/>
    <flow name="getpaldetails-flow">
        <http:listener config-ref="HTTP_Listener_Configuration" path="/getpaldetails" doc:name="/getpaldetails"/>
        <dw:transform-message doc:name="Transform Message">
            <dw:set-payload><![CDATA[%dw 1.0
%output application/xml
%namespace ns0 urn:ebay:api:PayPalAPI
%namespace ns1 urn:ebay:apis:eBLBaseComponents
    ns0#GetPalDetailsReq: {
        ns0#GetPalDetailsRequest: {
            ns1#Version: inboundProperties.'http.query.params'.version
        <paypal:invoke config-ref="PayPal_Connector__configuration__Signature_" type="PayPalAPI||GetPalDetails" doc:name="PayPal Connector Get Pal Details"/>
        <json:xml-to-json-transformer doc:name="XML to JSON"/>

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!