Skip to main content

Client

ClientsClient exposes the identity and permissions of the authenticated (token-scoped) B2B client. It is the smallest domain client β€” one read-only method β€” and a good first call to confirm your credentials and signature are both correct before touching money movement.

Reach it either directly on RetornaClient or through client.clients() β€” both call the same code.

getMyClient()​

Returns identity and permission information for the client the current credentials belong to.

Signature​

public ClientResponse getMyClient()

Parameters​

This method takes no parameters.

Returns​

ClientResponse:

AccessorTypeMeaning
client()ClientInfoIdentity and permissions β€” see below.
funding()Map<String, Object>Opaque, nullable. Not documented further here; treat it as unstructured.

ClientInfo:

AccessorTypeMeaning
id()StringClient UUID.
client()StringInternal client key/slug.
name()StringDisplay name.
isActive()booleanWhether the client is active.
permissions()List<String>Granted permission strings.

Example​

import app.retorna.sdk.RetornaClient;
import app.retorna.sdk.RetornaClientBuilder;
import app.retorna.sdk.core.environment.RetornaEnvironment;
import app.retorna.sdk.models.client.ClientResponse;

RetornaClient client = new RetornaClientBuilder()
.environment(RetornaEnvironment.SANDBOX)
.clientId(System.getenv("RETORNA_CLIENT_ID"))
.clientSecret(System.getenv("RETORNA_CLIENT_SECRET"))
.privateKey(System.getenv("RETORNA_PRIVATE_KEY"))
.buildClient();

ClientResponse me = client.getMyClient();
System.out.printf("%s (active=%s) permissions=%s%n",
me.client().name(), me.client().isActive(), me.client().permissions());

Errors​

  • RetornaB2BException with codeEnum() one of: B2B_UNAUTHORIZED β€” token or signature rejected, B2B_COMPANY_NOT_FOUND, B2B_RATE_LIMITED β€” retryable, B2B_UNKNOWN. Check e.codeEnum().isRetryable().
  • RetornaAuthException β€” the OAuth2 token exchange itself failed.
  • RetornaSdkException β€” network failure or deserialization failure.

Notes​

  • If this call throws, the exception tells you whether the problem was your token (RetornaAuthException) or your request signature (RetornaB2BException with B2B_UNAUTHORIZED) β€” a good first thing to call when wiring up a new environment.
  • There is no public API reference page for this endpoint (it is not part of the published API reference).