Fields
Needs write access. The body is the whole row.
| Field | Type | Rule |
|---|---|---|
| stockrequired | integer | Whole number, 0 to 1,000,000. |
| pricerequired | 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. |
This is a full replacement: an optional field you leave out becomes empty (null). To change one field and keep the rest, use PATCH.
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
- 201Created: the row is new.
- 200Replaced: the row existed.
- 422validation_failed:
errorsnames each field. - 403insufficient_scope: a Read only key.
This endpoint can also answer 401 invalid_api_key, 403 license_not_active, 403 product_not_included and 429 rate_limited.