Fields
Needs write access. Send any of the PUT fields, with the same rules; the rest are kept. Send null to clear cost_price, sku or notes; stock and price cannot be null. An empty body is refused.
| Field | Type | Rule |
|---|---|---|
| stockoptional | integer | Whole number, 0 to 1,000,000. |
| priceoptional | number or string | 0.01 to 9,999,999.99, at most two decimals. |
| cost_priceoptional | number, string or null | 0 to 9,999,999.99, at most two decimals, or null. For your records only. |
| skuoptional | string or null | Up to 64 characters, or null. |
| notesoptional | string or null | Up to 5,000 characters, or null. |
- PATCH never creates a row:
404 item_not_foundif it does not exist. - If the row's price is 0.00, include a
priceunless the change leaves stock at 0.
Why the price must be at least 0.01
An in-house row is published at your price with no markup, and it wins ties. A row priced 0.00 with stock would put the product in your store at $0.00.
So no write through this API may leave a row with stock above 0 and a price under 0.01. The In-house inventory screen in wp-admin does accept 0.00, so you may meet a row priced 0.00. A PATCH or an adjustment that would leave it with stock is refused with 422 validation_failed on price until you give it a price. Taking its stock to 0 is always allowed.
Returns
- 200Updated: the whole row, in
data. - 404item_not_found: create the row with PUT or batch first.
- 422A field broke a rule, the body was empty, or the row is priced 0.00.
This endpoint can also answer 401 invalid_api_key, 403 license_not_active, 403 product_not_included and 429 rate_limited.