WooCommerce REST API Overview
The WooCommerce REST API provides a powerful interface for interacting with your store programmatically. You can read and write various parts of WooCommerce data including orders, products, coupons, customers, shipping zones, and more.What is the REST API?
The REST API allows you to:- Retrieve store data in JSON format
- Create, update, and delete resources
- Integrate WooCommerce with external applications
- Build custom storefronts and mobile apps
- Automate store management tasks
API Versions
WooCommerce REST API is available in multiple versions:Version 3 (Current)
Namespace:wc/v3
The current stable version with the latest features and improvements. This version includes:
- Enhanced product management
- Improved order handling
- Customer data access
- Reports and analytics endpoints
- Batch operations support
Version 2 (Legacy)
Namespace:wc/v2
Previous stable version, still supported but not recommended for new integrations.
Version 1 (Deprecated)
Namespace:wc/v1
Deprecated version maintained for backwards compatibility only.
Always use the latest API version (v3) for new integrations to access the most recent features and security updates.
Base URL Structure
The REST API endpoints are accessed via the following URL pattern:Examples
Requirements
Permalinks Configuration
To access REST API endpoints using the standard URI structure, WordPress permalinks must be configured to something other than “Plain”.- Navigate to Settings > Permalinks in WordPress admin
- Select any option except “Plain” (recommended: “Post name”)
- Click Save Changes
If you cannot change permalinks, you can use the alternative query string format:
https://example.com/?rest_route=/wc/v3/productsHTTPS Recommended
While the API can work over HTTP, HTTPS is strongly recommended for:- Secure transmission of API credentials
- Protection of customer data
- Prevention of man-in-the-middle attacks
Core Endpoints
The WooCommerce REST API provides access to the following core resources:Products
- Endpoint:
/wc/v3/products - Operations: List, create, retrieve, update, delete products
- Related: Product variations, attributes, categories, tags
Orders
- Endpoint:
/wc/v3/orders - Operations: List, create, retrieve, update, delete orders
- Related: Order notes, refunds, line items
Customers
- Endpoint:
/wc/v3/customers - Operations: List, create, retrieve, update, delete customers
- Related: Customer orders, downloads
Coupons
- Endpoint:
/wc/v3/coupons - Operations: Manage discount coupons and promotional codes
Reports
- Endpoint:
/wc/v3/reports - Operations: Access sales reports, analytics, and statistics
Settings
- Endpoint:
/wc/v3/settings - Operations: Retrieve and update store settings
Shipping
- Endpoint:
/wc/v3/shipping - Operations: Manage shipping zones, methods, and classes
Taxes
- Endpoint:
/wc/v3/taxes - Operations: Manage tax rates and classes
HTTP Methods
The API uses standard HTTP methods:| Method | Description | Example Use |
|---|---|---|
GET | Retrieve resources | Get list of products |
POST | Create new resources | Create a new order |
PUT | Update existing resources | Update product price |
DELETE | Remove resources | Delete a customer |
OPTIONS | Get endpoint information | Discover available fields |
Response Format
All API responses are returned in JSON format:Response Headers
Important headers included in API responses:Pagination
List endpoints support pagination with the following parameters:Current page of results
Number of items per page (maximum 100)
Example
Filtering and Searching
Most endpoints support filtering and searching:Batch Operations
Many endpoints support batch operations for creating, updating, and deleting multiple items in a single request:Error Handling
API errors return appropriate HTTP status codes with detailed error messages:Common Status Codes
| Code | Status | Description |
|---|---|---|
| 200 | OK | Request successful |
| 201 | Created | Resource created successfully |
| 400 | Bad Request | Invalid request parameters |
| 401 | Unauthorized | Authentication failed |
| 403 | Forbidden | Insufficient permissions |
| 404 | Not Found | Resource does not exist |
| 500 | Internal Server Error | Server error occurred |
Error Response Format
Rate Limiting
WooCommerce does not impose rate limits by default, but your hosting provider may have restrictions. Always implement retry logic with exponential backoff in your integrations.
Webhooks Integration
While not part of the REST API itself, WooCommerce webhooks can notify your application of events:- Order created/updated
- Product created/updated
- Customer created/updated
- And more
Next Steps
Authentication
Learn how to authenticate API requests
Products
Manage products via the API
Orders
Create and manage orders
Customers
Work with customer data