Skip to content

zoho/subscriptions-java-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zoho Subscriptions Java Client Library

An open source Java Client library for integrating with Zoho Subscriptions Billing Solution

To get the latest jar

Subscriptions java client jar is listed under the dist directory. Just checkout the latest version by git checkout [latest release tag]

Usage

Import the Zoho Subscriptions Java Client Library to your project

Setup

SetUp Organization ID and OAuth Access Token

  1. Get Organization Id refer
  2. Generate oauth token using API Reference
Sample Code:
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}}");
    }
}

How to use

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())
    }
}

License

See the LICENCE file.

Dependencies