Skip to content
⚡️ Java Client
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Apache License Build Status Maven Central Coverage Status

⚡️ Java Client.


Download the latest JAR or grab via Maven:


or Gradle:

compile 'org.brunocvcunha.opennode-java:opennode-java:1.2'

Snapshots of the development version are available in Sonatype's snapshots repository.

Supported Operations & Examples

Create the Client

        OpenNodeService service = OpenNodeServiceFactory.buildClient("{api_token}");

Create a Charge

        OpenNodeCreateCharge createCharge = OpenNodeCreateCharge.builder()
                .description("OpenNode Java Client")
                .currency(OpenNodeCurrency.USD) // default is satoshis
        OpenNodeCharge createdCharge = service.createCharge(createCharge).execute().body().getData();
        System.out.println("Created charge with ID: " + createdCharge.getId() + ". Invoice: " + createdCharge.getLightningInvoice().getPayreq());

Get a Charge by ID

    OpenNodeCharge charge = service.getCharge("{charge_id"}).execute().body().getData();
    System.out.println(charge.getDescription() + " - " + charge.getAmount() + " - " + charge.getStatus());

List Charges

    OpenNodeResponse<List<OpenNodeCharge>> charges = service.listCharges().execute().body();
    for (OpenNodeCharge charge : charges.getData()) {
        System.out.println(charge.getDescription() + " - " + charge.getAmount() + " - " + charge.getStatus());

Want to tip a few satoshis?

opennode-java requires at minimum Java 8.

You can’t perform that action at this time.