The WooCommerce REST API v3 provides programmatic access to WooCommerce store data. This documentation focuses on the three main resources used in ShopCall.ai integration: Products, Orders, and Customers.
All API requests use the following base URL pattern:
https://your-store.com/wp-json/wc/v3/
This documentation covers WooCommerce REST API v3, which is the latest stable version.
Important: This is NOT the legacy WooCommerce API (v1, v2, v3 at /wc-api/v*). The modern REST API uses /wp-json/wc/v3/.
WooCommerce REST API supports two authentication methods depending on your connection type.
For secure HTTPS connections, use HTTP Basic Auth with your API credentials:
Headers:
Authorization: Basic <base64_encoded_credentials>
Where <base64_encoded_credentials> is the Base64 encoding of consumer_key:consumer_secret.
Example:
curl https://example.com/wp-json/wc/v3/products \
-u consumer_key:consumer_secret
For non-HTTPS connections, WooCommerce uses OAuth 1.0a "one-legged" authentication to prevent credential interception.
Required Parameters:
oauth_consumer_key - Your API consumer keyoauth_timestamp - Unix timestamp (must be within 15 minutes)oauth_nonce - 32-character random string, unique per consumer keyoauth_signature - HMAC-SHA1 or HMAC-SHA256 signatureoauth_signature_method - Either HMAC-SHA1 or HMAC-SHA256Signature Generation:
Example OAuth 1.0a Request:
GET /wp-json/wc/v3/products?oauth_consumer_key=ck_xxx&oauth_timestamp=1234567890&oauth_nonce=abc123...&oauth_signature=xyz789...&oauth_signature_method=HMAC-SHA256
The Products API allows you to create, view, update, and delete products.
| Method | Endpoint | Description |
|---|---|---|
| GET | /wp-json/wc/v3/products |
List all products |
| GET | /wp-json/wc/v3/products/{id} |
Retrieve a single product |
| POST | /wp-json/wc/v3/products |
Create a product |
| PUT/PATCH | /wp-json/wc/v3/products/{id} |
Update a product |
| DELETE | /wp-json/wc/v3/products/{id} |
Delete a product |
| POST | /wp-json/wc/v3/products/batch |
Batch update products |
| Property | Type | Description |
|---|---|---|
id |
integer | Unique product identifier (read-only) |
name |
string | Product name/title |
slug |
string | URL-friendly product name |
permalink |
string | Product URL (read-only) |
date_created |
string | ISO8601 date when created (read-only) |
date_modified |
string | ISO8601 date when last modified (read-only) |
type |
string | Product type: simple, grouped, external, variable |
status |
string | Status: draft, pending, private, publish |
featured |
boolean | Featured product flag |
catalog_visibility |
string | Visibility: visible, catalog, search, hidden |
description |
string | Full product description (HTML) |
short_description |
string | Short product description (HTML) |
sku |
string | Stock Keeping Unit |
price |
string | Current price (read-only) |
regular_price |
string | Regular price |
sale_price |
string | Sale price |
on_sale |
boolean | Sale status (read-only) |
purchasable |
boolean | Can be purchased (read-only) |
total_sales |
integer | Total units sold (read-only) |
virtual |
boolean | Is virtual product |
downloadable |
boolean | Is downloadable product |
external_url |
string | External product URL (for external products) |
button_text |
string | External product button text |
| Property | Type | Description |
|---|---|---|
manage_stock |
boolean | Enable stock management |
stock_quantity |
integer | Current stock quantity |
stock_status |
string | Stock status: instock, outofstock, onbackorder |
backorders |
string | Backorder policy: no, notify, yes |
backorders_allowed |
boolean | Backorders allowed (read-only) |
backordered |
boolean | Is on backorder (read-only) |
low_stock_amount |
integer | Low stock threshold |
sold_individually |
boolean | Limit purchases to 1 per order |
| Property | Type | Description |
|---|---|---|
tax_status |
string | Tax status: taxable, shipping, none |
tax_class |
string | Tax class |
price_html |
string | Formatted price HTML (read-only) |
| Property | Type | Description |
|---|---|---|
shipping_required |
boolean | Requires shipping |
shipping_taxable |
boolean | Is shipping taxable |
shipping_class |
string | Shipping class slug |
shipping_class_id |
integer | Shipping class ID |
weight |
string | Product weight |
dimensions |
object | Product dimensions: length, width, height |
| Property | Type | Description |
|---|---|---|
categories |
array | List of category objects with id and name |
tags |
array | List of tag objects with id and name |
images |
array | List of product images (see Images section) |
attributes |
array | List of product attributes (see Attributes section) |
{
"id": 123,
"src": "https://example.com/image.jpg",
"name": "Product image",
"alt": "Alt text"
}
{
"id": 1,
"name": "Color",
"position": 0,
"visible": true,
"variation": false,
"options": ["Red", "Blue", "Green"]
}
Request:
GET /wp-json/wc/v3/products
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
context |
string | Scope: view or edit. Default: view |
page |
integer | Current page. Default: 1 |
per_page |
integer | Results per page. Default: 10, Max: 100 |
search |
string | Search by product name or SKU |
after |
string | ISO8601 date - products created after |
before |
string | ISO8601 date - products created before |
exclude |
array | Product IDs to exclude |
include |
array | Product IDs to include |
offset |
integer | Offset results |
order |
string | Sort order: asc or desc. Default: desc |
orderby |
string | Sort by: date, id, include, title, slug. Default: date |
parent |
array | Parent product IDs |
parent_exclude |
array | Parent product IDs to exclude |
slug |
string | Product slug |
status |
string | Product status: any, draft, pending, private, publish |
type |
string | Product type: simple, grouped, external, variable |
sku |
string | Filter by SKU |
featured |
boolean | Featured products only |
category |
string | Category slug |
tag |
string | Tag slug |
on_sale |
boolean | On sale products only |
min_price |
string | Minimum price |
max_price |
string | Maximum price |
stock_status |
string | Stock status: instock, outofstock, onbackorder |
Example Request:
curl https://example.com/wp-json/wc/v3/products?per_page=20&status=publish \
-u consumer_key:consumer_secret
Response:
[
{
"id": 123,
"name": "Premium T-Shirt",
"slug": "premium-t-shirt",
"permalink": "https://example.com/product/premium-t-shirt/",
"date_created": "2025-01-15T10:30:00",
"date_modified": "2025-01-20T14:25:00",
"type": "simple",
"status": "publish",
"featured": false,
"catalog_visibility": "visible",
"description": "<p>High quality cotton t-shirt</p>",
"short_description": "<p>Comfortable premium tee</p>",
"sku": "TSHIRT-001",
"price": "29.99",
"regular_price": "29.99",
"sale_price": "",
"on_sale": false,
"purchasable": true,
"total_sales": 45,
"virtual": false,
"downloadable": false,
"manage_stock": true,
"stock_quantity": 100,
"stock_status": "instock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"sold_individually": false,
"weight": "0.2",
"dimensions": {
"length": "",
"width": "",
"height": ""
},
"shipping_required": true,
"shipping_taxable": true,
"shipping_class": "",
"shipping_class_id": 0,
"tax_status": "taxable",
"tax_class": "",
"categories": [
{
"id": 9,
"name": "Clothing",
"slug": "clothing"
}
],
"tags": [
{
"id": 15,
"name": "Cotton",
"slug": "cotton"
}
],
"images": [
{
"id": 456,
"src": "https://example.com/wp-content/uploads/tshirt.jpg",
"name": "tshirt.jpg",
"alt": "Premium T-Shirt"
}
],
"attributes": [],
"_links": {
"self": [{"href": "https://example.com/wp-json/wc/v3/products/123"}]
}
}
]
Request:
GET /wp-json/wc/v3/products/{id}
Example:
curl https://example.com/wp-json/wc/v3/products/123 \
-u consumer_key:consumer_secret
Response: Single product object (same structure as list response)
Request:
POST /wp-json/wc/v3/products
Example:
curl -X POST https://example.com/wp-json/wc/v3/products \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"name": "New Product",
"type": "simple",
"regular_price": "19.99",
"description": "Product description",
"short_description": "Short description",
"categories": [{"id": 9}],
"images": [{"src": "https://example.com/image.jpg"}]
}'
Request:
PUT /wp-json/wc/v3/products/{id}
PATCH /wp-json/wc/v3/products/{id}
Example:
curl -X PATCH https://example.com/wp-json/wc/v3/products/123 \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"regular_price": "24.99",
"stock_quantity": 75
}'
Request:
DELETE /wp-json/wc/v3/products/{id}
Query Parameters:
force (boolean): Set to true to permanently delete (default moves to trash)Example:
curl -X DELETE https://example.com/wp-json/wc/v3/products/123?force=true \
-u consumer_key:consumer_secret
The Orders API allows you to create, view, update, and delete orders.
| Method | Endpoint | Description |
|---|---|---|
| GET | /wp-json/wc/v3/orders |
List all orders |
| GET | /wp-json/wc/v3/orders/{id} |
Retrieve a single order |
| POST | /wp-json/wc/v3/orders |
Create an order |
| PUT/PATCH | /wp-json/wc/v3/orders/{id} |
Update an order |
| DELETE | /wp-json/wc/v3/orders/{id} |
Delete an order |
| POST | /wp-json/wc/v3/orders/batch |
Batch update orders |
| GET | /wp-json/wc/v3/orders/{id}/notes |
List order notes |
| POST | /wp-json/wc/v3/orders/{id}/notes |
Create an order note |
| GET | /wp-json/wc/v3/orders/{id}/refunds |
List order refunds |
| POST | /wp-json/wc/v3/orders/{id}/refunds |
Create a refund |
| Property | Type | Description |
|---|---|---|
id |
integer | Unique order identifier (read-only) |
parent_id |
integer | Parent order ID |
number |
string | Order number (read-only) |
order_key |
string | Order key (read-only) |
created_via |
string | Source of order creation (read-only) |
version |
string | WooCommerce version (read-only) |
status |
string | Order status (see Order Statuses) |
currency |
string | Currency code (ISO 4217) |
date_created |
string | ISO8601 date when created (read-only) |
date_modified |
string | ISO8601 date when modified (read-only) |
discount_total |
string | Total discount amount |
discount_tax |
string | Total discount tax |
shipping_total |
string | Total shipping amount |
shipping_tax |
string | Total shipping tax |
cart_tax |
string | Cart tax amount |
total |
string | Order total |
total_tax |
string | Total tax amount |
prices_include_tax |
boolean | Prices include tax |
customer_id |
integer | Customer/user ID |
customer_ip_address |
string | Customer IP address (read-only) |
customer_user_agent |
string | Customer user agent (read-only) |
customer_note |
string | Customer-provided note |
payment_method |
string | Payment method ID |
payment_method_title |
string | Payment method title |
transaction_id |
string | Transaction ID |
date_paid |
string | ISO8601 date when paid |
date_completed |
string | ISO8601 date when completed |
cart_hash |
string | Cart hash (read-only) |
| Property | Type | Description |
|---|---|---|
billing |
object | Billing address (see Address Structure) |
shipping |
object | Shipping address (see Address Structure) |
| Property | Type | Description |
|---|---|---|
line_items |
array | Line items data (see Line Items Structure) |
tax_lines |
array | Tax line items |
shipping_lines |
array | Shipping line items |
fee_lines |
array | Fee line items |
coupon_lines |
array | Coupon line items |
| Status | Description |
|---|---|
pending |
Payment pending |
processing |
Payment received, processing order |
on-hold |
Awaiting payment or stock |
completed |
Order fulfilled and complete |
cancelled |
Cancelled by admin or customer |
refunded |
Fully refunded |
failed |
Payment failed or declined |
trash |
Moved to trash |
{
"first_name": "John",
"last_name": "Doe",
"company": "Acme Inc",
"address_1": "123 Main St",
"address_2": "Apt 4B",
"city": "New York",
"state": "NY",
"postcode": "10001",
"country": "US",
"email": "john@example.com",
"phone": "+1-555-1234"
}
{
"id": 789,
"name": "Premium T-Shirt",
"product_id": 123,
"variation_id": 0,
"quantity": 2,
"tax_class": "",
"subtotal": "59.98",
"subtotal_tax": "0.00",
"total": "59.98",
"total_tax": "0.00",
"taxes": [],
"meta_data": [],
"sku": "TSHIRT-001",
"price": 29.99
}
Request:
GET /wp-json/wc/v3/orders
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
context |
string | Scope: view or edit. Default: view |
page |
integer | Current page. Default: 1 |
per_page |
integer | Results per page. Default: 10, Max: 100 |
search |
string | Search orders |
after |
string | ISO8601 date - orders created after |
before |
string | ISO8601 date - orders created before |
exclude |
array | Order IDs to exclude |
include |
array | Order IDs to include |
offset |
integer | Offset results |
order |
string | Sort order: asc or desc. Default: desc |
orderby |
string | Sort by: date, id, include, title, slug. Default: date |
parent |
array | Parent order IDs |
parent_exclude |
array | Parent order IDs to exclude |
status |
array | Order statuses (see Order Statuses) |
customer |
integer | Customer user ID |
product |
integer | Product ID in order |
dp |
integer | Decimal points for amounts. Default: 2 |
Example Request:
curl https://example.com/wp-json/wc/v3/orders?status=processing&per_page=20 \
-u consumer_key:consumer_secret
Response:
[
{
"id": 456,
"parent_id": 0,
"number": "456",
"order_key": "wc_order_abc123",
"created_via": "checkout",
"version": "8.5.0",
"status": "processing",
"currency": "USD",
"date_created": "2025-01-20T15:30:00",
"date_modified": "2025-01-20T15:31:00",
"discount_total": "0.00",
"discount_tax": "0.00",
"shipping_total": "10.00",
"shipping_tax": "0.00",
"cart_tax": "0.00",
"total": "69.98",
"total_tax": "0.00",
"prices_include_tax": false,
"customer_id": 789,
"customer_ip_address": "192.168.1.1",
"customer_user_agent": "Mozilla/5.0...",
"customer_note": "",
"billing": {
"first_name": "John",
"last_name": "Doe",
"company": "",
"address_1": "123 Main St",
"address_2": "",
"city": "New York",
"state": "NY",
"postcode": "10001",
"country": "US",
"email": "john@example.com",
"phone": "+1-555-1234"
},
"shipping": {
"first_name": "John",
"last_name": "Doe",
"company": "",
"address_1": "123 Main St",
"address_2": "",
"city": "New York",
"state": "NY",
"postcode": "10001",
"country": "US"
},
"payment_method": "stripe",
"payment_method_title": "Credit Card",
"transaction_id": "ch_abc123",
"date_paid": "2025-01-20T15:30:15",
"date_completed": null,
"cart_hash": "abc123def456",
"line_items": [
{
"id": 789,
"name": "Premium T-Shirt",
"product_id": 123,
"variation_id": 0,
"quantity": 2,
"tax_class": "",
"subtotal": "59.98",
"subtotal_tax": "0.00",
"total": "59.98",
"total_tax": "0.00",
"taxes": [],
"meta_data": [],
"sku": "TSHIRT-001",
"price": 29.99
}
],
"tax_lines": [],
"shipping_lines": [
{
"id": 790,
"method_title": "Flat Rate",
"method_id": "flat_rate",
"total": "10.00",
"total_tax": "0.00",
"taxes": []
}
],
"fee_lines": [],
"coupon_lines": [],
"_links": {
"self": [{"href": "https://example.com/wp-json/wc/v3/orders/456"}]
}
}
]
Request:
GET /wp-json/wc/v3/orders/{id}
Example:
curl https://example.com/wp-json/wc/v3/orders/456 \
-u consumer_key:consumer_secret
Request:
POST /wp-json/wc/v3/orders
Example:
curl -X POST https://example.com/wp-json/wc/v3/orders \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"payment_method": "bacs",
"payment_method_title": "Direct Bank Transfer",
"set_paid": true,
"billing": {
"first_name": "John",
"last_name": "Doe",
"address_1": "123 Main St",
"city": "New York",
"state": "NY",
"postcode": "10001",
"country": "US",
"email": "john@example.com",
"phone": "+1-555-1234"
},
"shipping": {
"first_name": "John",
"last_name": "Doe",
"address_1": "123 Main St",
"city": "New York",
"state": "NY",
"postcode": "10001",
"country": "US"
},
"line_items": [
{
"product_id": 123,
"quantity": 2
}
],
"shipping_lines": [
{
"method_id": "flat_rate",
"method_title": "Flat Rate",
"total": "10.00"
}
]
}'
Request:
PUT /wp-json/wc/v3/orders/{id}
PATCH /wp-json/wc/v3/orders/{id}
Example:
curl -X PATCH https://example.com/wp-json/wc/v3/orders/456 \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"status": "completed"
}'
Order notes are internal or customer-facing messages attached to orders.
List Order Notes:
GET /wp-json/wc/v3/orders/{order_id}/notes
Create Order Note:
POST /wp-json/wc/v3/orders/{order_id}/notes
Example:
curl -X POST https://example.com/wp-json/wc/v3/orders/456/notes \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"note": "Order packed and ready for shipment",
"customer_note": true
}'
The Customers API allows you to create, view, update, and delete customers.
| Method | Endpoint | Description |
|---|---|---|
| GET | /wp-json/wc/v3/customers |
List all customers |
| GET | /wp-json/wc/v3/customers/{id} |
Retrieve a single customer |
| POST | /wp-json/wc/v3/customers |
Create a customer |
| PUT/PATCH | /wp-json/wc/v3/customers/{id} |
Update a customer |
| DELETE | /wp-json/wc/v3/customers/{id} |
Delete a customer |
| POST | /wp-json/wc/v3/customers/batch |
Batch update customers |
| GET | /wp-json/wc/v3/customers/{id}/downloads |
List customer downloads |
| Property | Type | Description |
|---|---|---|
id |
integer | Unique customer identifier (read-only) |
date_created |
string | ISO8601 date when created (read-only) |
date_modified |
string | ISO8601 date when modified (read-only) |
email |
string | Customer email address (required) |
first_name |
string | Customer first name |
last_name |
string | Customer last name |
role |
string | User role (read-only) |
username |
string | Customer login username |
password |
string | Customer password (write-only) |
billing |
object | Billing address (see Address Structure) |
shipping |
object | Shipping address (see Address Structure) |
is_paying_customer |
boolean | Has purchased before (read-only) |
avatar_url |
string | Avatar/Gravatar URL (read-only) |
meta_data |
array | Customer metadata (custom fields) |
Request:
GET /wp-json/wc/v3/customers
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
context |
string | Scope: view or edit. Default: view |
page |
integer | Current page. Default: 1 |
per_page |
integer | Results per page. Default: 10, Max: 100 |
search |
string | Search customers by name or email |
exclude |
array | Customer IDs to exclude |
include |
array | Customer IDs to include |
offset |
integer | Offset results |
order |
string | Sort order: asc or desc. Default: asc |
orderby |
string | Sort by: id, include, name, registered_date. Default: name |
email |
string | Filter by email address |
role |
string | Filter by user role: all, administrator, customer, etc. |
Example Request:
curl https://example.com/wp-json/wc/v3/customers?per_page=20&orderby=registered_date \
-u consumer_key:consumer_secret
Response:
[
{
"id": 789,
"date_created": "2025-01-10T09:15:00",
"date_modified": "2025-01-20T14:30:00",
"email": "john@example.com",
"first_name": "John",
"last_name": "Doe",
"role": "customer",
"username": "johndoe",
"billing": {
"first_name": "John",
"last_name": "Doe",
"company": "",
"address_1": "123 Main St",
"address_2": "",
"city": "New York",
"state": "NY",
"postcode": "10001",
"country": "US",
"email": "john@example.com",
"phone": "+1-555-1234"
},
"shipping": {
"first_name": "John",
"last_name": "Doe",
"company": "",
"address_1": "123 Main St",
"address_2": "",
"city": "New York",
"state": "NY",
"postcode": "10001",
"country": "US"
},
"is_paying_customer": true,
"avatar_url": "https://secure.gravatar.com/avatar/...",
"meta_data": [],
"_links": {
"self": [{"href": "https://example.com/wp-json/wc/v3/customers/789"}]
}
}
]
Request:
GET /wp-json/wc/v3/customers/{id}
Example:
curl https://example.com/wp-json/wc/v3/customers/789 \
-u consumer_key:consumer_secret
Request:
POST /wp-json/wc/v3/customers
Example:
curl -X POST https://example.com/wp-json/wc/v3/customers \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"email": "jane@example.com",
"first_name": "Jane",
"last_name": "Smith",
"username": "janesmith",
"password": "SecurePass123!",
"billing": {
"first_name": "Jane",
"last_name": "Smith",
"address_1": "456 Oak Ave",
"city": "Los Angeles",
"state": "CA",
"postcode": "90001",
"country": "US",
"email": "jane@example.com",
"phone": "+1-555-5678"
}
}'
Request:
PUT /wp-json/wc/v3/customers/{id}
PATCH /wp-json/wc/v3/customers/{id}
Example:
curl -X PATCH https://example.com/wp-json/wc/v3/customers/789 \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"first_name": "Jonathan",
"billing": {
"phone": "+1-555-9999"
}
}'
Request:
DELETE /wp-json/wc/v3/customers/{id}
Query Parameters:
force (boolean): Required and must be true to deletereassign (integer): User ID to reassign posts toExample:
curl -X DELETE "https://example.com/wp-json/wc/v3/customers/789?force=true" \
-u consumer_key:consumer_secret
The WooCommerce REST API uses page-based pagination for list endpoints.
posts_per_page option| Parameter | Description | Example |
|---|---|---|
per_page |
Items per page (1-100) | ?per_page=20 |
page |
Page number (1-based) | ?page=2 |
offset |
Offset from first item | ?offset=10 |
The API includes pagination information in response headers:
| Header | Description |
|---|---|
X-WP-Total |
Total number of resources |
X-WP-TotalPages |
Total number of pages |
Link |
Navigation links (next, prev, first, last) |
Example Response Headers:
X-WP-Total: 157
X-WP-TotalPages: 16
Link: <https://example.com/wp-json/wc/v3/products?page=1>; rel="first",
<https://example.com/wp-json/wc/v3/products?page=2>; rel="next",
<https://example.com/wp-json/wc/v3/products?page=16>; rel="last"
# Get first page (20 items)
curl "https://example.com/wp-json/wc/v3/products?per_page=20&page=1" \
-u consumer_key:consumer_secret
# Get second page
curl "https://example.com/wp-json/wc/v3/products?per_page=20&page=2" \
-u consumer_key:consumer_secret
# Use offset instead
curl "https://example.com/wp-json/wc/v3/products?per_page=20&offset=20" \
-u consumer_key:consumer_secret
The WooCommerce REST API uses standard HTTP status codes to indicate success or failure.
| Code | Type | Description |
|---|---|---|
200 |
Success | Request successful |
201 |
Created | Resource created successfully |
400 |
Bad Request | Invalid request parameters or data |
401 |
Unauthorized | Invalid or missing authentication |
403 |
Forbidden | Insufficient permissions |
404 |
Not Found | Resource does not exist |
500 |
Server Error | Internal server error |
All errors return JSON with the following structure:
{
"code": "error_identifier",
"message": "Human-readable error description",
"data": {
"status": 404
}
}
| Code | HTTP Status | Description |
|---|---|---|
woocommerce_rest_authentication_error |
401 | Authentication failed |
woocommerce_rest_cannot_view |
403 | Insufficient permissions to view |
woocommerce_rest_cannot_create |
403 | Insufficient permissions to create |
woocommerce_rest_cannot_edit |
403 | Insufficient permissions to edit |
woocommerce_rest_cannot_delete |
403 | Insufficient permissions to delete |
woocommerce_rest_invalid_id |
404 | Resource ID not found |
woocommerce_rest_shop_order_invalid_id |
404 | Order not found |
woocommerce_rest_product_invalid_id |
404 | Product not found |
woocommerce_rest_customer_invalid_id |
404 | Customer not found |
rest_invalid_param |
400 | Invalid parameter value |
rest_missing_callback_param |
400 | Missing required parameter |
Authentication Error:
{
"code": "woocommerce_rest_authentication_error",
"message": "Invalid signature - provided signature does not match",
"data": {
"status": 401
}
}
Not Found Error:
{
"code": "woocommerce_rest_product_invalid_id",
"message": "Invalid ID",
"data": {
"status": 404
}
}
Invalid Parameter Error:
{
"code": "rest_invalid_param",
"message": "Invalid parameter(s): status",
"data": {
"status": 400,
"params": {
"status": "status is not one of draft, pending, private, publish"
}
}
}
JavaScript/TypeScript Example:
try {
const response = await fetch('https://example.com/wp-json/wc/v3/products/123', {
headers: {
'Authorization': 'Basic ' + btoa(consumerKey + ':' + consumerSecret)
}
});
if (!response.ok) {
const error = await response.json();
console.error(`Error ${error.data.status}: ${error.message}`);
throw new Error(error.message);
}
const product = await response.json();
return product;
} catch (error) {
console.error('API request failed:', error);
}
These parameters are available across most list endpoints.
| Parameter | Type | Default | Description |
|---|---|---|---|
context |
string | view |
Scope of response: view (public) or edit (all fields) |
page |
integer | 1 |
Current page number |
per_page |
integer | 10 |
Results per page (max 100) |
search |
string | - | Search term for full-text search |
after |
string | - | ISO8601 date - resources created after |
before |
string | - | ISO8601 date - resources created before |
exclude |
array | - | Resource IDs to exclude |
include |
array | - | Resource IDs to include |
offset |
integer | - | Offset results by number |
order |
string | desc |
Sort order: asc (ascending) or desc (descending) |
orderby |
string | date |
Sort field (varies by resource) |
parent |
array | - | Parent resource IDs |
parent_exclude |
array | - | Parent resource IDs to exclude |
slug |
string | - | Filter by slug |
| Parameter | Type | Description |
|---|---|---|
status |
string | Product status: any, draft, pending, private, publish |
type |
string | Product type: simple, grouped, external, variable |
category |
string | Category slug |
tag |
string | Tag slug |
sku |
string | Stock Keeping Unit |
featured |
boolean | Featured products only |
on_sale |
boolean | On sale products only |
min_price |
string | Minimum price filter |
max_price |
string | Maximum price filter |
stock_status |
string | Stock status: instock, outofstock, onbackorder |
| Parameter | Type | Description |
|---|---|---|
status |
array | Order statuses (see Order Statuses section) |
customer |
integer | Customer user ID |
product |
integer | Product ID in order |
dp |
integer | Decimal places for amounts (default: 2) |
| Parameter | Type | Description |
|---|---|---|
email |
string | Filter by email address |
role |
string | Filter by user role |
Use ISO8601 format for date parameters:
# Products created after January 1, 2025
curl "https://example.com/wp-json/wc/v3/products?after=2025-01-01T00:00:00" \
-u consumer_key:consumer_secret
# Orders created in January 2025
curl "https://example.com/wp-json/wc/v3/orders?after=2025-01-01T00:00:00&before=2025-02-01T00:00:00" \
-u consumer_key:consumer_secret
# Products by price (ascending)
curl "https://example.com/wp-json/wc/v3/products?orderby=price&order=asc" \
-u consumer_key:consumer_secret
# Orders by date (newest first)
curl "https://example.com/wp-json/wc/v3/orders?orderby=date&order=desc" \
-u consumer_key:consumer_secret
# Customers by name (alphabetical)
curl "https://example.com/wp-json/wc/v3/customers?orderby=name&order=asc" \
-u consumer_key:consumer_secret
WooCommerce itself does not implement rate limiting, but:
Recommended Rate Limiting:
// ShopCall.ai implementation uses 5 requests per second
const RATE_LIMIT = 5; // requests per second
const delay = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));
async function rateLimitedRequest(url: string, options: RequestInit) {
await delay(1000 / RATE_LIMIT);
return fetch(url, options);
}
_fields parametermodified_after parameter to fetch only updated resources/wc-api/v*) are deprecatedDocument Version: 1.0 Last Updated: 2025-01-29 API Version: WooCommerce REST API v3 Created for: ShopCall.ai Integration