- create - Create profile
- list - List profiles
- get - Get profile
- update - Update profile
- delete - Delete profile
- getCurrent - Get current profile
Create a profile to process payments on.
Profiles are required for payment processing. Normally they are created via the Mollie dashboard. Alternatively, you can use this endpoint to automate profile creation.
package hello.world;
import com.mollie.mollie.Client;
import com.mollie.mollie.models.components.ProfileRequest;
import com.mollie.mollie.models.components.Security;
import com.mollie.mollie.models.errors.ErrorResponse;
import com.mollie.mollie.models.operations.CreateProfileResponse;
import java.lang.Exception;
import java.util.List;
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();
CreateProfileResponse res = sdk.profiles().create()
.idempotencyKey("123e4567-e89b-12d3-a456-426")
.profileRequest(ProfileRequest.builder()
.name("My website name")
.website("https://example.com")
.email("test@mollie.com")
.phone("+31208202070")
.description("My website description")
.countriesOfActivity(List.of(
"NL",
"GB"))
.businessCategory("OTHER_MERCHANDISE")
.build())
.call();
if (res.profileResponse().isPresent()) {
System.out.println(res.profileResponse().get());
}
}
}package hello.world;
import com.mollie.mollie.Client;
import com.mollie.mollie.models.components.ProfileRequest;
import com.mollie.mollie.models.components.Security;
import com.mollie.mollie.models.errors.ErrorResponse;
import com.mollie.mollie.models.operations.CreateProfileResponse;
import java.lang.Exception;
import java.util.List;
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();
CreateProfileResponse res = sdk.profiles().create()
.idempotencyKey("123e4567-e89b-12d3-a456-426")
.profileRequest(ProfileRequest.builder()
.name("My website name")
.website("https://example.com")
.email("test@mollie.com")
.phone("+31208202070")
.description("My website description")
.countriesOfActivity(List.of(
"NL",
"GB"))
.businessCategory("OTHER_MERCHANDISE")
.build())
.call();
if (res.profileResponse().isPresent()) {
System.out.println(res.profileResponse().get());
}
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
idempotencyKey |
Optional<String> | ➖ | A unique key to ensure idempotent requests. This key should be a UUID v4 string. | 123e4567-e89b-12d3-a456-426 |
profileRequest |
ProfileRequest | ✔️ | N/A |
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/ErrorResponse | 403, 422 | application/hal+json |
| models/errors/APIException | 4XX, 5XX | */* |
Retrieve a list of all of your profiles.
The results are paginated.
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.ListProfilesResponse;
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.profiles().list()
.from("pfl_QkEhN94Ba")
.limit(50L)
.idempotencyKey("123e4567-e89b-12d3-a456-426")
.callAsStream()
.forEach((ListProfilesResponse item) -> {
// handle page
});
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
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 |
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/ErrorResponse | 400 | application/hal+json |
| models/errors/APIException | 4XX, 5XX | */* |
Retrieve a single profile by its ID.
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.GetProfileResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ErrorResponse, Exception {
Client sdk = Client.builder()
.testmode(false)
.security(Security.builder()
.organizationAccessToken(System.getenv().getOrDefault("ORGANIZATION_ACCESS_TOKEN", ""))
.build())
.build();
GetProfileResponse res = sdk.profiles().get()
.profileId("pfl_5B8cwPMGnU")
.idempotencyKey("123e4567-e89b-12d3-a456-426")
.call();
if (res.profileResponse().isPresent()) {
System.out.println(res.profileResponse().get());
}
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
profileId |
String | ✔️ | Provide the ID of the related profile. | pfl_5B8cwPMGnU |
testmode |
Optional<Boolean> | ➖ | You can enable test mode by setting the testmode query parameter to true.Test entities cannot be retrieved when the endpoint is set to live mode, and vice versa. |
|
idempotencyKey |
Optional<String> | ➖ | A unique key to ensure idempotent requests. This key should be a UUID v4 string. | 123e4567-e89b-12d3-a456-426 |
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/ErrorResponse | 404, 410 | application/hal+json |
| models/errors/APIException | 4XX, 5XX | */* |
Update an existing profile.
Profiles are required for payment processing. Normally they are created and updated via the Mollie dashboard. Alternatively, you can use this endpoint to automate profile management.
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.UpdateProfileRequestBody;
import com.mollie.mollie.models.operations.UpdateProfileResponse;
import java.lang.Exception;
import java.util.List;
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();
UpdateProfileResponse res = sdk.profiles().update()
.profileId("pfl_5B8cwPMGnU")
.idempotencyKey("123e4567-e89b-12d3-a456-426")
.requestBody(UpdateProfileRequestBody.builder()
.name("My new website name")
.website("https://example.com")
.email("test@mollie.com")
.phone("+31208202071")
.description("My website description")
.countriesOfActivity(List.of(
"NL",
"GB"))
.businessCategory("OTHER_MERCHANDISE")
.build())
.call();
if (res.profileResponse().isPresent()) {
System.out.println(res.profileResponse().get());
}
}
}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.UpdateProfileRequestBody;
import com.mollie.mollie.models.operations.UpdateProfileResponse;
import java.lang.Exception;
import java.util.List;
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();
UpdateProfileResponse res = sdk.profiles().update()
.profileId("pfl_5B8cwPMGnU")
.idempotencyKey("123e4567-e89b-12d3-a456-426")
.requestBody(UpdateProfileRequestBody.builder()
.name("My new website name")
.website("https://example.com")
.email("test@mollie.com")
.phone("+31208202071")
.description("My website description")
.countriesOfActivity(List.of(
"NL",
"GB"))
.businessCategory("OTHER_MERCHANDISE")
.build())
.call();
if (res.profileResponse().isPresent()) {
System.out.println(res.profileResponse().get());
}
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
profileId |
String | ✔️ | Provide the ID of the related profile. | pfl_5B8cwPMGnU |
idempotencyKey |
Optional<String> | ➖ | A unique key to ensure idempotent requests. This key should be a UUID v4 string. | 123e4567-e89b-12d3-a456-426 |
requestBody |
UpdateProfileRequestBody | ✔️ | N/A |
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/ErrorResponse | 403, 404, 410, 422 | application/hal+json |
| models/errors/APIException | 4XX, 5XX | */* |
Delete a profile. A deleted profile and its related credentials can no longer be used for accepting payments.
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.DeleteProfileResponse;
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();
DeleteProfileResponse res = sdk.profiles().delete()
.profileId("pfl_5B8cwPMGnU")
.idempotencyKey("123e4567-e89b-12d3-a456-426")
.call();
// handle response
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
profileId |
String | ✔️ | Provide the ID of the related profile. | pfl_5B8cwPMGnU |
idempotencyKey |
Optional<String> | ➖ | A unique key to ensure idempotent requests. This key should be a UUID v4 string. | 123e4567-e89b-12d3-a456-426 |
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/ErrorResponse | 404, 410 | application/hal+json |
| models/errors/APIException | 4XX, 5XX | */* |
Retrieve the currently authenticated profile. A convenient alias of the Get profile endpoint.
For a complete reference of the profile object, refer to the Get profile endpoint documentation.
package hello.world;
import com.mollie.mollie.Client;
import com.mollie.mollie.models.components.Security;
import com.mollie.mollie.models.operations.GetCurrentProfileResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
Client sdk = Client.builder()
.security(Security.builder()
.apiKey(System.getenv().getOrDefault("API_KEY", ""))
.build())
.build();
GetCurrentProfileResponse res = sdk.profiles().getCurrent()
.idempotencyKey("123e4567-e89b-12d3-a456-426")
.call();
if (res.profileResponse().isPresent()) {
System.out.println(res.profileResponse().get());
}
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
idempotencyKey |
Optional<String> | ➖ | A unique key to ensure idempotent requests. This key should be a UUID v4 string. | 123e4567-e89b-12d3-a456-426 |
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/APIException | 4XX, 5XX | */* |