# WooCommerce Inventory Reconciliation vs warehouse CSV (`asunoki/woocommerce-inventory-reconciliation`) Actor

Read-only audit of WooCommerce stock (product CSV export) against a warehouse stock CSV by SKU: differences, missing and duplicate SKUs, review list and suggested updates. Never changes your store.

- **URL**: https://apify.com/asunoki/woocommerce-inventory-reconciliation.md
- **Developed by:** [Seisuke Nagahara](https://apify.com/asunoki) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 sku checkeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## WooCommerce Inventory Reconciliation vs warehouse CSV

Compare the stock in your **WooCommerce product export** with a **warehouse or supplier stock CSV**, SKU by SKU, and get a list of what does not agree. **Read-only**: it never connects to your store, needs no WooCommerce credentials and changes nothing.

### What it finds

- Stock differences between WooCommerce and the warehouse
- SKUs that exist on only one side
- Duplicate SKUs (isolated for review, not compared)
- Products with stock management off (blank Stock), variations that use the parent's stock, invalid quantities, and negative stock with backorders allowed
- Several warehouse rows for one SKU are summed per location
- SKUs are matched exactly. A SKU that differs only in letter case (`abc-1` vs `ABC-1`) is flagged on both sides for review, not matched by guess

### How to use it

1. In WooCommerce, export your products: **Products > Export** (CSV).
2. Get the stock CSV from your warehouse or supplier (a `SKU` and a `Quantity` column are needed).
3. Give both files to the Actor as links or pasted text and press Start. The form is pre-filled with a small demo, so you can press Start once to see the output first.

Example input (the demo):

```
WooCommerce CSV
ID,Type,SKU,Name,Parent,In stock?,Stock,Backorders allowed?
101,variable,MUG,Stoneware Mug,,1,,0
102,variation,MUG-WHT,Stoneware Mug - White,MUG,1,12,0
103,variation,MUG-BLK,Stoneware Mug - Black,MUG,1,8,0
113,simple,CANDLE,Soy Candle,,1,-3,notify
...
Warehouse CSV
SKU,Quantity,Warehouse
MUG-WHT,12,Tokyo
MUG-BLK,5,Tokyo
MUG-BLK,2,Osaka
CANDLE,2,Tokyo
TRAY-OAK,9,Osaka
...
```

| Input | What to enter |
|---|---|
| WooCommerce CSV (URL or paste) | The product export |
| Warehouse CSV (URL or paste) | The stock CSV |
| Max rows per file | Default 50,000 (up to 200,000). The run stops with an error above this size, before anything is charged |
| Include matched rows in the dataset | Off by default |

Each file can be up to 50 MB.

### Output

Files in the run's key-value store:

| File | Contents |
|---|---|
| `summary.json` | Counts and the billing summary |
| `inventory_reconciliation.csv` | Every SKU, WooCommerce and warehouse side by side |
| `stock_differences.csv` | SKUs whose stock differs |
| `missing_skus.csv` | SKUs missing on either side |
| `duplicate_skus.csv` | SKUs used more than once |
| `review_required.csv` | Rows a person should check |
| `suggested_updates.csv` | Suggested stock updates (review only; review cases never appear in it) |

The dataset contains the rows that need attention. Rows from the demo:

| status | SKU | WooCommerce | Warehouse | Suggested action |
|---|---|---|---|---|
| stock_mismatch | MUG-BLK | 8 | 7 (Tokyo 5 + Osaka 2) | Review and set WooCommerce stock to 7 if the warehouse count is current |
| stock_mismatch + negative_stock_backorders | CANDLE | -3 | 2 | Check open orders before changing (review) |
| review (variation_uses_parent_stock) | MUG-GRN | parent | 4 | Compare at the parent product, or enable stock at variation level |
| not_managed | TOWEL-M | (blank) | 6 | Turn on stock management if WooCommerce should track it |
| only_in_warehouse | TRAY-OAK | - | 9 | Check whether the product is missing in WooCommerce or the SKU differs |

**The suggested updates are not a WooCommerce import file.** They are a checklist for a person.

### Pricing

Pay per event: **$1.00 per 1,000 WooCommerce rows checked** ($0.001 per row), charged once per run after the report is saved, plus a start fee of $0.00005. Platform usage is included. A row is counted when it appears in the report; variable parent products without their own stock and rows that are skipped are not charged.

Examples: the demo (8 rows checked) costs about $0.01; 3,000 rows cost $3.00; 50,000 rows cost $50.00. The pricing tab on this page is authoritative. If your "maximum cost per run" is too low for the file, the run stops before anything is charged. A run that fails on invalid input is not charged for rows.

### Memory and run time

The default is 1 GB memory and a 300-second timeout, which fits files of tens of thousands of rows. Large runs have not yet been measured on Apify, so start with a smaller file if you can.

### Use cases

- Weekly or monthly check that WooCommerce stock matches the warehouse or 3PL count before a sale or a stocktake
- After switching warehouses or suppliers, find SKUs that exist on only one side
- Before importing new stock numbers, see exactly which SKUs would change and which need a person to look

### FAQ

- **Does it update my stock?** No. It tells you what to change; suggested_updates.csv is a checklist, not an import file.
- **Why is a row in review?** Duplicate SKUs, invalid quantities, variations that use the parent's stock, negative stock with backorders and letter-case-only SKU differences are never guessed.
- **Support:** use the Issues tab on this page.

### Your data

The files are read during the run and the results stay in your own Apify account storage. Nothing is sent to WooCommerce or to any third party. Stock files do not need customer data, so do not upload files with personal data.

### Not supported yet

Connecting to the WooCommerce REST API, multi-location stock inside WooCommerce, and non-WooCommerce CSV layouts.

WooCommerce is a trademark of Automattic Inc. This Actor is an independent tool and is not affiliated with, sponsored by or endorsed by WooCommerce or Automattic. It is new and has no reviews yet.

# Actor input Schema

## `wooUrl` (type: `string`):

Link to the CSV from WooCommerce > Products > Export (needs SKU and Stock columns).

## `wooText` (type: `string`):

Or paste the CSV text.

## `warehouseUrl` (type: `string`):

Link to a CSV with a SKU column and a quantity column (Quantity, Qty, Stock, On hand or Available); optional Warehouse/Location column.

## `warehouseText` (type: `string`):

Or paste the CSV text.

## `maxRows` (type: `integer`):

Stop with an error above this size (protects your spending limit). Default 50,000; up to 200,000 is accepted (large runs are not yet measured on Apify).

## `includeMatchedRows` (type: `boolean`):

The full table is always in inventory_reconciliation.csv.

## Actor input object example

```json
{
  "wooText": "ID,Type,SKU,Name,Parent,In stock?,Stock,Backorders allowed?\n101,variable,MUG,Stoneware Mug,,1,,0\n102,variation,MUG-WHT,Stoneware Mug - White,MUG,1,12,0\n103,variation,MUG-BLK,Stoneware Mug - Black,MUG,1,8,0\n104,variation,MUG-GRN,Stoneware Mug - Green,MUG,1,parent,0\n110,simple,TOWEL-L,Linen Towel L,,1,20,0\n111,simple,TOWEL-M,Linen Towel M,,1,,0\n112,simple,APRON,Canvas Apron,,0,0,0\n113,simple,CANDLE,Soy Candle,,1,-3,notify\n114,simple,0042-SOAP,Olive Soap,,1,30,0\n",
  "warehouseText": "SKU,Quantity,Warehouse\nMUG-WHT,12,Tokyo\nMUG-BLK,5,Tokyo\nMUG-BLK,2,Osaka\nMUG-GRN,4,Tokyo\nTOWEL-L,18,Tokyo\nTOWEL-M,6,Tokyo\nAPRON,0,Tokyo\nCANDLE,2,Tokyo\n0042-SOAP,30,Tokyo\nTRAY-OAK,9,Osaka\n",
  "maxRows": 50000,
  "includeMatchedRows": false
}
```

# Actor output Schema

## `rows` (type: `string`):

Dataset: one row per problem item.

## `summary` (type: `string`):

Counts and billing summary.

## `inventoryReconciliation` (type: `string`):

inventory_reconciliation.csv

## `stockDifferences` (type: `string`):

stock_differences.csv

## `missingSkus` (type: `string`):

missing_skus.csv

## `duplicateSkus` (type: `string`):

duplicate_skus.csv

## `reviewRequired` (type: `string`):

review_required.csv

## `suggestedUpdates` (type: `string`):

suggested_updates.csv (review only, not an import file)

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "wooText": `ID,Type,SKU,Name,Parent,In stock?,Stock,Backorders allowed?
101,variable,MUG,Stoneware Mug,,1,,0
102,variation,MUG-WHT,Stoneware Mug - White,MUG,1,12,0
103,variation,MUG-BLK,Stoneware Mug - Black,MUG,1,8,0
104,variation,MUG-GRN,Stoneware Mug - Green,MUG,1,parent,0
110,simple,TOWEL-L,Linen Towel L,,1,20,0
111,simple,TOWEL-M,Linen Towel M,,1,,0
112,simple,APRON,Canvas Apron,,0,0,0
113,simple,CANDLE,Soy Candle,,1,-3,notify
114,simple,0042-SOAP,Olive Soap,,1,30,0`,
    "warehouseText": `SKU,Quantity,Warehouse
MUG-WHT,12,Tokyo
MUG-BLK,5,Tokyo
MUG-BLK,2,Osaka
MUG-GRN,4,Tokyo
TOWEL-L,18,Tokyo
TOWEL-M,6,Tokyo
APRON,0,Tokyo
CANDLE,2,Tokyo
0042-SOAP,30,Tokyo
TRAY-OAK,9,Osaka`
};

// Run the Actor and wait for it to finish
const run = await client.actor("asunoki/woocommerce-inventory-reconciliation").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "wooText": """ID,Type,SKU,Name,Parent,In stock?,Stock,Backorders allowed?
101,variable,MUG,Stoneware Mug,,1,,0
102,variation,MUG-WHT,Stoneware Mug - White,MUG,1,12,0
103,variation,MUG-BLK,Stoneware Mug - Black,MUG,1,8,0
104,variation,MUG-GRN,Stoneware Mug - Green,MUG,1,parent,0
110,simple,TOWEL-L,Linen Towel L,,1,20,0
111,simple,TOWEL-M,Linen Towel M,,1,,0
112,simple,APRON,Canvas Apron,,0,0,0
113,simple,CANDLE,Soy Candle,,1,-3,notify
114,simple,0042-SOAP,Olive Soap,,1,30,0
""",
    "warehouseText": """SKU,Quantity,Warehouse
MUG-WHT,12,Tokyo
MUG-BLK,5,Tokyo
MUG-BLK,2,Osaka
MUG-GRN,4,Tokyo
TOWEL-L,18,Tokyo
TOWEL-M,6,Tokyo
APRON,0,Tokyo
CANDLE,2,Tokyo
0042-SOAP,30,Tokyo
TRAY-OAK,9,Osaka
""",
}

# Run the Actor and wait for it to finish
run = client.actor("asunoki/woocommerce-inventory-reconciliation").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "wooText": "ID,Type,SKU,Name,Parent,In stock?,Stock,Backorders allowed?\\n101,variable,MUG,Stoneware Mug,,1,,0\\n102,variation,MUG-WHT,Stoneware Mug - White,MUG,1,12,0\\n103,variation,MUG-BLK,Stoneware Mug - Black,MUG,1,8,0\\n104,variation,MUG-GRN,Stoneware Mug - Green,MUG,1,parent,0\\n110,simple,TOWEL-L,Linen Towel L,,1,20,0\\n111,simple,TOWEL-M,Linen Towel M,,1,,0\\n112,simple,APRON,Canvas Apron,,0,0,0\\n113,simple,CANDLE,Soy Candle,,1,-3,notify\\n114,simple,0042-SOAP,Olive Soap,,1,30,0\\n",
  "warehouseText": "SKU,Quantity,Warehouse\\nMUG-WHT,12,Tokyo\\nMUG-BLK,5,Tokyo\\nMUG-BLK,2,Osaka\\nMUG-GRN,4,Tokyo\\nTOWEL-L,18,Tokyo\\nTOWEL-M,6,Tokyo\\nAPRON,0,Tokyo\\nCANDLE,2,Tokyo\\n0042-SOAP,30,Tokyo\\nTRAY-OAK,9,Osaka\\n"
}' |
apify call asunoki/woocommerce-inventory-reconciliation --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,asunoki/woocommerce-inventory-reconciliation"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/aAHDewB8g5OyWxMAV/builds/963leM7WmAxumAsvi/openapi.json
