Ensuring Accurate B2B Pricing: Resolving Draft Order Price List Discrepancies in ESHOPMAN Admin

Critical Insight: ESHOPMAN Admin UI Draft Orders and Price List Discrepancies

At Move My Store, we're dedicated to keeping the ESHOPMAN community informed about critical platform insights that impact your e-commerce operations. A recent discussion within the ESHOPMAN community has highlighted an important issue concerning how price lists are applied within the ESHOPMAN administrative interface when creating draft orders for specific customer groups. This insight is particularly crucial for merchants leveraging ESHOPMAN's robust B2B capabilities and HubSpot integration.

The Challenge: Inconsistent Pricing for B2B Draft Orders

Merchants utilizing ESHOPMAN's headless commerce platform, especially those with B2B models, rely heavily on accurate pricing. A reported bug revealed that when shop managers create draft orders via the ESHOPMAN Admin UI for customers belonging to a customer group with an active, configured price list, the line item unit prices incorrectly reflect the original or default product prices. This happens even when the customer and their group membership are explicitly linked to the draft order.

The inconsistency is stark: the same customer, adding the same product to their cart on an ESHOPMAN storefront (deployed via HubSpot CMS), correctly receives the price list price. This discrepancy makes the draft order workflow unreliable for scenarios where negotiated or group-specific pricing is essential, directly impacting B2B sales efficiency and accuracy.

Reproducing the Issue in ESHOPMAN Admin

To understand this issue, consider the following steps:

  • Create a customer and assign them to a specific customer group within ESHOPMAN.
  • Configure a price list, scoping it to that customer group, and set a lower price for a particular product variant.
  • Log into the ESHOPMAN Admin UI and initiate a draft order for the created customer.
  • Add the product variant that is part of the price list to the draft order.

Expected Outcome: The unit price for the line item should reflect the price list price configured for that customer group.

Actual Outcome: The unit price defaults to the original product price, ignoring the active price list.

Understanding the Technical Root Cause (Node.js/TypeScript & Admin API)

A deep dive into the ESHOPMAN core, built on Node.js/TypeScript, revealed the precise technical reason behind this behavior. The ESHOPMAN Admin API's pricing module, responsible for calculating line item prices, expects customer group membership data in a specific structured format—specifically, an object like { id: [group_id] }. However, the system was passing this data as an array of objects, such as [{ id, name }], directly from the database without the necessary transformation.

This critical data transformation, which is correctly handled in other ESHOPMAN modules (like the tax calculation module), was missing from the pricing context builder specifically for order line items. Furthermore, investigations suggested that the workflow responsible for adding order line items might not consistently load the complete customer groups relationship, potentially compounding the issue.

Impact on ESHOPMAN Merchants and Developers

This issue primarily affects ESHOPMAN merchants operating B2B models where custom pricing is a cornerstone of their sales strategy. For developers working with the ESHOPMAN Admin API to build custom workflows or integrations, understanding this data handling nuance is vital. The ESHOPMAN team has acknowledged this as a confirmed bug and is actively tracking it for a fix, demonstrating their commitment to maintaining a robust and reliable platform for headless commerce.

This insight underscores the importance of precise data handling within complex commerce systems and highlights the ongoing efforts to refine ESHOPMAN's core functionalities, ensuring seamless storefront management and accurate pricing across all touchpoints, from HubSpot CMS-deployed storefronts to the ESHOPMAN Admin UI.

Start with the tools

Explore migration tools

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

Explore migration tools