Inventory Synchronization - Sync Netsuite Inventory Synchronization - Sync Netsuite

Inventory Synchronization

Estimated reading: 7 minutes 6 views

Inventory Synchronization

Keep your WooCommerce store inventory levels synchronized with NetSuite in real-time. This guide covers inventory sync configuration, multi-location support, and stock management strategies.

Inventory Sync Overview

Inventory synchronization ensures accurate stock levels across platforms:

  • One-Way Sync: NetSuite → WooCommerce (NetSuite is source of truth)
  • Real-Time Updates: Stock levels update based on NetSuite availability
  • Multi-Location: Aggregate inventory from multiple warehouses
  • Automated Sync: Scheduled updates via cron jobs
  • Stock Statuses: Automatic in-stock/out-of-stock management
  • Prevent Overselling: Accurate counts prevent selling unavailable items

How Inventory Sync Works

  1. Scheduled Trigger: Cron job runs at configured interval (hourly/daily)
  2. Fetch from NetSuite: Query inventory levels for all mapped items
  3. Calculate Stock: Apply location filters and calculation rules
  4. Update WooCommerce: Update product stock quantities
  5. Set Status: Mark products in-stock or out-of-stock
  6. Log Results: Record sync results and any errors

Product Matching

Products must be matched between WooCommerce and NetSuite for inventory sync:

Matching Methods

Method How It Works Best For
SKU Matching WooCommerce SKU = NetSuite Item Number Most stores (recommended)
Product ID Product meta stores NetSuite Internal ID Products created from NetSuite
Custom Meta Field Use custom field for mapping Complex integrations

Configure in: Settings > Inventory Sync > Product Matching Method

SKU Format Requirements

  • SKUs must match exactly (case-sensitive)
  • No leading/trailing spaces
  • Special characters allowed if same in both systems
  • Variations use variation SKU, not parent SKU

Inventory Calculations

Choose how to calculate WooCommerce stock from NetSuite data:

Available Calculation Methods

Method Formula Description
Available On Hand – Committed Stock available to sell (recommended)
On Hand On Hand Only Total physical inventory
On Hand + On Order On Hand + On Order Includes incoming stock
Available – Safety Stock Available – Safety Stock Value Reserve buffer stock
Custom Formula User-defined Advanced calculations

Configure in: Settings > Inventory Sync > Stock Calculation Method

Example Calculations

For a product with NetSuite data:

  • On Hand: 100 units
  • Committed: 25 units (pending orders)
  • On Order: 50 units (incoming from supplier)
  • Safety Stock: 10 units
Calculation Method WooCommerce Stock
Available 75 (100 – 25)
On Hand 100
On Hand + On Order 150 (100 + 50)
Available – Safety Stock 65 (75 – 10)

Multi-Location Inventory

Aggregate inventory from multiple NetSuite locations:

Location Selection

  1. Go to Settings > Inventory Sync > Inventory Locations
  2. Select which NetSuite locations to include:
    • All Locations
    • Specific Locations (multi-select)
    • Exclude Specific Locations
  3. Save settings

Location Aggregation Strategies

Strategy Behavior Use Case
Sum All Add quantities from all selected locations Multiple fulfillment centers
Primary Only Use only primary location quantity Single warehouse with backup locations
Highest Use location with highest quantity Regional inventory pools
Custom Rule Apply custom location logic Complex multi-location scenarios

Location-Based Stock Rules

// Custom location aggregation logic
add_filter('woons_calculate_inventory', function($quantity, $netsuite_data, $product_id) {
    $locations = $netsuite_data['locations'];
    $total = 0;
    
    foreach ($locations as $location) {
        // Only include locations with code starting with 'WH-'
        if (strpos($location['code'], 'WH-') === 0) {
            $total += $location['available'];
        }
    }
    
    return $total;
}, 10, 3);

Sync Schedule Configuration

Sync Frequency Options

Frequency Cron Schedule Best For
Hourly Every 60 minutes High-volume stores, fast-moving inventory
Every 6 Hours 4 times per day Medium-volume stores (recommended)
Daily Once per day Low-volume stores, stable inventory
Custom Interval Custom cron expression Specific business needs

Schedule Configuration

  1. Go to Settings > Inventory Sync > Sync Frequency
  2. Select frequency
  3. Choose sync time (for daily sync)
  4. Enable/disable during specific hours (optional)
  5. Save settings

Stock Status Management

Automatic Stock Status

The plugin automatically manages WooCommerce stock status:

NetSuite Quantity WooCommerce Status Visibility
> 0 In Stock Visible, purchasable
= 0 Out of Stock Visible, not purchasable
< 0 Out of Stock Visible, not purchasable

Stock Thresholds

Configure custom thresholds for stock warnings:

Setting Default Purpose
Low Stock Threshold 5 Trigger low stock notification
Out of Stock Threshold 0 Mark product out of stock
Low Stock Badge Disabled Show “Only X left!” message

Backorder Management

Control how products behave when out of stock:

Backorder Setting Behavior Customer Experience
Do Not Allow Cannot purchase when out of stock “Out of stock” – no purchase button
Allow Backorders Can purchase regardless of stock Always purchasable
Allow but Notify Can purchase with notification “Available on backorder” message

Configure in: Settings > Inventory Sync > Backorders Handling

Manual Inventory Sync

Via Admin Interface

Manually sync inventory for specific products:

  1. Navigate to Products > All Products
  2. Hover over product and click Edit
  3. Go to Inventory tab
  4. Find NetSuite Integration section
  5. Click Sync from NetSuite
  6. Stock quantity updates immediately

Via WP-CLI

# Sync all products
wp woons sync inventory

# Sync specific product by ID
wp woons sync inventory --product=123

# Sync products by SKU
wp woons sync inventory --sku=PRODUCT-SKU

# Sync specific category
wp woons sync inventory --category=electronics

# Dry run to preview changes
wp woons sync inventory --dry-run

# Force sync (ignore cache)
wp woons sync inventory --force

Bulk Sync via Admin

  1. Navigate to WooCommerce > NetSuite > Tools
  2. Select Bulk Inventory Sync
  3. Choose criteria:
    • All products
    • Products with stock < threshold
    • Specific categories
    • Products not synced in X days
  4. Click Start Sync
  5. Monitor progress in queue dashboard

Product Variations

Handle inventory for variable products:

Variation Inventory Sync

  • Individual Tracking: Each variation has unique SKU and inventory
  • Separate Sync: Each variation syncs independently
  • Parent Stock: Parent product shows “Variable” stock status

Configuration

  1. Ensure each variation has unique SKU in both systems
  2. Enable Manage stock at variation level in WooCommerce
  3. Plugin automatically syncs each variation

Example

T-Shirt with sizes:

Variation SKU NetSuite Qty WooCommerce Qty
Small TSHIRT-S 20 20
Medium TSHIRT-M 15 15
Large TSHIRT-L 0 0 (out of stock)

Monitoring Inventory Sync

Product Meta Box

Each product shows NetSuite inventory information:

  • NetSuite Item ID: Internal ID of NetSuite item
  • Last Synced: Date/time of last inventory sync
  • NetSuite Quantity: Current quantity in NetSuite
  • WooCommerce Quantity: Current quantity in WooCommerce
  • Sync Status: Success / Failed / Pending

Inventory Sync Dashboard

  1. Navigate to WooCommerce > NetSuite > Inventory
  2. View inventory sync overview:
    • Total products synced
    • Products out of sync
    • Last sync date/time
    • Sync errors
  3. Filter and sort by stock level, sync status, category

Sync Notifications

Get notified of inventory issues:

  1. Go to Settings > Inventory Sync > Notifications
  2. Enable notifications for:
    • Sync failures
    • Low stock alerts
    • Out of stock alerts
    • Stock discrepancies
  3. Configure notification recipients (email addresses)

Troubleshooting Inventory Sync

Issue Cause Solution
Product Not Syncing SKU mismatch Verify SKU matches exactly in both systems
Stock Always Zero Wrong location selected Check location configuration in settings
Quantity Incorrect Wrong calculation method Review stock calculation formula
Variations Not Syncing Missing variation SKUs Add unique SKUs to all variations
Sync Too Slow Too many products Increase batch size, enable caching
API Rate Limit Too frequent syncs Reduce sync frequency or batch size

Performance Optimization

Caching

  • Enable Caching: Cache NetSuite inventory data for faster lookups
  • Cache Duration: Set appropriate cache lifetime (e.g., 1 hour)
  • Smart Invalidation: Cache automatically cleared on sync

Batch Processing

  • Batch Size: Process products in batches (default: 50)
  • Stagger Requests: Add delay between API calls to avoid rate limits
  • Queue Priority: Prioritize high-priority products

Selective Sync

// Only sync products from specific categories
add_filter('woons_inventory_sync_products', function($product_ids) {
    $electronics = get_term_by('slug', 'electronics', 'product_cat');
    
    $filtered_ids = [];
    foreach ($product_ids as $product_id) {
        if (has_term($electronics->term_id, 'product_cat', $product_id)) {
            $filtered_ids[] = $product_id;
        }
    }
    
    return $filtered_ids;
});

Advanced Inventory Features

Real-Time Inventory Checks

Check NetSuite inventory in real-time during checkout:

  1. Enable Real-Time Inventory Validation in settings
  2. During checkout, plugin verifies stock availability in NetSuite
  3. Prevents overselling between sync intervals
  4. Adds slight delay to checkout process

Reserve Stock on Order

Automatically reserve/commit stock in NetSuite when order is placed:

  1. Enable Auto-Reserve Stock in settings
  2. When order created in WooCommerce, stock is committed in NetSuite
  3. Prevents selling the same inventory twice
  4. Released if order cancelled

Custom Stock Calculations

// Implement custom stock calculation
add_filter('woons_calculate_stock', function($quantity, $netsuite_item) {
    // Example: Reserve 20% as safety stock
    $available = $netsuite_item['quantityAvailable'];
    $safety_percent = 0.20;
    
    return floor($available * (1 - $safety_percent));
}, 10, 2);

Best Practices

  • Consistent SKUs: Maintain identical SKUs across platforms
  • Appropriate Frequency: Balance accuracy vs. API usage
  • Use Available Quantity: Recommended calculation method
  • Monitor Sync Logs: Regularly check for sync failures
  • Test Calculations: Verify stock calculation matches expectations
  • Enable Notifications: Get alerted to inventory issues
  • Safety Stock: Consider reserving buffer stock

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Share this Doc

Inventory Synchronization

Or copy link

CONTENTS