Where deliveryTime is average preparation duration (in minutes).
Practical example
Scenario: Customer schedules delivery for 20:00, your store takes 40 minutes to prepare
Scheduled delivery: 20:00Preparation time: 40 minutes─────────────────────────Start prep at: 19:20SLA deadline: 19:28 (8 min after 19:20)
Expected timeline:
16:00 → Customer schedules for 20:00 in app16:01 → You receive CONFIRMED16:02 → Confirm order (within 8 min after 19:20)19:00 → System alerts: "start prep in 20 min"19:20 → Receipt prints — start preparation19:20 → Call /startPreparation19:28 → SLA deadline passed (not a problem, already confirmed at 16:02)20:00 → Call /dispatch or /readyToPickup20:00 → Driver arrives or customer picks up
Important rules
Never prepare early
Wrong: Start prep before preparationStartDateTime
Customer may not be home (DELIVERY)
Food gets cold/warm
Customer sees order leaving early than scheduled
Correct: Start exactly at preparationStartDateTime or shortly after
System allows delivery during entire window, but respect start time.
Order confirmation (8-minute SLA)
Although you confirm right away, technical SLA is:
8 minutes after preparationStartDateTime
This allows time to:
Validate item availability
Alert customer if there's delay
You already confirmed early (16:02 in example), so you're covered.
Common scenarios
Scenario 1: On-time scheduled delivery
16:00 → Customer schedules for 20:0016:01 → Receive CONFIRMED16:02 → Confirm via API19:20 → Get alert "start prep"19:20 → Call /startPreparation19:50 → Prep done20:00 → Call /dispatch exactly20:15 → Driver arrives and picks up20:40 → Customer receives
Scenario 2: Scheduled takeout with margin
17:00 → Customer schedules for 19:3017:01 → Receive CONFIRMED17:02 → Confirm19:00 → Get alert "start prep in 30 min"19:30 → Call /startPreparation (15 min early to be ready)19:45 → Prep done19:50 → Call /readyToPickup20:00 → Customer arrives, picks up at counter