WooCommerce API

⭐ Beginner's Pick Shopping / API Key Intermediate HTTPS CORS
Varies by plan (check documentation)

Overview

The WooCommerce REST API lets you read and manage data on any WordPress site running WooCommerce — including products, orders, customers, and coupons. It uses standard HTTP methods (GET, POST, PUT, DELETE) and returns JSON, making it easy to work with from any language. You authenticate with consumer key and consumer secret credentials generated in your WooCommerce settings.

💡

Beginner Tip

Generate your API credentials from WooCommerce Settings Advanced REST API in your WordPress dashboard. Use HTTPS for all requests, since HTTP connections will be rejected by default.

Available Data

word definitions
pronunciation
synonyms and antonyms
example sentences
part of speech

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from WooCommerce",
    "description": "WooCommerce REST APIS to create, read, update, and delete data on wordpress website in JSON format",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

id Unique identifier for the product or order within WooCommerce.
name Display name of the product.
status Visibility status of the product, such as publish, draft, or private.
price Current selling price of the product as a string (e.g., "29.99").
stock_status Indicates whether the product is instock, outofstock, or onbackorder.
categories List of category objects (id and name) the product belongs to.

Implementation Example

const url = "https://woocommerce.github.io/woocommerce-rest-api-docs/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

401 Unauthorized: Consumer key is invalid The consumer key or secret is incorrect, or the credentials were generated for a different site.
Regenerate the API keys in WooCommerce Settings Advanced REST API and copy them carefully.
404 Not Found: No route was found matching the URL Pretty permalinks are not enabled on the WordPress site, so the REST API routes do not work.
Go to WordPress Settings Permalinks and select any option other than Plain, then save.
403 Forbidden: You do not have permission to read this resource The API key was created with Read-Only permission but you are trying to write data.
Create a new API key with Read/Write permission in the WooCommerce API settings.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 10/20
🔒 Security 15/15
🛠 Developer XP 17/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS YES
Category Shopping
Difficulty Intermediate
Verified: 2026-04-04

Similar APIs

View All →