Skip to content

Latest commit

 

History

History
231 lines (173 loc) · 39 KB

File metadata and controls

231 lines (173 loc) · 39 KB

Clients

Overview

Available Operations

  • list - List clients
  • get - Get client

list

Retrieve a list of all clients linked to your account.

The results are paginated.

Example Usage

package hello.world;

import com.mollie.mollie.Client;
import com.mollie.mollie.models.components.Security;
import com.mollie.mollie.models.errors.ErrorResponse;
import com.mollie.mollie.models.operations.ListClientsResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ErrorResponse, Exception {

        Client sdk = Client.builder()
                .security(Security.builder()
                    .organizationAccessToken(System.getenv().getOrDefault("ORGANIZATION_ACCESS_TOKEN", ""))
                    .build())
            .build();


        sdk.clients().list()
                .embed("organization")
                .from("org_12345678")
                .limit(50L)
                .idempotencyKey("123e4567-e89b-12d3-a456-426")
                .callAsStream()
                .forEach((ListClientsResponse item) -> {
                   // handle page
                });

    }
}

Parameters

Parameter Type Required Description Example
embed JsonNullable<String> This endpoint allows embedding related API items by appending the
following values via the embed query string parameter.

* organization: Include the organization of the client. Available for signuplink partners, or for oauth
partners with the organizations.read scope.
* onboarding: Include the onboarding status of the client. Available for signuplink partners, or for oauth
partners with the onboarding.read scope.
* capabilities: Include the capabilities of the client organization.
Available for oauth partners with the onboarding.read scope.
from JsonNullable<String> Provide an ID to start the result set from the item with the given ID and onwards. This allows you to paginate the
result set.
limit JsonNullable<Long> The maximum number of items to return. Defaults to 50 items. 50
idempotencyKey Optional<String> A unique key to ensure idempotent requests. This key should be a UUID v4 string. 123e4567-e89b-12d3-a456-426

Response

ListClientsResponse

Errors

Error Type Status Code Content Type
models/errors/ErrorResponse 400, 404 application/hal+json
models/errors/APIException 4XX, 5XX */*

get

Retrieve a single client by its ID.

Example Usage: get-client-200-1

package hello.world;

import com.mollie.mollie.Client;
import com.mollie.mollie.models.components.Security;
import com.mollie.mollie.models.errors.ErrorResponse;
import com.mollie.mollie.models.operations.GetClientResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ErrorResponse, Exception {

        Client sdk = Client.builder()
                .security(Security.builder()
                    .organizationAccessToken(System.getenv().getOrDefault("ORGANIZATION_ACCESS_TOKEN", ""))
                    .build())
            .build();

        GetClientResponse res = sdk.clients().get()
                .organizationId("org_1234567")
                .embed("organization")
                .idempotencyKey("123e4567-e89b-12d3-a456-426")
                .call();

        if (res.object().isPresent()) {
            System.out.println(res.object().get());
        }
    }
}

Example Usage: get-client-200-2

package hello.world;

import com.mollie.mollie.Client;
import com.mollie.mollie.models.components.Security;
import com.mollie.mollie.models.errors.ErrorResponse;
import com.mollie.mollie.models.operations.GetClientResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ErrorResponse, Exception {

        Client sdk = Client.builder()
                .security(Security.builder()
                    .organizationAccessToken(System.getenv().getOrDefault("ORGANIZATION_ACCESS_TOKEN", ""))
                    .build())
            .build();

        GetClientResponse res = sdk.clients().get()
                .organizationId("org_1234567")
                .embed("organization")
                .idempotencyKey("123e4567-e89b-12d3-a456-426")
                .call();

        if (res.object().isPresent()) {
            System.out.println(res.object().get());
        }
    }
}

Example Usage: get-client-200-3

package hello.world;

import com.mollie.mollie.Client;
import com.mollie.mollie.models.components.Security;
import com.mollie.mollie.models.errors.ErrorResponse;
import com.mollie.mollie.models.operations.GetClientResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ErrorResponse, Exception {

        Client sdk = Client.builder()
                .security(Security.builder()
                    .organizationAccessToken(System.getenv().getOrDefault("ORGANIZATION_ACCESS_TOKEN", ""))
                    .build())
            .build();

        GetClientResponse res = sdk.clients().get()
                .organizationId("org_1234567")
                .embed("organization")
                .idempotencyKey("123e4567-e89b-12d3-a456-426")
                .call();

        if (res.object().isPresent()) {
            System.out.println(res.object().get());
        }
    }
}

Example Usage: get-client-200-4

package hello.world;

import com.mollie.mollie.Client;
import com.mollie.mollie.models.components.Security;
import com.mollie.mollie.models.errors.ErrorResponse;
import com.mollie.mollie.models.operations.GetClientResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ErrorResponse, Exception {

        Client sdk = Client.builder()
                .security(Security.builder()
                    .organizationAccessToken(System.getenv().getOrDefault("ORGANIZATION_ACCESS_TOKEN", ""))
                    .build())
            .build();

        GetClientResponse res = sdk.clients().get()
                .organizationId("org_1234567")
                .embed("organization")
                .idempotencyKey("123e4567-e89b-12d3-a456-426")
                .call();

        if (res.object().isPresent()) {
            System.out.println(res.object().get());
        }
    }
}

Parameters

Parameter Type Required Description Example
organizationId String ✔️ Provide the ID of the related organization. org_1234567
embed JsonNullable<String> This endpoint allows embedding related API items by appending the following values via the embed query string
parameter.

* organization: Include the organization of the client. Available for signuplink partners, or for oauth
partners with the organizations.read scope.
* onboarding: Include the onboarding status of the client. Available for signuplink partners, or for oauth
partners with the onboarding.read scope.
* capabilities: Include the capabilities of the client organization.
Available for oauth partners with the onboarding.read scope.
idempotencyKey Optional<String> A unique key to ensure idempotent requests. This key should be a UUID v4 string. 123e4567-e89b-12d3-a456-426

Response

GetClientResponse

Errors

Error Type Status Code Content Type
models/errors/ErrorResponse 404 application/hal+json
models/errors/APIException 4XX, 5XX */*