Skip to content

Latest commit

 

History

History
930 lines (795 loc) · 63.8 KB

File metadata and controls

930 lines (795 loc) · 63.8 KB

PaymentLinks

Overview

Available Operations

create

With the Payment links API you can generate payment links that by default, unlike regular payments, do not expire. The payment link can be shared with your customers and will redirect them to them the payment page where they can complete the payment. A payment will only be created once the customer initiates the payment.

Example Usage: create-payment-link-201-1

package hello.world;

import com.mollie.mollie.Client;
import com.mollie.mollie.models.components.*;
import com.mollie.mollie.models.errors.ErrorResponse;
import com.mollie.mollie.models.operations.*;
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()
                    .apiKey(System.getenv().getOrDefault("API_KEY", ""))
                    .build())
            .build();

        CreatePaymentLinkResponse res = sdk.paymentLinks().create()
                .idempotencyKey("123e4567-e89b-12d3-a456-426")
                .requestBody(CreatePaymentLinkRequestBody.builder()
                    .description("Chess Board")
                    .amount(AmountNullable.builder()
                        .currency("EUR")
                        .value("10.00")
                        .build())
                    .minimumAmount(AmountNullable.builder()
                        .currency("EUR")
                        .value("10.00")
                        .build())
                    .redirectUrl("https://webshop.example.org/payment-links/redirect/")
                    .webhookUrl("https://webshop.example.org/payment-links/webhook/")
                    .lines(List.of(
                        PaymentLineItem.builder()
                            .description("LEGO 4440 Forest Police Station")
                            .quantity(1L)
                            .unitPrice(Amount.builder()
                                .currency("EUR")
                                .value("10.00")
                                .build())
                            .totalAmount(Amount.builder()
                                .currency("EUR")
                                .value("10.00")
                                .build())
                            .type(PaymentLineType.PHYSICAL)
                            .quantityUnit("pcs")
                            .discountAmount(Amount.builder()
                                .currency("EUR")
                                .value("10.00")
                                .build())
                            .vatRate("21.00")
                            .vatAmount(Amount.builder()
                                .currency("EUR")
                                .value("10.00")
                                .build())
                            .sku("9780241661628")
                            .categories(List.of(
                                LineCategories.MEAL,
                                LineCategories.ECO))
                            .imageUrl("https://...")
                            .productUrl("https://...")
                            .build()))
                    .billingAddress(PaymentAddress.builder()
                        .title("Mr.")
                        .givenName("Piet")
                        .familyName("Mondriaan")
                        .organizationName("Mollie B.V.")
                        .streetAndNumber("Keizersgracht 126")
                        .streetAdditional("Apt. 1")
                        .postalCode("1234AB")
                        .email("piet@example.org")
                        .phone("31208202070")
                        .city("Amsterdam")
                        .region("Noord-Holland")
                        .country("NL")
                        .build())
                    .shippingAddress(PaymentAddress.builder()
                        .title("Mr.")
                        .givenName("Piet")
                        .familyName("Mondriaan")
                        .organizationName("Mollie B.V.")
                        .streetAndNumber("Keizersgracht 126")
                        .streetAdditional("Apt. 1")
                        .postalCode("1234AB")
                        .email("piet@example.org")
                        .phone("31208202070")
                        .city("Amsterdam")
                        .region("Noord-Holland")
                        .country("NL")
                        .build())
                    .profileId("pfl_QkEhN94Ba")
                    .reusable(false)
                    .expiresAt("2025-12-24T11:00:16+00:00")
                    .allowedMethods(List.of(
                        PaymentLinkMethod.IDEAL))
                    .applicationFee(ApplicationFee.builder()
                        .amount(Amount.builder()
                            .currency("EUR")
                            .value("10.00")
                            .build())
                        .description("Platform fee")
                        .build())
                    .sequenceType(PaymentLinkSequenceType.ONEOFF)
                    .customerId("cst_XimFHuaEzd")
                    .testmode(false)
                    .build())
                .call();

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

Example Usage: create-payment-link-201-2

package hello.world;

import com.mollie.mollie.Client;
import com.mollie.mollie.models.components.*;
import com.mollie.mollie.models.errors.ErrorResponse;
import com.mollie.mollie.models.operations.*;
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()
                    .apiKey(System.getenv().getOrDefault("API_KEY", ""))
                    .build())
            .build();

        CreatePaymentLinkResponse res = sdk.paymentLinks().create()
                .idempotencyKey("123e4567-e89b-12d3-a456-426")
                .requestBody(CreatePaymentLinkRequestBody.builder()
                    .description("Chess Board")
                    .amount(AmountNullable.builder()
                        .currency("EUR")
                        .value("10.00")
                        .build())
                    .minimumAmount(AmountNullable.builder()
                        .currency("EUR")
                        .value("10.00")
                        .build())
                    .redirectUrl("https://webshop.example.org/payment-links/redirect/")
                    .webhookUrl("https://webshop.example.org/payment-links/webhook/")
                    .lines(List.of(
                        PaymentLineItem.builder()
                            .description("LEGO 4440 Forest Police Station")
                            .quantity(1L)
                            .unitPrice(Amount.builder()
                                .currency("EUR")
                                .value("10.00")
                                .build())
                            .totalAmount(Amount.builder()
                                .currency("EUR")
                                .value("10.00")
                                .build())
                            .type(PaymentLineType.PHYSICAL)
                            .quantityUnit("pcs")
                            .discountAmount(Amount.builder()
                                .currency("EUR")
                                .value("10.00")
                                .build())
                            .vatRate("21.00")
                            .vatAmount(Amount.builder()
                                .currency("EUR")
                                .value("10.00")
                                .build())
                            .sku("9780241661628")
                            .categories(List.of(
                                LineCategories.MEAL,
                                LineCategories.ECO))
                            .imageUrl("https://...")
                            .productUrl("https://...")
                            .build()))
                    .billingAddress(PaymentAddress.builder()
                        .title("Mr.")
                        .givenName("Piet")
                        .familyName("Mondriaan")
                        .organizationName("Mollie B.V.")
                        .streetAndNumber("Keizersgracht 126")
                        .streetAdditional("Apt. 1")
                        .postalCode("1234AB")
                        .email("piet@example.org")
                        .phone("31208202070")
                        .city("Amsterdam")
                        .region("Noord-Holland")
                        .country("NL")
                        .build())
                    .shippingAddress(PaymentAddress.builder()
                        .title("Mr.")
                        .givenName("Piet")
                        .familyName("Mondriaan")
                        .organizationName("Mollie B.V.")
                        .streetAndNumber("Keizersgracht 126")
                        .streetAdditional("Apt. 1")
                        .postalCode("1234AB")
                        .email("piet@example.org")
                        .phone("31208202070")
                        .city("Amsterdam")
                        .region("Noord-Holland")
                        .country("NL")
                        .build())
                    .profileId("pfl_QkEhN94Ba")
                    .reusable(false)
                    .expiresAt("2025-12-24T11:00:16+00:00")
                    .allowedMethods(List.of(
                        PaymentLinkMethod.IDEAL))
                    .applicationFee(ApplicationFee.builder()
                        .amount(Amount.builder()
                            .currency("EUR")
                            .value("10.00")
                            .build())
                        .description("Platform fee")
                        .build())
                    .sequenceType(PaymentLinkSequenceType.ONEOFF)
                    .customerId("cst_XimFHuaEzd")
                    .testmode(false)
                    .build())
                .call();

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

Example Usage: create-payment-link-201-3

package hello.world;

import com.mollie.mollie.Client;
import com.mollie.mollie.models.components.*;
import com.mollie.mollie.models.errors.ErrorResponse;
import com.mollie.mollie.models.operations.*;
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()
                    .apiKey(System.getenv().getOrDefault("API_KEY", ""))
                    .build())
            .build();

        CreatePaymentLinkResponse res = sdk.paymentLinks().create()
                .idempotencyKey("123e4567-e89b-12d3-a456-426")
                .requestBody(CreatePaymentLinkRequestBody.builder()
                    .description("Chess Board")
                    .amount(AmountNullable.builder()
                        .currency("EUR")
                        .value("10.00")
                        .build())
                    .minimumAmount(AmountNullable.builder()
                        .currency("EUR")
                        .value("10.00")
                        .build())
                    .redirectUrl("https://webshop.example.org/payment-links/redirect/")
                    .webhookUrl("https://webshop.example.org/payment-links/webhook/")
                    .lines(List.of(
                        PaymentLineItem.builder()
                            .description("LEGO 4440 Forest Police Station")
                            .quantity(1L)
                            .unitPrice(Amount.builder()
                                .currency("EUR")
                                .value("10.00")
                                .build())
                            .totalAmount(Amount.builder()
                                .currency("EUR")
                                .value("10.00")
                                .build())
                            .type(PaymentLineType.PHYSICAL)
                            .quantityUnit("pcs")
                            .discountAmount(Amount.builder()
                                .currency("EUR")
                                .value("10.00")
                                .build())
                            .vatRate("21.00")
                            .vatAmount(Amount.builder()
                                .currency("EUR")
                                .value("10.00")
                                .build())
                            .sku("9780241661628")
                            .categories(List.of(
                                LineCategories.MEAL,
                                LineCategories.ECO))
                            .imageUrl("https://...")
                            .productUrl("https://...")
                            .build()))
                    .billingAddress(PaymentAddress.builder()
                        .title("Mr.")
                        .givenName("Piet")
                        .familyName("Mondriaan")
                        .organizationName("Mollie B.V.")
                        .streetAndNumber("Keizersgracht 126")
                        .streetAdditional("Apt. 1")
                        .postalCode("1234AB")
                        .email("piet@example.org")
                        .phone("31208202070")
                        .city("Amsterdam")
                        .region("Noord-Holland")
                        .country("NL")
                        .build())
                    .shippingAddress(PaymentAddress.builder()
                        .title("Mr.")
                        .givenName("Piet")
                        .familyName("Mondriaan")
                        .organizationName("Mollie B.V.")
                        .streetAndNumber("Keizersgracht 126")
                        .streetAdditional("Apt. 1")
                        .postalCode("1234AB")
                        .email("piet@example.org")
                        .phone("31208202070")
                        .city("Amsterdam")
                        .region("Noord-Holland")
                        .country("NL")
                        .build())
                    .profileId("pfl_QkEhN94Ba")
                    .reusable(false)
                    .expiresAt("2025-12-24T11:00:16+00:00")
                    .allowedMethods(List.of(
                        PaymentLinkMethod.IDEAL))
                    .applicationFee(ApplicationFee.builder()
                        .amount(Amount.builder()
                            .currency("EUR")
                            .value("10.00")
                            .build())
                        .description("Platform fee")
                        .build())
                    .sequenceType(PaymentLinkSequenceType.ONEOFF)
                    .customerId("cst_XimFHuaEzd")
                    .testmode(false)
                    .build())
                .call();

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

Example Usage: create-payment-link-201-4

package hello.world;

import com.mollie.mollie.Client;
import com.mollie.mollie.models.components.*;
import com.mollie.mollie.models.errors.ErrorResponse;
import com.mollie.mollie.models.operations.*;
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()
                    .apiKey(System.getenv().getOrDefault("API_KEY", ""))
                    .build())
            .build();

        CreatePaymentLinkResponse res = sdk.paymentLinks().create()
                .idempotencyKey("123e4567-e89b-12d3-a456-426")
                .requestBody(CreatePaymentLinkRequestBody.builder()
                    .description("Chess Board")
                    .amount(AmountNullable.builder()
                        .currency("EUR")
                        .value("10.00")
                        .build())
                    .minimumAmount(AmountNullable.builder()
                        .currency("EUR")
                        .value("10.00")
                        .build())
                    .redirectUrl("https://webshop.example.org/payment-links/redirect/")
                    .webhookUrl("https://webshop.example.org/payment-links/webhook/")
                    .lines(List.of(
                        PaymentLineItem.builder()
                            .description("LEGO 4440 Forest Police Station")
                            .quantity(1L)
                            .unitPrice(Amount.builder()
                                .currency("EUR")
                                .value("10.00")
                                .build())
                            .totalAmount(Amount.builder()
                                .currency("EUR")
                                .value("10.00")
                                .build())
                            .type(PaymentLineType.PHYSICAL)
                            .quantityUnit("pcs")
                            .discountAmount(Amount.builder()
                                .currency("EUR")
                                .value("10.00")
                                .build())
                            .vatRate("21.00")
                            .vatAmount(Amount.builder()
                                .currency("EUR")
                                .value("10.00")
                                .build())
                            .sku("9780241661628")
                            .categories(List.of(
                                LineCategories.MEAL,
                                LineCategories.ECO))
                            .imageUrl("https://...")
                            .productUrl("https://...")
                            .build()))
                    .billingAddress(PaymentAddress.builder()
                        .title("Mr.")
                        .givenName("Piet")
                        .familyName("Mondriaan")
                        .organizationName("Mollie B.V.")
                        .streetAndNumber("Keizersgracht 126")
                        .streetAdditional("Apt. 1")
                        .postalCode("1234AB")
                        .email("piet@example.org")
                        .phone("31208202070")
                        .city("Amsterdam")
                        .region("Noord-Holland")
                        .country("NL")
                        .build())
                    .shippingAddress(PaymentAddress.builder()
                        .title("Mr.")
                        .givenName("Piet")
                        .familyName("Mondriaan")
                        .organizationName("Mollie B.V.")
                        .streetAndNumber("Keizersgracht 126")
                        .streetAdditional("Apt. 1")
                        .postalCode("1234AB")
                        .email("piet@example.org")
                        .phone("31208202070")
                        .city("Amsterdam")
                        .region("Noord-Holland")
                        .country("NL")
                        .build())
                    .profileId("pfl_QkEhN94Ba")
                    .reusable(false)
                    .expiresAt("2025-12-24T11:00:16+00:00")
                    .allowedMethods(List.of(
                        PaymentLinkMethod.IDEAL))
                    .applicationFee(ApplicationFee.builder()
                        .amount(Amount.builder()
                            .currency("EUR")
                            .value("10.00")
                            .build())
                        .description("Platform fee")
                        .build())
                    .sequenceType(PaymentLinkSequenceType.ONEOFF)
                    .customerId("cst_XimFHuaEzd")
                    .testmode(false)
                    .build())
                .call();

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

Parameters

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
requestBody Optional<CreatePaymentLinkRequestBody> N/A

Response

CreatePaymentLinkResponse

Errors

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

list

Retrieve a list of all payment links.

The results are paginated.

Example Usage: list-payment-links-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.ListPaymentLinksResponse;
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()
                    .apiKey(System.getenv().getOrDefault("API_KEY", ""))
                    .build())
            .build();


        sdk.paymentLinks().list()
                .from("pl_d9fQur83kFdhH8hIhaZfq")
                .limit(50L)
                .idempotencyKey("123e4567-e89b-12d3-a456-426")
                .callAsStream()
                .forEach((ListPaymentLinksResponse item) -> {
                   // handle page
                });

    }
}

Example Usage: list-payment-links-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.ListPaymentLinksResponse;
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()
                    .apiKey(System.getenv().getOrDefault("API_KEY", ""))
                    .build())
            .build();


        sdk.paymentLinks().list()
                .from("pl_d9fQur83kFdhH8hIhaZfq")
                .limit(50L)
                .idempotencyKey("123e4567-e89b-12d3-a456-426")
                .callAsStream()
                .forEach((ListPaymentLinksResponse item) -> {
                   // handle page
                });

    }
}

Parameters

Parameter Type Required Description Example
from Optional<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.
pl_d9fQur83kFdhH8hIhaZfq
limit JsonNullable<Long> The maximum number of items to return. Defaults to 50 items. 50
testmode Optional<Boolean> Most API credentials are specifically created for either live mode or test mode. In those cases the testmode query
parameter must not be sent. For organization-level credentials such as OAuth access tokens, 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

Response

ListPaymentLinksResponse

Errors

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

get

Retrieve a single payment link by its ID.

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.GetPaymentLinkResponse;
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()
                    .apiKey(System.getenv().getOrDefault("API_KEY", ""))
                    .build())
            .build();

        GetPaymentLinkResponse res = sdk.paymentLinks().get()
                .paymentLinkId("pl_d9fQur83kFdhH8hIhaZfq")
                .idempotencyKey("123e4567-e89b-12d3-a456-426")
                .call();

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

Parameters

Parameter Type Required Description Example
paymentLinkId String ✔️ Provide the ID of the related payment link. pl_d9fQur83kFdhH8hIhaZfq
testmode Optional<Boolean> Most API credentials are specifically created for either live mode or test mode. In those cases the testmode query
parameter must not be sent. For organization-level credentials such as OAuth access tokens, 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

Response

GetPaymentLinkResponse

Errors

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

update

Certain details of an existing payment link can be updated.

Example Usage

package hello.world;

import com.mollie.mollie.Client;
import com.mollie.mollie.models.components.*;
import com.mollie.mollie.models.errors.ErrorResponse;
import com.mollie.mollie.models.operations.UpdatePaymentLinkRequestBody;
import com.mollie.mollie.models.operations.UpdatePaymentLinkResponse;
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()
                    .apiKey(System.getenv().getOrDefault("API_KEY", ""))
                    .build())
            .build();

        UpdatePaymentLinkResponse res = sdk.paymentLinks().update()
                .paymentLinkId("pl_d9fQur83kFdhH8hIhaZfq")
                .idempotencyKey("123e4567-e89b-12d3-a456-426")
                .requestBody(UpdatePaymentLinkRequestBody.builder()
                    .description("Chess Board")
                    .minimumAmount(Amount.builder()
                        .currency("EUR")
                        .value("10.00")
                        .build())
                    .archived(false)
                    .allowedMethods(List.of(
                        PaymentLinkMethod.IDEAL))
                    .lines(List.of(
                        PaymentLineItem.builder()
                            .description("LEGO 4440 Forest Police Station")
                            .quantity(1L)
                            .unitPrice(Amount.builder()
                                .currency("EUR")
                                .value("10.00")
                                .build())
                            .totalAmount(Amount.builder()
                                .currency("EUR")
                                .value("10.00")
                                .build())
                            .type(PaymentLineType.PHYSICAL)
                            .quantityUnit("pcs")
                            .discountAmount(Amount.builder()
                                .currency("EUR")
                                .value("10.00")
                                .build())
                            .vatRate("21.00")
                            .vatAmount(Amount.builder()
                                .currency("EUR")
                                .value("10.00")
                                .build())
                            .sku("9780241661628")
                            .categories(List.of(
                                LineCategories.MEAL,
                                LineCategories.ECO))
                            .imageUrl("https://...")
                            .productUrl("https://...")
                            .build()))
                    .billingAddress(PaymentAddress.builder()
                        .title("Mr.")
                        .givenName("Piet")
                        .familyName("Mondriaan")
                        .organizationName("Mollie B.V.")
                        .streetAndNumber("Keizersgracht 126")
                        .streetAdditional("Apt. 1")
                        .postalCode("1234AB")
                        .email("piet@example.org")
                        .phone("31208202070")
                        .city("Amsterdam")
                        .region("Noord-Holland")
                        .country("NL")
                        .build())
                    .shippingAddress(PaymentAddress.builder()
                        .title("Mr.")
                        .givenName("Piet")
                        .familyName("Mondriaan")
                        .organizationName("Mollie B.V.")
                        .streetAndNumber("Keizersgracht 126")
                        .streetAdditional("Apt. 1")
                        .postalCode("1234AB")
                        .email("piet@example.org")
                        .phone("31208202070")
                        .city("Amsterdam")
                        .region("Noord-Holland")
                        .country("NL")
                        .build())
                    .testmode(false)
                    .build())
                .call();

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

Parameters

Parameter Type Required Description Example
paymentLinkId String ✔️ Provide the ID of the related payment link. pl_d9fQur83kFdhH8hIhaZfq
idempotencyKey Optional<String> A unique key to ensure idempotent requests. This key should be a UUID v4 string. 123e4567-e89b-12d3-a456-426
requestBody Optional<UpdatePaymentLinkRequestBody> N/A

Response

UpdatePaymentLinkResponse

Errors

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

delete

Payment links which have not been opened and no payments have been made yet can be deleted entirely. This can be useful for removing payment links that have been incorrectly configured or that are no longer relevant.

Once deleted, the payment link will no longer show up in the API or Mollie dashboard.

To simply disable a payment link without fully deleting it, you can use the archived parameter on the Update payment link endpoint instead.

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.DeletePaymentLinkRequestBody;
import com.mollie.mollie.models.operations.DeletePaymentLinkResponse;
import java.lang.Exception;

public class Application {

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

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

        DeletePaymentLinkResponse res = sdk.paymentLinks().delete()
                .paymentLinkId("pl_d9fQur83kFdhH8hIhaZfq")
                .idempotencyKey("123e4567-e89b-12d3-a456-426")
                .requestBody(DeletePaymentLinkRequestBody.builder()
                    .testmode(false)
                    .build())
                .call();

        // handle response
    }
}

Parameters

Parameter Type Required Description Example
paymentLinkId String ✔️ Provide the ID of the related payment link. pl_d9fQur83kFdhH8hIhaZfq
idempotencyKey Optional<String> A unique key to ensure idempotent requests. This key should be a UUID v4 string. 123e4567-e89b-12d3-a456-426
requestBody Optional<DeletePaymentLinkRequestBody> N/A

Response

DeletePaymentLinkResponse

Errors

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

listPayments

Retrieve the list of payments for a specific payment link.

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.components.Sorting;
import com.mollie.mollie.models.errors.ErrorResponse;
import com.mollie.mollie.models.operations.GetPaymentLinkPaymentsRequest;
import com.mollie.mollie.models.operations.GetPaymentLinkPaymentsResponse;
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()
                    .apiKey(System.getenv().getOrDefault("API_KEY", ""))
                    .build())
            .build();

        GetPaymentLinkPaymentsRequest req = GetPaymentLinkPaymentsRequest.builder()
                .paymentLinkId("pl_d9fQur83kFdhH8hIhaZfq")
                .from("tr_5B8cwPMGnU")
                .limit(50L)
                .sort(Sorting.DESC)
                .idempotencyKey("123e4567-e89b-12d3-a456-426")
                .build();


        sdk.paymentLinks().listPayments()
                .callAsStream()
                .forEach((GetPaymentLinkPaymentsResponse item) -> {
                   // handle page
                });

    }
}

Parameters

Parameter Type Required Description
request GetPaymentLinkPaymentsRequest ✔️ The request object to use for the request.

Response

GetPaymentLinkPaymentsResponse

Errors

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