Inventory Export to Shopify
Overview
The Inventory Export feature allows you to synchronize inventory levels from Business Central to your Shopify store, ensuring your online store always displays accurate stock information.
Key Features
-
Automated Sync: Export inventory levels automatically using Job Queue
-
Manual Export with Filters: Trigger inventory export on-demand with item filters
-
Smart Comparison: Only updates items where BC inventory differs from Shopify
-
Batch Processing: Efficiently handles large catalogs (250 items per API call)
-
Flexible Calculation: Choose between "On Hand" (total inventory) or "Available" (inventory minus reservations)
Setup
Prerequisites
-
Shopify API connection configured (API URL and Token)
-
Items already exported to Shopify
-
Default Shopify Location configured in Setup
Configuration Steps
-
Choose the 🔍 icon, enter Shopify Setup, and then choose the related link.
-
Navigate to the Inventory Export section.
-
Configure the following fields:
-
Export Inventory: Enable inventory export functionality
-
Inventory Calculation Method:
-
On Hand: Exports total inventory regardless of reservations
-
Available: Exports inventory minus reserved quantities (prevents overselling)
-
-
Shopify Location Id: Your Shopify location ID (numeric ID from Shopify)
- To find this: Use the Show Locations button (see section below)
-
Finding Your Shopify Location ID
The easiest way to find your Shopify location ID:
-
Choose the 🔍 icon, enter Shopify Setup, and then choose the related link.
-
Press Show Locations
-
A lookup page will display all locations from your Shopify store with their names and IDs.
-
Find your desired location and note the ID value (e.g.,
12345678901234) -
Enter this ID in the Shopify Location Id field in Setup.
The id field contains the GID (e.g., gid://shopify/Location/67890). Use only the numeric part for the Location Id field.
Using Inventory Export
Manual Export
To export inventory levels manually:
-
Choose the 🔍 icon, enter Shopify Setup, and then choose the related link.
-
Press Export Inventory Levels
-
On the request page, you can filter items by:
-
Item No. - Export specific items or ranges
-
Item Category Code - Export items from specific categories
-
Inventory Posting Group - Export items with specific posting groups
-
-
Press OK to start the export.
-
System will:
-
Fetch current Shopify inventory levels for filtered items
-
Calculate Business Central inventory
-
Compare and identify differences
-
Update only changed items in Shopify
-
Tip: Leave all filters empty to export inventory for all items.
Automatic Export (Job Queue)
To set up automatic inventory export:
-
Choose the 🔍 icon, enter Shopify Setup, and then choose the related link.
-
Press Job Queue Entry > Inventory
-
Configure the job:
-
Recurrence: Set schedule (e.g., Daily at 2:00 AM)
-
Status: Set to Ready to enable
-
-
Click OK to save.
The job will automatically export inventory based on the configured schedule.
How It Works
The inventory export follows a three-phase process:
Phase 1: Import Current Shopify Inventory
-
Queries Shopify for current inventory levels at your configured location
-
Stores data in a temporary buffer table
-
Handles pagination for large catalogs (100 items per query)
Phase 2: Calculate BC Inventory
-
For each item, calculates inventory using the selected method:
-
On Hand: Total inventory at the configured location
-
Available: Inventory minus reserved quantities
-
-
Rounds down to whole numbers
-
Sets negative values to zero (Shopify doesn't support negative inventory)
Phase 3: Export Differences
-
Compares BC calculated stock with Shopify current stock
-
Only updates items where quantities differ
-
Sends updates in batches of 250 items for efficiency
-
Logs all API requests for troubleshooting
Calculation Methods
On Hand (Default)
Formula: Total Inventory
Use When: You want to show all available stock, allowing potential overselling
Example:
-
Inventory: 100 units
-
Reserved: 20 units
-
Exported to Shopify: 100 units
Available Inventory
Formula: Inventory - Reserved Qty. on Inventory
Use When: You want to prevent overselling by accounting for sales orders and reservations
Example:
-
Inventory: 100 units
-
Reserved: 20 units
-
Exported to Shopify: 80 units
Monitoring
Last Export Date
The Last Inventory Export DT field shows when inventory was last successfully exported to Shopify.
Log Entries
All inventory export operations are logged in Shopify Log Entries (if logging is enabled):
-
View logs: Search for "JML Shopify Log Entry"
-
Filter by Type: "API Request"
-
Review Request and Response details
Troubleshooting
Issue: No items updated
Cause: All BC inventory levels match Shopify levels
Solution: This is normal - no action needed
Issue: "Export Inventory Enabled" is false
Cause: Feature not enabled in setup
Solution: Enable "Export Inventory" in Shopify Setup > Inventory Export section
Issue: "Shopify Location Id must have a value"
Cause: Shopify Location Id not configured
Solution:
-
Press Show Locations to view available Shopify locations
-
Copy the ID of your desired location
-
Enter the ID in the Shopify Location Id field
Issue: Items not found in Shopify
Cause: Items haven't been exported to Shopify yet
Solution:
-
Export items first using "Sync Item List" function
-
Then run inventory export
Issue: Negative inventory not showing
Cause: BC inventory calculation resulted in negative value
Solution: System automatically sets negative values to zero (Shopify limitation)
Issue: Missing permissions error
Cause: Shopify app doesn't have required inventory permissions
Solution:
-
Press Test to verify connection and permissions
-
If missing
read_inventoryorwrite_inventorypermissions, update your Shopify app configuration
Best Practices
-
Schedule During Off-Hours: Run automatic export during low-traffic periods (e.g., 2:00 AM)
-
Export Items First: Ensure all items are in Shopify before exporting inventory
-
Monitor Logs: Regularly check Shopify Log Entries for errors
-
Test Calculation Method: Try both methods to see which works best for your business
-
Single Location: For multi-location setups, export inventory for your primary Shopify fulfillment location
-
Test Connection First: Use the Test button to verify API permissions before running inventory export
Limitations
-
Single Location: Current version supports one Shopify location
-
No Import: Feature exports BC > Shopify only (no import from Shopify > BC)
-
Item Variants: Not currently supported (coming in future version)
-
Negative Inventory: Automatically converted to zero