Log in
Interface

CreditmemoValidatorInterface

Magento\Sales\Model\Order\Creditmemo\CreditmemoValidatorInterface

What it does

This interface defines a contract for validating credit memos in Magento 2 before they are saved or processed.

Developers use this when implementing custom validation logic for credit memos, ensuring they meet business rules like valid amounts, proper item quantities, or refund eligibility.

The validate method accepts a credit memo entity and an array of validator instances, returning a validation result or throwing an exception if validation fails.

Public Methods

  • validate()