Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.124.0"
".": "0.125.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 191
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-d29b68bb85936070878d8badaa8a7c5991313285e70a990bc812c838eba85373.yml
openapi_spec_hash: 54b44da68df22eb0ea99f2bc564667a2
config_hash: ac8326134e692f3f3bdec82396bbec80
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-0f374e78a0212145a2f55a55dfc39a612de19094d5152ae26b1bc74b01b9e343.yml
openapi_spec_hash: ec888cdaebea979a2cd6231ca04c346c
config_hash: 01dfc901bb6d54b0f582155d779bcbe0
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
# Changelog

## 0.125.0 (2026-05-06)

Full Changelog: [v0.124.0...v0.125.0](https://github.com/lithic-com/lithic-java/compare/v0.124.0...v0.125.0)

### Features

* **api:** add AMEX to Network enum in settlement params and models ([638084a](https://github.com/lithic-com/lithic-java/commit/638084a329e3e2da55a350e950f6752e185b5ae4))
* **api:** add CARD_TRANSACTION_UPDATE event stream and conditional action to auth rules ([064ee52](https://github.com/lithic-com/lithic-java/commit/064ee523f9ced5648ad252fd7a625709b61ad1f4))
* **api:** add IS_NEW_MERCHANT attribute to authorization action parameters ([6a44f6b](https://github.com/lithic-com/lithic-java/commit/6a44f6b77dc5749fe3e39e6deee4e0e2de316efe))
* **client:** improve logging ([bb282c7](https://github.com/lithic-com/lithic-java/commit/bb282c75d62080e57456309b7b0c510dab94f5ca))
* **client:** more robust error parsing ([af54a46](https://github.com/lithic-com/lithic-java/commit/af54a46bbbdbb176835e48074572df830dbc39c2))
* **client:** support proxy authentication ([183501b](https://github.com/lithic-com/lithic-java/commit/183501b5aa6bde88a884b70a370f848b29cdcd8b))
* support setting headers via env ([0493d0a](https://github.com/lithic-com/lithic-java/commit/0493d0ad4f3d8e45f35b652e670e505bcbfaf67a))


### Bug Fixes

* **types:** add EMPTY exemption type, make fields optional in Account/Card/NonPciCard ([2a2a00a](https://github.com/lithic-com/lithic-java/commit/2a2a00acc9cd3a92991a7ae50b6e02cdebaa930d))


### Performance Improvements

* **client:** create one json mapper ([1743358](https://github.com/lithic-com/lithic-java/commit/1743358e72d12f38c5012963276deef9f78831d9))


### Chores

* remove duplicated dokka setup ([1728d1a](https://github.com/lithic-com/lithic-java/commit/1728d1a87fbefc15fd86228d122d3a6e2ec53afb))


### Documentation

* **api:** improve event_tokens and transaction_token field docs in SettlementDetail ([1ccf96d](https://github.com/lithic-com/lithic-java/commit/1ccf96d80d888a5c0756ef5a115dd3e810f9f25b))
* **api:** update exp_month/exp_year descriptions in card create/renew ([36c34a0](https://github.com/lithic-com/lithic-java/commit/36c34a04d23013e6504d322f84ed85506ab46220))
* clarify forwards compat behavior ([746bf4a](https://github.com/lithic-com/lithic-java/commit/746bf4a1c7e5de2f4c498d411422827c2107ffc5))

## 0.124.0 (2026-04-20)

Full Changelog: [v0.123.0...v0.124.0](https://github.com/lithic-com/lithic-java/compare/v0.123.0...v0.124.0)
Expand Down
44 changes: 36 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<!-- x-release-please-start-version -->

[![Maven Central](https://img.shields.io/maven-central/v/com.lithic.api/lithic-java)](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.124.0)
[![javadoc](https://javadoc.io/badge2/com.lithic.api/lithic-java/0.124.0/javadoc.svg)](https://javadoc.io/doc/com.lithic.api/lithic-java/0.124.0)
[![Maven Central](https://img.shields.io/maven-central/v/com.lithic.api/lithic-java)](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.125.0)
[![javadoc](https://javadoc.io/badge2/com.lithic.api/lithic-java/0.125.0/javadoc.svg)](https://javadoc.io/doc/com.lithic.api/lithic-java/0.125.0)

<!-- x-release-please-end -->

Expand All @@ -22,7 +22,7 @@ Use the Lithic MCP Server to enable AI assistants to interact with this API, all

<!-- x-release-please-start-version -->

The REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.lithic.api/lithic-java/0.124.0).
The REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.lithic.api/lithic-java/0.125.0).

<!-- x-release-please-end -->

Expand All @@ -33,7 +33,7 @@ The REST API documentation can be found on [docs.lithic.com](https://docs.lithic
### Gradle

```kotlin
implementation("com.lithic.api:lithic-java:0.124.0")
implementation("com.lithic.api:lithic-java:0.125.0")
```

### Maven
Expand All @@ -42,7 +42,7 @@ implementation("com.lithic.api:lithic-java:0.124.0")
<dependency>
<groupId>com.lithic.api</groupId>
<artifactId>lithic-java</artifactId>
<version>0.124.0</version>
<version>0.125.0</version>
</dependency>
```

Expand Down Expand Up @@ -349,8 +349,6 @@ while (true) {

## Logging

The SDK uses the standard [OkHttp logging interceptor](https://github.com/square/okhttp/tree/master/okhttp-logging-interceptor).

Enable logging by setting the `LITHIC_LOG` environment variable to `info`:

```sh
Expand All @@ -363,6 +361,19 @@ Or to `debug` for more verbose logging:
export LITHIC_LOG=debug
```

Or configure the client manually using the `logLevel` method:

```java
import com.lithic.api.client.LithicClient;
import com.lithic.api.client.okhttp.LithicOkHttpClient;
import com.lithic.api.core.LogLevel;

LithicClient client = LithicOkHttpClient.builder()
.fromEnv()
.logLevel(LogLevel.INFO)
.build();
```

## Webhooks

Lithic uses webhooks to notify your application when events happen. The SDK provides methods for verifying webhook signatures and parsing event payloads.
Expand Down Expand Up @@ -500,6 +511,21 @@ LithicClient client = LithicOkHttpClient.builder()
.build();
```

If the proxy responds with `407 Proxy Authentication Required`, supply credentials by also configuring `proxyAuthenticator`:

```java
import com.lithic.api.client.LithicClient;
import com.lithic.api.client.okhttp.LithicOkHttpClient;
import com.lithic.api.core.http.ProxyAuthenticator;

LithicClient client = LithicOkHttpClient.builder()
.fromEnv()
.proxy(...)
// Or a custom implementation of `ProxyAuthenticator`.
.proxyAuthenticator(ProxyAuthenticator.basic("username", "password"))
.build();
```

### Connection pooling

To customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods:
Expand Down Expand Up @@ -751,7 +777,9 @@ In rare cases, the API may return a response that doesn't match the expected typ

By default, the SDK will not throw an exception in this case. It will throw [`LithicInvalidDataException`](lithic-java-core/src/main/kotlin/com/lithic/api/errors/LithicInvalidDataException.kt) only if you directly access the property.

If you would prefer to check that the response is completely well-typed upfront, then either call `validate()`:
Validating the response is _not_ forwards compatible with new types from the API for existing fields.

If you would still prefer to check that the response is completely well-typed upfront, then either call `validate()`:

```java
import com.lithic.api.models.Card;
Expand Down
3 changes: 1 addition & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repositories {

allprojects {
group = "com.lithic.api"
version = "0.124.0" // x-release-please-version
version = "0.125.0" // x-release-please-version
}

subprojects {
Expand All @@ -21,7 +21,6 @@ subprojects {
group = "Verification"
description = "Verifies all source files are formatted."
}
apply(plugin = "org.jetbrains.dokka")
}

subprojects {
Expand Down
1 change: 0 additions & 1 deletion lithic-java-client-okhttp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ dependencies {
api(project(":lithic-java-core"))

implementation("com.squareup.okhttp3:okhttp:4.12.0")
implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")

testImplementation(kotlin("test"))
testImplementation("org.assertj:assertj-core:3.27.7")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import com.fasterxml.jackson.databind.json.JsonMapper
import com.lithic.api.client.LithicClient
import com.lithic.api.client.LithicClientImpl
import com.lithic.api.core.ClientOptions
import com.lithic.api.core.LogLevel
import com.lithic.api.core.Sleeper
import com.lithic.api.core.Timeout
import com.lithic.api.core.http.AsyncStreamResponse
import com.lithic.api.core.http.Headers
import com.lithic.api.core.http.HttpClient
import com.lithic.api.core.http.ProxyAuthenticator
import com.lithic.api.core.http.QueryParams
import com.lithic.api.core.jsonMapper
import java.net.Proxy
Expand Down Expand Up @@ -49,6 +51,7 @@ class LithicOkHttpClient private constructor() {
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
private var dispatcherExecutorService: ExecutorService? = null
private var proxy: Proxy? = null
private var proxyAuthenticator: ProxyAuthenticator? = null
private var maxIdleConnections: Int? = null
private var keepAliveDuration: Duration? = null
private var sslSocketFactory: SSLSocketFactory? = null
Expand Down Expand Up @@ -79,6 +82,20 @@ class LithicOkHttpClient private constructor() {
/** Alias for calling [Builder.proxy] with `proxy.orElse(null)`. */
fun proxy(proxy: Optional<Proxy>) = proxy(proxy.getOrNull())

/**
* Provides credentials when an HTTP proxy responds with `407 Proxy Authentication
* Required`.
*/
fun proxyAuthenticator(proxyAuthenticator: ProxyAuthenticator?) = apply {
this.proxyAuthenticator = proxyAuthenticator
}

/**
* Alias for calling [Builder.proxyAuthenticator] with `proxyAuthenticator.orElse(null)`.
*/
fun proxyAuthenticator(proxyAuthenticator: Optional<ProxyAuthenticator>) =
proxyAuthenticator(proxyAuthenticator.getOrNull())

/**
* The maximum number of idle connections kept by the underlying OkHttp connection pool.
*
Expand Down Expand Up @@ -236,6 +253,9 @@ class LithicOkHttpClient private constructor() {
/**
* Whether to call `validate` on every response before returning it.
*
* Setting this to `true` is _not_ forwards compatible with new types from the API for
* existing fields.
*
* Defaults to false, which means the shape of the response will not be validated upfront.
* Instead, validation will only occur for the parts of the response that are accessed.
*/
Expand Down Expand Up @@ -277,6 +297,15 @@ class LithicOkHttpClient private constructor() {
*/
fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) }

/**
* The level at which to log request and response information.
*
* [fromEnv] will set the level from environment variables. See [LogLevel.fromEnv].
*
* Defaults to [LogLevel.fromEnv].
*/
fun logLevel(logLevel: LogLevel) = apply { clientOptions.logLevel(logLevel) }

fun apiKey(apiKey: String) = apply { clientOptions.apiKey(apiKey) }

fun webhookSecret(webhookSecret: String?) = apply {
Expand Down Expand Up @@ -386,6 +415,7 @@ class LithicOkHttpClient private constructor() {
OkHttpClient.builder()
.timeout(clientOptions.timeout())
.proxy(proxy)
.proxyAuthenticator(proxyAuthenticator)
.maxIdleConnections(maxIdleConnections)
.keepAliveDuration(keepAliveDuration)
.dispatcherExecutorService(dispatcherExecutorService)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import com.fasterxml.jackson.databind.json.JsonMapper
import com.lithic.api.client.LithicClientAsync
import com.lithic.api.client.LithicClientAsyncImpl
import com.lithic.api.core.ClientOptions
import com.lithic.api.core.LogLevel
import com.lithic.api.core.Sleeper
import com.lithic.api.core.Timeout
import com.lithic.api.core.http.AsyncStreamResponse
import com.lithic.api.core.http.Headers
import com.lithic.api.core.http.HttpClient
import com.lithic.api.core.http.ProxyAuthenticator
import com.lithic.api.core.http.QueryParams
import com.lithic.api.core.jsonMapper
import java.net.Proxy
Expand Down Expand Up @@ -49,6 +51,7 @@ class LithicOkHttpClientAsync private constructor() {
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
private var dispatcherExecutorService: ExecutorService? = null
private var proxy: Proxy? = null
private var proxyAuthenticator: ProxyAuthenticator? = null
private var maxIdleConnections: Int? = null
private var keepAliveDuration: Duration? = null
private var sslSocketFactory: SSLSocketFactory? = null
Expand Down Expand Up @@ -79,6 +82,20 @@ class LithicOkHttpClientAsync private constructor() {
/** Alias for calling [Builder.proxy] with `proxy.orElse(null)`. */
fun proxy(proxy: Optional<Proxy>) = proxy(proxy.getOrNull())

/**
* Provides credentials when an HTTP proxy responds with `407 Proxy Authentication
* Required`.
*/
fun proxyAuthenticator(proxyAuthenticator: ProxyAuthenticator?) = apply {
this.proxyAuthenticator = proxyAuthenticator
}

/**
* Alias for calling [Builder.proxyAuthenticator] with `proxyAuthenticator.orElse(null)`.
*/
fun proxyAuthenticator(proxyAuthenticator: Optional<ProxyAuthenticator>) =
proxyAuthenticator(proxyAuthenticator.getOrNull())

/**
* The maximum number of idle connections kept by the underlying OkHttp connection pool.
*
Expand Down Expand Up @@ -236,6 +253,9 @@ class LithicOkHttpClientAsync private constructor() {
/**
* Whether to call `validate` on every response before returning it.
*
* Setting this to `true` is _not_ forwards compatible with new types from the API for
* existing fields.
*
* Defaults to false, which means the shape of the response will not be validated upfront.
* Instead, validation will only occur for the parts of the response that are accessed.
*/
Expand Down Expand Up @@ -277,6 +297,15 @@ class LithicOkHttpClientAsync private constructor() {
*/
fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) }

/**
* The level at which to log request and response information.
*
* [fromEnv] will set the level from environment variables. See [LogLevel.fromEnv].
*
* Defaults to [LogLevel.fromEnv].
*/
fun logLevel(logLevel: LogLevel) = apply { clientOptions.logLevel(logLevel) }

fun apiKey(apiKey: String) = apply { clientOptions.apiKey(apiKey) }

fun webhookSecret(webhookSecret: String?) = apply {
Expand Down Expand Up @@ -386,6 +415,7 @@ class LithicOkHttpClientAsync private constructor() {
OkHttpClient.builder()
.timeout(clientOptions.timeout())
.proxy(proxy)
.proxyAuthenticator(proxyAuthenticator)
.maxIdleConnections(maxIdleConnections)
.keepAliveDuration(keepAliveDuration)
.dispatcherExecutorService(dispatcherExecutorService)
Expand Down
Loading
Loading