Skip to content
Bitcoin Bitcoin $ 43,595.00 ▼ 17.15% | Ethereum Ethereum $ 1,366.97 ▼ 14.77% | BNB BNB $ 423.17 ▼ 18.58% | XRP XRP $ 0.71 ▼ 17.06% | Solana Solana $ 55.30 ▼ 19.66% | Figure Heloc Figure Heloc $ 1.04 ▲ 0.49% | TRON TRON $ 0.26 ▼ 6.12% | Zcash Zcash $ 822.91 ▼ 14.35% | Hyperliquid Hyperliquid $ 58.71 ▼ 9.86% | LEO Token LEO Token $ 8.92 ▼ 2.72% | Dogecoin Dogecoin $ 0.04 ▼ 21.66% | Chainlink Chainlink $ 7.25 ▼ 16.24% | WhiteBIT Coin WhiteBIT Coin $ 45.49 ▼ 15.79% | Monero Monero $ 274.81 ▼ 22.42% | Cardano Cardano $ 0.12 ▼ 18.42% | Stellar Stellar $ 0.10 ▼ 12.50% | NEAR Protocol NEAR Protocol $ 2.72 ▼ 22.01% | Bitcoin Cash Bitcoin Cash $ 166.08 ▼ 19.82% | Tether Gold Tether Gold $ 3,757.76 ▲ 1.30% | Bitway Bitway $ 2.95 ▲ 30.26% | Ripple USD Ripple USD $ 1.00 ▲ 0.00% | Litecoin Litecoin $ 33.18 ▼ 17.59% | Global Dollar Global Dollar $ 1.00 ▲ 0.02% | Canton Canton $ 0.06 ▼ 14.20% | Ondo US Dollar Yield Ondo US Dollar Yield $ 1.15 ▼ 0.38% | Avalanche Avalanche $ 5.26 ▼ 15.81% | PayPal USD PayPal USD $ 1.00 ▲ 0.01% | Circle USYC Circle USYC $ 1.15 ▲ 0.04% | Sui Sui $ 0.54 ▼ 18.73% | Uniswap Uniswap $ 3.62 ▼ 20.23% | Spiko Amundi Overnight Swap Fund (EUR) Spiko Amundi Overnight Swap Fund (EUR) $ 1.10 ▲ 0.19% | USD1 USD1 $ 1.00 ▲ 0.01% | Gram (prev. Toncoin) Gram (prev. Toncoin) $ 0.68 ▼ 20.86% | Hedera Hedera $ 0.04 ▼ 15.63% | PAX Gold PAX Gold $ 3,762.99 ▲ 1.41% | BlackRock USD Institutional Digital Liquidity Fund BlackRock USD Institutional Digital Liquidity Fund $ 1.00 ▲ 0.00% | Falcon USD Falcon USD $ 1.00 ▲ 0.02% | Quant Quant $ 112.51 ▼ 17.57% | Cronos Cronos $ 0.03 ▼ 11.91% |
Menu

How to Use REST API with WooCommerce

Introduction: What is the WooCommerce REST API?

The WooCommerce REST API is a powerful tool that allows developers and store owners to interact with WooCommerce data from outside the WordPress dashboard. Using it, you can perform actions like retrieving products, creating orders, updating customer data, and integrating with third-party services—all without logging into wp-admin.

In this guide, you’ll learn everything from the basics of enabling the API to making advanced API calls using authentication and custom endpoints.


🚀 Why Use the WooCommerce REST API?

  • 📦 Manage orders, products, and customers externally
  • 🔄 Sync data with ERP/CRM tools
  • 🛒 Build custom mobile or desktop applications
  • 🤖 Automate tasks using scripts or webhooks
  • 🔗 Integrate WooCommerce with third-party platforms like Zapier, Integromat, etc.

🛠️ Prerequisites Before Using the REST API

Before getting started, make sure you have:

  • Admin access to your WordPress site
  • WooCommerce installed and active
  • Permalinks enabled (not set to “Plain”)
  • Basic knowledge of HTTP, JSON, and API usage

📖 WooCommerce REST API documentation
📖 WordPress REST API basics


🔐 Step 1: Enable the REST API in WooCommerce

  1. Go to WooCommerce > Settings > Advanced > REST API
  2. Click Add Key
  3. Enter a description (e.g., “Mobile App Integration”)
  4. Choose a user with admin rights
  5. Set permissions:
    • Read: View only
    • Write: Create/Update/Delete
    • Read/Write: Full access
  6. Click Generate API Key

📌 Note the Consumer Key and Consumer Secret—these are needed for authentication.


🌐 Step 2: Making Your First API Request

You can test the API using tools like:

Example: Get a list of products

curl https://yourdomain.com/wp-json/wc/v3/products \
-u consumer_key:consumer_secret

 


📥 Step 3: Authentication Methods

1. HTTP Basic Auth (Simplest for dev use)

  • Use your consumer key and secret

2. OAuth 1.0a (Legacy method)

  • Used in WooCommerce 2.x

3. Application Passwords (WordPress 5.6+)

4. JWT (JSON Web Tokens)


🔄 Step 4: CRUD Operations with WooCommerce API

✅ GET (Read data)

GET /wp-json/wc/v3/products

➕ POST (Create data)

POST /wp-json/wc/v3/products
{
  "name": "Test Product",
  "type": "simple",
  "price": "25.99"
}

✏️ PUT (Update data)

PUT /wp-json/wc/v3/products/123
{
  "price": "29.99"
}

❌ DELETE (Remove data)

DELETE /wp-json/wc/v3/products/123?force=true

📊 Step 5: Useful API Endpoints

Function Endpoint
List Products /wp-json/wc/v3/products
View Orders /wp-json/wc/v3/orders
Create Customer /wp-json/wc/v3/customers
Check Inventory /wp-json/wc/v3/products?stock_status=instock
Update Shipping /wp-json/wc/v3/orders/{id}/shipping_lines

Full list 👉 WooCommerce REST API Reference


🧠 Advanced Use Cases

1. 📲 Build a Custom WooCommerce Mobile App

Use the REST API to fetch/store live data for customers, products, and checkout.

2. 🔗 Integrate with CRM/ERP

Sync orders with Zoho, Salesforce, or QuickBooks using automation tools or custom code.

3. 📩 Automate Workflows with Zapier

Trigger actions on new orders or abandoned carts. Zapier WooCommerce Integration


⚠️ Security Tips for API Usage

  • Use HTTPS always 🔐
  • Regenerate keys if you suspect a breach
  • Set read-only permissions when possible
  • Avoid exposing API credentials in client-side apps
  • Use JWT or OAuth for secure integrations

🧰 Helpful Tools & Plugins


🧪 Testing & Debugging API Requests

  • Use browser console or Postman
  • Enable WordPress debugging
  • Monitor network requests using Chrome DevTools

💡

The WooCommerce REST API is a gateway to limitless customizations, automations, and integrations. Whether you’re a developer looking to build a headless store, or a business automating backend processes, understanding how to interact with this API will give you superpowers.

Start small, test thoroughly, and always prioritize security.