Appearance
REST API
WooCommerce Attribute Stock includes a fully integrated WooCommerce REST API endpoint, which can be used to read and manage your attribute stock items from external software.
Before you can access the WooCommerce REST API for your site, you'll need to create an API key. Please refer to the official guide for instructions.
For further instructions and examples of using the WooCommerce REST API, please refer to the WooCommerce REST API documentation.
Stock item properties
Property | Type | Description | |
---|---|---|---|
id | integer | Unique identifier for the stock item. | readonly |
title | string | Stock item name. | |
slug | string | Stock item post slug. | readonly |
sku | string | Internal stock keeping unit. | |
enabled | boolean | Whether the stock item is enabled or disabled. | |
status | string | The post status of the stock item. | |
quantity | number | Current stock quantity. | |
low_stock | number | Low stock threshold. An empty string ("" ) inherits the global WooCommerce setting. | |
internal | boolean | Internal stock is ignored when determining the stock availability of matched products. | |
multiplex | boolean | Deduct stock for multiple matching rules simultaneously instead of only the first matched rule. | |
lock_multipliers | boolean | Prevent this item's stock multipliers from being overridden by products. | |
product_image | boolean | Use this item's stock image as a fallback for matched products with no image. | |
image_id | integer | Attachment ID of the stock image. | |
components | array | List of component relationships. | |
match_rules | array | List of attribute match rule data. | |
products | array | Products filter. List of product IDs. | |
exclude_products | array | Exclude products filter. List of product IDs. | |
categories | array | Categories filter. List of category IDs. | |
exclude_categories | array | Exclude categories filter. List of category IDs. | |
product_types | array | Product types filter. List of product type strings. | |
tags | array | List of tag names. | |
notes | string | Internal notes. | |
created | date-time | The date the stock item was created, in the site's timezone. | readonly |
created_gmt | date-time | The date the stock item was created, in GMT. | readonly |
modified | date-time | The date the stock item was last modified, in the site's timezone. | readonly |
modified_gmt | date-time | The date the stock item was last modified, in GMT. | readonly |
List stock items
http
GET /wp-json/wc/v3/attribute-stock
Parameters
Key | Type | Description |
---|---|---|
context | string | Scope under which the request is made; determines fields present in response. Options: view and edit . Default is view . |
page | integer | Current page of the collection. Default is 1 . |
per_page | integer | Maximum number of items to be returned in result set. Default is 10 . |
status | string|array | Status of post object. Options: any , publish , draft , trash . Default is any , which is equivalent to ["publish", "draft"] . |
enabled | boolean | Overrides status if present. true is equivalent to publish status. false is equivalent to draft status. |
search | string | Limit results to those matching a string. |
after | string | Limit response to resources published after a given ISO8601 compliant date. |
before | string | Limit response to resources published before a given ISO8601 compliant date. |
exclude | array | Ensure result set excludes specific IDs. |
include | array | Limit result set to specific IDs. |
offset | integer | Offset the result set by a specific number of items. |
orderby | string | Sort collection by object attribute. Options: title , sku , quantity , date , id , include , and slug . Default is title . |
order | string | Sort order. Options: asc and desc . Default is asc . |
Single item requests
Retrieve a stock item
http
GET /wp-json/wc/v3/attribute-stock/<id>
Create a new stock item
http
POST /wp-json/wc/v3/attribute-stock
Update a stock item
http
PUT /wp-json/wc/v3/attribute-stock/<id>
Delete a stock item
http
DELETE /wp-json/wc/v3/attribute-stock/<id>
Batch update stock items
http
POST /wp-json/wc/v3/attribute-stock/batch
Webhooks
Attribute stock includes standard WooCommerce webhook topics (under WooCommerce
▹ Settings
▹ Advanced
▹ Webhooks
) for changes on attribute stock items.
Webhooks are useful in combination with workflow automation services like Make.com. For example, you could automatically export your attribute stock list to a Google Sheet whenever there's a change. Or email yourself a weekly CSV stock report.
See the WooCommerce Webhooks documentation to learn more about webhooks.