woocommerce-order-inventory-sync
/woocommerce-order-inventory-sync
When the user needs to process paid WooCommerce orders to calculate raw material consumption based on Bill of Materials (BOM), update inventory levels, and sync maximum producible quantities back to WooCommerce stock. This skill monitors new paid orders, retrieves SKU and quantity data, calculates material requirements from BOM data (typically stored in Google Sheets or similar), deducts consumed materials from inventory, recalculates maximum producible product quantities based on remaining materials, and updates WooCommerce product stock levels. Triggers include WooCommerce order processing,
Assessment and security
- Files in this package
- 2
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 05.07.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
When the user needs to process paid WooCommerce orders to calculate raw material consumption based on Bill of Materials (BOM), update inventory levels, and sync maximum producible quantities back to WooCommerce stock. This skill monitors new paid orders, retrieves SKU and quantity data, calculates material requirements from BOM data (typically stored in Google Sheets or similar), deducts consumed materials from inventory, recalculates maximum producible product quantities based on remaining materials, and updates WooCommerce product stock levels. Triggers include WooCommerce order processing,
Original author description
When the user needs to process paid WooCommerce orders to calculate raw material consumption based on Bill of Materials (BOM), update inventory levels, and sync maximum producible quantities back to WooCommerce stock. This skill monitors new paid orders, retrieves SKU and quantity data, calculates material requirements from BOM data (typically stored in Google Sheets or similar), deducts consumed materials from inventory, recalculates maximum producible product quantities based on remaining materials, and updates WooCommerce product stock levels. Triggers include WooCommerce order processing,
How it works
- Overview
- Prerequisites
- Execution Flow
- Error Handling
- Notes
SKILL.md preview
---
name: woocommerce-order-inventory-sync
description: When the user needs to process paid WooCommerce orders to calculate raw material consumption based on Bill of Materials (BOM), update inventory levels, and sync maximum producible quantities back to WooCommerce stock. This skill monitors new paid orders, retrieves SKU and quantity data, calculates material requirements from BOM data (typically stored in Google Sheets or similar), deducts consumed materials from inventory, recalculates maximum producible product quantities based on remaining materials, and updates WooCommerce product stock levels. Triggers include WooCommerce order processing, inventory management, BOM-based material calculations, stock synchronization, and production planning workflows.
---
# Instructions
## Overview
This skill automates the end-to-end process of converting paid WooCommerce orders into raw material consumption, updating inventory, and recalculating available stock based on Bill of Materials (BOM). It connects WooCommerce with Google Sheets for BOM and inventory management.
## Prerequisites
1. **WooCommerce Connection**: Configured with API access to list orders and update products.
2. **Google Sheets Connection**: Access to a spreadsheet containing:
- `BOM` sheet: Product_SKU, Material_Code, Material_Name, Quantity_Per_Unit
- `Material_Inventory` sheet: Material_Code, Material_Name, Stock_Quantity
3. **Configuration File**: A `config.json` file with:
- `spreadsheet_id`: Google Sheets ID (not folder ID)
- `bom_sheet_name`: Name of BOM sheet (default: "BOM")
- `inventory_sheet_name`: Name of inventory sheet (default: "Material_Inventory")
- `product_mapping`: Mapping of product SKUs to WooCommerce product IDs
## Execution Flow
### Step 1: Monitor Paid Orders
1. Use `woocommerce-woo_orders_list` to retrieve orders with status `["processing"]` (paid orders).
2. Extract from each order:
- `order_id`
- `line_items`: For each item, extract `sku` and `quantity`
- Note: The `_reduced_stock` meta indicates WooCommerce has already reduced finished product stock.
### Step 2: Retrieve BOM and Inventory Data
1. Read configuration from `config.json` to get spreadsheet ID and sheet names.
2. Use `google_sheet-get_sheet_data` to fetch:
- BOM data from the specified BOM sheet
- Current inventory from the specified inventory sheet
3. Validate data structure:
- BOM must have columns: Product_SKU, Material_Code, Quantity_Per_Unit
- Inventory must have columns: Material_Code, Stock_Quantity
### Step 3: Calculate Material Consumption
1. Aggregate total quantities needed for each product SKU across all orders.
2. For each product SKU, look up its BOM entries.
3. Calculate total material consumption:
- `material_consumption[material_code] = sum(product_quantity × quantity_per_unit)`
4. Log detailed consumption breakdown for verification.
### Step 4: Update Raw Material Inventory
1. For each material in inventory:
- Subtract consumed quantity from current stock
- Calculate new stock level
2. Use `google_sheet-update_cells` to write updated inventory back to Google Sheets.
3. Maintain the same data structure (Material_Code, Material_Name, Stock_Quantity).
### Step 5: Calculate Maximum Producible Quantities
1. For each product SKU:
- For each material in its BOM:
- Calculate `max_from_material = floor(available_stock / quantity_per_unit)`
- Determine `min(max_from_material)` across all materials → maximum producible quantity
- Identify the limiting material (bottleneck)
2. This calculation determines the actual stock that can be promised/sold.
### Step 6: Sync to WooCommerce Stock
1. Use `woocommerce-woo_products_batch_update` to update product stock quantities.
2. Update `stock_quantity` for each product based on maximum producible calculation.
3. Ensure `manage_stock: true` is set for each product.
### Step 7: Verification and Reporting
1. Fetch updated inventory from Google Sheets to confirm changes.
2. Fetch updated products from WooCommerce to confirm stock levels.
3. Provide a comprehensive summary including:
- Orders processed
- Material consumption
- Updated inventory levels
- Maximum producible quantities
- Updated WooCommerce stock levels
## Error Handling
1. **Missing Configuration**: Check `config.json` exists and has required fields.
2. **Invalid Spreadsheet ID**: Verify it's a spreadsheet ID, not a folder ID.
3. **Missing Sheets**: Verify BOM and inventory sheets exist with correct names.
4. **Data Validation**: Check for missing SKUs in BOM, negative inventory, etc.
5. **API Errors**: Handle WooCommerce and Google Sheets API errors gracefully.
## Notes
1. The skill assumes WooCommerce has already reduced finished product stock via `_reduced_stock` meta.
2. Decimal quantities in BOM (e.g., 0.5L of varnish) are supported.
3. The limiting material calculation uses integer division (floor) for practical production planning.
4. Consider running this skill on a schedule (e.g., hourly) or triggered by order status changes.
Files in this package (2)
- SKILL.md 5 KB
- references/data_schemas.md 1 KB
Versions
The database has no other skills named woocommerce-order-inventory-sync.
Database snapshot: 13.11.2026 · package version 882ecbd08678 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Similar skills
- 90wp-woocommerce
WooCommerce store management through the WordPress MCP Adapter. Use when the user asks about "orders", "products", "customers", "sales", "inventory", "coupons", "WooCommerce", "store", "ecommerce", "shipping", "revenue", "order status", "product stock", "add a product", "check… - 100respira-woocommerce
Use for WooCommerce operations on a WordPress site. Listing, reading, creating, updating, and duplicating products. Managing categories and tags. Reading orders and updating order status. Stock management. Sales reports. Storefront layout edits. Builder-aware throughout.… - 90inventory-monitoring-and-alert-system
When the user needs to monitor product inventory levels, check stock quantities against safety thresholds, identify low-stock items, and trigger automated notifications and documentation updates. This skill is triggered by keywords like 'inventory levels', 'stock quantity',… - 90inventory-risk-review
Use when the merchant asks about stock risk, inventory risk, out-of-stock or low-stock products, products to restock or watch, slow-moving stocked products, or sale-priced products with stock issues. Produces a merchant-friendly WooCommerce inventory risk review using existing… - 100inventory-and-multi-warehouse
Track stock per location with on-hand, reserved, and available quantities, reserve at checkout, and allocate orders across warehouses without overselling. Use when adding warehouses or stores as stock locations, reservations, transfers, or order routing. - 90wordpress-woocommerce-ops
Use when managing a WooCommerce store: products, orders, customers, stock, coupons, reports over the WooCommerce REST API.