{"id":1912,"date":"2021-09-29T17:30:42","date_gmt":"2021-09-29T17:30:42","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/generate-invoice-with-pending-status-in-magento-2\/"},"modified":"2025-07-16T17:24:22","modified_gmt":"2025-07-16T11:54:22","slug":"generate-invoice-with-pending-status-in-magento-2","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/generate-invoice-with-pending-status-in-magento-2\/","title":{"rendered":"How to Generate Invoice with Pending Status in Magento 2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The default\u00a0Magento 2\u00a0CMS manages orders and invoices effectively so as to ensure smooth online store functioning.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, with increasing E-commerce facilities, the default features fall short. Fortunately, Magento 2 allows customizing the default features, for example,&nbsp;<em><strong>generate invoice with pending status in Magento 2<\/strong><\/em>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To fulfill the modern requirements of online shoppers, you might have to offer varied payment methods such as cash on delivery, cheque, or money order.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When a customer chooses one of these payment methods while placing the order, the invoice is in a processing state. But, if you want to mark that order as pending until the payment is received, you can implement the below solution.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Method to Generate Invoice with Pending Status in Magento 2:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">1. Create file di.xml at app\\code\\Vendor\\Extension\\etc\\ directory<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?xml version=\"1.0\"?>\n&lt;config xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:ObjectManager\/etc\/config.xsd\">\n    &lt;preference for=\"Magento\\OfflinePayments\\Model\\Checkmo\" type=\"Vendor\\Extension\\Model\\Checkmo\" \/>\n&lt;\/config><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">2. Create file Checkmo.php at app\\code\\Vendor\\Extension\\Model\\ directory<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\n\/**\n * Copyright \u00a9 Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n *\/\nnamespace Vendor\\Extension\\Model;\n\n\/**\n * Class Checkmo\n *\n * @method \\Magento\\Quote\\Api\\Data\\PaymentMethodExtensionInterface getExtensionAttributes()\n *\n * @api\n * @since 100.0.2\n *\/\nclass Checkmo extends \\Magento\\Payment\\Model\\Method\\AbstractMethod\n{\n    const PAYMENT_METHOD_CHECKMO_CODE = 'checkmo';\n\n    \/**\n     * Payment method code\n     *\n     * @var string\n     *\/\n    protected $_code = self::PAYMENT_METHOD_CHECKMO_CODE;\n\n    \/**\n     * @var string\n     *\/\n    protected $_formBlockType = \\Magento\\OfflinePayments\\Block\\Form\\Checkmo::class;\n\n    \/**\n     * @var string\n     *\/\n    protected $_infoBlockType = \\Magento\\OfflinePayments\\Block\\Info\\Checkmo::class;\n\n    \/**\n     * Availability option\n     *\n     * @var bool\n     *\/\n    protected $_isOffline = true;\n    protected $_canCapture = true;\n\n    \/**\n     * @return string\n     *\/\n    public function getPayableTo()\n    {\n        return $this->getConfigData('payable_to');\n    }\n\n    \/**\n     * @return string\n     *\/\n    public function getMailingAddress()\n    {\n        return $this->getConfigData('mailing_address');\n    }\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s it for generating invoice with pending status in Magento 2 store!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Do share the solution with Magento Community via social media.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The default\u00a0Magento 2\u00a0CMS manages orders and invoices effectively so as to ensure smooth online store functioning. However, with increasing E-commerce facilities, the default features fall&#8230;<\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-1912","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1912","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=1912"}],"version-history":[{"count":5,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1912\/revisions"}],"predecessor-version":[{"id":18021,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1912\/revisions\/18021"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=1912"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=1912"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=1912"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}