Log in
Model

Creditmemo

Magento\Sales\Model\Order\Creditmemo

What it does

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

Developers use this class when processing refunds, managing credit memo items, calculating refund totals, and handling the complete lifecycle of a credit memo from creation through refund completion.

It provides methods to retrieve order information, manage items being refunded, calculate totals with adjustments, and track the refund status.

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()