Using WooCommerce REST API Batch Endpoint for Bulk Product Updates
Learn how to update many products in a single HTTP request with WooCommerce’s /wp-json/wc/v3/products/batch endpoint, reducing latency and staying within rate limits.
30 Mar 2026, 23:10 UTC

Problem: Too many API calls slow down bulk product updates
When you need to change prices, stock levels, or metadata for dozens or hundreds of products, sending a separate request for each item adds latency and can quickly hit WooCommerce’s REST API rate limits. This makes nightly inventory syncs or mass price adjustments unreliable and slow.
Takeaway: Use the batch endpoint to send up to 100 product changes in one request
The WooCommerce REST API includes a batch endpoint (/wp-json/wc/v3/products/batch) that accepts create, update, and delete arrays in a single JSON payload. It reduces round‑trips, helps you stay under rate limits, and returns a combined response that mirrors the request structure.
Understanding the batch endpoint
The endpoint is available on WooCommerce 3.4 or later and works with any authentication method the REST API supports (API keys, JWT, OAuth). You POST a JSON object with up to three optional keys:
create– array of new product objectsupdate– array of product objects that include anidand fields to changedelete– array of product IDs or objects withidand optionalforce: true
The response contains the same keys, each holding the resulting product objects (or error details) for the corresponding request items.
Preparing a payload and authenticating
First, generate a consumer key and secret from WooCommerce → Settings → Advanced → REST API. Use HTTP Basic Auth or pass the keys as consumer_key and consumer_secret query parameters.
Example payload that updates the regular price of two products:
{
"update": [
{
"id": 25,
"regular_price": "19.99"
},
{
"id": 57,
"regular_price": "29.99"
}
]
}
Worked example: curl request
Run the following command from a terminal where you have access to the WordPress site (replace placeholders with your actual values). No special privileges are needed beyond being able to make outbound HTTP requests.
curl -X POST "https://example.com/wp-json/wc/v3/products/batch?consumer_key=ck_your_key&consumer_secret=cs_your_secret" \
-H "Content-Type: application/json" \
-d '{
"update": [
{"id": 25, "regular_price": "19.99"},
{"id": 57, "regular_price": "29.99"}
]
}'
Expected checks:
- HTTP status code should be
200 OK. - The response body will contain an
updatearray with two product objects showing the newregular_pricevalues. - If any product fails validation (e.g., price format wrong), that item will appear in the response with an error code and message, while the other item may still succeed.
Trade‑offs and limitations
- Size limit: The batch endpoint accepts a maximum of 100 items per request. Exceeding this returns
400 Bad Request. Split large sets into multiple batches. - Partial failure: Although the HTTP request is atomic, WooCommerce does not roll back successful items if one fails. Your application must inspect the response for errors and decide whether to retry or log failures.
- Server resources: Large JSON payloads can exceed PHP
post_max_sizeormemory_limit. Verify these settings if you plan to approach the 100‑item limit.
Actionable closing
- Confirm your WooCommerce version (≥ 3.4) via WooCommerce → Status → System Info.
- Send a test batch request with the curl example above, using a couple of non‑critical products.
- Check the response for successful updates and any error objects.
- If successful, incorporate the batch endpoint into your sync script, remembering to chunk payloads at 100 items and handle partial failures.
By consolidating many product changes into a single request, you reduce latency, stay within API rate limits, and simplify your integration code—while staying aware of the size and failure‑handling constraints outlined above.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.