Live2024

Apollo Healthcare — E-commerce Platform

Designed and built a complete e-commerce platform for Apollo Healthcare using Medusa open-source — integrated with Microsoft Dynamics ERP, Razorpay payments, and a lead capture pipeline that measurably increased online sales.

Medusa.jsNext.jsNode.jsPostgreSQLRazorpayMicrosoft DynamicsMS ERPRedisDocker

Category

Enterprise

Year

2024

Status

Live

The Problem

Apollo Healthcare had a fragmented online presence. Products were listed on the website but there was no proper e-commerce flow — no cart, no checkout, no payment processing. Customers had to call in or visit a store to purchase. Inventory lived in Microsoft Dynamics ERP, but there was no bridge between the ERP and the web. The result: lost sales, manual order processing, and zero visibility into online customer behavior.

They needed a full e-commerce store that worked seamlessly with their existing ERP system, handled payments online, and didn’t require ripping out their back-office infrastructure.

What I Built

A complete e-commerce platform from the ground up using Medusa.js — an open-source headless commerce engine. This gave Apollo full ownership of their commerce stack without vendor lock-in to Shopify or Magento.

Storefront (Next.js):

  • Server-side rendered product catalog with fast page loads and SEO optimization
  • Product search and filtering by category, brand, health condition
  • Responsive design — mobile-first, since majority of Apollo’s traffic is mobile
  • Product detail pages with rich descriptions, images, dosage info, and related products
  • Cart and multi-step checkout flow optimized for conversion

Commerce Backend (Medusa.js + Node.js):

  • Product management — catalog, variants, pricing, inventory tracking
  • Order management — lifecycle from placement to fulfillment to delivery
  • Customer accounts — order history, saved addresses, wishlists
  • Discount engine — coupon codes, bulk pricing, promotional campaigns
  • Admin dashboard for Apollo’s operations team to manage everything

Microsoft Dynamics ERP Integration:

  • Bi-directional sync between Medusa product catalog and Dynamics ERP
  • Real-time inventory updates — when stock changes in the warehouse, the website reflects it instantly
  • Order push — online orders automatically flow into the ERP for fulfillment
  • Customer sync — new online customers created in Dynamics for the sales team
  • Price sync — pricing rules from ERP propagated to the storefront, including B2B tier pricing

Payment Integration (Razorpay):

  • Full Razorpay integration for credit/debit cards, UPI, net banking, and wallets
  • Payment capture on order confirmation with automatic reconciliation
  • Refund flow integrated with order cancellation workflow
  • Payment failure handling with retry logic and abandoned cart recovery

Lead Capture Pipeline:

  • High-intent visitors who browse but don’t purchase are captured as leads
  • Lead scoring based on browsing behavior — products viewed, time on site, cart additions
  • Automatic routing to the sales team in Dynamics CRM for follow-up
  • Conversion tracking to measure which channels and campaigns drive sales

Technical Challenges

  • ERP integration complexity — Microsoft Dynamics has a sprawling API surface. Building a reliable, bi-directional sync that handles inventory, orders, customers, and pricing without data conflicts or race conditions was the hardest part of the project. We built an event-driven sync layer with retry logic and conflict resolution.

  • Medusa customization — Medusa provides solid commerce primitives, but Apollo’s healthcare catalog had unique requirements: prescription vs. OTC classification, health condition tagging, dosage information on variants, and regulatory disclaimers. Extended Medusa’s product model and admin UI to handle all of this.

  • Payment edge cases — Indian payment systems (UPI, net banking) have unique timeout and failure modes that don’t map cleanly to standard payment gateway flows. Built robust handling for partial payments, pending UPI confirmations, and bank-side timeouts with automatic status polling.

  • Inventory accuracy — The ERP is the source of truth for stock, but the website needs near-real-time accuracy. Built a webhook + polling hybrid that pushes stock changes immediately when possible and polls as a fallback, with a reconciliation job that catches any drift.

  • Performance at scale — Apollo’s catalog has thousands of SKUs. Product listing pages needed to be fast despite complex filtering. Implemented Redis caching for product queries and incremental static regeneration (ISR) in Next.js for product pages.

Architecture

  • Frontend — Next.js with server-side rendering and ISR for product pages. Tailwind CSS for styling. Deployed as a standalone app.
  • Commerce API — Medusa.js running on Node.js. Extended with custom plugins for ERP sync, lead capture, and healthcare-specific product attributes.
  • Database — PostgreSQL for all commerce data — products, orders, customers, inventory. Medusa’s schema with custom extensions.
  • ERP Bridge — Custom Node.js service that handles bi-directional sync with Microsoft Dynamics via its REST API. Event-driven with a message queue for reliability.
  • Payments — Razorpay SDK integrated into the checkout flow. Webhook receiver for payment status updates.
  • Caching — Redis for product catalog caching, session management, and rate limiting.
  • Infrastructure — Docker containers, deployed on cloud infrastructure.

Results & Impact

  • Measurable sales increase — Apollo went from zero online transactions to a fully functional e-commerce channel generating consistent revenue
  • Order processing time reduced dramatically — orders flow directly from website to ERP to warehouse, eliminating manual data entry
  • Real-time inventory accuracy — customers see actual stock levels, reducing out-of-stock frustration and overselling
  • Lead conversion pipeline — high-intent visitors who don’t purchase are captured and followed up by the sales team, recovering otherwise lost revenue
  • Full ownership — built on open-source Medusa, Apollo owns their commerce stack with no monthly platform fees or vendor lock-in

Stack Deep Dive

  • Medusa.js as the headless commerce engine — open-source, extensible, Node.js-native
  • Next.js storefront with SSR and ISR for SEO and performance
  • PostgreSQL for all commerce, order, and customer data
  • Microsoft Dynamics integration for inventory, orders, customers, and pricing
  • Razorpay for payment processing — cards, UPI, net banking, wallets
  • Redis for caching and session management
  • Docker for containerized deployment
  • Custom event-driven ERP sync service with retry and reconciliation

Interested in working together?

Get in Touch