Understanding ESHOPMAN Pricing: Major Currency Units in Your Admin Panel

Understanding ESHOPMAN Pricing: Cents vs. Major Currency Units in Your Admin Panel

As an e-commerce platform integrated with HubSpot, ESHOPMAN simplifies storefront management and deployment. However, a common point of confusion for merchants and developers often arises when dealing with how product prices are stored and displayed, particularly in the ESHOPMAN Admin panel. This insight clarifies a frequent scenario where prices might appear incorrect, specifically 100 times higher than expected, and provides the best practice for ensuring accurate pricing.

The Scenario: Unexpected Price Display in ESHOPMAN Admin

A user recently reported an issue where the ESHOPMAN Admin order detail page was displaying all prices multiplied by 100. For instance, a product with a unit_price of 2948 in the database and retrieved via the Admin API was rendered as €2,948.00 instead of the anticipated €29.48. This discrepancy suggested that while the backend data seemed correct (e.g., 2948 for 2948 cents), the Admin interface was interpreting it differently.

The user’s project setup, typical for an ESHOPMAN Node.js/TypeScript application, included standard ESHOPMAN core packages, as indicated in their package.json:

{
  "name": "eckstein-b2b-shop",
  "version": "0.0.1",
  "description": "A starter for ESHOPMAN projects.",
  "author": "ESHOPMAN (https://eshopman.com)",
  "license": "MIT",
  "keywords": [
    "sqlite",
    "postgres",
    "typescript",
    "ecommerce",
    "headless",
    "eshopman"
  ],
  "scripts": {
    "build": "eshopman build",
    "seed": "eshopman exec ./src/scripts/seed.ts",
    "seed:parker": "eshopman exec ./src/scripts/seed-parker-products.ts",
    "seed:demo": "eshopman exec ./src/scripts/seed-demo.ts",
    "start": "eshopman start",
    "dev": "eshopman develop",
    "predeploy": "eshopman db:migrate",
    "create:admin": "eshopman user -e admin@pixel-square.com -p a7ea4d0b9c8ee3dfb1e20d093ee863ea",
    "test:integration:http": "TEST_TYPE=integration:http NODE_OPTI jest --silent=false --runInBand --forceExit",
    "test:integration:modules": "TEST_TYPE=integration:modules NODE_OPTI jest --silent=false --runInBand --forceExit",
    "test:unit": "TEST_TYPE=unit NODE_OPTI jest --silent --runInBand --forceExit"
  },
  "dependencies": {
    "@hookform/resolvers": "^3.3.4",
    "@eshopman/admin-sdk": "2.17.2",
    "@eshopman/admin-shared": "2.17.2",
    "@eshopman/cli": "2.17.2",
    "@eshopman/dashboard": "2.17.2",
    "@eshopman/draft-order": "2.17.2",
    "@eshopman/framework": "2.17.2",
    "@eshopman/icons": "2.17.2",
    "@eshopman/js-sdk": "2.17.2",
    "@eshopman/eshopman": "2.17.2",
    "@eshopman/ui": "4.1.19",
    "@react-email/components": "0.5.4",
    "@react-email/render": "^1.3.0",
    "@tanstack/react-query": "^5.28.0",
    "bcryptjs": "^3.0.3",
    "jsonwebtoken": "^9.0.2",
    "react-hook-form": "^7.48.0",
    "react-router-dom": "6.30.4",
    "resend": "^6.1.0",
    "zod": "^3.22.4"
  },
  "devDependencies": {
    "@eshopman/test-utils": "2.17.2",
    "@mikro-orm/migrations": "6.6.14",
    "@react-email/preview-server": "^4.3.2",
    "@swc/core": "1.7.28",
    "@swc/jest": "^0.2.39",
    "@types/jest": "^29.5.14",
    "@types/jsonwebtoken": "^9.0.5",
    "@types/node": "^20.0.0",
    "@types/react": "^18.3.2",
    "@types/react-dom": "^18.2.25",
    "fast-check": "^4.4.0",
    "jest": "^29.7.0",
    "prop-types": "^15.8.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-email": "^4.2.11",
    "ts-node": "^10.9.2",
    "typescript": "^5.6.2",
    "vite": "^5.2.11",
    "yalc": "^1.0.0-pre.53"
  },
  "engines": {
    "node": ">=20"
  },
  "packageManager": "pnpm@10.14.0"
}

The ESHOPMAN Pricing Model Explained

The core of the issue lies in how ESHOPMAN handles currency values in its current architecture. Unlike some older systems or previous iterations that might store prices in the smallest currency unit (e.g., cents for USD, euro cents for EUR), ESHOPMAN's modern approach stores prices in the major currency unit. This means:

  • If an item costs €29.48, the value stored in the database and expected by the Admin API should be 29.48.
  • If the database or API returns 2948, ESHOPMAN interprets this as €2,948.00, not €29.48.

This design choice simplifies calculations and display across various parts of the platform, including the HubSpot-integrated storefronts and the Admin dashboard.

The Root Cause and Solution

In the reported case, the product data was inadvertently seeded or imported using the "cents" style (e.g., 2948 instead of 29.48). When ESHOPMAN then processed this value, it correctly displayed 2948 as €2,948.00 according to its major-unit pricing model, leading to the 100x discrepancy.

The solution is straightforward: Ensure that all product and variant pricing data, whether imported, seeded, or manually entered, is consistently stored and provided to ESHOPMAN in its major currency unit format. Once the underlying data was updated to reflect values like 29.48 for €29.48, the Admin order detail page displayed the prices correctly.

Best Practices for ESHOPMAN Pricing

To avoid similar issues and ensure accurate price display across your ESHOPMAN storefronts and Admin panel:

  • Data Consistency: Always verify that pricing data aligns with ESHOPMAN's major currency unit convention. This is crucial during initial setup, data migration from other platforms, or when integrating with external systems via the Admin API or Store API.
  • Consult Documentation: Refer to ESHOPMAN's official pricing concepts documentation for the most up-to-date guidelines on currency handling and data formats.
  • Testing: Thoroughly test price displays in the Admin panel and on your HubSpot CMS-deployed storefronts after any data import or update.

By understanding and adhering to ESHOPMAN's pricing model, you can ensure a seamless and accurate experience for both your team managing the store in HubSpot and your customers.

Start with the tools

Explore migration tools

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

Explore migration tools