Enhancing ESHOPMAN Order Fulfillment: Granular Control Over Delivery Notifications

As an e-commerce platform built for headless commerce and deeply integrated with HubSpot, ESHOPMAN empowers merchants with robust storefront management and flexible order processing. A key aspect of managing customer experience is precise control over communication. Recently, our vibrant ESHOPMAN community identified and addressed an important enhancement concerning order fulfillment notifications.

The Challenge: Suppressing Delivery Notifications in ESHOPMAN

In the world of e-commerce, there are often scenarios where merchants need to mark an order as delivered without automatically triggering a customer notification. This could be for internal tracking, specific customer service protocols, or when a separate, custom communication flow is in place. ESHOPMAN's Admin API already provides a no_notification flag for crucial steps like creating fulfillments and shipments, allowing for this granular control.

However, a gap was identified in the markOrderFulfillmentAsDeliveredWorkflow. While creating a fulfillment or shipment allowed developers to suppress notifications, the final step of marking an order as delivered did not offer this direct option. This meant that even if a merchant wanted to quietly update an order's status, the system would default to sending a "delivery created" notification to the customer, potentially leading to redundant or unwanted communication.

Technical Deep Dive into ESHOPMAN Workflows

The core of the issue lay in how the ESHOPMAN workflow and its associated Admin API endpoint were structured. For context, ESHOPMAN's workflows are designed to handle complex business logic, emitting events that other parts of the system (like notification services) can subscribe to.

  • Missing Parameter: The input type for the markOrderFulfillmentAsDeliveredWorkflow was found to only accept orderId and fulfillmentId, lacking a dedicated no_notification field.
  • Event Propagation: Consequently, the DELIVERY_CREATED event emitted by this workflow did not carry any flag to indicate that notifications should be suppressed, making it impossible for event subscribers to act accordingly.
  • Admin API Endpoint: The corresponding Admin API route, POST /admin/orders/:id/fulfillments/:fulfillment_id/mark-as-delivered, also lacked the necessary body validation middleware to accept and process such a flag.

This contrasted with other related workflows, such as createOrderFulfillmentWorkflow, createShipmentWorkflow, and even cancelOrderFulfillmentWorkflow, which all gracefully accept and propagate the no_notification parameter, demonstrating a clear pattern within ESHOPMAN's architecture.

The ESHOPMAN Community's Solution

Our community swiftly rallied to address this. The proposed solution, aligned with ESHOPMAN's existing Node.js/TypeScript patterns, involves a few key steps to integrate the no_notification functionality:

  1. Extend Workflow Input: Add the no_notification field to the input type of the markOrderFulfillmentAsDeliveredWorkflow.
  2. Propagate to Event: Ensure this flag is passed along to the emitEventStep, so the DELIVERY_CREATED event carries the suppression instruction.
  3. Update Admin API Validation: Implement a body validator for the POST /admin/orders/:id/fulfillments/:fulfillment_id/mark-as-delivered route, mirroring the validation patterns seen in other fulfillment-related endpoints. This ensures the Admin API can properly receive and process the flag.

This enhancement is a testament to the collaborative spirit of the ESHOPMAN community and its commitment to refining the platform for optimal headless commerce operations. By enabling this level of control, ESHOPMAN further solidifies its position as a flexible and powerful solution for managing storefronts within the HubSpot ecosystem.

What This Means for ESHOPMAN Users

For ESHOPMAN developers and merchants, this update provides enhanced flexibility in managing order fulfillment and customer communications. You'll soon be able to use the Admin API or SDKs to mark orders as delivered without automatically sending notifications, giving you more power to craft unique customer journeys and manage internal processes seamlessly. This ensures that your ESHOPMAN-powered storefronts, deployed via HubSpot CMS, offer an even more tailored and efficient experience.

Stay tuned for official updates and documentation on how to leverage this new capability in your ESHOPMAN implementations!

Start with the tools

Explore migration tools

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

Explore migration tools