{"id":125277,"date":"2025-03-19T12:55:56","date_gmt":"2025-03-19T12:55:56","guid":{"rendered":"\/tutorials\/?p=125277"},"modified":"2025-05-12T09:20:58","modified_gmt":"2025-05-12T09:20:58","slug":"woocommerce-api","status":"publish","type":"post","link":"\/in\/tutorials\/woocommerce-api\/","title":{"rendered":"WooCommerce REST API: A complete guide"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Are you looking to connect your WooCommerce store with external platforms? The WooCommerce REST API is a good friend! It makes it easy to access and manage store data with HTTP requests.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this guide, we\u2019ll cover everything you need to know about the WooCommerce REST API, from setup and authentication to troubleshooting tips. Whether you&#8217;re a developer or a store owner, this guide will help you make the most of the WooCommerce API.<\/p>\n\n\n\n\n\n\n<h2 class=\"wp-block-heading h-t-title-2\" id=\"h-what-is-woocommerce-rest-api\">What is WooCommerce REST API?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The WooCommerce REST API is an interface that allows external applications, websites, and systems to interact with your online store. In other words, it lets you retrieve and manage store data without direct access to the WordPress dashboard.<\/p>\n\n\n\n<h3 class=\"wp-block-heading h-t-title-3\" id=\"h-advantages-of-using-woocommerce-api\">Advantages of using WooCommerce API<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You can benefit from the <a data-click-id=\"hgr-post-content-link-rest-api\" href=\"\/in\/tutorials\/wordpress-rest-api\/\">REST API<\/a> in many ways, including:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Efficient store management<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The WooCommerce REST API allows store owners to automate tasks, such as:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705 Syncing inventory levels between WooCommerce and warehouses.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705 Reducing stock count in real time when an order is placed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705 Auto-generating invoices and send them to customers when an order is placed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705 Automatically assigning orders to specific shipping providers based on location.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705 Bulk-updating product prices and descriptions across multiple stores.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Seamless third-party integrations<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Businesses rely on different software tools to manage operations. The WooCommerce REST API enables seamless integration with:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705 Enterprise resource planning (ERP) tools to sync product inventory, supplier data, and warehouse stock levels in real time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705 <a data-click-id=\"hgr-post-content-link-customer-relationship-management-crm-systems\" href=\"\/in\/tutorials\/best-woocommerce-crm\/\">Customer relationship management (CRM) systems<\/a> to automatically process customer data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705 Accounting software to sync transactions, taxes, and refunds.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705 Business intelligence tools like Google Data Studio, Power BI, or Tableau for custom sales reports.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Multichannel selling<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The WooCommerce REST API helps sync multiple sales channels seamlessly. Here are some use case examples:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705 List WooCommerce products on Amazon, eBay, Walmart, and Etsy while keeping stock synchronized.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705 Auto-sync WooCommerce products with other selling channels like Instagram Shopping, Facebook Marketplace, or TikTok Shop.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705 Route orders to different warehouses or fulfillment centers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Custom mobile or <\/strong><a data-click-id=\"hgr-post-content-link-web-apps\" href=\"\/in\/tutorials\/custom-web-applications\/\">web apps<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The WooCommerce REST API is beneficial for businesses that want to build custom mobile apps, POS systems, or <a data-click-id=\"hgr-post-content-link-headless-commerce-solutions\" href=\"\/in\/tutorials\/headless-wordpress\/\">headless commerce solutions<\/a>. You can:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705 Create a native iOS or Android app that pulls product data, customer accounts, and orders from WooCommerce.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705 Connect WooCommerce with in-store point of sale (POS) systems to sync sales and inventory.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705 Use WooCommerce as the backend while building a fully customized front-end with other frameworks like React, Vue, or Next.js.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Scalability and flexibility<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As your business grows, modifying WooCommerce&#8217;s core files can impact your store\u2019s performance negatively. You can use the WooCommerce REST API as a scalable solution for:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705 Implementing advanced pricing rules based on customer roles, cart value, or purchase history.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705 Building custom subscription models without relying on third-party plugins.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705 Integrating with AI-based recommendation engines to personalize product suggestions.<\/p>\n\n\n\n<h3 class=\"wp-block-heading h-t-title-3\" id=\"h-how-does-woocommerce-api-work\">How does WooCommerce API work?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The WooCommerce API follows the <strong>Representational State Transfer (REST) <\/strong>principles, which provide guidelines for building scalable and stateless web services. This makes the WooCommerce API a RESTful application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When exchanging data, the API sends a <strong>request<\/strong> to the WooCommerce database. In return, it provides a response containing the requested content along with confirmation of whether the process was successful.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">External applications use REST API <strong>endpoints<\/strong> to determine which data to retrieve from your WooCommerce site. These endpoints are URLs that target specific store elements, such as products, orders, or customers. For instance, the following route accesses your store\u2019s list of products:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">http:\/\/example.com\/wp-json\/wc\/v3\/products<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">These routes interact with WooCommerce\u2019s endpoint functions, allowing you to manage the data using standard HTTP methods:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>GET<\/strong> \u2013 fetches data from the server.<\/li>\n\n\n\n<li><strong>POST<\/strong> \u2013 creates new data.<\/li>\n\n\n\n<li><strong>PUT<\/strong> \u2013 updates existing data.<\/li>\n\n\n\n<li><strong>DELETE<\/strong> \u2013 removes data.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading h-t-title-3\" id=\"h-woocommerce-api-requirements\">WooCommerce API requirements<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Before you start using the WooCommerce REST API, make sure that you meet the following requirements:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Newer WordPress and WooCommerce version <\/strong>\u2013 the API is only compatible with WordPress <strong>4.4+<\/strong> with WooCommerce <strong>3.5+<\/strong> activated.<\/li>\n\n\n\n<li><strong>Clean permalinks enabled <\/strong>\u2013<strong> <\/strong>to do this, go to <strong>Settings<\/strong> \u2192 <strong>Permalinks<\/strong> from your WordPress dashboard. Any permalink setting other than <strong>Plain<\/strong> will work.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6b0d7eb580c9d&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6b0d7eb580c9d\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"2398\" height=\"1240\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/wordpress-permalink-settings.png\/w=1024,h=1024,fit=scale-down\" alt=\"WordPress Permalink Settings page\" class=\"wp-image-125285\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/wordpress-permalink-settings.png\/w=2398,fit=scale-down 2398w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/wordpress-permalink-settings.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/wordpress-permalink-settings.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/wordpress-permalink-settings.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/wordpress-permalink-settings.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/wordpress-permalink-settings.png\/w=1536,fit=scale-down 1536w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/wordpress-permalink-settings.png\/w=2048,fit=scale-down 2048w\" sizes=\"(max-width: 2398px) 100vw, 2398px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div>\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Correct<\/strong> <a data-click-id=\"hgr-post-content-link-wordpress-user-roles-and-permissions\" href=\"\/in\/tutorials\/wordpress-user-roles-guide\/\">WordPress user roles and permissions<\/a> \u2013 only users with <strong>Administrator<\/strong> and <strong>Shop Manager<\/strong> roles can generate API keys and access certain endpoints.<\/li>\n\n\n\n<li><strong>HTTPS enabled<\/strong> \u2013 WooCommerce highly promotes HTTPS usage to secure API requests. Installing an <a data-click-id=\"hgr-post-content-link-ssl-certificate\" href=\"\/in\/tutorials\/what-is-ssl\/\">SSL certificate<\/a> also helps prevent errors related to establishing a secure connection.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading h-t-title-2\" id=\"h-how-to-generate-woocommerce-rest-api-key\">How to generate WooCommerce REST API key<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Once you confirm that all the requirements are met, create an authentication key to keep your API requests secure. WooCommerce supports different authentication methods, including API keys, OAuth 1.0a, and Basic Auth.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s keep it simple! Here\u2019s how you can generate the WooCommerce REST API keys from your WordPress dashboard:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Log in to your WordPress dashboard.<\/li>\n\n\n\n<li>Navigate to <strong>WooCommerce<\/strong> \u2192 <strong>Settings<\/strong> \u2192 <strong>Advanced<\/strong>.<\/li>\n\n\n\n<li>Open the <strong>REST API<\/strong> tab, and click <strong>Create an API key<\/strong>.<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6b0d7eb581eaa&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6b0d7eb581eaa\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"2410\" height=\"1186\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-tab.png\/w=1024,h=1024,fit=scale-down\" alt=\"The REST API tab in WooCommerce's Advanced settings\" class=\"wp-image-125287\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-tab.png\/w=2410,fit=scale-down 2410w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-tab.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-tab.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-tab.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-tab.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-tab.png\/w=1536,fit=scale-down 1536w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-tab.png\/w=2048,fit=scale-down 2048w\" sizes=\"(max-width: 2410px) 100vw, 2410px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div>\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li>Add a description, select the WordPress user who will own the key, and then choose the level of access from the drop-down menu.<\/li>\n\n\n\n<li>Click the <strong>Generate API Key <\/strong>button.<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6b0d7eb582e1d&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6b0d7eb582e1d\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"2418\" height=\"1138\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-key-generation-page.png\/w=1024,h=1024,fit=scale-down\" alt=\"The WooCommerce REST API generation page\" class=\"wp-image-125288\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-key-generation-page.png\/w=2418,fit=scale-down 2418w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-key-generation-page.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-key-generation-page.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-key-generation-page.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-key-generation-page.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-key-generation-page.png\/w=1536,fit=scale-down 1536w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-key-generation-page.png\/w=2048,fit=scale-down 2048w\" sizes=\"(max-width: 2418px) 100vw, 2418px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div>\n\n\n<ol start=\"6\" class=\"wp-block-list\">\n<li>You\u2019ll see the <strong>Consumer Key<\/strong> and <strong>Consumer Secret<\/strong> information along with a barcode. Make sure to store them in a safe place, as <strong>you\u2019ll only see them once<\/strong>.<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6b0d7eb583d1d&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6b0d7eb583d1d\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"2418\" height=\"1138\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-authentication-keys.png\/w=1024,h=1024,fit=scale-down\" alt=\"The WooCommerce REST API authentication keys\" class=\"wp-image-125289\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-authentication-keys.png\/w=2418,fit=scale-down 2418w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-authentication-keys.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-authentication-keys.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-authentication-keys.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-authentication-keys.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-authentication-keys.png\/w=1536,fit=scale-down 1536w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-authentication-keys.png\/w=2048,fit=scale-down 2048w\" sizes=\"(max-width: 2418px) 100vw, 2418px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div>\n\n<div class=\"announcement-block announcement-block--important\">\n            <span class=\"announcement-block__heading\">\n                <svg aria-hidden=\"true\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n                          d=\"M12 22.5C17.799 22.5 22.5 17.799 22.5 12C22.5 6.20101 17.799 1.5 12 1.5C6.20101 1.5 1.5 6.20101 1.5 12C1.5 17.799 6.20101 22.5 12 22.5ZM13.637 7.65198C13.637 6.74791 12.9041 6.01501 12 6.01501C11.0959 6.01501 10.363 6.74791 10.363 7.65198C10.5335 9.53749 10.875 13.383 10.875 13.383C10.875 14.0043 11.3787 14.508 12 14.508C12.6213 14.508 13.125 14.0043 13.125 13.383V13.38L13.637 7.65198ZM11.9927 15.714C11.3714 15.714 10.8677 16.2177 10.8677 16.839C10.8677 17.4603 11.3714 17.964 11.9927 17.964H12.0073C12.6286 17.964 13.1323 17.4603 13.1323 16.839C13.1323 16.2177 12.6286 15.714 12.0073 15.714H11.9927Z\"\n                          fill=\"#FEA419\"\/>\n                <\/svg>\n                Important\n            <\/span>\n            <p class=\"announcement-block__content\">\n                <strong>Important!<\/strong> If you delete the WordPress user linked to an API key, the key will stop working. API keys can\u2019t be transferred to other users.\n            <\/p><\/div>\n\n\n\n<h2 class=\"wp-block-heading h-t-title-2\" id=\"h-how-to-use-woocommerce-rest-api\">How to use WooCommerce REST API<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you\u2019re planning to use the WooCommerce REST API in an external application, you\u2019ll need to write a script in the application&#8217;s programming language to send requests.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Some API endpoints you can use include:<\/p>\n\n\n\n<figure tabindex=\"0\" class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Endpoints<\/strong><\/td><td><strong>Functions<\/strong><\/td><\/tr><tr><td>\/wp-json\/wc\/v3\/products<\/td><td>Retrieve or create products<\/td><\/tr><tr><td>\/wp-json\/wc\/v3\/products\/id number<\/td><td>Manage a specific product<\/td><\/tr><tr><td>\/wp-json\/wc\/v3\/orders<\/td><td>Retrieve or create orders<\/td><\/tr><tr><td>\/wp-json\/wc\/v3\/orders\/id number<\/td><td>Manage a specific order<\/td><\/tr><tr><td>\/wp-json\/wc\/v3\/customers<\/td><td>Retrieve or create customer data<\/td><\/tr><tr><td>\/wp-json\/wc\/v3\/customers\/id number<\/td><td>Manage specific customer data<\/td><\/tr><tr><td>\/wp-json\/wc\/v3\/categories<\/td><td>Retrieve or create categories<\/td><\/tr><tr><td>\/wp-json\/wc\/v3\/categories\/id number<\/td><td>Manage a specific category<\/td><\/tr><tr><td>\/wp-json\/wc\/v3\/coupons<\/td><td>Retrieve or create coupons<\/td><\/tr><tr><td>\/wp-json\/wc\/v3\/coupons\/id number<\/td><td>Manage a specific coupon<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">For a complete list of API endpoints and attributes, refer to the <a data-click-id=\"hgr-post-content-link-official-woocommerce-documentation\" href=\"https:\/\/woocommerce.github.io\/woocommerce-rest-api-docs\/\" target=\"_blank\" rel=\"noopener\">official WooCommerce documentation<\/a>. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It\u2019s always a good idea to test whether your WooCommerce REST API works correctly, as it can help identify potential issues or bugs early on.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this section, we\u2019ll show you how to use <a data-click-id=\"hgr-post-content-link-postman\" href=\"https:\/\/www.postman.com\/\" target=\"_blank\" rel=\"noopener\">Postman<\/a>, a manual testing tool to send and verify API requests before implementing them in your application. We\u2019ll focus on manipulating product data using the API.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If this is your first time using Postman, you\u2019ll need to create an account first. Once you can see the home page, click the <strong>New Request <\/strong>button.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6b0d7eb585471&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6b0d7eb585471\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1828\" height=\"720\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/new-request-button-in-postman.png\/w=1024,h=1024,fit=scale-down\" alt=\"The New Request button highlighted in Postman's initial interface\" class=\"wp-image-125292\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/new-request-button-in-postman.png\/w=1828,fit=scale-down 1828w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/new-request-button-in-postman.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/new-request-button-in-postman.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/new-request-button-in-postman.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/new-request-button-in-postman.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/new-request-button-in-postman.png\/w=1536,fit=scale-down 1536w\" sizes=\"(max-width: 1828px) 100vw, 1828px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading h-t-title-3\" id=\"h-using-woocommerce-api-to-retrieve-all-product-data\">Using WooCommerce API to retrieve all product data<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Once you enter the workspace interface, follow these steps to fetch your entire product data:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Select <strong>GET<\/strong> from the drop-down menu.<\/li>\n\n\n\n<li>In the text field, type the endpoint URL, like <strong>https:\/\/example.com\/wp-json\/wc\/v3\/products<\/strong> (remember to replace the store\u2019s URL with your own).<\/li>\n\n\n\n<li>Go to the <strong>Authorization<\/strong> tab. Choose <strong>Basic Auth<\/strong> from the drop-down menu.<\/li>\n\n\n\n<li>Input your <strong>Consumer Key<\/strong> in the <strong>Username<\/strong> field and your <strong>Consumer Secret<\/strong> in the <strong>Password<\/strong> field.<\/li>\n\n\n\n<li>Hit <strong>Send<\/strong>.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">If you receive a <strong>200 OK<\/strong> response, it means your API request was successful. Your full product list will be displayed in the results.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6b0d7eb586926&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6b0d7eb586926\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1986\" height=\"1154\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-get-request-example.png\/w=1024,h=1024,fit=scale-down\" alt=\"The WooCommerce REST API GET request example\" class=\"wp-image-125294\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-get-request-example.png\/w=1986,fit=scale-down 1986w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-get-request-example.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-get-request-example.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-get-request-example.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-get-request-example.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-get-request-example.png\/w=1536,fit=scale-down 1536w\" sizes=\"(max-width: 1986px) 100vw, 1986px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading h-t-title-3\" id=\"h-using-woocommerce-api-to-add-products\">Using WooCommerce API to add products<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Other than fetching data, you can send a POST request to add a new product:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Choose POST from the drop-down menu.<\/li>\n\n\n\n<li>Make sure the API endpoint URL is correct.<\/li>\n\n\n\n<li>Open the <strong>Headers<\/strong> tab. Type <strong>Content-Type <\/strong>in the <strong>Key<\/strong> field and <strong>application\/json <\/strong>in <strong>Value<\/strong>.<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6b0d7eb5880af&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6b0d7eb5880af\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1872\" height=\"566\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-post-request-header-value.png\/w=1024,h=1024,fit=scale-down\" alt=\"The WooCommerce REST API POST request Header value example\" class=\"wp-image-125295\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-post-request-header-value.png\/w=1872,fit=scale-down 1872w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-post-request-header-value.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-post-request-header-value.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-post-request-header-value.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-post-request-header-value.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-post-request-header-value.png\/w=1536,fit=scale-down 1536w\" sizes=\"(max-width: 1872px) 100vw, 1872px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div>\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li>Go to the <strong>Body<\/strong> tab, select <strong>raw<\/strong>, and enter the following JSON script:<\/li>\n<\/ol>\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=\"\">{\n\n\u00a0\u00a0\"name\": \"Sample Product\",\n\n\u00a0\u00a0\"type\": \"simple\",\n\n\u00a0\u00a0\"regular_price\": \"29.99\",\n\n\u00a0\u00a0\"description\": \"This is a sample product.\",\n\n\u00a0\u00a0\"categories\": [{\"id\": 17}]\n\n}<\/pre>\n\n\n\n<ol start=\"5\" class=\"wp-block-list\">\n<li>Feel free to tweak the product information as you see fit. Hit <strong>Send<\/strong> once done.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">If successful, the response will return the product details with an ID.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6b0d7eb589a16&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6b0d7eb589a16\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1778\" height=\"1402\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-post-request-result.png\/w=1024,h=1024,fit=scale-down\" alt=\"The WooCommerce REST API POST request result example\" class=\"wp-image-125296\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-post-request-result.png\/w=1778,fit=scale-down 1778w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-post-request-result.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-post-request-result.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-post-request-result.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-post-request-result.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-post-request-result.png\/w=1536,fit=scale-down 1536w\" sizes=\"(max-width: 1778px) 100vw, 1778px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading h-t-title-3\" id=\"h-using-woocommerce-api-to-update-product-data\">Using WooCommerce API to update product data<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To edit existing product data without accessing your WooCommerce dashboard, follow this step:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Change the request method to <strong>PUT<\/strong>.<\/li>\n\n\n\n<li>Enter the API URL with the product ID that you want to change, like: <strong>https:\/\/example.com\/wp-json\/wc\/v3\/products\/17<\/strong>.<\/li>\n\n\n\n<li>In the <strong>Body<\/strong> tab, enter the JSON script with the updated product information:<\/li>\n<\/ol>\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=\"\">{\n\n\u00a0\u00a0\"name\": \"Updated Product Name\",\n\n\u00a0\u00a0\"regular_price\": \"34.99\"\n\n}<\/pre>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li>Hit <strong>Send<\/strong>.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>200 OK<\/strong> response should confirm the product update.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6b0d7eb58adc3&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6b0d7eb58adc3\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1968\" height=\"1052\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-put-request-example-1.png\/w=1024,h=1024,fit=scale-down\" alt=\"The WooCommerce REST API PUT request example\" class=\"wp-image-125297\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-put-request-example-1.png\/w=1968,fit=scale-down 1968w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-put-request-example-1.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-put-request-example-1.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-put-request-example-1.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-put-request-example-1.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2025\/03\/woocommerce-rest-api-put-request-example-1.png\/w=1536,fit=scale-down 1536w\" sizes=\"(max-width: 1968px) 100vw, 1968px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading h-t-title-2\" id=\"h-common-woocommerce-api-issues\">Common WooCommerce API issues<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">While working with the WooCommerce REST API can have its hurdles, most issues are easy to fix. In this section, we\u2019ll highlight common challenges and the simple solutions to fix them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Authentication errors<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When your API requests fail with an authentication error, it means the credentials are incorrect, expired, or improperly formatted.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Solutions:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705 Check if the API keys you\u2019re using are correct.<br>\u2705 Make sure<strong> <\/strong>you\u2019re using the appropriate authentication method for your request.<br>\u2705 Some hosting providers disable Basic Authentication for security reasons. If you\u2019re using it, confirm that your host supports it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Invalid or missing API keys<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If WooCommerce rejects your API request due to invalid or missing API keys, it means the API credentials aren\u2019t set up correctly or have insufficient permissions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Solutions:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705 If your API keys aren\u2019t working, revoke them and generate new ones.<br>\u2705 Make sure the API key has the right permission to perform the operations.<br>\u2705 Include the API keys properly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>401 Unauthorized or 403 Forbidden errors<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">These errors happen when the user role doesn\u2019t have permission to access the API endpoint, or an external security setting is blocking the request.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Solutions:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705 Make sure your WordPress account is assigned to the <strong>Administrator<\/strong> or <strong>Shop Manager<\/strong> role.<br>\u2705 Some WordPress security plugins block API requests. Try temporarily deactivating the plugin to see if the API is working.<br>\u2705 If you use Cloudflare or a web application firewall (WAF), allowlist your API endpoints to prevent blocking.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>404 Not Found error<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This occurs when the requested endpoint doesn\u2019t exist or your WordPress permalinks aren\u2019t configured correctly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Solutions:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705<strong> <\/strong>Make sure your WooCommerce site has the pretty permalink setting enabled.<br>\u2705 Recheck your<strong> <\/strong>API version and endpoint, and make sure they are correct.<br>\u2705 If you\u2019re fetching a specific product or order, verify if the resource exists in WooCommerce.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>400 Bad Request error<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This occurs when the request is improperly formatted, contains missing parameters, or includes invalid data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Solutions:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705<strong> <\/strong>Make sure that all required parameters are included in the request.<br>\u2705 Check if the data format matches WooCommerce API specifications.<br>\u2705 Verify that your authentication details (API keys, tokens) are correct and properly formatted.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>API rate limits and performance issues<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">WooCommerce limits the number of API requests per hour, which can cause performance issues or temporary blocks.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Solutions:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2705<strong> <\/strong>Use batch requests to fetch or update multiple records in a single call.<br>\u2705 Reduce redundant API calls by storing frequently requested data locally.<br>\u2705 If necessary, modify rate limits using a plugin like WooCommerce REST API Manager or adjust the Apache\/Nginx rate limits.<\/p>\n\n\n<figure class=\"wp-block-image size-full\"><a data-click-id=\"hgr-post-content-link-in-woocommerce-hosting\" aria-label=\"Woocommerce hosting\" href=\"\/in\/woocommerce-hosting\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" width=\"2048\" height=\"600\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/06\/Woocommerce-hosting-x-WP_in-text-banner.png\/public\" alt=\"\" class=\"wp-image-111779\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/06\/Woocommerce-hosting-x-WP_in-text-banner.png\/w=2048,fit=scale-down 2048w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/06\/Woocommerce-hosting-x-WP_in-text-banner.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/06\/Woocommerce-hosting-x-WP_in-text-banner.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/06\/Woocommerce-hosting-x-WP_in-text-banner.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/06\/Woocommerce-hosting-x-WP_in-text-banner.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/06\/Woocommerce-hosting-x-WP_in-text-banner.png\/w=1536,fit=scale-down 1536w\" sizes=\"(max-width: 2048px) 100vw, 2048px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading h-t-title-2\" id=\"h-conclusion\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The WooCommerce REST API lets your store seamlessly integrate with third-party applications, automate tasks, and manage data programmatically. Whether you want to fetch product details, update order statuses, or customize customer information, you can do it without accessing your WordPress dashboard.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Since the WooCommerce REST API is enabled by default, you can start testing it right away using tools like Postman or by running <a data-click-id=\"hgr-post-content-link-curl-commands\" href=\"\/in\/tutorials\/curl-command\/\">cURL commands<\/a>. Use GET requests to retrieve data, POST to create new entries, PUT to update existing records, and DELETE to remove them. Just be sure to secure your API with proper authentication, such as OAuth or API keys, and optimize performance by handling requests efficiently.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ready to elevate your WooCommerce store? Start experimenting with the API today and see what\u2019s possible.<\/p>\n\n\n\n<h2 class=\"wp-block-heading h-t-title-2\" id=\"h-woocommerce-rest-api-faq\">WooCommerce REST API FAQ<\/h2>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1742388507812\"><h3 class=\"schema-faq-question\">How to get data from WooCommerce API?<\/h3> <p class=\"schema-faq-answer\">First, generate API keys from your WooCommerce settings to authenticate requests. Next, send a <strong>GET<\/strong> request to the specific API endpoint using a platform like Postman or by running a cURL command in your terminal.\u00a0<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1742388513535\"><h3 class=\"schema-faq-question\">How do I create a custom API in WooCommerce?<\/h3> <p class=\"schema-faq-answer\">Navigate to <strong>WooCommerce<\/strong> \u2192 <strong>Settings<\/strong> \u2192 <strong>Advanced<\/strong> from your WordPress dashboard. Under the <strong>Page setup<\/strong> tab, find the <strong>Account endpoints<\/strong> section, where you can customize the URL endpoints. Make sure the URLs are unique to prevent conflicts, and don\u2019t forget to click <strong>Save changes<\/strong> once you&#8217;re<strong> <\/strong>done.\u00a0<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1742388520224\"><h3 class=\"schema-faq-question\">What is the limit of REST API in WooCommerce?<\/h3> <p class=\"schema-faq-answer\">By default, the WooCommerce REST API supports up to <strong>100 items<\/strong> per request.<\/p> <\/div> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>Are you looking to connect your WooCommerce store with external platforms? The WooCommerce REST API is a good friend! It makes it easy to access and manage store data with HTTP requests. In this guide, we\u2019ll cover everything you need to know about the WooCommerce REST API, from setup and authentication to troubleshooting tips. Whether [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/in\/tutorials\/woocommerce-api\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":257,"featured_media":122851,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"","rank_math_description":"","rank_math_focus_keyword":"","_content_updated_date":"","footnotes":""},"categories":[22720,22667],"tags":[],"class_list":["post-125277","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-woocommerce","category-wordpress"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/how-to-generate-woocommerce-api\/","default":1},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/woocommerce-api\/","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/how-to-generate-woocommerce-api\/","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/how-to-generate-woocommerce-api\/","default":0},{"locale":"en-GB","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/woocommerce-api\/","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/woocommerce-api\/","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/how-to-generate-woocommerce-api\/","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/how-to-generate-woocommerce-api\/","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/how-to-generate-woocommerce-api\/","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts\/125277","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/users\/257"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/comments?post=125277"}],"version-history":[{"count":10,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts\/125277\/revisions"}],"predecessor-version":[{"id":128118,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts\/125277\/revisions\/128118"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/media?parent=125277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/categories?post=125277"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/tags?post=125277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}