ATUM REST API

Stock takes

ATUM Stock Takes

The stock takes API allows you to create, view, update, and delete individual, or a batch, of stock takes. A stock take lists the products (or inventories, when Multi-Inventory is active) to count, with their stock and the counted quantities.

The requests need a user with the Stock Takes capabilities: read_stock_takes to list, read_stock_take, create_stock_takes, edit_stock_take and delete_stock_take for the single stock takes, and edit_others_stock_takes for the batch requests.

Stock take properties

AttributeTypeDescription
idintegerUnique identifier for the resource. read-only
statusstringStock take status. Options: draft (Counting), publish (Reconciled) and trash. Default is draft.
titlestringStock take title. If it's empty, a title with the creation date is shown in the admin.
items_addedintegerNumber of items added to the stock take.
items_countedintegerNumber of items that were already counted.
total_stocknumberSum of the current stock of all the items.
total_countnumberSum of the counted quantities of all the items.
total_valuenumberValue of the current stock of all the items (stock × purchase price).
count_valuenumberValue of the counted quantities of all the items (count × purchase price).
count_differencenumberDifference between the total count and the total stock.
value_differencenumberDifference between the count value and the total value.
date_createddate-timeThe date the stock take was created, in the site's timezone.
date_created_gmtdate-timeThe date the stock take was created, as GMT.
date_modifieddate-timeThe date the stock take was last modified, in the site's timezone. read-only
date_modified_gmtdate-timeThe date the stock take was last modified, as GMT. read-only
date_reconcileddate-timeThe date the stock take was reconciled, in the site's timezone.
date_reconciled_gmtdate-timeThe date the stock take was reconciled, as GMT.
author_idintegerUser ID who created the stock take. write-only
line_itemsarrayStock take items data. See Stock take - Line items properties
meta_dataarrayMeta data. See Stock take - Meta data properties

The totals (from items_added to value_difference) are calculated from the line items every time the stock take is loaded, so any value sent for them is overwritten. The stock and the values are taken from the current stock and purchase price of the related products or inventories.

Stock take - Line items properties

AttributeTypeDescription
idintegerStock take item ID. Pass it to update or delete an existing item. read-only
item_idintegerRelated item ID (product ID or inventory ID).
st_idintegerStock take ID. read-only
stocknumberThe item stock quantity.
countnumberThe items counted.
reconciledbooleanWhether the item has been reconciled. Default is false.
parent_idintegerThe item's parent ID (if applicable). If it's not set, it's filled automatically with the parent product of a variation or with the product an inventory belongs to.
is_inventorybooleanWhether the related item is an inventory. It's returned as 0 or 1. Default is false. Multi-Inventory
deletebooleanTo delete an item, pass this prop as true with the item ID to remove. write-only
meta_dataarrayItem meta data. read-only

Stock take - Meta data properties

AttributeTypeDescription
idintegerMeta ID. read-only
keystringMeta key.
valuemixedMeta value.

The reconciliation (updating the stock of the products with the counted quantities) can only be run from the Stock Takes screens in the WordPress admin. Setting status to publish or reconciled to true through the API doesn't change the stock of the products.

Create a stock take

This API helps you to create a new stock take.

HTTP request

POST/wp-json/wc/v3/atum/stock-takes

Example of how to create a stock take with two products

curl -X POST https://example.com/wp-json/wc/v3/atum/stock-takes \
	-u consumer_key:consumer_secret \
	-H "Content-Type: application/json" \
	-d '{
    "title": "Warehouse A - Monthly count",
    "line_items": [
        {
            "item_id": 93,
            "stock": 10,
            "count": 8
        },
        {
            "item_id": 37,
            "stock": 20
        }
    ]
}'
JSON response example
{
    "meta_data": [],
    "id": 2150,
    "status": "draft",
    "items_added": 2,
    "items_counted": 1,
    "total_stock": "30.00",
    "total_count": "8.00",
    "total_value": "170.00",
    "count_value": "40.00",
    "count_difference": -22,
    "value_difference": "-130.00",
    "line_items": [
        {
            "id": 1021,
            "item_id": 93,
            "st_id": 2150,
            "stock": 10,
            "count": 8,
            "reconciled": false,
            "is_inventory": 0,
            "parent_id": 0,
            "meta_data": []
        },
        {
            "id": 1022,
            "item_id": 37,
            "st_id": 2150,
            "stock": 20,
            "count": null,
            "reconciled": false,
            "is_inventory": 0,
            "parent_id": 0,
            "meta_data": []
        }
    ],
    "date_created": "2026-10-30T09:12:40",
    "title": "Warehouse A - Monthly count",
    "date_modified": "2026-10-30T09:12:40",
    "date_reconciled": null,
    "date_reconciled_gmt": null,
    "date_created_gmt": "2026-10-30T08:12:40",
    "date_modified_gmt": "2026-10-30T08:12:40",
    "_links": {
        "self": [
            {
                "href": "https://example.com/wp-json/wc/v3/atum/stock-takes/2150"
            }
        ],
        "collection": [
            {
                "href": "https://example.com/wp-json/wc/v3/atum/stock-takes"
            }
        ]
    }
}

Retrieve a stock take

This API lets you retrieve and view a specific stock take.

HTTP request

GET/wp-json/wc/v3/atum/stock-takes/<id>
curl https://example.com/wp-json/wc/v3/atum/stock-takes/2150 \
	-u consumer_key:consumer_secret
JSON response example
{
    "meta_data": [],
    "id": 2150,
    "status": "draft",
    "items_added": 2,
    "items_counted": 1,
    "total_stock": "30.00",
    "total_count": "8.00",
    "total_value": "170.00",
    "count_value": "40.00",
    "count_difference": -22,
    "value_difference": "-130.00",
    "line_items": [
        {
            "id": 1021,
            "item_id": 93,
            "st_id": 2150,
            "stock": 10,
            "count": 8,
            "reconciled": false,
            "is_inventory": 0,
            "parent_id": 0,
            "meta_data": []
        },
        {
            "id": 1022,
            "item_id": 37,
            "st_id": 2150,
            "stock": 20,
            "count": null,
            "reconciled": false,
            "is_inventory": 0,
            "parent_id": 0,
            "meta_data": []
        }
    ],
    "date_created": "2026-10-30T09:12:40",
    "title": "Warehouse A - Monthly count",
    "date_modified": "2026-10-30T09:12:40",
    "date_reconciled": null,
    "date_reconciled_gmt": null,
    "date_created_gmt": "2026-10-30T08:12:40",
    "date_modified_gmt": "2026-10-30T08:12:40",
    "_links": {
        "self": [
            {
                "href": "https://example.com/wp-json/wc/v3/atum/stock-takes/2150"
            }
        ],
        "collection": [
            {
                "href": "https://example.com/wp-json/wc/v3/atum/stock-takes"
            }
        ]
    }
}

Available parameters

ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
dpintegerNumber of decimal points to use in the totals. Default is the WooCommerce price decimals setting.

List all stock takes

This API helps you to view all the stock takes.

HTTP request

GET/wp-json/wc/v3/atum/stock-takes
curl https://example.com/wp-json/wc/v3/atum/stock-takes \
	-u consumer_key:consumer_secret
JSON response example
[
    {
        "meta_data": [],
        "id": 2150,
        "status": "draft",
        "items_added": 2,
        "items_counted": 1,
        "total_stock": "30.00",
        "total_count": "8.00",
        "total_value": "170.00",
        "count_value": "40.00",
        "count_difference": -22,
        "value_difference": "-130.00",
        "line_items": [
            {
                "id": 1021,
                "item_id": 93,
                "st_id": 2150,
                "stock": 10,
                "count": 8,
                "reconciled": false,
                "is_inventory": 0,
                "parent_id": 0,
                "meta_data": []
            },
            {
                "id": 1022,
                "item_id": 37,
                "st_id": 2150,
                "stock": 20,
                "count": null,
                "reconciled": false,
                "is_inventory": 0,
                "parent_id": 0,
                "meta_data": []
            }
        ],
        "date_created": "2026-10-30T09:12:40",
        "title": "Warehouse A - Monthly count",
        "date_modified": "2026-10-30T09:12:40",
        "date_reconciled": null,
        "date_reconciled_gmt": null,
        "date_created_gmt": "2026-10-30T08:12:40",
        "date_modified_gmt": "2026-10-30T08:12:40",
        "_links": {
            "self": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/stock-takes/2150"
                }
            ],
            "collection": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/stock-takes"
                }
            ]
        }
    },
    {
        "meta_data": [],
        "id": 2101,
        "status": "publish",
        "items_added": 1,
        "items_counted": 1,
        "total_stock": "12.00",
        "total_count": "12.00",
        "total_value": "60.00",
        "count_value": "60.00",
        "count_difference": 0,
        "value_difference": "0.00",
        "line_items": [
            {
                "id": 998,
                "item_id": 208,
                "st_id": 2101,
                "stock": 12,
                "count": 12,
                "reconciled": true,
                "is_inventory": 1,
                "parent_id": 507,
                "meta_data": []
            }
        ],
        "date_created": "2026-09-28T16:03:11",
        "date_reconciled": "2026-09-30T10:45:02",
        "title": "Inventory 1 - September count",
        "date_modified": "2026-09-30T10:45:02",
        "date_reconciled_gmt": "2026-09-30T08:45:02",
        "date_created_gmt": "2026-09-28T14:03:11",
        "date_modified_gmt": "2026-09-30T08:45:02",
        "_links": {
            "self": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/stock-takes/2101"
                }
            ],
            "collection": [
                {
                    "href": "https://example.com/wp-json/wc/v3/atum/stock-takes"
                }
            ]
        }
    }
]

Available parameters

ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
pageintegerCurrent page of the collection. Default is 1.
per_pageintegerMaximum number of items to be returned in result set. Default is 10.
searchstringLimit results to the stock takes whose title matches a string.
afterstringLimit response to resources published after a given ISO8601 compliant date.
beforestringLimit response to resources published before a given ISO8601 compliant date.
modified_afterstringLimit response to stock takes modified after a given ISO8601 compliant date.
modified_beforestringLimit response to stock takes modified before a given ISO8601 compliant date.
dates_are_gmtbooleanWhether to consider GMT post dates when limiting response by published or modified date. Default is false.
excludearrayEnsure result set excludes specific IDs.
includearrayLimit result set to specific IDs.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Options: asc and desc. Default is desc.
orderbystringSort collection by object attribute. Options: date, id, include, title, slug and modified. Default is date.
statusarrayLimit result set to stock takes which have specific statuses. Options: any, draft, publish and trash. Default is any.
productintegerLimit result set to stock takes that include the specified product ID.
dpintegerNumber of decimal points to use in the totals. Default is the WooCommerce price decimals setting.

Update a stock take

This API lets you make changes to a stock take. To update an existing item, pass its id within the line_items. The items without id are added to the stock take.

HTTP request

PUT/wp-json/wc/v3/atum/stock-takes/<id>

Example of how to count an item and remove another one

curl -X PUT https://example.com/wp-json/wc/v3/atum/stock-takes/2150 \
	-u consumer_key:consumer_secret \
	-H "Content-Type: application/json" \
	-d '{
    "line_items": [
        {
            "id": 1022,
            "count": 18
        },
        {
            "id": 1021,
            "delete": true
        }
    ]
}'
JSON response example
{
    "meta_data": [],
    "id": 2150,
    "status": "draft",
    "items_added": 1,
    "items_counted": 1,
    "total_stock": "20.00",
    "total_count": "18.00",
    "total_value": "120.00",
    "count_value": "108.00",
    "count_difference": -2,
    "value_difference": "-12.00",
    "line_items": [
        {
            "id": 1022,
            "item_id": 37,
            "st_id": 2150,
            "stock": 20,
            "count": 18,
            "reconciled": false,
            "is_inventory": 0,
            "parent_id": 0,
            "meta_data": []
        }
    ],
    "date_created": "2026-10-30T09:12:40",
    "title": "Warehouse A - Monthly count",
    "date_modified": "2026-10-30T09:20:15",
    "date_reconciled": null,
    "date_reconciled_gmt": null,
    "date_created_gmt": "2026-10-30T08:12:40",
    "date_modified_gmt": "2026-10-30T08:20:15",
    "_links": {
        "self": [
            {
                "href": "https://example.com/wp-json/wc/v3/atum/stock-takes/2150"
            }
        ],
        "collection": [
            {
                "href": "https://example.com/wp-json/wc/v3/atum/stock-takes"
            }
        ]
    }
}

Delete a stock take

This API helps you delete a stock take.

HTTP request

DELETE/wp-json/wc/v3/atum/stock-takes/<id>
curl -X DELETE https://example.com/wp-json/wc/v3/atum/stock-takes/2150?force=true \
	-u consumer_key:consumer_secret
JSON response example
{
    "meta_data": [],
    "id": 2150,
    "status": "draft",
    "items_added": 1,
    "items_counted": 1,
    "total_stock": "20.00",
    "total_count": "18.00",
    "total_value": "120.00",
    "count_value": "108.00",
    "count_difference": -2,
    "value_difference": "-12.00",
    "line_items": [
        {
            "id": 1022,
            "item_id": 37,
            "st_id": 2150,
            "stock": 20,
            "count": 18,
            "reconciled": false,
            "is_inventory": 0,
            "parent_id": 0,
            "meta_data": []
        }
    ],
    "date_created": "2026-10-30T09:12:40",
    "title": "Warehouse A - Monthly count",
    "date_modified": "2026-10-30T09:20:15",
    "date_reconciled": null,
    "date_reconciled_gmt": null,
    "date_created_gmt": "2026-10-30T08:12:40",
    "date_modified_gmt": "2026-10-30T08:20:15",
    "_links": {
        "self": [
            {
                "href": "https://example.com/wp-json/wc/v3/atum/stock-takes/2150"
            }
        ],
        "collection": [
            {
                "href": "https://example.com/wp-json/wc/v3/atum/stock-takes"
            }
        ]
    }
}

Available parameters

ParameterTypeDescription
forcebooleanUse true to permanently delete the stock take. Otherwise, it's moved to the trash. Default is false.

Batch update stock takes

This API helps you to batch create, update and delete multiple stock takes.

Note: By default it's limited to up to 100 objects to be created, updated or deleted. The stock takes listed in delete are deleted permanently.

HTTP request

POST/wp-json/wc/v3/atum/stock-takes/batch
curl -X POST https://example.com/wp-json/wc/v3/atum/stock-takes/batch \
	-u consumer_key:consumer_secret \
	-H "Content-Type: application/json" \
	-d '{
    "create": [
        {
            "title": "Warehouse B - Monthly count",
            "line_items": [
                {
                    "item_id": 22,
                    "stock": 5
                }
            ]
        }
    ],
    "update": [
        {
            "id": 2150,
            "title": "Warehouse A - October count"
        }
    ],
    "delete": [ 2101 ]
}'
JSON response example
{
    "create": [
        {
            "meta_data": [],
            "id": 2160,
            "status": "draft",
            "items_added": 1,
            "items_counted": 0,
            "total_stock": "5.00",
            "total_count": "0.00",
            "total_value": "40.00",
            "count_value": "0.00",
            "count_difference": -5,
            "value_difference": "-40.00",
            "line_items": [
                {
                    "id": 1030,
                    "item_id": 22,
                    "st_id": 2160,
                    "stock": 5,
                    "count": null,
                    "reconciled": false,
                    "is_inventory": 0,
                    "parent_id": 0,
                    "meta_data": []
                }
            ],
            "date_created": "2026-10-30T09:31:05",
            "title": "Warehouse B - Monthly count",
            "date_modified": "2026-10-30T09:31:05",
            "date_reconciled": null,
            "date_reconciled_gmt": null,
            "date_created_gmt": "2026-10-30T08:31:05",
            "date_modified_gmt": "2026-10-30T08:31:05",
            "_links": {
                "self": [
                    {
                        "href": "https://example.com/wp-json/wc/v3/atum/stock-takes/2160"
                    }
                ],
                "collection": [
                    {
                        "href": "https://example.com/wp-json/wc/v3/atum/stock-takes"
                    }
                ]
            }
        }
    ],
    "update": [
        {
            "meta_data": [],
            "id": 2150,
            "status": "draft",
            "items_added": 1,
            "items_counted": 1,
            "total_stock": "20.00",
            "total_count": "18.00",
            "total_value": "120.00",
            "count_value": "108.00",
            "count_difference": -2,
            "value_difference": "-12.00",
            "line_items": [
                {
                    "id": 1022,
                    "item_id": 37,
                    "st_id": 2150,
                    "stock": 20,
                    "count": 18,
                    "reconciled": false,
                    "is_inventory": 0,
                    "parent_id": 0,
                    "meta_data": []
                }
            ],
            "date_created": "2026-10-30T09:12:40",
            "title": "Warehouse A - October count",
            "date_modified": "2026-10-30T09:31:05",
            "date_reconciled": null,
            "date_reconciled_gmt": null,
            "date_created_gmt": "2026-10-30T08:12:40",
            "date_modified_gmt": "2026-10-30T08:31:05",
            "_links": {
                "self": [
                    {
                        "href": "https://example.com/wp-json/wc/v3/atum/stock-takes/2150"
                    }
                ],
                "collection": [
                    {
                        "href": "https://example.com/wp-json/wc/v3/atum/stock-takes"
                    }
                ]
            }
        }
    ],
    "delete": [
        {
            "meta_data": [],
            "id": 2101,
            "status": "publish",
            "items_added": 1,
            "items_counted": 1,
            "total_stock": "12.00",
            "total_count": "12.00",
            "total_value": "60.00",
            "count_value": "60.00",
            "count_difference": 0,
            "value_difference": "0.00",
            "line_items": [
                {
                    "id": 998,
                    "item_id": 208,
                    "st_id": 2101,
                    "stock": 12,
                    "count": 12,
                    "reconciled": true,
                    "is_inventory": 1,
                    "parent_id": 507,
                    "meta_data": []
                }
            ],
            "date_created": "2026-09-28T16:03:11",
            "date_reconciled": "2026-09-30T10:45:02",
            "title": "Inventory 1 - September count",
            "date_modified": "2026-09-30T10:45:02",
            "date_reconciled_gmt": "2026-09-30T08:45:02",
            "date_created_gmt": "2026-09-28T14:03:11",
            "date_modified_gmt": "2026-09-30T08:45:02",
            "_links": {
                "self": [
                    {
                        "href": "https://example.com/wp-json/wc/v3/atum/stock-takes/2101"
                    }
                ],
                "collection": [
                    {
                        "href": "https://example.com/wp-json/wc/v3/atum/stock-takes"
                    }
                ]
            }
        }
    ]
}

On this page