Skip to main content

Inventory Sync

Admin Manager

When you sell a product in-store, your WooCommerce store needs to reflect the updated stock level. The inventory sync feature automatically pushes stock changes from Brother POS to WooCommerce, keeping your online store accurate and preventing overselling.


How Inventory Push Works

Inventory sync is a one-way push from Brother POS to WooCommerce. Brother POS is the source of truth for stock levels, and WooCommerce is updated to match.

The push runs at your configured polling interval (default: every 15 minutes) and includes:

  1. All products that have a WooCommerce product mapping.
  2. Both simple products and variations.
  3. Stock quantity, manage_stock flag, and stock status (in stock / out of stock).

What Gets Pushed

WooCommerce Configuration

For each product with a WooCommerce mapping, the following data is sent:

FieldValueDescription
stock_quantityIntegerAvailable stock (current stock minus reserved)
manage_stockBooleanWhether WooCommerce should track stock for this product
stock_statusinstock / outofstockBased on whether stock is greater than zero

Available Stock Calculation

The stock quantity sent to WooCommerce is the available stock, which accounts for reservations:

Available Stock = Current Stock - Stock Reservations

Stock reservations include items reserved for pending WooCommerce orders, pending wholesale orders, and other holds. This ensures your online store does not accept orders for products that are already allocated.


Simple Products vs. Variations

Simple Products

For simple (non-variable) products:

  • Stock quantity is pushed directly.
  • manage_stock is set to true.
  • Stock status is set based on the stock quantity.

Variable Products (Parent)

For parent products that have variations:

  • manage_stock is set to false on the parent. WooCommerce manages stock at the variation level.
  • stock_status is set to instock if any active variation has stock, or outofstock if all variations are out of stock.
  • The parent's stock quantity is informational only.

Variations

Each variation is updated individually through the WooCommerce Variations API:

  • Stock quantity reflects the specific variation's available stock.
  • manage_stock is set to true.
  • Stock status is based on the variation's individual stock level.

Batch Processing

To minimize API calls and improve performance, Brother POS uses batch updates for simple and parent products:

  1. Product updates are collected into batches of up to 100 products.
  2. Each batch is sent as a single API request using the WooCommerce Batch Update endpoint.
  3. If a batch fails, Brother POS falls back to updating each product individually.
Variation updates

WooCommerce does not support batch updates for variations. Each variation is updated with an individual API call. If you have many variations, inventory push may take longer.


When Inventory Is Pushed

Inventory push runs automatically at your configured polling interval. Stock is also pushed in these scenarios:

Automatic Triggers

  • Scheduled sync -- Runs every N minutes based on your polling interval.
  • After a sale -- Stock deduction triggers an update on the next sync cycle.
  • After a return -- Stock restoration triggers an update on the next sync cycle.
  • After a stock adjustment -- Manual stock changes are picked up in the next cycle.
  • After order fulfillment -- When a WooCommerce order is fulfilled, stock deductions push back.

Manual Trigger

You can force an immediate inventory push:

  1. Go to Admin > WooCommerce > Monitor.
  2. Click Force Sync.
  3. Brother POS runs a full product sync immediately (categories, then products). This is a product sync, not an inventory-specific push.

Monitoring Push Status

Each WooCommerce product mapping includes a sync status:

StatusMeaning
syncedStock was successfully pushed to WooCommerce
errorThe last push attempt failed

After a push completes, Brother POS updates the last_synced_at timestamp on each product mapping. You can view this on the Health Monitor page.


Push Results

After each inventory push, Brother POS records detailed statistics:

MetricDescription
Products ProcessedTotal products evaluated for pushing
Products UpdatedProducts successfully updated in WooCommerce
Products FailedProducts that failed to update
Products SkippedProducts without a WooCommerce mapping
Variations UpdatedVariations successfully updated
Variations FailedVariations that failed to update

These metrics are visible in the sync log on the Health Monitor page.


Handling Push Failures

When a stock push fails for a product:

  1. The error is logged in the sync log with details about the failure.
  2. The product's sync status is set to error.
  3. Brother POS will retry on the next sync cycle.

Common causes of push failures:

ErrorCauseSolution
Product not foundWooCommerce product was deletedRemove the WooCommerce mapping in Brother POS
API rate limitToo many requests in a short timeIncrease your polling interval
Authentication failedAPI keys revoked or expiredRe-generate WooCommerce API keys
Network timeoutConnectivity issuesCheck your internet connection; Brother POS retries automatically
Automatic retry

Failed pushes are not lost. Brother POS includes every mapped product in every push cycle, so a failed product will be retried on the next cycle. You do not need to manually retry individual products.


Preventing Overselling

The combination of stock reservations and inventory push works together to prevent overselling:

  1. When a product is sold in-store, the stock count is immediately decremented.
  2. On the next sync cycle, the updated stock is pushed to WooCommerce.
  3. If a WooCommerce order comes in before the push, the stock reservation system ensures the in-store stock is not available for another online order.
Sync delay

There is always a small window (up to your polling interval) between an in-store sale and the WooCommerce stock update. During high-traffic periods, consider reducing your polling interval to minimize this window. Setting it to 1 minute provides near-real-time updates.


Inventory Discrepancy Handling

If you notice discrepancies between Brother POS and WooCommerce stock levels:

  1. Brother POS is always the source of truth. In-store sales and adjustments are recorded immediately.
  2. Force a sync from the Health Monitor to push current levels immediately.
  3. Check for failed pushes in the sync log -- a failed push means WooCommerce was not updated.
  4. Review stock adjustments in the admin panel to find when stock was changed.
  5. WooCommerce-side changes (manual stock edits in WooCommerce) are overwritten on the next push. Avoid editing stock directly in WooCommerce.

Best Practices

  • Do not edit stock in WooCommerce directly. Always make stock adjustments in Brother POS. The next inventory push will overwrite any WooCommerce-side changes.
  • Use a reasonable polling interval. 5 minutes is a good default. Set it to 1-2 minutes during sales events or high-traffic periods.
  • Monitor the Health Monitor. Check for failed pushes regularly, especially after network issues.
  • Enable stock management in WooCommerce. For inventory push to work, products must have "Manage Stock" enabled in WooCommerce.

What's Next?