Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here


Java SDK for integrating with PayPal's Express Checkout / MassPay / Web Payments Pro APIs

Subscribe to updates I use merchant-sdk-java

Statistics on merchant-sdk-java

Number of watchers on Github 50
Number of open issues 1
Average time to close an issue 6 months
Main language Java
Average time to merge a PR about 1 month
Open pull requests 0+
Closed pull requests 1+
Last commit over 1 year ago
Repo Created about 7 years ago
Repo Last Updated over 1 year ago
Size 17.3 MB
Organization / Authorpaypal
Latest Releasev2.15.122
Page Updated
Do you use merchant-sdk-java? Leave a review!
View merchant-sdk-java activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating merchant-sdk-java for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

This repository contains java sdk and samples for Merchant API.


Please contact PayPal Technical Support for any live or account issues.


  • Java jdk-1.5 or higher
  • Apache Maven 3 or higher
  • Please refer for any help in Maven.

To build sdk and samples:

  • Build core files from, as it is a dependency for sdk.
  • Then, run 'mvn install' to build sdk jar and sample war files.

SDK Integration:

For Non-Maven Users:

  • Create a new application.

  • Copy all the jar files present inside 'lib' folder to your application.

For Maven Users:

  • Install all the jar files present inside 'lib' folder manually to local repository.

    mvn install:install-file -Dfile=commons-codec-1.3.jar -DgroupId=commons-codec -DartifactId=commons-codec -Dversion=1.3 -Dpackaging=jar
    mvn install:install-file -Dfile=paypal-core-1.7.0.jar -DgroupId=com.paypal.sdk -DartifactId=paypal-core -Dversion=1.7.0 -Dpackaging=jar
    mvn install:install-file -Dfile=merchantsdk-2.14.117.jar -DgroupId=com.paypal.sdk -DartifactId=merchantsdk -Dversion=2.15.122 -Dpackaging=jar   
  • Create a new maven application.

  • Add dependency to sdk in your application's pom.xml as below.


To make an API call:

  • Import into your code.

  • Create a configuration file '' with parameters specified in configuration section (make sure the file is in class path). Use the default constructor to run with configuration used from '' found in classpath.

    new PayPalAPIInterfaceServiceService();
  • For Dynamic configuration(configuration is tied to the lifetime of the service object)

    new PayPalAPIInterfaceServiceService(new File("/pathto/"));
    new PayPalAPIInterfaceServiceService(new FileInputStream(new File("/pathto/")));
    new PayPalAPIInterfaceServiceService("/pathto/");
    new PayPalAPIInterfaceServiceService(Map<String, String> customConfigurationMap);
    new PayPalAPIInterfaceServiceService(Properties customProperties);
  • The SDK takes defaults for certain parameters (eg: Account Credentials and either of 'mode' or 'service.Endpoint' are mandatory parameters).

  • Create a service wrapper object.

  • Create a request object as per your project needs.

  • Invoke the appropriate method on the service wrapper object.

    For example,

    import urn.ebay.api.PayPalAPI.*;
    TransactionSearchReq txnreq = new TransactionSearchReq();
    TransactionSearchRequestType requestType = new TransactionSearchRequestType();
    PayPalAPIInterfaceServiceService service = new PayPalAPIInterfaceServiceService();
    Map<String, String> customConfigurationMap = new HashMap<String, String>();
    customConfigurationMap.put("mode", "sandbox"); // Load the map with all mandatory parameters
    PayPalAPIInterfaceServiceService service = new PayPalAPIInterfaceServiceService(Map<String, String> customConfigurationMap);
    TransactionSearchResponseType txnresponse = service.transactionSearch(txnreq, username);

SDK Logging:

  • For logging - java.util.logging has been used. To change the default configuration, edit the file in 'jre/lib' folder under your JDK root.

SDK Configuration:

The SDK uses dynamic configuration map or '*.properties' format configuration file as shown in code snippet above, to configure

  • Mode is specified using the parameter name 'mode' with values 'sandbox' or 'live', if specified 'service.EndPoint' parameter is not required and the SDK chooses the sandbox or live endpoints automatically.

  • (Multiple) API account credentials, by appending a '.' (dot) character and the service name to 'service.EndPoint' parameter.

  • HTTP connection parameters, if certain connection parameters are not specified, the SDK will assume defaults for them.

  • Service configuration.

  • You can refer full list of configuration parameters in wiki page.

Multiple SDK usage (Multiple End-points Support)

Multiple end-points configuration can be done by specifying mulitple end-points identified by specific property keys. When using multiple SDKs in combination, like Merchant and Permissions etc..configure the endpoints as shown below one for each service used, The existing service.EndPoint property is still supported for backward compatibility (using a single SDK). The list below specifies endpoints for different services, in SANDBOX and PRODUCTION, with their property keys and end-point as property values.

For additional information on Merchant API, please refer to

Instant Payment Notification(IPN)

merchant-sdk-java open issues Ask a question     (View All Issues)
  • almost 3 years I createRecurringPaymentsProfile and set initialAmount but can't receive IPN message
  • about 3 years FinancingMonthlyPayment no return currencyID
merchant-sdk-java questions on Stackoverflow (View All Questions)
  • how do I reduce the elapsed time for a billing cycle with PayPal's merchant-sdk-java?
merchant-sdk-java list of languages used
merchant-sdk-java latest release notes
v2.15.122 v2.15.122
  • Add email field to TransactionSearchRequestType.
v2.6.121 Stub Updates
  • Updated API version to 121
v2.14.117 TLS 1.2 support
  • TLS 1.2 support
  • Add refund, reversal to PaymentTransactionCodeType
Other projects in Java