What You'll Build
In this tutorial, you'll create a comprehensive e-commerce checkout flow diagram that covers the entire purchase journey from cart to confirmation. This diagram is perfect for:
- Product documentation for payment systems
- Developer onboarding for checkout integrations
- Stakeholder presentations on payment flows
- UX documentation for checkout optimization
Understanding the Flow
Our checkout flow has several key stages and decision points:
| Stage | Color | Purpose |
|---|---|---|
| Start | Green | Cart ready - user initiates checkout |
| Inventory Check | Blue | Validate stock availability |
| Decision Points | Amber | Branch logic (in stock? 3D Secure?) |
| Shipping Info | Purple | Collect and validate address |
| Payment Gateway | Cyan | Stripe, PayPal, or Razorpay |
| Success/Error | Green/Red | Order confirmation or failure |
Design Pattern: Decision Diamonds
Use diamond shapes for all Yes/No decision points. Color the "Yes" arrows green and "No" arrows red for instant visual clarity.
Step 1: Create the Start Node
Checkout flows traditionally start with an ellipse (oval) shape. This signals to readers that this is an entry point.
Add the Cart Ready Ellipse
{
"id": "start",
"type": "ellipse",
"x": 80,
"y": 150,
"w": 120,
"h": 60,
"options": {
"stroke": "green.500",
"fill": "green.100",
"fillStyle": "solid"
}
},
{
"id": "start-label",
"type": "text",
"x": 80,
"y": 170,
"w": 120,
"h": 24,
"text": "🛍️ Cart Ready",
"fontSize": 14,
"fontWeight": "bold",
"align": "center",
"options": { "stroke": "green.800" }
}
Step 2: Add Decision Diamonds
Decision points use diamond shapes. The "In Stock?" check is critical for e-commerce flows.
Create the Inventory Check Diamond
{
"id": "diamond-stock",
"type": "diamond",
"x": 310,
"y": 260,
"w": 80,
"h": 60,
"options": {
"stroke": "amber.500",
"fill": "amber.100",
"fillStyle": "solid"
}
},
{
"id": "diamond-stock-label",
"type": "text",
"x": 310,
"y": 278,
"w": 80,
"h": 18,
"text": "In Stock?",
"fontSize": 11,
"align": "center",
"options": { "stroke": "amber.800" }
}
Step 3: Branch with Yes/No Arrows
Connect your decision diamond to the next steps. Use colors to show the happy path (green) vs error path (red).
Create Branching Arrows
// "Yes" arrow (green) - pointing right to continue flow { "id": "arrow-yes", "type": "arrow", "x": 389, "y": 290, "w": 66, "h": 0, "endArrowhead": "arrow", "options": { "stroke": "green.500" } } // "No" arrow (red) - pointing left to error state { "id": "arrow-no", "type": "arrow", "x": 313, "y": 290, "w": -97, // Negative = points left! "h": 39, "endArrowhead": "arrow", "options": { "stroke": "red.500" } }
Pro tip: Add small text labels ("Yes", "No") near each arrow to make the flow crystal clear.
Arrow Direction Reminder
Negative w values make arrows point left. Negative h values make arrows
point up. Combine both for diagonal arrows.
Step 4: Add Payment Gateway Options
E-commerce flows often offer multiple payment options. Create branching arrows to each gateway.
Create Payment Gateway Cards
// Stripe payment option { "id": "stripe", "type": "rectangle", "x": 330, "y": 520, "w": 120, "h": 60, "borderRadius": 10, "options": { "stroke": "indigo.500", "fill": "indigo.100", "fillStyle": "solid" } }, { "id": "stripe-label", "type": "text", "x": 330, "y": 540, "w": 120, "h": 20, "text": "💳 Stripe", "fontSize": 13, "fontWeight": "bold", "align": "center", "options": { "stroke": "indigo.700" } }
Repeat this pattern for PayPal (blue tones) and Razorpay (teal tones), positioning them horizontally or vertically based on your layout.
Step 5: Add Error and Success States
Every good flowchart shows both happy and unhappy paths. Add "Out of Stock" and "Payment Failed" error states in red.
Create Error State Box
{
"id": "error-out-of-stock",
"type": "rectangle",
"x": 74,
"y": 303,
"w": 140,
"h": 60,
"borderRadius": 10,
"options": {
"stroke": "red.500",
"fill": "red.100",
"fillStyle": "solid"
}
},
{
"id": "error-label",
"type": "text",
"x": 74,
"y": 323,
"w": 140,
"h": 20,
"text": "❌ Out of Stock",
"fontSize": 13,
"fontWeight": "bold",
"align": "center",
"options": { "stroke": "red.700" }
}
Step 6: Add the Order Confirmation
End the flow with a green "Order Complete" ellipse, mirroring the start node's shape.
Create Success End Node
{
"id": "end-success",
"type": "ellipse",
"x": 990,
"y": 650,
"w": 140,
"h": 70,
"options": {
"stroke": "green.600",
"fill": "green.200",
"fillStyle": "solid"
}
},
{
"id": "end-label",
"type": "text",
"x": 990,
"y": 665,
"w": 140,
"h": 40,
"text": "✅ Order\\nComplete!",
"fontSize": 14,
"fontWeight": "bold",
"align": "center",
"options": { "stroke": "green.800" }
}
Note: Use \\n in your text string to create line breaks.
Key Takeaways
- Start/End nodes — Use ellipses for entry and exit points
- Decision points — Use diamonds with Yes/No branches
- Color coding — Green for success, red for errors, amber for decisions
- Multiple paths — Show all payment gateway options branching from a single point
- Labels — Add "Yes"/"No" labels near decision arrows
🛒 Build Your Checkout Flow
Open Privacy Sketch and start creating your e-commerce checkout diagram. Use the example JSON as your starting point.
Open Privacy SketchNext Steps
- CI/CD Pipeline Tutorial — Build DevOps diagrams
- Org Chart Tutorial — Create team structures
- LLM Reference — Technical JSON documentation