Java SDK

Official Declined.io client for Java. Source: Enoros/declined-sdk/declined-java

Install

bash
Maven: io.declined:declined

Initialize

java
import io.declined.Declined;
import io.declined.model.EventCreateParams;

Declined client = Declined.builder()
    .apiKey("decl_live_sk_...")
    .baseUrl("https://api.declined.io/api")
    .build();

Send a payment failed event

java
client.events().create(EventCreateParams.builder()
    .eventId("evt_123").type("payment_failed")
    .customerId("cus_123").invoiceId("inv_456")
    .amount(24900L).currency("usd").provider("stripe")
    .build());

Mark payment as recovered

When a customer pays outside Declined, notify the platform using either approach below. See the full Recoveries guide.

Via event API

java
client.events().markPaymentRecovered(EventCreateParams.builder()
    .eventId("evt_124").customerId("cus_123").invoiceId("inv_456")
    .build());

Via recovery attempt ID

java
client.recoveries().markRecovered("ra_abc123");

List resources

All SDKs expose customers, recoveries, sequences, webhooks, incentives, and analytics list methods. See the REST API reference for response shapes.