Log in
Model

OrderService

Magento\Sales\Model\Service\OrderService

What it does

OrderService is the primary service class for managing order operations in Magento 2.

Developers use this class to perform common order actions like canceling orders, placing holds, adding comments, changing order states, and sending notifications.

It provides a centralized, transaction-safe way to manipulate orders through the repository pattern.

Public Methods

  • cancel()
  • getCommentsList()
  • addComment()
  • notify()
  • getStatus()
  • hold()
  • unHold()
  • place()
  • setState()