Log in
Model

Invoice

Magento\Sales\Model\Order\Invoice

What it does

The Invoice model represents a sales invoice document in Magento 2.

Developers use this class to create, manage, and track customer invoices for orders, including operations like capturing payments, voiding, canceling, and processing refunds.

It handles invoice state management (open, paid, canceled), calculates totals, manages invoice items and comments, and maintains relationships with orders and payment information.

Public Methods

  • loadByIncrementId()
  • getConfig()
  • getStore()
  • setOrder()
  • getOrder()
  • getEntityType()
  • getBillingAddress()
  • getShippingAddress()
  • isCanceled()
  • canCapture()
  • canVoid()
  • canCancel()
  • canRefund()
  • capture()
  • pay()
  • wasPayCalled()
  • void()
  • cancel()
  • collectTotals()
  • roundPrice()
  • getItemsCollection()
  • getAllItems()
  • getItemById()
  • addItem()
  • getStates()
  • getStateName()
  • register()
  • isLast()
  • addComment()
  • getCommentsCollection()
  • reset()
  • getItems()
  • getComments()
  • getIncrementId()
  • getBaseTotalRefunded()
  • getDiscountDescription()
  • setItems()
  • getBaseCurrencyCode()
  • getBaseDiscountAmount()
  • getBaseGrandTotal()
  • getBaseDiscountTaxCompensationAmount()
  • getBaseShippingAmount()
  • getBaseShippingDiscountTaxCompensationAmnt()
  • getBaseShippingInclTax()
  • getBaseShippingTaxAmount()
  • getBaseSubtotal()
  • getBaseSubtotalInclTax()
  • getBaseTaxAmount()
  • getBaseToGlobalRate()
  • getBaseToOrderRate()
  • getBillingAddressId()
  • getCanVoidFlag()
  • getCreatedAt()
  • setCreatedAt()
  • getDiscountAmount()
  • getEmailSent()
  • getGlobalCurrencyCode()
  • getGrandTotal()
  • getDiscountTaxCompensationAmount()
  • getIsUsedForRefund()
  • getOrderCurrencyCode()
  • getOrderId()
  • getShippingAddressId()
  • getShippingAmount()
  • getShippingDiscountTaxCompensationAmount()
  • getShippingInclTax()
  • getShippingTaxAmount()
  • getState()
  • getStoreCurrencyCode()
  • getStoreId()
  • getStoreToBaseRate()
  • getStoreToOrderRate()
  • getSubtotal()
  • getSubtotalInclTax()
  • getTaxAmount()
  • getTotalQty()
  • getTransactionId()
  • setTransactionId()
  • getUpdatedAt()
  • setComments()
  • setUpdatedAt()
  • setStoreId()
  • setBaseGrandTotal()
  • setShippingTaxAmount()
  • setTaxAmount()
  • setBaseTaxAmount()
  • setStoreToOrderRate()
  • setBaseShippingTaxAmount()
  • setBaseDiscountAmount()
  • setBaseToOrderRate()
  • setGrandTotal()
  • setShippingAmount()
  • setSubtotalInclTax()
  • setBaseSubtotalInclTax()
  • setStoreToBaseRate()
  • setBaseShippingAmount()
  • setTotalQty()
  • setBaseToGlobalRate()
  • setSubtotal()
  • setBaseSubtotal()
  • setDiscountAmount()
  • setBillingAddressId()
  • setIsUsedForRefund()
  • setOrderId()
  • setEmailSent()
  • setCanVoidFlag()
  • setState()
  • setShippingAddressId()
  • setStoreCurrencyCode()
  • setOrderCurrencyCode()
  • setBaseCurrencyCode()
  • setGlobalCurrencyCode()
  • setIncrementId()
  • setDiscountTaxCompensationAmount()
  • setBaseDiscountTaxCompensationAmount()
  • setShippingDiscountTaxCompensationAmount()
  • setBaseShippingDiscountTaxCompensationAmnt()
  • setShippingInclTax()
  • setBaseShippingInclTax()
  • setBaseTotalRefunded()
  • setDiscountDescription()
  • getExtensionAttributes()
  • setExtensionAttributes()