Case Study
Nature Medica
A full-stack Ayurvedic e-commerce platform with tri-gateway payment resilience, multi-provider shipping automation, abandoned cart recovery, and GA4-powered analytics — engineered for scale.

Scaling Ayurvedic wellness beyond a basic storefront
Nature Medica sells authentic Ayurvedic wellness products online. Their challenge wasn't just building a store — it was building an enterprise-grade commerce engine that could handle the complexity of Indian e-commerce at scale.
Indian e-commerce has unique infrastructure challenges: payment gateways go down, customers expect COD but COD has the highest return-to-origin (RTO) rate, logistics providers have varying serviceability by pincode, and abandoned carts cost revenue daily. A template store can't solve these problems.
They needed a platform that would handle 500+ SKUs with complex variants, fail over seamlessly between payment gateways, automate shipping across multiple providers, recover abandoned carts through automated follow-ups, and provide granular analytics for every step of the customer journey.
Goals
- Build a high-performance storefront for 500+ Ayurvedic SKUs
- Implement tri-gateway payment failover for zero transaction loss
- Automate multi-provider shipping with optimal carrier selection
- Recover abandoned carts through WhatsApp + email sequences
- Track every micro-interaction with GA4 DataLayer events
- Reduce RTO losses from COD orders
Constraints
- Ongoing engagement — platform evolves with business needs
- Must handle complex product variants (sizes, packs, combos)
- Payment webhooks must be idempotent across 3 gateways
- Sub-2s load times for product pages on mobile
Engineering impact
Performance metrics comparing the current platform against the previous implementation.
What we built and why
Tri-Gateway Payment Resilience
Seamless failover between PhonePe, Cashfree, and Razorpay. If one gateway times out or returns an error during checkout, the system automatically routes to the next provider without the customer seeing a failure screen. Each gateway's webhook is processed idempotently to prevent duplicate charges. Zero transaction loss.
Multi-Provider Logistics Engine
Automated shipping across Shiprocket, Delhivery, and Ekart. The system checks pincode serviceability across providers, selects the optimal carrier based on weight and delivery speed, generates AWB numbers automatically, and provides real-time tracking. Order processing time dropped from manual hours to under 2 minutes.
Abandoned Cart Recovery CRM
When customers drop off during checkout, the system tracks exactly where they left (cart, address, payment). Automated WhatsApp and email sequences trigger with the exact items abandoned. 20% of abandoned carts are recovered — each one representing direct revenue that would have been lost.
Partial COD Logic
Full COD has the highest RTO rate in Indian e-commerce because customers have zero financial commitment. Our partial COD system charges a small upfront fee online before shipping, reducing RTO by 35% while still offering the COD flexibility that Indian customers demand.
Custom CMS & Admin Dashboard
Marketing team manages 500+ SKUs, blog content, FAQs, banners, coupons, and flash sales without developer involvement. Product variants (sizes, packs, combos) are managed through an intuitive admin interface with real-time inventory updates.
GA4 DataLayer Analytics Engine
Every customer interaction fires a structured DataLayer event — view_item, add_to_cart, begin_checkout, add_shipping_info, add_payment_info, purchase. This granular tracking enables precise marketing attribution, funnel analysis, and campaign optimization.
Platform screens


Why we chose each tool
Next.js 15 (Turbopack)
App Router for server-rendered product pages (critical for organic search in the Ayurvedic wellness space), API routes for payment webhooks and logistics APIs, and Turbopack for sub-second hot reloads across 500+ SKU pages.
Redux Toolkit
Complex client-side state: cart with product variants (sizes, packs), authentication flows, coupon application, address management, and checkout stages. Redux handles cross-component state synchronization that local state can't manage cleanly.
MongoDB + Mongoose
500+ SKUs with complex variant structures (sizes, packs, combos). Document-based storage maps naturally to product catalogs where each item has different attribute shapes.
PhonePe + Cashfree + Razorpay
Tri-gateway payment architecture. If PhonePe's UPI flow fails (gateway downtime, timeout), the system fails over to Cashfree, then Razorpay. Zero transaction loss — customers never see a 'payment failed, try again' screen.
Shiprocket + Delhivery + Ekart
Multi-provider shipping with automated AWB generation and real-time serviceability checks. The system selects the optimal carrier based on pincode, weight, and delivery speed. Order processing time dropped from manual hours to under 2 minutes.
GA4 DataLayer
Granular e-commerce tracking from view_item to purchase. Every micro-interaction (add_to_cart, begin_checkout, add_payment_info) fires a DataLayer event for precise marketing attribution and funnel analysis.
Phased platform build
Architecture & Storefront
Phase 1
Designed Next.js 15 foundation with product catalog, variant management, cart system with Redux, and server-rendered product pages for SEO.
Payments & Logistics
Phase 2
Integrated tri-gateway payment failover (PhonePe/Cashfree/Razorpay) and multi-provider shipping (Shiprocket/Delhivery/Ekart) with automated AWB generation.
CMS & Recovery Tools
Phase 3
Built custom admin CMS for 500+ SKUs, abandoned cart recovery engine with WhatsApp/email automation, and coupon/flash sale management.
Analytics & Scaling
Ongoing
Implemented GA4 DataLayer tracking for every checkout step, partial COD logic for RTO reduction, and SEO automation for sustained organic growth.
Problems we solved
Tri-Gateway Idempotency
With three payment gateways, webhook processing becomes complex. Each gateway has different webhook formats, retry policies, and signature verification methods. A payment that fails on PhonePe and succeeds on Cashfree could trigger webhooks from both.
Solution: Unified order ID serves as the idempotency key across all gateways. Each webhook handler normalizes the gateway-specific payload into a common format, verifies the gateway's signature, and checks the order's current state before processing. If the order is already paid (via another gateway), the webhook acknowledges success without re-processing.
Optimal Carrier Selection
Different logistics providers service different pincodes, have varying weight limits, and offer different delivery speeds. Manually selecting the right carrier for each order is error-prone and slow.
Solution: Automated serviceability check across all providers at order creation. The system queries Shiprocket, Delhivery, and Ekart APIs simultaneously, filters by pincode availability, sorts by delivery speed and cost, and auto-selects the optimal carrier. AWB is generated instantly — the entire process takes under 2 minutes.
"The Nature Medica platform is a showcase of strategic coding meets premium branding. We went from manual order processing to a fully automated commerce engine — payments, shipping, cart recovery, and analytics all running without our intervention.
Questions about this project
Why three payment gateways instead of one?+
How does the abandoned cart recovery system work?+
How did you reduce RTO (Return to Origin) losses by 35%?+
What does the custom CMS handle?+
Can you build a similar e-commerce platform for our brand?+
How we can help you
Similar projects
Spark & Stitch
UPI-first apparel e-commerce with Cashfree payments and affiliate program.
Online Planet
Multi-vendor marketplace with Razorpay split-payments and seller dashboards.
SaleBuy
AI-powered C2C marketplace with Gemini vision auto-listing.
Want to build a commerce platform?
We build e-commerce engines with multi-gateway payments, logistics automation, and growth tools.