Lead to Order Workflow
Cross-Module Workflow
This guide describes the end-to-end flow from lead capture in the CRM module to order creation in the Sales module.
Overview
The Lead to Order workflow covers the complete customer journey:
Lead Capture (CRM Module)
- Lead creation from various sources
- Lead qualification and scoring
- Assignment to sales representatives
Opportunity Management (CRM Module)
- Converting qualified leads to opportunities
- Opportunity stages and pipeline management
- Sales forecasting
Quote Generation (Sales Module)
- Creating quotes from opportunities
- Quote approval workflows
- Quote versioning and revisions
Order Conversion (Sales Module)
- Converting accepted quotes to sales orders
- Order confirmation and processing
- Inventory reservation
Order Fulfillment (Operations Module)
- Pick, pack, and ship processes
- Inventory updates
- Delivery confirmation
State Transitions
Lead (NEW) -> Lead (QUALIFIED) -> Opportunity (PROSPECTING)
-> Opportunity (WON) -> Order (DRAFT) -> Order (CONFIRMED)Integration Points
- CRM leads sync with Sales opportunities via
LeadConverteddomain event - Won opportunities trigger order creation via
OpportunityWondomain event - Sales orders trigger Operations inventory reservations via
OrderConfirmeddomain event - Domain events enable cross-module communication without direct coupling
API Flow Example
http
# 1. Create a lead
POST /api/v1/crm/leads
# 2. Qualify the lead
POST /api/v1/crm/leads/{id}/qualify
# 3. Convert to customer + opportunity
POST /api/v1/crm/leads/{id}/convert
# 4. Win the opportunity (auto-creates order)
POST /api/v1/crm/opportunities/{id}/win
# 5. Confirm the order (auto-reserves inventory)
POST /api/v1/sales/orders/{id}/confirm