Java API Client for integrating with ChargeBee
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist
src
.gitignore * * * Nov 24, 2016
CHANGELOG.md * * * Jan 10, 2019
LICENSE * * * Jan 10, 2019
README.md
pom.xml

README.md

Chargebee Java Client Library - API V2

The java library for integrating with Chargebee Recurring Billing and Subscription Management solution.

Chargebee now supports two API versions - V1 and V2, of which V2 is the latest release and all future developments will happen in V2.

This library is for our API version V2. The library for V1 can be found in chargebee-v1 branch.

Installation

Maven users

Add the below dependency to your pom.xml:

<dependency>
  <groupId>com.chargebee</groupId>
  <artifactId>chargebee-java</artifactId>
  <version>[latest-2.x.x-release-version]</version>
</dependency>

To get the latest jar

ChargeBee java jar is distributed as part of the release under the dist directory. Just checkout the latest version for 2.x.x by git checkout [latest 2.x.x release tag]

or

Build the jar by running maven as follows in latest release tag for 2.x.x:

git checkout [latest 2.x.x release tag]
mvn clean package

Documentation

API Reference

Usage

You can also copy the below code snippet from our API Reference documentation. We have provided downloadable code for each API operation.

import java.io.IOException;
import com.chargebee.*;
import com.chargebee.models.*;
import com.chargebee.models.enums.*;

public class Sample{

  public static void main(String args[]) throws IOException{
    Environment.configure("{site}","{site_api_key}");
    Result result = Subscription.create()
                      .id("HwxfyiHNUFzaiWO")
                      .planId("starter")
                      .customerEmail("john@user.com")
                      .customerFirstName("John")
                      .customerLastName("Wayne").request();
    Subscription subscription = result.subscription();
    Customer customer = result.customer();
    Card card = result.card();
    System.out.println(result);
  }
}

License

See the LICENSE file.