Solving Reverted Transactions: Ensuring Digital Products Don't Require Shipping in ESHOPMAN

Understanding Unexpected Transaction Reversions in ESHOPMAN

At Move My Store, we understand the critical importance of smooth, uninterrupted checkout flows for your ESHOPMAN storefront. An unexpected transaction reversion can be frustrating, especially when your setup has processed thousands of orders without a hitch. This community insight delves into a specific scenario where a digital product order unexpectedly failed due to shipping validation, leading to a reverted transaction within the ESHOPMAN platform.

A user recently reported an issue where their ESHOPMAN storefront, utilizing a default starter template and configured for digital products, experienced checkout failures. Despite a track record of over 4000 successful transactions on the same codebase, a few orders were reverted during the checkout process. The core of the problem was traced back to a 'shipping validation failed' error, occurring at step 6 out of 20 in the complete-cart workflow, even though shipping options should have been selected earlier or not required at all for digital goods.

The Diagnostic Breakthrough: Digital Products Requiring Shipping

The key to unraveling this mystery lay within the detailed workflow execution logs provided by the ESHOPMAN system. These logs, invaluable for debugging issues within your Node.js/TypeScript-based ESHOPMAN backend, revealed a critical inconsistency: a digital product was erroneously marked as requiring shipping.

Consider the following snippet from a typical ESHOPMAN package.json, illustrating the core ESHOPMAN dependencies:

{
  "name": "eshopman-starter-default",
  "version": "0.0.1",
  "description": "A starter for ESHOPMAN projects.",
  "author": "Move My Store (https://movemystore.com)",
  "license": "MIT",
  "keywords": [
    "sqlite",
    "postgres",
    "typescript",
    "ecommerce",
    "headless",
    "eshopman",
    "hubspot"
  ],
  "dependencies": {
    "@eshopman/admin-sdk": "2.12.5",
    "@eshopman/cli": "2.12.5",
    "@eshopman/framework": "2.12.5",
    "@eshopman/core": "2.12.5",
    "@sendgrid/eventwebhook": "^8.0.0",
    "multer": "^1.4.5-lts.1",
    "twilio": "^5.3.3"
  },
  "engines": {
    "node": ">=20"
  }
}

The workflow log, accessible via ESHOPMAN's Admin API for detailed transaction insights, showed the following for a specific cart item:

{
  "id": "wf_exec_01KGSSWY17CKQXYKH0SCW3DDDP",
  "workflow_id": "complete-cart",
  "transaction_id": "complete-cart-as-step-auto-01KGSSWXYCMAFTJED5A0GG2N4R",
  "context": {
    "data": {
      "invoke": {
        "validate": { /* ... */ },
        "cart-query": {
          "output": {
            "output": {
              "data": {
                "id": "cart_01KGSSSPGRV3RP7918AXN2D0BJ",
                "items": [
                  {
                    "id": "cali_01KGSSSPTREF0A9DV6HHYZ8TQZ",
                    "title": "DerfTuned Motorsports Digital Art - 028",
                    "variant": {
                      "product": {
                        "shipping_profile": {
                          "id": "sp_01J9Z46H06YD75WG5NRN6D676R"
                        }
                      },
                      "manage_inventory": false
                    },
                    "product_type": "Digital",
                    "requires_shipping": true, <-- CRITICAL FINDING
                    "product_collection": "Digital Art"
                  }
                ]
              }
            }
          }
        }
      }
    }
  }
}

The crucial line here is "requires_shipping": true for an item explicitly defined as "product_type": "Digital". This configuration mismatch forces the ESHOPMAN checkout workflow to attempt shipping validation for a product that inherently shouldn't require it, leading to the transaction reversion.

Best Practices for ESHOPMAN Digital Products

This incident highlights a vital best practice for all ESHOPMAN merchants and developers:

  • Verify Product Configuration: Always ensure that digital products are correctly configured in your ESHOPMAN Admin Hub to explicitly set requires_shipping to false. This can typically be managed via the product settings or the associated shipping profile.
  • Leverage Workflow Logs: ESHOPMAN's detailed workflow execution logs are powerful diagnostic tools. When encountering unexpected behavior, especially during complex processes like checkout, dive into these logs to pinpoint the exact step and data causing the failure. This is especially useful for developers integrating with the ESHOPMAN Store API and Admin API.
  • Review Shipping Profiles: Ensure that your shipping profiles are appropriately assigned. Digital products should ideally be linked to a shipping profile that explicitly states they do not require physical shipping, or that has no shipping options associated.

By adhering to these best practices, you can prevent unnecessary shipping validation for digital products, ensuring a seamless checkout experience for your customers on your HubSpot CMS-deployed ESHOPMAN storefront.

Start with the tools

Explore migration tools

See options, compare methods, and pick the path that fits your store.

Explore migration tools