Skip to main content

ShipStation Integration

The Dealers Site integrates with ShipStation for order fulfilment and shipping management through two complementary mechanisms.


Plugin: WooCommerce ShipStation Integration

PropertyValue
PluginWooCommerce ShipStation Integration
Locationplugins/woocommerce-shipstation-integration/

This official WooCommerce plugin provides:

  • WooCommerce → ShipStation order sync — new WooCommerce orders appear automatically in ShipStation for fulfilment
  • ShipStation → WooCommerce tracking push — when an order ships in ShipStation, tracking info is written back to WooCommerce
  • Order status updates — ShipStation can update WooCommerce order status to "Completed" when shipped

Theme-Level ShipStation Integration

The WooCommerce\ShipStation class in the Suma Elementor theme (inc/class-woocommerce-shipstation.php) provides additional functionality beyond the plugin:

International Customs Declarations

For international orders, the theme:

  1. Identifies orders needing customs declarations (marked with a custom meta flag)
  2. Strips tax/duty/fee virtual line items from ShipStation (these are not shipped items)
  3. Adds those amounts to taxAmount on the ShipStation order
  4. Enriches each line item with:
    • HS code (Harmonised Tariff code) from _hs_code product meta
    • Country of origin from _country_of_origin product meta
    • Product description from _product_description product meta
  5. Posts the corrected order back to ShipStation via its REST API

This process is triggered via an AJAX endpoint (wp_ajax_suma_shipstation_sync) and can also be run manually from the admin.

Environment-Aware Store IDs

The integration supports two ShipStation store IDs:

EnvironmentStore ID
Production (scottsdale.cc)80276
Staging (wpengine)66519

The store ID is auto-detected from the current server URL.


Tariff Data

The WooCommerce\Tariff class (inc/class-woocommerce-tariff.php) provides a static method get_tariff_data($product_id, $country_code) that returns the HS code, country of origin, and product description for international customs declarations.

These values are stored as product meta fields:

  • _hs_code — Harmonised System tariff code
  • _country_of_origin — ISO country code (e.g., US)
  • _product_description — regulatory product description

Configuration

ShipStation API credentials are stored in the theme class:

private $apikey    = 'db55f5c8...';
private $apisecret = '8b8eccef...';
warning

These credentials should ideally be moved to wp-config.php constants or environment variables for better security hygiene.

In ShipStation, configure:

  • The WooCommerce store connection to the Dealers Site
  • Shipping carriers and service mappings
  • Automation rules for standard domestic orders