{"id":22277,"date":"2018-10-29T09:33:42","date_gmt":"2018-10-29T09:33:42","guid":{"rendered":"https:\/\/www.knowband.com\/blog\/?p=22277\/"},"modified":"2018-10-29T19:05:27","modified_gmt":"2018-10-29T09:35:27","slug":"programmatically-create-orders-in-magento","status":"publish","type":"post","link":"https:\/\/www.knowband.com\/blog\/magento-tutorials\/programmatically-create-orders-in-magento\/","title":{"rendered":"How to programmatically create orders in Magento?"},"content":{"rendered":"<p>Sometimes we need to programmatically create orders in Magento. Suppose you are creating a Magento plugin for your store to connect it to the marketplace like Walmart or Etsy.\u00a0In these cases, we need to create order on our Magneto store whenever a customer places an order on the marketplace. To do so we fetch the details of the item ordered and the customer details like shipping and billing details and create order on our Magento store programmatically.<\/p>\n<p>So in today\u2019s article, we will be learning how we can programmatically create an order for a customer for any particular item. We will follow the following steps for creating an order on the Magento store.<\/p>\n<h2>Steps involved in creating order:<\/h2>\n<ul>\n<li>We will define customer data like first name, last name, email.<\/li>\n<li>Define Shipping and Billing address of the customer.<\/li>\n<li>Define Shipping and Payment method of the customer.<\/li>\n<li>Define product and the quantity which needs to be ordered on our Magento store.<\/li>\n<li>Create a customer if the customer does not exist our Magento store. It&#8217;s an optional step.<\/li>\n<li>Add product to the quote of the customer.<\/li>\n<li>Add Shipping and Billing address to the quote of the customer.<\/li>\n<li>Prepare and save quote of the customer.<\/li>\n<li>The order is created on your Magento store.<\/li>\n<\/ul>\n<h2>Use\u00a0the\u00a0below\u00a0code\u00a0to\u00a0create\u00a0order\u00a0in\u00a0Magneto 1.x &#8211;<\/h2>\n<pre class=\"brush: actionscript3; gutter: true\">         $_store = Mage::app()-&gt;getStore();\r\n         $_website = Mage::app()-&gt;getWebsite();\r\n         $_firstName = John&#039;;\r\n         $_lastName = &#039;doe;\r\n         $_email = &#039;demo@demo.com&#039;;\r\n        \/*\r\n         * Custom billing address\r\n         *\/\r\n        $billingAddress = array(\r\n            &#039;customer_address_id&#039; =&gt; &#039;&#039;,\r\n                         &#039;prefix&#039; =&gt; &#039;&#039;,\r\n            &#039;firstname&#039; =&gt; $_firstName,\r\n            &#039;middlename&#039; =&gt; &#039;&#039;,\r\n             &#039;lastname&#039; =&gt; $_lastName,\r\n            &#039;suffix&#039; =&gt; &#039;&#039;,\r\n            &#039;company&#039; =&gt; &#039;&#039;,\r\n            &#039;street&#039; =&gt; array(\r\n                 &#039;0&#039; =&gt; &#039;Sector 63&#039;, \/\/ Required\r\n                &#039;1&#039; =&gt; &#039;Noida, UP&#039; \r\n            ),\r\n             &#039;city&#039; =&gt; &#039;Noida&#039;,\r\n            &#039;country_id&#039; =&gt; &#039;IN&#039;, \/\/ Country code\r\n            &#039;region&#039; =&gt; &#039;UP&#039;, \r\n            &#039;region_id&#039; =&gt; &#039;&#039;,\r\n            &#039;postcode&#039; =&gt; &#039;201301&#039;,\r\n            &#039;telephone&#039; =&gt; &#039;888-888-8888&#039;,\r\n            &#039;fax&#039; =&gt; &#039;&#039;,\r\n            &#039;save_in_address_book&#039; =&gt; 1\r\n        );\r\n \r\n        \/*\r\n         * Custom shipping address\r\n         *\/\r\n        $shippingAddress = array(\r\n            &#039;customer_address_id&#039; =&gt; &#039;&#039;,\r\n            &#039;prefix&#039; =&gt; &#039;&#039;,\r\n            &#039;firstname&#039; =&gt; $_firstName,\r\n            &#039;middlename&#039; =&gt; &#039;&#039;,\r\n            &#039;lastname&#039; =&gt; $_lastName,\r\n            &#039;suffix&#039; =&gt; &#039;&#039;,\r\n            &#039;company&#039; =&gt; &#039;&#039;,\r\n            &#039;street&#039; =&gt; array(\r\n                &#039;0&#039; =&gt; &#039;Sector 63&#039;, \/\/ Required\r\n                &#039;1&#039; =&gt; &#039;Noida, UP&#039; \r\n            ),\r\n            &#039;city&#039; =&gt; &#039;Noida&#039;,\r\n            &#039;country_id&#039; =&gt; &#039;IN&#039;, \/\/ Country code\r\n            &#039;region&#039; =&gt; &#039;UP&#039;,\r\n            &#039;region_id&#039; =&gt; &#039;&#039;,\r\n            &#039;postcode&#039; =&gt; &#039;201301&#039;,\r\n            &#039;telephone&#039; =&gt; &#039;888-888-8888&#039;,\r\n            &#039;fax&#039; =&gt; &#039;&#039;,\r\n            &#039;save_in_address_book&#039; =&gt; 1\r\n        );\r\n \r\n        \/**\r\n         * Enter the shipping method you want to use. Some of the other shipping\r\n         * methods are tablerate_tablerate, freeshipping_freeshipping etc.\r\n         * Here we are using flatrate_flatrate\r\n         *\/\r\n        $_shippingMethod = &#039;flatrate_flatrate&#039;;\r\n \r\n        \/**\r\n         * Enter the payment method you want to use. Some of the order payment  \r\n   \t*methods are checkmo, free, banktransfer, ccsave, purchaseorder etc.\r\n         *\/\r\n        $_paymentMethod = &#039;cashondelivery&#039;;\r\n \r\n        \/**\r\n         * Provide array of product and their qty.\r\n         * $array = array(product_id =&gt; qty)\r\n         *\/\r\n        $productIds = array(905 =&gt; 1);\r\n        $quote = Mage::getModel(&#039;sales\/quote&#039;)\r\n                -&gt;setStoreId($_store-&gt;getId());\r\n \r\n        $quote-&gt;setCurrency(Mage::app()-&gt;getStore()-&gt;getBaseCurrencyCode());\r\n \r\n        $customer = Mage::getModel(&#039;customer\/customer&#039;)\r\n                -&gt;setWebsiteId($_website-&gt;getId())\r\n                -&gt;loadByEmail($_email);\r\n \r\n        \/**\r\n         * Preparing customer for the quote \r\n         * if the customer is not registered then we will create a new customer. This is  \t*an optional process.\r\n         *\/\r\n        if (!$customer-&gt;getId()) {\r\n            $customer = Mage::getModel(&#039;customer\/customer&#039;);\r\n \r\n            $customer-&gt;setWebsiteId($_website-&gt;getId())\r\n                    -&gt;setStore($_store)\r\n                    -&gt;setFirstname($_firstName)\r\n                    -&gt;setLastname($_lastName)\r\n                    -&gt;setEmail($_email);\r\n \r\n            \/**\r\n             * Creating new customer\r\n             * Skip try-catch if you don&#039;t want to create a new customer.\r\n             *\/\r\n            try {\r\n                \/\/ Generating password for customer. You can also use any custom  \/\/ password for it.\r\n                $password = $customer-&gt;generatePassword();\r\n                $customer-&gt;setPassword($password);\r\n                $customer-&gt;setForceConfirmed(true);\r\n                $customer-&gt;save();\r\n \r\n                $customer-&gt;setConfirmation(null);\r\n                $customer-&gt;save();\r\n                $customerId = $customer-&gt;getId();\r\n                $customAddress = Mage::getModel(&#039;customer\/address&#039;);\r\n                $customAddress-&gt;setData($billingAddress)\r\n                        -&gt;setCustomerId($customerId)\r\n                        -&gt;setIsDefaultBilling(&#039;1&#039;)\r\n                        -&gt;setIsDefaultShipping(&#039;1&#039;)\r\n                        -&gt;setSaveInAddressBook(&#039;1&#039;);\r\n                $customAddress-&gt;save();\r\n \r\n            } catch (Mage_Core_Exception $e) {\r\n                Mage::getSingleton(&#039;customer\/session&#039;)-&gt;addException($e, $this- &gt;__(&#039;Error in creating customer&#039;));\r\n                Mage::logException($e);\r\n            } catch (Exception $e) {\r\n                Mage::getSingleton(&#039;customer\/session&#039;)-&gt;addException($e, $this- &gt;__(&#039;Error in creating customer&#039;));\r\n                Mage::logException($e);\r\n            }\r\n        }\r\n \r\n        \/\/ Assign customer to quote\r\n        $quote-&gt;assignCustomer($customer);\r\n \r\n        \/\/ Add products to quote\r\n        foreach ($productIds as $productId =&gt; $qty) {\r\n            $product = Mage::getModel(&#039;catalog\/product&#039;)-&gt;load($productId);\r\n            $quote-&gt;addProduct($product, $qty);\r\n        }\r\n \r\n        \/\/ Add billing address to quote\r\n        $_billingAddressData = $quote-&gt;getBillingAddress()- &gt;addData($billingAddress);\r\n \r\n        \/\/ Add shipping address to quote\r\n        $_shippingAddressData = $quote-&gt;getShippingAddress()- &gt;addData($shippingAddress);\r\n \r\n        \/**\r\n         * If the customer is a registered customer then you can fetch their billing or  *shipping address as below\r\n         * \r\n         * $_customerBillingAddress = $customer-&gt;getPrimaryBillingAddress();\r\n         * $_customerShippingAddress = $customer-&gt;getPrimaryShippingAddress();\r\n         * \r\n         * $_billingAddressData = $quote-&gt;getBillingAddress()- &gt;addData($_customerBillingAddress);\r\n         * $_shippingAddressData = $quote-&gt;getShippingAddress()- &gt;addData($_customerShippingAddress);\r\n         *\/\r\n \r\n        \/\/ Collect shipping rates on quote shipping address data\r\n        $_shippingAddressData-&gt;setCollectShippingRates(true)\r\n                -&gt;collectShippingRates();\r\n \r\n        \/\/ Set shipping and payment method on quote shipping address data\r\n        $_shippingAddressData-&gt;setShippingMethod($_shippingMethod)\r\n                -&gt;setPaymentMethod($_paymentMethod);\r\n \r\n        \/\/ Set payment method for the quote\r\n        $quote-&gt;getPayment()-&gt;importData(array(&#039;method&#039; =&gt; $_paymentMethod));\r\n \r\n        try {\r\n            $quote-&gt;collectTotals();\r\n            $quote-&gt;save();\r\n \r\n            \/\/ Preparing Order From Quote\r\n            $service = Mage::getModel(&#039;sales\/service_quote&#039;, $quote);\r\n            $service-&gt;submitAll();\r\n            \r\n            \/\/ $incrementId is the increment id of the order created.\r\n            $incrementId = $service-&gt;getOrder()-&gt;getRealOrderId();\r\n \r\n            Mage::getSingleton(&#039;checkout\/session&#039;)\r\n                    -&gt;setLastQuoteId($quote-&gt;getId())\r\n                    -&gt;setLastSuccessQuoteId($quote-&gt;getId())\r\n                    -&gt;clearHelperData();\r\n \r\n           \/*\r\n           * $response is the Array of the response with the status of the order  creation.\r\n           *\/\r\n            $response[&#039;success&#039;] = true;\r\n            $response[&#039;error&#039;] = false;\r\n        $response[&#039;messages&#039;] = &#039;Order number &#039;.$incrementId.&#039; created  successfully.&#039;;\r\n        } catch (Mage_Core_Exception $e) {\r\n            $response[&#039;success&#039;] = false;\r\n            $response[&#039;error&#039;] = true;\r\n            $response[&#039;messages&#039;] = $e-&gt;getMessage();\r\n            Mage::logException($e);\r\n        } catch (Exception $e) {\r\n            $response[&#039;success&#039;] = false;\r\n            $response[&#039;error&#039;] = true;\r\n            $response[&#039;messages&#039;] = $this-&gt;__(&#039;Error in processing order. Please try  again later.&#039;);\r\n \r\n            Mage::logException($e);\r\n        }\r\n        \r\n        Mage::app()-&gt;getResponse()-&gt;setBody(Mage::helper(&#039;core&#039;)- &gt;jsonEncode($response));\r\n\r\n<\/pre>\n<p>Please go through the above-mentioned code\u00a0to create order on your store. \u00a0In the above example, we have placed an order of one simple item with quantity 1. We have used \u201ccash on delivery\u201d as the payment method and \u201cflatrate_flatrate\u201d as the shipping method. You can make any combination as per your requirement and your Magento store configuration. Hope this will help you in understanding the mechanism of creating order.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes we need to programmatically create orders in Magento. Suppose you are creating a Magento plugin for your store to connect it to the marketplace like Walmart or Etsy.\u00a0In these cases, we need to create order on our Magneto store whenever a customer places an order on the marketplace. To do so we fetch the [&hellip;]<\/p>\n","protected":false},"author":14,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_kbui_enabled":"","footnotes":""},"categories":[6],"tags":[7486,1555,1573,7487,7488],"class_list":["post-22277","post","type-post","status-publish","format-standard","hentry","category-magento-tutorials","tag-create-order-in-magento","tag-magento-extension","tag-magento-module","tag-magento-orders","tag-magento-store-configuration"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to programmatically create orders in Magento? - Knowband Blog<\/title>\n<meta name=\"description\" content=\"Are you in the search of the process to programmatically create order in Magento extension? This write-up will walk you with the exact process.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.knowband.com\/blog\/magento-tutorials\/programmatically-create-orders-in-magento\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to programmatically create orders in Magento? - Knowband Blog\" \/>\n<meta property=\"og:description\" content=\"Are you in the search of the process to programmatically create order in Magento extension? This write-up will walk you with the exact process.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.knowband.com\/blog\/magento-tutorials\/programmatically-create-orders-in-magento\/\" \/>\n<meta property=\"og:site_name\" content=\"Knowband Blog | Ecommerce Modules\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Knowband\" \/>\n<meta property=\"article:published_time\" content=\"2018-10-29T09:33:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-10-29T09:35:27+00:00\" \/>\n<meta name=\"author\" content=\"Prashant Kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@KnowbandPlugin\" \/>\n<meta name=\"twitter:site\" content=\"@KnowbandPlugin\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prashant Kumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/magento-tutorials\\\/programmatically-create-orders-in-magento\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/magento-tutorials\\\/programmatically-create-orders-in-magento\\\/\"},\"author\":{\"name\":\"Prashant Kumar\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#\\\/schema\\\/person\\\/04499d0d3f542a4f42182b91f772986c\"},\"headline\":\"How to programmatically create orders in Magento?\",\"datePublished\":\"2018-10-29T09:33:42+00:00\",\"dateModified\":\"2018-10-29T09:35:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/magento-tutorials\\\/programmatically-create-orders-in-magento\\\/\"},\"wordCount\":300,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#organization\"},\"keywords\":[\"create order in magento\",\"Magento extension\",\"Magento module\",\"magento orders\",\"magento store configuration\"],\"articleSection\":[\"Magento Tutorials\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/magento-tutorials\\\/programmatically-create-orders-in-magento\\\/\",\"url\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/magento-tutorials\\\/programmatically-create-orders-in-magento\\\/\",\"name\":\"How to programmatically create orders in Magento? - Knowband Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#website\"},\"datePublished\":\"2018-10-29T09:33:42+00:00\",\"dateModified\":\"2018-10-29T09:35:27+00:00\",\"description\":\"Are you in the search of the process to programmatically create order in Magento extension? This write-up will walk you with the exact process.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/magento-tutorials\\\/programmatically-create-orders-in-magento\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.knowband.com\\\/blog\\\/magento-tutorials\\\/programmatically-create-orders-in-magento\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/magento-tutorials\\\/programmatically-create-orders-in-magento\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to programmatically create orders in Magento?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#website\",\"url\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/\",\"name\":\"Knowband Blog | Ecommerce Modules\",\"description\":\"Magento, Prestashop, Opencart, Shopify\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#organization\",\"name\":\"Knowband Blog | Ecommerce Modules\",\"url\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/cropped-knowband_logo-v2.png\",\"contentUrl\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/cropped-knowband_logo-v2.png\",\"width\":153,\"height\":61,\"caption\":\"Knowband Blog | Ecommerce Modules\"},\"image\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Knowband\",\"https:\\\/\\\/x.com\\\/KnowbandPlugin\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#\\\/schema\\\/person\\\/04499d0d3f542a4f42182b91f772986c\",\"name\":\"Prashant Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/10\\\/10256082_607442326014813_1731639576902538685_o-150x150.jpg\",\"url\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/10\\\/10256082_607442326014813_1731639576902538685_o-150x150.jpg\",\"contentUrl\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/10\\\/10256082_607442326014813_1731639576902538685_o-150x150.jpg\",\"caption\":\"Prashant Kumar\"},\"description\":\"Prashant is a passionate Magento developer. He loves exploring e-commerce and reading books.\",\"url\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/author\\\/pkumar\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to programmatically create orders in Magento? - Knowband Blog","description":"Are you in the search of the process to programmatically create order in Magento extension? This write-up will walk you with the exact process.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.knowband.com\/blog\/magento-tutorials\/programmatically-create-orders-in-magento\/","og_locale":"en_US","og_type":"article","og_title":"How to programmatically create orders in Magento? - Knowband Blog","og_description":"Are you in the search of the process to programmatically create order in Magento extension? This write-up will walk you with the exact process.","og_url":"https:\/\/www.knowband.com\/blog\/magento-tutorials\/programmatically-create-orders-in-magento\/","og_site_name":"Knowband Blog | Ecommerce Modules","article_publisher":"https:\/\/www.facebook.com\/Knowband","article_published_time":"2018-10-29T09:33:42+00:00","article_modified_time":"2018-10-29T09:35:27+00:00","author":"Prashant Kumar","twitter_card":"summary_large_image","twitter_creator":"@KnowbandPlugin","twitter_site":"@KnowbandPlugin","twitter_misc":{"Written by":"Prashant Kumar","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.knowband.com\/blog\/magento-tutorials\/programmatically-create-orders-in-magento\/#article","isPartOf":{"@id":"https:\/\/www.knowband.com\/blog\/magento-tutorials\/programmatically-create-orders-in-magento\/"},"author":{"name":"Prashant Kumar","@id":"https:\/\/www.knowband.com\/blog\/fr\/#\/schema\/person\/04499d0d3f542a4f42182b91f772986c"},"headline":"How to programmatically create orders in Magento?","datePublished":"2018-10-29T09:33:42+00:00","dateModified":"2018-10-29T09:35:27+00:00","mainEntityOfPage":{"@id":"https:\/\/www.knowband.com\/blog\/magento-tutorials\/programmatically-create-orders-in-magento\/"},"wordCount":300,"commentCount":0,"publisher":{"@id":"https:\/\/www.knowband.com\/blog\/fr\/#organization"},"keywords":["create order in magento","Magento extension","Magento module","magento orders","magento store configuration"],"articleSection":["Magento Tutorials"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.knowband.com\/blog\/magento-tutorials\/programmatically-create-orders-in-magento\/","url":"https:\/\/www.knowband.com\/blog\/magento-tutorials\/programmatically-create-orders-in-magento\/","name":"How to programmatically create orders in Magento? - Knowband Blog","isPartOf":{"@id":"https:\/\/www.knowband.com\/blog\/fr\/#website"},"datePublished":"2018-10-29T09:33:42+00:00","dateModified":"2018-10-29T09:35:27+00:00","description":"Are you in the search of the process to programmatically create order in Magento extension? This write-up will walk you with the exact process.","breadcrumb":{"@id":"https:\/\/www.knowband.com\/blog\/magento-tutorials\/programmatically-create-orders-in-magento\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.knowband.com\/blog\/magento-tutorials\/programmatically-create-orders-in-magento\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.knowband.com\/blog\/magento-tutorials\/programmatically-create-orders-in-magento\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.knowband.com\/blog\/fr\/"},{"@type":"ListItem","position":2,"name":"How to programmatically create orders in Magento?"}]},{"@type":"WebSite","@id":"https:\/\/www.knowband.com\/blog\/fr\/#website","url":"https:\/\/www.knowband.com\/blog\/fr\/","name":"Knowband Blog | Ecommerce Modules","description":"Magento, Prestashop, Opencart, Shopify","publisher":{"@id":"https:\/\/www.knowband.com\/blog\/fr\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.knowband.com\/blog\/fr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.knowband.com\/blog\/fr\/#organization","name":"Knowband Blog | Ecommerce Modules","url":"https:\/\/www.knowband.com\/blog\/fr\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.knowband.com\/blog\/fr\/#\/schema\/logo\/image\/","url":"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2016\/09\/cropped-knowband_logo-v2.png","contentUrl":"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2016\/09\/cropped-knowband_logo-v2.png","width":153,"height":61,"caption":"Knowband Blog | Ecommerce Modules"},"image":{"@id":"https:\/\/www.knowband.com\/blog\/fr\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Knowband","https:\/\/x.com\/KnowbandPlugin"]},{"@type":"Person","@id":"https:\/\/www.knowband.com\/blog\/fr\/#\/schema\/person\/04499d0d3f542a4f42182b91f772986c","name":"Prashant Kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2018\/10\/10256082_607442326014813_1731639576902538685_o-150x150.jpg","url":"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2018\/10\/10256082_607442326014813_1731639576902538685_o-150x150.jpg","contentUrl":"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2018\/10\/10256082_607442326014813_1731639576902538685_o-150x150.jpg","caption":"Prashant Kumar"},"description":"Prashant is a passionate Magento developer. He loves exploring e-commerce and reading books.","url":"https:\/\/www.knowband.com\/blog\/author\/pkumar\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/posts\/22277","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/comments?post=22277"}],"version-history":[{"count":2,"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/posts\/22277\/revisions"}],"predecessor-version":[{"id":22283,"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/posts\/22277\/revisions\/22283"}],"wp:attachment":[{"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/media?parent=22277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/categories?post=22277"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/tags?post=22277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}