{"id":1755,"date":"2024-10-10T18:45:28","date_gmt":"2024-10-10T15:45:28","guid":{"rendered":"https:\/\/plumrocket.com\/learn\/?p=1755"},"modified":"2025-12-11T18:13:09","modified_gmt":"2025-12-11T16:13:09","slug":"how-to-change-order-status-in-magento-2","status":"publish","type":"post","link":"https:\/\/plumrocket.com\/learn\/change-magento-2-order-status","title":{"rendered":"How to Change Order Status in Magento 2"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full disable_zoom\"><img loading=\"lazy\" width=\"1600\" height=\"600\" src=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/10\/change-magento-order-status.png\" alt=\"How to Change Order Status in Magento 2\" class=\"wp-image-1950\" srcset=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/10\/change-magento-order-status.png 1600w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/10\/change-magento-order-status-300x113.png 300w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/10\/change-magento-order-status-1024x384.png 1024w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/10\/change-magento-order-status-768x288.png 768w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/10\/change-magento-order-status-1536x576.png 1536w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/10\/change-magento-order-status-1568x588.png 1568w\" sizes=\"(max-width: 1600px) 100vw, 1600px\" \/><\/figure>\n\n\n\n<p>Magento 2 provides a set of default statuses, which may vary depending on version and installed payment modules (e.g., PayPal adds additional statuses): <em>Received, Suspected Fraud, Processing, Pending Payment, Payment Review, Pending, On Hold, Complete, Closed, Canceled, Rejected, PayPal Canceled Reversal, Pending PayPal, PayPal Reversed.<\/em><\/p>\n\n\n\n<p>These statuses help merchants track the progress of each order through the fulfillment process.<\/p>\n\n\n\n<p>There are <strong>several ways to change order status in Magento 2<\/strong>, depending on your requirements:<\/p>\n\n\n\n<ol><li><a href=\"#how-to-change-order-status-in-magento-2-manually-in-the-admin-panel\">Manually<strong> <\/strong>through the Magento Admin panel<\/a><\/li><li><a href=\"#how-to-change-order-status-in-magento-2-programmatically\">Programmatically<strong> <\/strong>using custom code<\/a><\/li><li><a href=\"#how-to-change-order-status-in-magento-2-rest-api-method\">Via Magento REST API<\/a><\/li><li><a href=\"#how-to-change-order-status-in-magento-2-automatically\">Automatically<strong> <\/strong>using Magento 2 extensions<\/a><\/li><\/ol>\n\n\n\n<p>In this article, we will walk you through each of these methods. Choose the method that best aligns with your specific needs and technical capabilities.<\/p>\n\n\n\n<p style=\"background-color: #e8f2ff;min-height:100px;box-shadow: 0 3px 10px 0 rgba(0,0,0,.15); padding: 20px 20px;\">Improve order processing speed with automatic invoicing, shipping creation, and status updates using our <a href=\"\/magento-auto-invoice-shipment\" target=\"_blank\" rel=\"noreferrer noopener\">Auto Invoice &amp; Shipment Extension<\/a>.<\/p>\n\n\n\n<h2>How to Change Order Status in Magento 2 Manually in the Admin Panel<\/h2>\n\n\n\n<p>In the Magento 2 admin panel, you can only manually change the order status to <em>On Hold<\/em> or <em>Canceled<\/em>. All other statuses depend on payment method, payment status, shipping, and refunds.<\/p>\n\n\n\n<p>Steps to change order status to <em>Canceled <\/em>or <em>On hold <\/em>status:<\/p>\n\n\n\n<div class=\"wp-block-group pr-notice pr-notice-info\"><div class=\"wp-block-group__inner-container\">\n<p class=\"pr-notice-title\" style=\"margin-bottom: 25px;\">Step-by-step guide:<\/p>\n\n\n\n<ol><li>Open the Magento 2 Orders grid page.<\/li><li>Use checkboxes to select the orders you want to change the status of.<\/li><li>Choose the <em>Cancel<\/em> or <em>Hold <\/em>option from the Actions drop-down.<\/li><\/ol>\n\n\n\n<p><\/p>\n<\/div><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"1206\" height=\"602\" src=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/09\/change-magento-order-status-1.png\" alt=\"Change Order Status in Magento 2 Manually in the Admin Panel\" class=\"wp-image-1758\" srcset=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/09\/change-magento-order-status-1.png 1206w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/09\/change-magento-order-status-1-300x150.png 300w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/09\/change-magento-order-status-1-1024x511.png 1024w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/09\/change-magento-order-status-1-768x383.png 768w\" sizes=\"(max-width: 1206px) 100vw, 1206px\" \/><\/figure>\n\n\n\n<h2>How to Change Order Status in Magento 2 Programmatically<\/h2>\n\n\n\n<p>We will create a Magento 2 model <code>CompleteOrder<\/code> that will change the order status to <em>Complete<\/em>. It leverages the <code>Magento\\Sales\\Model\\Order<\/code> model to retrieve the order by its ID, update the order&#8217;s state and status, and then save the changes.<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-php\">&lt;?php\nnamespace Vendor\\CompleteOrder\\Model;\n\nuse Magento\\Sales\\Model\\Order;\n\nclass CompleteOrder\n{\n    private $order;\n\n    public function __construct(Order $order)\n    {\n        $this->order = $order;\n    }\n\n    public function execute($orderId)\n    {\n        $order = $this->order->load($orderId);\n\n        $order->setState(Order::STATE_COMPLETE)\n              ->setStatus(Order::STATE_COMPLETE)\n              ->save();\n    }\n}\n<\/code><\/pre><\/div>\n\n\n\n<p>The code below shows how you can use the model. Simply provide the order ID as an argument to the execute method, and the class will handle the rest.<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-php\">$orderComplete = $objectManager->create(\\Vendor\\CompleteOrder\\Model\\CompleteOrder::class)\n$orderId = 1;\n$orderComplete->execute($orderId);\n<\/code><\/pre><\/div>\n\n\n\n<p>This is a simple code example of how to change order status programmatically in Magento 2. However, in real-world scenarios, it&#8217;s important to consider the current status of the order before changing it to <em>Complete<\/em>. Depending on your business process, you may need to create a shipment or generate an invoice before setting the order as completed.<\/p>\n\n\n\n<h2>How to Change Order Status in Magento 2 (REST API Method)<\/h2>\n\n\n\n<p>To update the order status via Magento 2 Rest API, follow these steps:<\/p>\n\n\n\n<ol><li>Get Bear access token from the Magento store using the following request:<\/li><\/ol>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-php\">curl -X POST \"https:\/\/magento-store.com\/rest\/V1\/integration\/admin\/token\" \\\n-H \"Content-Type: application\/json\" \\\n-d '{\n  \"username\": \"admin_username\",\n  \"password\": \"admin_password\"\n<\/code><\/pre><\/div>\n\n\n\n<ol start=\"2\"><li>Replace the placeholders with the actual token and with the specific order ID in the request below:<\/li><\/ol>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-php\">curl -X POST \"https:\/\/magento-store.com\/rest\/V1\/orders\" \\\n-H \"Content-Type: application\/json\" \\\n-H \"Authorization: Bearer &lt;access-token>\" \\\n-d '{\n \"entity\": {\n   \"entity_id\": &lt;orderId>,\n    \"status\": \"canceled\",\n    \"state\": \"canceled\"\n }\n}'\n<\/code><\/pre><\/div>\n\n\n\n<p>By using this Magento 2 API, you can also change other order fields, making it a powerful tool for order management.<\/p>\n\n\n\n<h2>How to Change Order Status in Magento 2 Automatically<\/h2>\n\n\n\n<p>One efficient way to automate order status updates in Magento 2 is by using the <a href=\"\/magento-auto-invoice-shipment\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 Auto Invoice &amp; Shipment Extension<\/a>. This extension can automatically generate invoices and shipments, which triggers an automatic change in the order status to <em>Processing<\/em> or <em>Complete<\/em>, depending on the fulfillment stage.<\/p>\n\n\n\n<h3>Key features of this extension include:<\/h3>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column is-vertically-aligned-center\">\n<p><strong>Bulk Invoice and Shipment<\/strong><br>The extension enables store admins to generate Magento invoices and shipments in bulk, saving time and streamlining order processing.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column\" style=\"flex-basis:6%\"><\/div>\n\n\n\n<div class=\"wp-block-column\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"412\" height=\"229\" src=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/09\/change-magento-order-status-2.png\" alt=\"\" class=\"wp-image-1759\" srcset=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/09\/change-magento-order-status-2.png 412w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/09\/change-magento-order-status-2-300x167.png 300w\" sizes=\"(max-width: 412px) 100vw, 412px\" \/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column is-vertically-aligned-center\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"478\" height=\"270\" src=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/09\/change-magento-order-status-3.png\" alt=\"\" class=\"wp-image-1764\" srcset=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/09\/change-magento-order-status-3.png 478w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/09\/change-magento-order-status-3-300x169.png 300w\" sizes=\"(max-width: 478px) 100vw, 478px\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column\" style=\"flex-basis:6%\"><\/div>\n\n\n\n<div class=\"wp-block-column\">\n<p style=\"margin-top:20px; margin-bottom:20px\"><strong>Flexible Rules<\/strong><br>You can configure specific rules to specify when and how invoices and shipments are created automatically. These rules allow you to set conditions based on payment methods, order status, or other criteria, ensuring that your workflow aligns with your business needs.<\/p>\n<\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column is-vertically-aligned-center\">\n<p><strong>Support for Partial Invoices and Shipments<\/strong><br>If your business deals with partial shipments or split orders, the extension allows you to create partial invoices and shipments. This ensures that order statuses are updated correctly for each portion of the order that is fulfilled.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column\" style=\"flex-basis:6%\"><\/div>\n\n\n\n<div class=\"wp-block-column\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"490\" height=\"320\" src=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/09\/change-magento-order-status-4.png\" alt=\"\" class=\"wp-image-1765\" srcset=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/09\/change-magento-order-status-4.png 490w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/09\/change-magento-order-status-4-300x196.png 300w\" sizes=\"(max-width: 490px) 100vw, 490px\" \/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column\">\n<div class=\"wp-block-cover alignwide has-parallax\" style=\"background-image:url(https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/10\/change-magento-order-status-0.png);min-height:55px\"><div class=\"wp-block-cover__inner-container\">\n<p class=\"has-text-align-center has-dark-gray-color has-text-color\" style=\"font-size:18px\"><span class=\"has-inline-color has-dark-gray-color\">Automate the invoicing and shipping process to ensure order management efficiency and timely status updates.<\/span><\/p>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link has-background\" href=\"\/magento-auto-invoice-shipment\" style=\"border-radius:5px;background-color:#7d2c55\" target=\"_blank\" rel=\"\/magento-auto-invoice-shipment noopener\">Try Auto Invoice &amp; Shipment Extension<\/a><\/div>\n<\/div>\n<\/div><\/div>\n<\/div>\n<\/div>\n\n\n\n<h2>Frequently Asked Questions (FAQ)<\/h2>\n\n\n\n<h3><strong>Why can\u2019t I change the order status directly to Complete?<\/strong><\/h3>\n\n\n\n<p>Magento restricts the <strong>Complete<\/strong> status because it should only be applied when an order has been fully invoiced and shipped. To set it programmatically, you must do it through custom code or an integration.<\/p>\n\n\n\n<h3><strong>Can I force an order status update through the API?<\/strong><\/h3>\n\n\n\n<p>Yes \u2014 but Magento requires that the <code>state<\/code> and <code>status<\/code> pair be valid.<br>For example, you cannot set <code>status = complete<\/code> unless the order state supports it or workflow rules are bypassed programmatically.<\/p>\n\n\n\n<h3><strong>How can I automate order status changes in Magento 2?<\/strong><\/h3>\n\n\n\n<p>You can use automation tools such as the <a href=\"\/magento-auto-invoice-shipment\" target=\"_blank\" rel=\"noreferrer noopener\">Auto Invoice &amp; Shipment Extension for Magento 2<\/a>, which automatically generates invoices and shipments. This triggers automatic status changes and reduces manual admin work.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Magento 2 offers a comprehensive order management system with 14 predefined order statuses, which help merchants track the progress of each order through the fulfillment process. There are <strong>several ways to change order status in Magento 2<\/strong>, depending on your requirements:<br \/>\n<!-- \/wp:paragraph --><\/p>\n<p><!-- wp:list {\"ordered\":true} --><\/p>\n<ol>\n<li>Manually<strong> <\/strong>through the Magento Admin panel<\/li>\n<li>Programmatically<strong> <\/strong>using custom code<\/li>\n<li>Via Magento REST API<\/li>\n<li>Automatically<strong> <\/strong> using Magento 2 extensions<\/li>\n<\/ol>\n<p><!-- \/wp:list --><\/p>\n<p>In this article, we will walk you through each of these methods. Choose the method that best aligns with your specific needs and technical capabilities.<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[122],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Change Order Status in Magento 2 (Programmatically, Rest API)<\/title>\n<meta name=\"description\" content=\"A step-by-step guide on different ways to change order status in Magento 2 - programmatically, via Rest API, or automatically using extensions.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/plumrocket.com\/learn\/change-magento-2-order-status\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Change Order Status in Magento 2 (Programmatically, Rest API)\" \/>\n<meta property=\"og:description\" content=\"A step-by-step guide on different ways to change order status in Magento 2 - programmatically, via Rest API, or automatically using extensions.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/plumrocket.com\/learn\/change-magento-2-order-status\" \/>\n<meta property=\"og:site_name\" content=\"Magento Tutorials for Beginners &amp; Professionals\" \/>\n<meta property=\"article:published_time\" content=\"2024-10-10T15:45:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-12-11T16:13:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2024\/10\/change-magento-order-status.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/posts\/1755"}],"collection":[{"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/comments?post=1755"}],"version-history":[{"count":48,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/posts\/1755\/revisions"}],"predecessor-version":[{"id":2780,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/posts\/1755\/revisions\/2780"}],"wp:attachment":[{"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/media?parent=1755"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/categories?post=1755"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/tags?post=1755"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}