Log in
Model

Creditmemo

Magento\Sales\Model\Order\Creditmemo

What it does

The Creditmemo class represents a credit memo (refund document) in Magento 2's order management system.

Developers use this class to create, manage, and process refunds for orders, including calculating refund amounts, managing items being refunded, handling adjustments, and tracking refund states (open, refunded, canceled).

It provides methods to collect totals, add comments, validate refund eligibility, and manage relationships with orders and invoices.

Public Methods

  • getConfig()
  • getStore()
  • setOrder()
  • getOrder()
  • getEntityType()
  • getBillingAddress()
  • getShippingAddress()
  • getItemsCollection()
  • getAllItems()
  • getItemById()
  • getItemByOrderId()
  • addItem()
  • collectTotals()
  • roundPrice()
  • canRefund()
  • getInvoice()
  • setInvoice()
  • canCancel()
  • canVoid()
  • getStates()
  • getStateName()
  • setShippingAmount()
  • setAdjustmentPositive()
  • setAdjustmentNegative()
  • isLast()
  • addComment()
  • getCommentsCollection()
  • getFilteredCollectionItems()
  • getIncrementId()
  • isValidGrandTotal()
  • getItems()
  • getComments()
  • getDiscountDescription()
  • setItems()
  • getAdjustment()
  • getAdjustmentNegative()
  • getAdjustmentPositive()
  • getBaseAdjustment()
  • getBaseAdjustmentNegative()
  • setBaseAdjustmentNegative()
  • getBaseAdjustmentPositive()
  • setBaseAdjustmentPositive()
  • getBaseCurrencyCode()
  • getBaseDiscountAmount()
  • getBaseGrandTotal()
  • getBaseDiscountTaxCompensationAmount()
  • getBaseShippingAmount()
  • getBaseShippingDiscountTaxCompensationAmnt()
  • getBaseShippingInclTax()
  • getBaseShippingTaxAmount()
  • getBaseSubtotal()
  • getBaseSubtotalInclTax()
  • getBaseTaxAmount()
  • getBaseToGlobalRate()
  • getBaseToOrderRate()
  • getBillingAddressId()
  • getCreatedAt()
  • setCreatedAt()
  • getCreditmemoStatus()
  • getDiscountAmount()
  • getEmailSent()
  • getGlobalCurrencyCode()
  • getGrandTotal()
  • getDiscountTaxCompensationAmount()
  • getInvoiceId()
  • getOrderCurrencyCode()
  • getOrderId()
  • getShippingAddressId()
  • getShippingAmount()
  • getShippingDiscountTaxCompensationAmount()
  • getShippingInclTax()
  • getShippingTaxAmount()
  • getState()
  • getStoreCurrencyCode()
  • getStoreId()
  • getStoreToBaseRate()
  • getStoreToOrderRate()
  • getSubtotal()
  • getSubtotalInclTax()
  • getTaxAmount()
  • getTransactionId()
  • setTransactionId()
  • getUpdatedAt()
  • setComments()
  • setStoreId()
  • setBaseShippingTaxAmount()
  • setStoreToOrderRate()
  • setBaseDiscountAmount()
  • setBaseToOrderRate()
  • setGrandTotal()
  • setBaseSubtotalInclTax()
  • setSubtotalInclTax()
  • setBaseShippingAmount()
  • setStoreToBaseRate()
  • setBaseToGlobalRate()
  • setBaseAdjustment()
  • setBaseSubtotal()
  • setDiscountAmount()
  • setSubtotal()
  • setAdjustment()
  • setBaseGrandTotal()
  • setBaseTaxAmount()
  • setShippingTaxAmount()
  • setTaxAmount()
  • setOrderId()
  • setEmailSent()
  • setCreditmemoStatus()
  • setState()
  • setShippingAddressId()
  • setBillingAddressId()
  • setInvoiceId()
  • setStoreCurrencyCode()
  • setOrderCurrencyCode()
  • setBaseCurrencyCode()
  • setGlobalCurrencyCode()
  • setIncrementId()
  • setUpdatedAt()
  • setDiscountTaxCompensationAmount()
  • setBaseDiscountTaxCompensationAmount()
  • setShippingDiscountTaxCompensationAmount()
  • setBaseShippingDiscountTaxCompensationAmnt()
  • setShippingInclTax()
  • setBaseShippingInclTax()
  • setDiscountDescription()
  • getExtensionAttributes()
  • setExtensionAttributes()