An open source Java Client library for integrating with Zoho Subscriptions Billing Solution
Subscriptions java client jar is listed under the dist
directory. Just checkout the latest version by
git checkout [latest release tag]
Import the Zoho Subscriptions Java Client Library to your project
SetUp Organization ID and OAuth Access Token
- Get Organization Id refer
- Generate oauth token using API Reference
import com.zoho.subscription.net.*;
import java.io.IOException;
import java.util.*;
public class Main {
public static void main (String args[]) throws Exception
{
ZSClient object = new ZSClient();
object.setOauthtoken("{{Zoho Subscriptions Oauth Token}}");
object.setOrganizationId("{{Zoho Organization ID}}");
}
}
Use the below sample code for Customer Creation refer Api Docs
Example to create a Customer:
import com.zoho.subscription.net.*;
import com.zoho.subscription.model.*;
import java.io.IOException;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.*;
public class Main {
public static void main (String args[]) throws Exception
{
ZSClient object = new ZSClient();
object.setOauthtoken("{{Zoho Subscriptions Oauth Token}}");
object.setOrganizationId("{{Zoho Organization ID}}");
ObjectMapper mapper = new ObjectMapper();
Customer customer=new Customer();
customer.setDisplayName("Patricia Boyale");
customer.setEmail("patricia.boyale@zylker.com");
customer.setPhone("9876543210");
Customer new_customer = new Customer();
new_customer = Customer.create(customer);
System.out.println(new_customer.getCustomerId())
}
}
See the LICENCE file.