{"id":386912,"date":"2023-06-14T05:35:27","date_gmt":"2023-06-14T05:35:27","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=386912"},"modified":"2023-06-14T05:45:51","modified_gmt":"2023-06-14T05:45:51","slug":"how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/","title":{"rendered":"How to create a custom API endpoint instead of api in webservice using PrestaShop 1.7"},"content":{"rendered":"\n<p>In this blog, We are going to learn how we can create a custom API endpoint instead of api in the PrestaShop webservice. Sometimes we want to show our custom endpoint in webservice URL instead PrestaShop existing endpoint (api).<\/p>\n\n\n\n<p>We are creating a custom module to manage things on the install\/uninstall process of this module.<\/p>\n\n\n\n<p>For our example, we have created a .txt file with the code which we want to add in core PrestaShop files. We have created an update_htaccess.txt file with this below code &amp; we will add some custom code in the .htaccess file at the time of module installation.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">RewriteRule ^api(?:\/(.*))?$ %{ENV:REWRITEBASE}webservice\/dispatcher.php?url=$1 &#091;QSA,L]\nRewriteRule ^customapi\/v1(?:\/(.*))?$ %{ENV:REWRITEBASE}webservice\/dispatcher.php?url=$1 &#091;QSA,L]<\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"641\" height=\"83\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/Selection_185.png\" alt=\"Selection_185\" class=\"wp-image-386914\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/Selection_185.png 641w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/Selection_185-300x39.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/Selection_185-250x32.png 250w\" sizes=\"(max-width: 641px) 100vw, 641px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>Check the below code which we have added to the install function.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">public function install()\n{\n    if (!parent::install()\n        || !$this-&gt;addCustomCodeInHtaccessFile()\n    ) {\n        return false;\n    }\n\n    return true;\n}\n\nprivate function addCustomCodeInHtaccessFile()\n{\n    $findInHtaccess = &#039;RewriteRule ^api(?:\/(.*))?$ %{ENV:REWRITEBASE}webservice\/dispatcher.php?url=$1 &#091;QSA,L]&#039;;\n    $updatedContent = file_get_contents(_PS_MODULE_DIR_. $this-&gt;name . &#039;\/update_htaccess.txt&#039;);\n    $htaccessFile = _PS_CORE_DIR_.&#039;\/.htaccess&#039;;\n    $htaccessContent = file_get_contents($htaccessFile);\n    $updatedHtaccessContent = str_replace($findInHtaccess, $updatedContent, $htaccessContent);\n    file_put_contents($htaccessFile, $updatedHtaccessContent);\n}<\/pre>\n\n\n\n<p>Now you can see when the module is installed then customapi endpoint related code is added in the main .htaccess file.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1082\" height=\"524\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/Selection_186.png\" alt=\"Selection_186\" class=\"wp-image-386915\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/Selection_186.png 1082w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/Selection_186-300x145.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/Selection_186-250x121.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/Selection_186-768x372.png 768w\" sizes=\"(max-width: 1082px) 100vw, 1082px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>The same flow you can use for the uninstall process that when the module will uninstall then custom code should be removed from the .htaccess file.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">public function uninstall()\n{\n    if (!parent::uninstall()\n        || !$this-&gt;removeCustomCodeFromHtaccessFile()\n    ) {\n        return false;\n    }\n\n    return true;\n}\n\nprivate function removeCustomCodeFromHtaccessFile()\n{\n    $findInHtaccess = &#039;RewriteRule ^customapi\/v1(?:\/(.*))?$ %{ENV:REWRITEBASE}webservice\/dispatcher.php?url=$1 &#091;QSA,L]&#039;;\n    $htaccessFile = _PS_CORE_DIR_.&#039;\/.htaccess&#039;;\n    $htaccessContent = file_get_contents($htaccessFile);\n    $updatedHtaccessContent = str_replace($findInHtaccess, &#039;&#039;, $htaccessContent);\n    file_put_contents($htaccessFile, $updatedHtaccessContent);\n}<\/pre>\n\n\n\n<p>Now when you will run the webservice with a custom endpoint then it will work the same as the core api endpoint.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"535\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/Selection_184-1200x535.png\" alt=\"Selection_184\" class=\"wp-image-386916\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/Selection_184-1200x535.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/Selection_184-300x134.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/Selection_184-250x111.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/Selection_184-768x342.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/Selection_184-604x270.png 604w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/Selection_184.png 1364w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p><strong>Note:<\/strong> If you can change the functionality or flow then you can add a custom dispatcher file for your custom api endpoint. Here is an example.<\/p>\n\n\n\n<p><strong>RewriteRule ^customapi\/v1(?:\/(.*))?$ %{ENV:REWRITEBASE}webservice\/customdispatcher.php?url=$1 [QSA,L]<\/strong><\/p>\n\n\n\n<p>Then you need to add a customdispatcher.php in webservice folder.<\/p>\n\n\n\n<p>That\u2019s all about this blog. Hope it will help you.<\/p>\n\n\n\n<p>If you are facing any issues or have any doubts about the above process, please feel free to contact us through the comment section.<\/p>\n\n\n\n<p>Also, you can explore our <a href=\"https:\/\/webkul.com\/prestashop-development\/\">PrestaShop Development Services<\/a> and a large range of quality <a href=\"https:\/\/store.webkul.com\/PrestaShop-Extensions.html\">PrestaShop Modules<\/a>.<\/p>\n\n\n\n<p>For any doubt contact us at support@webkul.com <\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog, We are going to learn how we can create a custom API endpoint instead of api in the PrestaShop webservice. Sometimes we want to show our custom endpoint in webservice URL instead PrestaShop existing endpoint (api). We are creating a custom module to manage things on the install\/uninstall process of this module. <a href=\"https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":387,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1173,209,1172],"tags":[2065,4126,3291,3283,3294,294],"class_list":["post-386912","post","type-post","status-publish","format-standard","hentry","category-api-2","category-prestashop","category-web-service","tag-prestashop","tag-prestashop-1-7","tag-prestashop-webservice","tag-prestashop-webservice-api","tag-webservice-api","tag-webservices"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to create a custom API endpoint instead of api in webservice using PrestaShop 1.7 - Webkul Blog<\/title>\n<meta name=\"description\" content=\"In this blog, We are going to learn how we can create a custom API endpoint instead of api in the PrestaShop webservice. Sometimes we want to show our custom endpoint in webservice URL instead PrestaShop existing endpoint (api).\" \/>\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\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to create a custom API endpoint instead of api in webservice using PrestaShop 1.7 - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"In this blog, We are going to learn how we can create a custom API endpoint instead of api in the PrestaShop webservice. Sometimes we want to show our custom endpoint in webservice URL instead PrestaShop existing endpoint (api).\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/\" \/>\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-06-14T05:35:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-06-14T05:45:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/06\/Selection_185.png\" \/>\n<meta name=\"author\" content=\"Sunny Kumar\" \/>\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=\"Sunny Kumar\" \/>\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\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/\"},\"author\":{\"name\":\"Sunny Kumar\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/82afaa5265683f080b52d639e7cdaf67\"},\"headline\":\"How to create a custom API endpoint instead of api in webservice using PrestaShop 1.7\",\"datePublished\":\"2023-06-14T05:35:27+00:00\",\"dateModified\":\"2023-06-14T05:45:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/\"},\"wordCount\":309,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/06\/Selection_185.png\",\"keywords\":[\"prestashop\",\"Prestashop 1.7\",\"Prestashop Webservice\",\"Prestashop WebService API\",\"Webservice API\",\"webservices\"],\"articleSection\":[\"API\",\"prestashop\",\"web service\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/\",\"url\":\"https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/\",\"name\":\"How to create a custom API endpoint instead of api in webservice using PrestaShop 1.7 - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/06\/Selection_185.png\",\"datePublished\":\"2023-06-14T05:35:27+00:00\",\"dateModified\":\"2023-06-14T05:45:51+00:00\",\"description\":\"In this blog, We are going to learn how we can create a custom API endpoint instead of api in the PrestaShop webservice. Sometimes we want to show our custom endpoint in webservice URL instead PrestaShop existing endpoint (api).\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/Selection_185.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/Selection_185.png\",\"width\":641,\"height\":83,\"caption\":\"Selection_185\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to create a custom API endpoint instead of api in webservice using PrestaShop 1.7\"}]},{\"@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\/82afaa5265683f080b52d639e7cdaf67\",\"name\":\"Sunny Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/71f74f424b1b289dfe7a885325f69bf2ecd11c159d2c3ee19fc5df341650df4c?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\/71f74f424b1b289dfe7a885325f69bf2ecd11c159d2c3ee19fc5df341650df4c?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Sunny Kumar\"},\"description\":\"Sunny, a Prestashop virtuoso, crafts innovative eCommerce solutions. His expertise in marketplace development is unparalleled, seamlessly integrating modules. With precision coding, Sunny creates robust online stores, ensuring a seamless user experience. His engineering prowess enhances digital retail, leaving a lasting impact on the Prestashop community.\",\"url\":\"https:\/\/webkul.com\/blog\/author\/sunny-kumar912\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to create a custom API endpoint instead of api in webservice using PrestaShop 1.7 - Webkul Blog","description":"In this blog, We are going to learn how we can create a custom API endpoint instead of api in the PrestaShop webservice. Sometimes we want to show our custom endpoint in webservice URL instead PrestaShop existing endpoint (api).","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\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/","og_locale":"en_US","og_type":"article","og_title":"How to create a custom API endpoint instead of api in webservice using PrestaShop 1.7 - Webkul Blog","og_description":"In this blog, We are going to learn how we can create a custom API endpoint instead of api in the PrestaShop webservice. Sometimes we want to show our custom endpoint in webservice URL instead PrestaShop existing endpoint (api).","og_url":"https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2023-06-14T05:35:27+00:00","article_modified_time":"2023-06-14T05:45:51+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/06\/Selection_185.png","type":"","width":"","height":""}],"author":"Sunny Kumar","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Sunny Kumar","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/"},"author":{"name":"Sunny Kumar","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/82afaa5265683f080b52d639e7cdaf67"},"headline":"How to create a custom API endpoint instead of api in webservice using PrestaShop 1.7","datePublished":"2023-06-14T05:35:27+00:00","dateModified":"2023-06-14T05:45:51+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/"},"wordCount":309,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/06\/Selection_185.png","keywords":["prestashop","Prestashop 1.7","Prestashop Webservice","Prestashop WebService API","Webservice API","webservices"],"articleSection":["API","prestashop","web service"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/","url":"https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/","name":"How to create a custom API endpoint instead of api in webservice using PrestaShop 1.7 - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/06\/Selection_185.png","datePublished":"2023-06-14T05:35:27+00:00","dateModified":"2023-06-14T05:45:51+00:00","description":"In this blog, We are going to learn how we can create a custom API endpoint instead of api in the PrestaShop webservice. Sometimes we want to show our custom endpoint in webservice URL instead PrestaShop existing endpoint (api).","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/Selection_185.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/06\/Selection_185.png","width":641,"height":83,"caption":"Selection_185"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/how-to-create-a-custom-api-endpoint-instead-of-api-in-webservice-using-prestashop-1-7\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to create a custom API endpoint instead of api in webservice using PrestaShop 1.7"}]},{"@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\/82afaa5265683f080b52d639e7cdaf67","name":"Sunny Kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/71f74f424b1b289dfe7a885325f69bf2ecd11c159d2c3ee19fc5df341650df4c?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\/71f74f424b1b289dfe7a885325f69bf2ecd11c159d2c3ee19fc5df341650df4c?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Sunny Kumar"},"description":"Sunny, a Prestashop virtuoso, crafts innovative eCommerce solutions. His expertise in marketplace development is unparalleled, seamlessly integrating modules. With precision coding, Sunny creates robust online stores, ensuring a seamless user experience. His engineering prowess enhances digital retail, leaving a lasting impact on the Prestashop community.","url":"https:\/\/webkul.com\/blog\/author\/sunny-kumar912\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/386912","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\/387"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=386912"}],"version-history":[{"count":3,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/386912\/revisions"}],"predecessor-version":[{"id":386923,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/386912\/revisions\/386923"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=386912"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=386912"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=386912"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}