API Quick-start Java Toolkit

Zuora ZCommerce


Thank you for downloading the Commerce API Quick-start Java Toolkit. This download contains code designed to help you begin using Zuora APIs.



This sample zip contains:

 /readme.txt - this file
 /build.xml - ant build files to compile and run the test code manually 
 /test.properties - external property file for setting different values while running the application
 /zuora.a.38.0.wsdl - The latest version of the WSDL
 /lib - contains all dependent jar files to run the sample
 /src - example code to execute the Zuora APIs
 /.classpath & .project - project files for eclipse

Documentation and Support

API Documentation is available at http://developer.zuora.com


The following are pre-requisites to successfully run the sample code:

  1. A Zuora Tenant
  2. A Zuora User
  3. A Product created with a Rate Plan & Rate Plan Component (http://knowledgecenter.zuora.com/index.php/Product_Catalog), with
    • The Effective Period (Start & End) of the Product/Rate Plan not expired (start < today and end > today)
    • An Accounting Code specified on the Rate Plan Component (Update $AccountingCode in main.php with the code you specify)
  4. A Zuora Gateway set up (http://knowledgecenter.zuora.com/index.php/Z-Payments_Admin#Setup_Payment_Gateway)
    • Either Authorize.net, CyberSource, PayPal Payflow Pro (production or test)
    • The setting "Verify new credit card" disabled

Running the Example

  1. Unzip the files contained in the quickstart_java.zip file to a folder on you hard drive.
  2. In test.properties, specify:
  3. From the command line, run the test using ant
    • "ant crud" to test create, update and delete of active account
    • "ant subscribe" to test subscribe() call
  4. Run from command line as a java application
    • "account-create" to test create Account. Get the proper argument from ApiTest.java to run the specific operation i,e account-update, subscribe-create etc.

Compiling the Example

From the command line, run "ant compile" to generate the Java stubs and compile the test code

Debugging the Example in Eclipse IDE

  1. From the command line, run "ant setup" to generate the Java stubs.
  2. Load the project into Eclipse.
  3. Copy the unzipped folder into your Eclipse workspace
  4. In Eclipse, create a new Java project:
    • File -> New -> Java Project
    • Enter project name, and point the project's root folder to the unzipped folder's location
    • Click 'Next'
    • Click 'Finish'
  5. Create a Run/Debug Configuraiton for ApiTest.java
  6. Navigate to src/com.zuora.api/ApiTest.java, and right click to select "Run As => Run Configurations". Click on "Arguments" tab, and specify the VM parameters as: -Dtest.properties=./test.properties

Updating the WSDL Version

If you want to use another WSDL version instead of the current WSDL version in the sample code, you can follow the steps below:

  1. In test.properties file, change the zuora.wsdl.version value
  2. In test.properties file, change the version number in the end point
  3. Copy the WSDL file to the root folder, e.g. zuora.a.37.0.wsdl
  4. Run "ant setup". This will re-generate the Java stubs from the new WSDL file.