(auth().v1())
Create client
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.operations.CreateClientResponse;
import com.formance.formance_sdk.models.shared.CreateClientRequest;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
CreateClientRequest req = CreateClientRequest.builder()
.name("<value>")
.build();
CreateClientResponse res = sdk.auth().v1().createClient()
.request(req)
.call();
if (res.createClientResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
CreateClientRequest |
✔️ |
The request object to use for the request. |
CreateClientResponse
Error Type |
Status Code |
Content Type |
models/errors/SDKError |
4XX, 5XX |
*/* |
Add a secret to a client
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.operations.CreateSecretRequest;
import com.formance.formance_sdk.models.operations.CreateSecretResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
CreateSecretRequest req = CreateSecretRequest.builder()
.clientId("<id>")
.build();
CreateSecretResponse res = sdk.auth().v1().createSecret()
.request(req)
.call();
if (res.createSecretResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
CreateSecretRequest |
✔️ |
The request object to use for the request. |
CreateSecretResponse
Error Type |
Status Code |
Content Type |
models/errors/SDKError |
4XX, 5XX |
*/* |
Delete client
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.operations.DeleteClientRequest;
import com.formance.formance_sdk.models.operations.DeleteClientResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
DeleteClientRequest req = DeleteClientRequest.builder()
.clientId("<id>")
.build();
DeleteClientResponse res = sdk.auth().v1().deleteClient()
.request(req)
.call();
// handle response
}
}
Parameter |
Type |
Required |
Description |
request |
DeleteClientRequest |
✔️ |
The request object to use for the request. |
DeleteClientResponse
Error Type |
Status Code |
Content Type |
models/errors/SDKError |
4XX, 5XX |
*/* |
Delete a secret from a client
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.operations.DeleteSecretRequest;
import com.formance.formance_sdk.models.operations.DeleteSecretResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
DeleteSecretRequest req = DeleteSecretRequest.builder()
.clientId("<id>")
.secretId("<id>")
.build();
DeleteSecretResponse res = sdk.auth().v1().deleteSecret()
.request(req)
.call();
// handle response
}
}
Parameter |
Type |
Required |
Description |
request |
DeleteSecretRequest |
✔️ |
The request object to use for the request. |
DeleteSecretResponse
Error Type |
Status Code |
Content Type |
models/errors/SDKError |
4XX, 5XX |
*/* |
Retrieve OpenID connect well-knowns.
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.operations.GetOIDCWellKnownsResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
GetOIDCWellKnownsResponse res = sdk.auth().v1().getOIDCWellKnowns()
.call();
// handle response
}
}
GetOIDCWellKnownsResponse
Error Type |
Status Code |
Content Type |
models/errors/SDKError |
4XX, 5XX |
*/* |
Get server info
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.operations.GetServerInfoResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
GetServerInfoResponse res = sdk.auth().v1().getServerInfo()
.call();
if (res.serverInfo().isPresent()) {
// handle response
}
}
}
GetServerInfoResponse
Error Type |
Status Code |
Content Type |
models/errors/SDKError |
4XX, 5XX |
*/* |
List clients
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.operations.ListClientsResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
ListClientsResponse res = sdk.auth().v1().listClients()
.call();
if (res.listClientsResponse().isPresent()) {
// handle response
}
}
}
ListClientsResponse
Error Type |
Status Code |
Content Type |
models/errors/SDKError |
4XX, 5XX |
*/* |
List users
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.operations.ListUsersResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
ListUsersResponse res = sdk.auth().v1().listUsers()
.call();
if (res.listUsersResponse().isPresent()) {
// handle response
}
}
}
ListUsersResponse
Error Type |
Status Code |
Content Type |
models/errors/SDKError |
4XX, 5XX |
*/* |
Read client
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.operations.ReadClientRequest;
import com.formance.formance_sdk.models.operations.ReadClientResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
ReadClientRequest req = ReadClientRequest.builder()
.clientId("<id>")
.build();
ReadClientResponse res = sdk.auth().v1().readClient()
.request(req)
.call();
if (res.readClientResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
ReadClientRequest |
✔️ |
The request object to use for the request. |
ReadClientResponse
Error Type |
Status Code |
Content Type |
models/errors/SDKError |
4XX, 5XX |
*/* |
Read user
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.operations.ReadUserRequest;
import com.formance.formance_sdk.models.operations.ReadUserResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
ReadUserRequest req = ReadUserRequest.builder()
.userId("<id>")
.build();
ReadUserResponse res = sdk.auth().v1().readUser()
.request(req)
.call();
if (res.readUserResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
ReadUserRequest |
✔️ |
The request object to use for the request. |
ReadUserResponse
Error Type |
Status Code |
Content Type |
models/errors/SDKError |
4XX, 5XX |
*/* |
Update client
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.operations.UpdateClientRequest;
import com.formance.formance_sdk.models.operations.UpdateClientResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
UpdateClientRequest req = UpdateClientRequest.builder()
.clientId("<id>")
.build();
UpdateClientResponse res = sdk.auth().v1().updateClient()
.request(req)
.call();
if (res.updateClientResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
UpdateClientRequest |
✔️ |
The request object to use for the request. |
UpdateClientResponse
Error Type |
Status Code |
Content Type |
models/errors/SDKError |
4XX, 5XX |
*/* |