WooCommerce to Square Object Mappings

Overview

↑ Back to top

The WooCommerce to Square integration ensures that product information is consistent and up-to-date across online and in-store platforms, and it synchronizes product data between platforms based on a configured System of Record (SOR). The System of Record setting wc_square_system_of_record determines which platform is authoritative for product data. This setting defaults to ‘square’. System of Record behavior:

When Square is SOR

↑ Back to top
  • Square data overwrites WooCommerce data ONLY when
    • Square is set as System of Record (controlled by wc_square_system_of_record option)
    • Square data is not empty
    • The field has a corresponding mapping in WooCommerce
    • The sync operation succeeds
  • Specific field sync behavior
    • Product name: Only updated if Square name is not empty
    • Description: Only updated if Square description is not empty
    • Categories: Only synced if Square category_id exists
    • Prices: Only updated from valid Square variation data
    • Stock: Only synced for products with inventory tracking enabled
  • Stock status (in_stock/out_of_stock) is also synced from Square, conditional on inventory tracking settings
  • Inventory tracking settings are respected from Square
  • Images are only imported from Square if no featured image exists in WooCommerce

When WooCommerce is SOR

↑ Back to top
  • WooCommerce data overwrites Square data
  • New products are created in Square if no match found
  • Product variations are created in Square if they don’t exist
  • For initial sync only, stock levels are still pulled from Square even when WooCommerce is SOR
  • Product images in WooCommerce sync to Square only when WooCommerce is the SOR.
  • Inventory tracking settings from WooCommerce are respected
  • Product status (active/inactive) and inventory tracking settings from WooCommerce are pushed to Square.

Here’s how WooCommerce objects align with Square’s catalog system to streamline its operations:

Inventory synchronization

↑ Back to top
FeatureBehavior
Stock FetchProducts can fetch current stock levels from Square via “Fetch stock from Square” button.
Manual Sync“Sync Inventory” option available for products with inventory tracking enabled.
Auto SyncInventory updates automatically sync when orders are processed and stock is reduced, or when product/variation stock is manually updated.

A sync process also runs periodically in the background to keep WooCommerce inventory in sync with Square without requiring manual intervention.

Inventory counts syncFetches current inventory counts from SquareUpdates WooCommerce product stock levelsHandles pagination through cursorsUpdates products in batches to avoid timeouts

Key featuresUses cursors for paginationTracks last sync timestamp to only fetch recent changesHandles both inventory tracking status and actual countsUpdates products in batchesMaintains sync history and processed product IDsHandles errors and invalid responses
Batch ProcessingInventory sync processes up to 1000 items per batch to optimize performance

WooCommerce to Square: Entities Overview

↑ Back to top
WooCommerceSquareDescription
ProductsCatalogSquare’s catalog holds all items synced from WooCommerce, ensuring listings and availability are aligned.
ProductItemEach WooCommerce product syncs directly to a Square item, maintaining consistency in name, SKU, and price.
Product VariationsItem VariationsWooCommerce variations (such as size, color) map to Square item variations, syncing variant-specific SKUs and stock levels.
Product CategoriesCategoryWooCommerce categories link to Square categories, organizing products consistently on both platforms.

Field Mappings: WooCommerce Product to Square Item

↑ Back to top
WooCommerce FieldSquare FieldDescription
Product NameItem NameMaps WooCommerce product names to Square item names. Can be filtered via wc_square_update_product_set_name
Product DescriptionItem DescriptionSyncs WooCommerce product descriptions to Square. HTML support can be toggled via wc_square_enable_html_description filter
Product TypeItem TypeSyncs WooCommerce product types (e.g., simple, variable) with Square item types. Note that product sync is disabled for unsupported product types.
Product CategoryCategoryLinks WooCommerce categories to Square categories.
SKUItem Variation SKUSKUs are used as unique identifiers for synchronization. For simple products, the product SKU maps directly to Square’s item variation SKU. For variable products, each variation must have a unique SKU that maps to a corresponding Square variation SKU. Empty SKUs will prevent sync for that product/variation.
Regular PriceItem PriceSyncs the WooCommerce regular price to Square’s item price.
Sale PriceDiscounted Item PriceSyncs the sale price, if available, from WooCommerce to Square’s discounted price.
Stock QuantityInventory CountMaps stock quantities for managing inventory levels between WooCommerce and Square.
Product ImageItem ImageDownloads the primary product image from Square to WooCommerce, ensuring consistent visual representation across both platforms. Note that images set in WooCommerce are uploaded to Square only when WooCommerce is SOR.
AttributesItem AttributesMaps WooCommerce product attributes (e.g., color, size) to attributes in Square.
Soft DeletesSoft DeletesWhen Square is the system of record (SOR), products missing from Square are optionally hidden (not deleted) in WooCommerce based on the hide_missing_products setting. This is handled in three scenarios:When a product is deleted in SquareWhen a product doesn’t exist in Square catalogWhen variations are missing from Square
Location-Based AvailabilityLocation-Based AvailabilityWooCommerce Square extension manages product availability at specific Square locations, ignoring items that are absent at the WooCommerce store location. 
Custom AttributesCustom AttributesWooCommerce custom attributes are synced to Square’s custom attributes for products, providing additional descriptive fields that extend beyond basic product data.
Stock ThresholdLow Stock AlertSyncs low stock threshold settings between platforms.

Field Mappings: WooCommerce Category to Square Category

↑ Back to top

The WooCommerce Square extension syncs categories by mapping WooCommerce categories to their Square counterparts based on Square’s unique category ID. If a matching category exists in WooCommerce, it’s updated for consistency; if not, a new category is created using the Square category name. This process keeps product organization consistent across both platforms.

WooCommerce FieldSquare FieldDescription
Category NameCategory NameMaps WooCommerce category names to Square’s category names.
Category DescriptionCategory DescriptionSyncs category descriptions, if available.
Category ImageCategory ImageSyncs WooCommerce category images to Square categories where possible.

Field Mappings: WooCommerce Product Variations to Square Item Variations

↑ Back to top
WooCommerce FieldSquare FieldDescription
AttributesItem OptionsLinks WooCommerce variation attributes with Square’s attributes (aka Options).
Attribute values listItem Option Data ValuesThe value of the attribute at WooCommerce links with Options Data Values at Square.
Variation NameVariation NameLinks WooCommerce variation names with Square’s variation names. Can be filtered via wc_square_update_product_set_variation_name
Variation SKUVariation SKUSyncs each WooCommerce variation SKU to Square’s variation SKU for identification.
Variation PriceVariation PriceSyncs price information for each variation from WooCommerce to Square.
Stock StatusInventory StatusMaps variation stock status (in stock, out of stock) with Square’s inventory status.

Best Practices for Handling Attributes

When syncing attributes between WooCommerce and Square, adhering to these guidelines can help avoid sync issues and ensure smooth operation:

1. Avoid Changing Taxonomy Attribute Slugs or Names

  • Changing the slugs or names of taxonomy attributes in WooCommerce can disrupt the synchronization process.
  • Similarly, renaming dynamic options in Square can lead to mismatched data, as these changes are not automatically reflected during the sync.
  • Best Practice: Once set, keep taxonomy attribute slugs and names consistent in WooCommerce and Square.

2. Avoid Creating Custom Attributes with Identical Names to Existing Taxonomy Attributes

  • Custom attributes with names identical to taxonomy attributes can cause issues during import or synchronization.
  • For example, products using custom attributes with duplicate names may have their data replaced incorrectly with taxonomy attributes.
  • Best Practice: Use unique and descriptive names for custom attributes to prevent conflicts.