Skip to content

zuora/sdk-java-samples

Repository files navigation

Getting Started Quickly with Zuora Samples

Zuora Samples are built by Zuora, and provide all of the server code you need for common integration use cases like creating a subscription with Zuora Billing.

You will also find comprehensive SDK Technical Reference documentation here.

Go to the Zuora Developer Community to connect with other developers, report issues or discuss these samples.

Installation

Add the following to the dependencies in your project's pom.xml

<dependency>
    <groupId>com.zuora.sdk</groupId>
    <artifactId>zuora-sdk-java</artifactId>
    <version>{version}</version>
</dependency>

Latest SDK Version: 1.0.8

View on Maven Central

Base URLs

Different Zuora environments have different base URLs. You can use environment variables to manage base URLs and the different credentials you have for these environments.

When using the SDK you should select the endpoint base URL you wish to use.

Tenant Endpoint Base
US Production https://rest.zuora.com
US API Sandbox https://rest.apisandbox.zuora.com
US Central Sandbox https://rest.test.zuora.com
US Performance Test https://rest.pt1.zuora.com
US Cloud Production https://rest.na.zuora.com
US Cloud API Sandbox https://rest.sandbox.na.zuora.com
EU Production https://rest.eu.zuora.com
EU Sandbox https://rest.sandbox.eu.zuora.com
EU Central Sandbox https://rest.test.eu.zuora.com

Authentication

  1. Create an API User. See Create an API User for details. Note: this and the following step, must be performed by a Zuora administrator from your organization with a company email address.

  2. Create an OAuth Client for that API User. See Create an OAuth Client. Note: API-only users do not have access to Zuora Central so will not be able to create OAuth clients from themselves.

  3. Make a note of the Client ID and Client Secret and add them to the following snippet in your code to authenticate.

String CLIENT_ID = System.getenv("CLIENT_ID");
String CLIENT_SECRET = System.getenv("CLIENT_SECRET");
String ENDPOINT = System.getenv("ENDPOINT_BASE");
ZuoraClient zuoraClient = new ZuoraClient(CLIENT_ID, CLIENT_SECRET, ENDPOINT);

To protect your tenant from unauthorized access be sure not to share these credentials in publicly accessible areas such as GitHub or client-side code.


Samples

If you're not sure where to start this basic sample demonstrates how to create an Account, a Product and a Subscription to subscribe a customer to your product or service.

Basic Sample

Pricing Samples


SDK Guide

SDK Guide


SDK Technical Reference

This technical reference documents every recommended object and method available in Zuora's SDK for Java.

Product

Account

Subscription

Billing Document

Payment

License Agreement

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages