Real‑Time Dynamic Pricing in Medusa – Fluctum
Описание и применение
Fluctum добавляет к Medusa динамическое ценообразование для товаров с изменяющимися рыночными ценами, автоматически обновляя цены в реальном времени и фиксируя их при оформлении заказа.
Задача
E‑commerce merchants selling spot‑priced goods (gold, silver, etc.) face price mismatches between add‑to‑cart and checkout because market quotes change continuously, leading to losses or unhappy customers.
Результат
The Fluctum starter demonstrates end‑to‑end dynamic pricing: live price updates via SSE, checkout‑time price locking, and audit‑ready price records, all without custom engine development.
Рабочий процесс
- Create a repo from the Fluctum starter template
- Install dependencies with pnpm
- Configure environment variables (copy .env templates, set API keys)
- Start Docker Compose to run PostgreSQL and Redis
- Run Medusa migrations
- Create an admin user and start the backend
- Copy the publishable API key to the storefront .env
- Start the storefront
- Add a product to the cart and observe live SSE price updates
- Proceed to checkout, triggering lockCartPrices
- Complete the order, verifying price lock and validation
Доказательства
Fluctum fetches live spot prices on a schedule, streams them to the storefront, and locks the computed price for a cart when checkout begins.
The price stays fixed across these steps – it won’t drift even if the underlying spot price moves in the meantime.
- Дата записи: 2026-09-08T19:32:03.130Z