Skip to content

Incrementally authorizing a transaction

Incremental authorization increases the authorized amount of an existing transaction that has not been fully captured, such as when a buyer adds an item to an order before shipment.

Use the ratepayTransactionId returned by the original authorization to identify the transaction.

Unlike the initial authorization, an incremental authorization does not require a shopping basket. You can submit an amount increase without providing item details. If included, items are specified directly in IncrementalAuthorizationRequest.

The following example increases the authorized amount by €25.00 without specifying additional items.

import com.ratepay.sdk.IncrementalAuthorizeOutcome;
import com.ratepay.sdk.model.api.payment.IncrementalAuthorizationRequest;
import java.math.BigDecimal;

IncrementalAuthorizationRequest request = new IncrementalAuthorizationRequest(
    new BigDecimal("25.00"), // grossAmount to add
    null, // items
    null, // partnerOperationId
    null, // partnerShopId, required only for marketplace (multi-shop) transactions
    null, // specialItems
    null  // vats
);

IncrementalAuthorizeOutcome outcome = client.incrementalAuthorize(ratepayTransactionId, request, null);

if (outcome.kind() == IncrementalAuthorizeOutcome.Kind.ACCEPTED) {
    var accepted = (IncrementalAuthorizeOutcome.Accepted) outcome;
    System.out.println("Increased by " + accepted.getRatepayAuthorizationId());
} else {
    var declined = (IncrementalAuthorizeOutcome.Declined) outcome;
    System.out.println("Increase declined: " + declined.getDecline().getCategory());
}

Exceptions

ExceptionHTTP Status Code
RatepayAuthException401/403
RatepayValidationException400
RatepayTransactionNotFoundException404
RatepayLegalException451
RatepayNetworkException5xx/transport

Next