{"id":71767,"date":"2023-05-08T11:23:39","date_gmt":"2023-05-08T11:23:39","guid":{"rendered":"http:\/\/webkul.com\/blog\/?p=71767"},"modified":"2023-05-08T11:23:45","modified_gmt":"2023-05-08T11:23:45","slug":"use-customer-api-opencart","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/","title":{"rendered":"How to use customer api in Opencart"},"content":{"rendered":"<p>Today, we will learn about, how the customer api is used in opencart . By default, opencart uses this api while creating the order from the back end .<\/p>\n<p>To create the order from the back end, you have to login with your admin end and then go to sales-&gt;orders and click add button.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-380027 size-full\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/addorder-3.png\" alt=\"addorder\" width=\"1281\" height=\"660\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/addorder-3.png 1281w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/addorder-3-300x155.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/addorder-3-1200x618.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/addorder-3-250x129.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/addorder-3-768x396.png 768w\" sizes=\"(max-width: 1281px) 100vw, 1281px\" loading=\"lazy\" \/><\/p>\n<p>After clicking the add button, fill the customer details or select the existing customer from the customer field .<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-380028 size-full\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/addorder1-2.png\" alt=\"addorder1\" width=\"1282\" height=\"662\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/addorder1-2.png 1282w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/addorder1-2-300x155.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/addorder1-2-1200x620.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/addorder1-2-250x129.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/addorder1-2-768x397.png 768w\" sizes=\"(max-width: 1282px) 100vw, 1282px\" loading=\"lazy\" \/><\/p>\n<p>After filling all the details, press the continue button.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-380029 size-full\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/addorder2-2.png\" alt=\"addorder2\" width=\"1283\" height=\"521\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/addorder2-2.png 1283w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/addorder2-2-300x122.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/addorder2-2-1200x487.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/addorder2-2-250x102.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/addorder2-2-768x312.png 768w\" sizes=\"(max-width: 1283px) 100vw, 1283px\" loading=\"lazy\" \/><\/p>\n<p>When you will press the continue button then customer api will be called to add the customer details for generating the new order. The code for the customer api is given below :<\/p>\n<p><\/p>\n\n\n<pre class=\"EnlighterJSRAW\">\/**\n * Webkul Software.\n *\n * @category Webkul\n * @package api\n * @author Webkul\n * @copyright Webkul Software Private Limited (https:\/\/webkul.com)\n * @license https:\/\/store.webkul.com\/license.html\n *\/\n&lt;?php\nclass ControllerApiCustomer extends Controller\n{\n\tpublic function index()\n\t{\n\t\t$this-&gt;load-&gt;language(&#039;api\/customer&#039;);\n\n\t\t\/\/ Delete past customer in case there is an error\n\t\tunset($this-&gt;session-&gt;data&#091;&#039;customer&#039;]);\n\n\t\t$json = array();\n\n\t\tif (!isset($this-&gt;session-&gt;data&#091;&#039;api_id&#039;])) {\n\t\t\t$json&#091;&#039;error&#039;]&#091;&#039;warning&#039;] = $this-&gt;language-&gt;get(&#039;error_permission&#039;);\n\t\t} else {\n\t\t\t\/\/ Add keys for missing post vars\n\t\t\t$keys = array(\n\t\t\t\t&#039;customer_id&#039;,\n\t\t\t\t&#039;customer_group_id&#039;,\n\t\t\t\t&#039;firstname&#039;,\n\t\t\t\t&#039;lastname&#039;,\n\t\t\t\t&#039;email&#039;,\n\t\t\t\t&#039;telephone&#039;,\n\t\t\t);\n\n\t\t\tforeach ($keys as $key) {\n\t\t\t\tif (!isset($this-&gt;request-&gt;post&#091;$key])) {\n\t\t\t\t\t$this-&gt;request-&gt;post&#091;$key] = &#039;&#039;;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\/\/ Customer\n\t\t\tif ($this-&gt;request-&gt;post&#091;&#039;customer_id&#039;]) {\n\t\t\t\t$this-&gt;load-&gt;model(&#039;account\/customer&#039;);\n\n\t\t\t\t$customer_info = $this-&gt;model_account_customer-&gt;getCustomer($this-&gt;request-&gt;post&#091;&#039;customer_id&#039;]);\n\n\t\t\t\tif (!$customer_info || !$this-&gt;customer-&gt;login($customer_info&#091;&#039;email&#039;], &#039;&#039;, true)) {\n\t\t\t\t\t$json&#091;&#039;error&#039;]&#091;&#039;warning&#039;] = $this-&gt;language-&gt;get(&#039;error_customer&#039;);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ((utf8_strlen(trim($this-&gt;request-&gt;post&#091;&#039;firstname&#039;])) &lt; 1) || (utf8_strlen(trim($this-&gt;request-&gt;post&#091;&#039;firstname&#039;])) &gt; 32)) {\n\t\t\t\t$json&#091;&#039;error&#039;]&#091;&#039;firstname&#039;] = $this-&gt;language-&gt;get(&#039;error_firstname&#039;);\n\t\t\t}\n\n\t\t\tif ((utf8_strlen(trim($this-&gt;request-&gt;post&#091;&#039;lastname&#039;])) &lt; 1) || (utf8_strlen(trim($this-&gt;request-&gt;post&#091;&#039;lastname&#039;])) &gt; 32)) {\n\t\t\t\t$json&#091;&#039;error&#039;]&#091;&#039;lastname&#039;] = $this-&gt;language-&gt;get(&#039;error_lastname&#039;);\n\t\t\t}\n\n\t\t\tif ((utf8_strlen($this-&gt;request-&gt;post&#091;&#039;email&#039;]) &gt; 96) || (!filter_var($this-&gt;request-&gt;post&#091;&#039;email&#039;], FILTER_VALIDATE_EMAIL))) {\n\t\t\t\t$json&#091;&#039;error&#039;]&#091;&#039;email&#039;] = $this-&gt;language-&gt;get(&#039;error_email&#039;);\n\t\t\t}\n\n\t\t\tif ((utf8_strlen($this-&gt;request-&gt;post&#091;&#039;telephone&#039;]) &lt; 3) || (utf8_strlen($this-&gt;request-&gt;post&#091;&#039;telephone&#039;]) &gt; 32)) {\n\t\t\t\t$json&#091;&#039;error&#039;]&#091;&#039;telephone&#039;] = $this-&gt;language-&gt;get(&#039;error_telephone&#039;);\n\t\t\t}\n\n\t\t\t\/\/ Customer Group\n\t\t\tif (is_array($this-&gt;config-&gt;get(&#039;config_customer_group_display&#039;)) &amp;&amp; in_array($this-&gt;request-&gt;post&#091;&#039;customer_group_id&#039;], $this-&gt;config-&gt;get(&#039;config_customer_group_display&#039;))) {\n\t\t\t\t$customer_group_id = $this-&gt;request-&gt;post&#091;&#039;customer_group_id&#039;];\n\t\t\t} else {\n\t\t\t\t$customer_group_id = $this-&gt;config-&gt;get(&#039;config_customer_group_id&#039;);\n\t\t\t}\n\n\t\t\t\/\/ Custom field validation\n\t\t\t$this-&gt;load-&gt;model(&#039;account\/custom_field&#039;);\n\n\t\t\t$custom_fields = $this-&gt;model_account_custom_field-&gt;getCustomFields($customer_group_id);\n\n\t\t\tforeach ($custom_fields as $custom_field) {\n\t\t\t\tif ($custom_field&#091;&#039;location&#039;] == &#039;account&#039;) {\n\t\t\t\t\tif ($custom_field&#091;&#039;required&#039;] &amp;&amp; empty($this-&gt;request-&gt;post&#091;&#039;custom_field&#039;]&#091;$custom_field&#091;&#039;custom_field_id&#039;]])) {\n\t\t\t\t\t\t$json&#091;&#039;error&#039;]&#091;&#039;custom_field&#039; . $custom_field&#091;&#039;custom_field_id&#039;]] = sprintf($this-&gt;language-&gt;get(&#039;error_custom_field&#039;), $custom_field&#091;&#039;name&#039;]);\n\t\t\t\t\t} elseif (($custom_field&#091;&#039;type&#039;] == &#039;text&#039;) &amp;&amp; !empty($custom_field&#091;&#039;validation&#039;]) &amp;&amp; !filter_var($this-&gt;request-&gt;post&#091;&#039;custom_field&#039;]&#091;$custom_field&#091;&#039;custom_field_id&#039;]], FILTER_VALIDATE_REGEXP, array(&#039;options&#039; =&gt; array(&#039;regexp&#039; =&gt; $custom_field&#091;&#039;validation&#039;])))) {\n\t\t\t\t\t\t$json&#091;&#039;error&#039;]&#091;&#039;custom_field&#039; . $custom_field&#091;&#039;custom_field_id&#039;]] = sprintf($this-&gt;language-&gt;get(&#039;error_custom_field&#039;), $custom_field&#091;&#039;name&#039;]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!$json) {\n\t\t\t\t$this-&gt;session-&gt;data&#091;&#039;customer&#039;] = array(\n\t\t\t\t\t&#039;customer_id&#039; =&gt; $this-&gt;request-&gt;post&#091;&#039;customer_id&#039;],\n\t\t\t\t\t&#039;customer_group_id&#039; =&gt; $customer_group_id,\n\t\t\t\t\t&#039;firstname&#039; =&gt; $this-&gt;request-&gt;post&#091;&#039;firstname&#039;],\n\t\t\t\t\t&#039;lastname&#039; =&gt; $this-&gt;request-&gt;post&#091;&#039;lastname&#039;],\n\t\t\t\t\t&#039;email&#039; =&gt; $this-&gt;request-&gt;post&#091;&#039;email&#039;],\n\t\t\t\t\t&#039;telephone&#039; =&gt; $this-&gt;request-&gt;post&#091;&#039;telephone&#039;],\n\t\t\t\t\t&#039;custom_field&#039; =&gt; isset($this-&gt;request-&gt;post&#091;&#039;custom_field&#039;]) ? $this-&gt;request-&gt;post&#091;&#039;custom_field&#039;] : array()\n\t\t\t\t);\n\n\t\t\t\t$json&#091;&#039;success&#039;] = $this-&gt;language-&gt;get(&#039;text_success&#039;);\n\t\t\t}\n\t\t}\n\n\t\t$this-&gt;response-&gt;addHeader(&#039;Content-Type: application\/json&#039;);\n\t\t$this-&gt;response-&gt;setOutput(json_encode($json));\n\t}\n}<\/pre>\n\n\n\n<p>When the customer details will be successfully added to the session, then the api will return the success message.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1044\" height=\"536\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/ordersuccess1.png\" alt=\"ordersuccess1\" class=\"wp-image-380311\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/ordersuccess1.png 1044w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/ordersuccess1-300x154.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/ordersuccess1-250x128.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/05\/ordersuccess1-768x394.png 768w\" sizes=\"(max-width: 1044px) 100vw, 1044px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>If you need custom <a href=\"https:\/\/webkul.com\/opencart-development\/\" target=\"_blank\" rel=\"noreferrer noopener\">Opencart Development services<\/a> then feel free to <a href=\"https:\/\/webkul.com\/contacts\" target=\"_blank\" rel=\"noreferrer noopener\">reach us<\/a> and also explore our exclusive range of <a href=\"https:\/\/store.webkul.com\/OpenCart-Modules.html\" target=\"_blank\" rel=\"noreferrer noopener\">Opencart Extensions<\/a>.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today, we will learn about, how the customer api is used in opencart . By default, opencart uses this api while creating the order from the back end . To create the order from the back end, you have to login with your admin end and then go to sales-&gt;orders and click add button. After <a href=\"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":533,"featured_media":41008,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[305],"tags":[292,2071,2253],"class_list":["post-71767","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-opencart","tag-api","tag-opencart","tag-rest-api"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to use customer api in Opencart - Webkul Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to use customer api in Opencart - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"Today, we will learn about, how the customer api is used in opencart . By default, opencart uses this api while creating the order from the back end . To create the order from the back end, you have to login with your admin end and then go to sales-&gt;orders and click add button. After [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-08T11:23:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-08T11:23:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png\" \/>\n\t<meta property=\"og:image:width\" content=\"825\" \/>\n\t<meta property=\"og:image:height\" content=\"260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Faizali\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Faizali\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/\"},\"author\":{\"name\":\"Faizali\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/763dcded51281ad75e73e8d2561964bb\"},\"headline\":\"How to use customer api in Opencart\",\"datePublished\":\"2023-05-08T11:23:39+00:00\",\"dateModified\":\"2023-05-08T11:23:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/\"},\"wordCount\":161,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png\",\"keywords\":[\"api\",\"opencart\",\"REST API\"],\"articleSection\":[\"opencart\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/\",\"url\":\"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/\",\"name\":\"How to use customer api in Opencart - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png\",\"datePublished\":\"2023-05-08T11:23:39+00:00\",\"dateModified\":\"2023-05-08T11:23:45+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png\",\"width\":825,\"height\":260},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to use customer api in Opencart\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/763dcded51281ad75e73e8d2561964bb\",\"name\":\"Faizali\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e442205bdedb21e4c501111e8edf79079733c7accdc23facfbb762c53217cd76?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e442205bdedb21e4c501111e8edf79079733c7accdc23facfbb762c53217cd76?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Faizali\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/faizali-cs643\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to use customer api in Opencart - Webkul Blog","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:\/\/webkul.com\/blog\/use-customer-api-opencart\/","og_locale":"en_US","og_type":"article","og_title":"How to use customer api in Opencart - Webkul Blog","og_description":"Today, we will learn about, how the customer api is used in opencart . By default, opencart uses this api while creating the order from the back end . To create the order from the back end, you have to login with your admin end and then go to sales-&gt;orders and click add button. After [...]","og_url":"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2023-05-08T11:23:39+00:00","article_modified_time":"2023-05-08T11:23:45+00:00","og_image":[{"width":825,"height":260,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png","type":"image\/png"}],"author":"Faizali","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Faizali","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/"},"author":{"name":"Faizali","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/763dcded51281ad75e73e8d2561964bb"},"headline":"How to use customer api in Opencart","datePublished":"2023-05-08T11:23:39+00:00","dateModified":"2023-05-08T11:23:45+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/"},"wordCount":161,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png","keywords":["api","opencart","REST API"],"articleSection":["opencart"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/use-customer-api-opencart\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/","url":"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/","name":"How to use customer api in Opencart - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png","datePublished":"2023-05-08T11:23:39+00:00","dateModified":"2023-05-08T11:23:45+00:00","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/use-customer-api-opencart\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png","width":825,"height":260},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/use-customer-api-opencart\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to use customer api in Opencart"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/763dcded51281ad75e73e8d2561964bb","name":"Faizali","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e442205bdedb21e4c501111e8edf79079733c7accdc23facfbb762c53217cd76?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e442205bdedb21e4c501111e8edf79079733c7accdc23facfbb762c53217cd76?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Faizali"},"url":"https:\/\/webkul.com\/blog\/author\/faizali-cs643\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/71767","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/533"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=71767"}],"version-history":[{"count":7,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/71767\/revisions"}],"predecessor-version":[{"id":380325,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/71767\/revisions\/380325"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media\/41008"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=71767"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=71767"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=71767"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}