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.
<dependency>
<groupId>com.zuora.sdk</groupId>
<artifactId>zuora-sdk-java</artifactId>
<version>{version}</version>
</dependency>
Latest SDK Version: 1.0.8
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 |
-
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.
-
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.
-
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.
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.
This technical reference documents every recommended object and method available in Zuora's SDK for Java.