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());
}| Exception | HTTP Status Code |
|---|---|
RatepayAuthException | 401/403 |
RatepayValidationException | 400 |
RatepayTransactionNotFoundException | 404 |
RatepayLegalException | 451 |
RatepayNetworkException | 5xx/transport |