Overview
This guide explains the order processing flow from a storefront perspective. Important: Storefronts don’t directly create or manage orders - this is handled by Crave’s backend via webhooks after successful payments.Order Flow for Storefronts
From a storefront developer’s perspective, the order flow is:- Customer places order → Payment succeeds
- Crave receives webhook → Order is created automatically
- Merchant receives notification → Order appears in Crave Business Manager
- Customer receives receipt → Via Stripe (handled automatically)
What Storefronts Handle
1. Pre-Order (Your Responsibility)
- Menu Display - Show available products
- Cart Management - Add/remove items, calculate totals
- Checkout Flow - Collect customer info, process payment
- Payment Success - Show confirmation to customer
2. Post-Payment (Handled by Crave)
- Order Creation - Crave creates order from successful payment
- Merchant Notification - Order appears in Crave Business Manager
- Order Fulfillment - Merchant handles preparation and delivery
- Customer Updates - Merchant handles status updates
Cart to Order Flow
Here’s what happens when a customer completes checkout:Order Confirmation Page
Create a confirmation page to show after successful payment:API Route for Payment Details
Customer Communication
What You Can Do
What You Cannot Do
❌ Don’t implement these (merchant-side features managed through Crave Business Manager):- Order status tracking
- Order modifications
- Delivery tracking
- Customer accounts with order history
- Real-time order updates
Error Handling
Handle payment-related errors that might occur:Order Information Storage
If you need to store order information locally:Best Practices
1. Clear Communication
- Always explain that the order is being sent to the restaurant
- Set proper expectations about timing
- Provide clear next steps
2. Error Recovery
- Handle payment failures gracefully
- Provide clear error messages
- Offer retry options
3. Confirmation Details
- Show payment confirmation immediately
- Include order reference (payment intent ID)
- Provide receipt link when available
4. Don’t Over-Promise
- Don’t promise real-time order tracking
- Don’t claim to control restaurant operations
- Focus on what you can deliver
Integration with Merchant Systems
The order flow continues on the merchant side:- Storefront processes payment
- Crave API handles payment intent
- Stripe processes payment
- Webhook notifies Crave of success
- Crave Business Manager receives new order
Styling Example
Summary
As a storefront developer, your responsibility ends when the payment succeeds. The order creation and management is handled by Crave’s backend and the merchant. Focus on:- Smooth checkout experience
- Clear payment confirmation
- Proper error handling
- Setting correct expectations
Related Guides
- Creating a Menu - Display menu items
- Implementing Checkout - Payment processing
- Stripe Integration - Payment setup details