RoutexAsyncClient
Java-friendly async facade for RoutexClient: every public method is exposed here as an instance method returning CompletableFuture. Kotlin callers should use RoutexClient directly; this class is intended for Java consumers and other JVM languages that integrate with CompletableFuture.
The conceptual model carries over from RoutexClient: each call is authorized by a typed Ticket (for example Ticket.Accounts) minted by the caller's backend (see Getting started), the bank-side identification uses a Credentials envelope (see Providing Credentials), and every service call yields a typed Response that is either a final Response.Result or an interrupt the caller resolves with the matching respond* / confirm* method before the flow can complete (see Handling interrupts).
Handling the result
Forward result.getAuthenticated().getJwt() to your backend, verify the signature with your YAXI API secret (the same key your backend uses to mint tickets), and act on the verified payload. See Verify results for backend snippets. result.getAuthenticated().decodeUnverified() is available for client-only display; its output must never reach a backend or drive a security-sensitive decision.
Persist result.getConnectionData(). Pass it back via Credentials.connectionData on a future call to skip prompts the original consent already covers, or hand it to your backend to drive non-interactive refreshes via RoutexRefreshAsyncClient.
Pass result.getSession() to subsequent calls in the same flow.
Usage
try (RoutexAsyncClient client = new RoutexAsyncClient()) {
CompletableFuture<Response<AccountsResult>> future =
client.accounts(ticket, credentials, fields);
future.whenComplete(
(response, error) -> {
if (error != null) {
// error is the original exception, not wrapped in CompletionException.
handleFailure(error);
return;
}
if (response instanceof Response.Result<AccountsResult> result) {
// forward result.getAuthenticated().getJwt() to your backend
}
// also handle Response.Dialog / Response.Redirect / Response.RedirectHandle
});
}Calling CompletableFuture.get / CompletableFuture.join instead rewraps failures in ExecutionException (get) or CompletionException (join); unwrap with e.getCause() to recover the underlying exception (a RoutexError subclass mapped from the server's typed error response, see Errors; RoutexClientError.MalformedResponse; AuthenticatedDecodeError; or an I/O exception).
Lifecycle
The supplied Executor (default ForkJoinPool.commonPool) backs every emitted future. close cancels the underlying coroutine scope: in-flight futures complete exceptionally with CancellationException, and subsequent calls return failed futures. Instances are safe to share across threads.
Constructors
Construct a client.
Convenience overload that parses baseUrl as a Ktor Url.
Properties
Functions
Invoke the accounts service: list accounts (and selected fields) reachable through credentials.
Invoke the balances service: fetch current balances for accounts.
Invoke the collect-payment service: identify the debtor and prepare a payment-initiation flow.
Continue an accounts flow paused on a confirmation Response.Dialog, Response.Redirect, or Response.RedirectHandle.
Continue a balances flow paused on a confirmation Response.Dialog, Response.Redirect, or Response.RedirectHandle.
Continue a collect-payment flow paused on a confirmation Response.Dialog, Response.Redirect, or Response.RedirectHandle.
Continue a transactions flow paused on a confirmation Response.Dialog, Response.Redirect, or Response.RedirectHandle.
Continue a transfer flow paused on a confirmation Response.Dialog, Response.Redirect, or Response.RedirectHandle.
Fetch metadata for a single service connection.
Finalize a Response.RedirectHandle by registering redirectUriValue as the landing URI for handle.
Continue an accounts flow by submitting the user's answer to a Response.Dialog.
Continue a balances flow by submitting the user's answer to a Response.Dialog.
Continue a collect-payment flow by submitting the user's answer to a Response.Dialog.
Continue a transactions flow by submitting the user's answer to a Response.Dialog.
Continue a transfer flow by submitting the user's answer to a Response.Dialog.
Search for service connections (banks and other providers).
Set the redirect URI for subsequent service requests, or pass null to clear it.
Authenticated TEE system version learned during settlement of ticket's key-settlement session.
Invoke the transactions service: fetch the booked-and-pending transaction list authorized by credentials.