Integration Path WhatsApp Customer Meta WhatsApp Cloud API / BSP HypedMind Webhook CUSCAPI APIs
WA-1 Chat-to-Cart Ordering Phase 1 MVP Customer orders via natural language → WhatsApp sends to HypedMind webhook → AI identifies intent → product lookup → cart → checkout → payment Click to highlight ▼
Customer
Action
💬
Types natural language order request
"I want chicken rice"
📍
Selects nearest pickup outlet
Taman Jaya (0.8 km)
👀
Reads product options returned by AI
☝️
Selects item from list
"Chicken Ramen x2, less spicy"
🛒
Receives cart confirmation
📱
Taps Checkout button
Requests secure login_url
💳
Completes payment on Mini Program
Order confirmed & receipt sent
WhatsApp
Chat
I want chicken rice10:31 ✓✓
📍 Select your pickup outlet
🔵 Nearest: Taman Jaya (0.8 km)10:34
☰ Choose Outlet
Here are our Chicken Rice options 🍚
Choose your favourite10:32
☰ View options
Chicken Ramen x2, less spicy10:33 ✓✓
Added to cart! 🛒
Chicken Ramen × 2
Note: Less spicy
Total: RM 45.80
10:33
➕ Add More
💳 Checkout
🔐 Secure Checkout
Your cart is ready. Tap below to continue payment.10:35
🚀 Open Checkout
-
✅ Order Confirmed!
Order #ORD-0042
Chicken Ramen × 2
RM 45.8010:35
Track Order
WhatsApp →
HypedMind
Webhook
POSTWhatsApp Cloud API → HypedMind
Customer message delivered from WhatsApp to HypedMind webhook
POSTHypedMind → /api/v1/webhooks/wa
Forward normalized inbound WhatsApp event to CUSCAPI
Outlet selection event passed through HypedMind
POSTHypedMind → CUSCAPI
Send extracted keyword/entity to product search
POSTHypedMind → CUSCAPI
Forward selected item and quantity
Session event passed through HypedMind
Call customer token API and return login_url to WhatsApp
-
Confirmation template sent via WhatsApp
AI Engine
🤖
Intent Detection
Classify: ordering intent
Entity: "chicken rice"
NLU · 97% conf.
📍
Location Resolver
Rank outlets by proximity to user GPS · surface nearest first
Geo-sort
🔍
Outlet Catalog Search
Query products from selected outlet_id
📋
Selection Parser
Extract: product_id, quantity from reply
🛒
Cart Manager
Add item, compute totals, generate confirmation
🔗
Customer Token Bridge
Request customer token · return login_url for WhatsApp in-app browser
💸
Payment Orchestrator
Continue from tokenized cart checkout page inside WhatsApp in-app browser and monitor payment callback
📨
Notification Dispatch
Build WhatsApp template payload
CUSCAPI → HypedMind → WhatsApp
Platform
APIs
POST/api/v1/webhooks/wa
Inbound WhatsApp message
GET/api/v1/outlets?lat={}&lng={}
Fetch outlets sorted by distance
{
  "success": true,
  "message": "Outlet list retrieved successfully.",
  "data": [
    {
      "id": 3,
      "name": "City Mall Branch",
      "city": "Kuching",
      "distance_label": "0.00km away",
      "is_open_now": true,
      "is_accepting_order_now": true
    },
    {
      "id": 2,
      "name": "Main Branch",
      "city": "Kuching",
      "distance_label": "50.02km away",
      "is_open_now": true,
      "is_accepting_order_now": true
    }
  ]
}
GET/api/v1/outlet/{outlet_id}/products?q=chicken+rice
Search outlet-specific catalog by keyword
{
  "success": true,
  "message": "Product list retrieved successfully.",
  "data": [
    {
      "id": 1,
      "name": "Chicken Katsu Curry Don",
      "category": "Rice",
      "price": 28.90
    },
    {
      "id": 4,
      "name": "Chicken Ramen",
      "category": "Noodles",
      "price": 22.90
    },
    {
      "id": 8,
      "name": "Chicken Katsu Set",
      "category": "Combo",
      "price": 26.90
    }
  ]
}
POST/api/v1/cart/
Add selected product and quantity to cart
{
  "product_id": 4,
  "quantity": 2,
  "note": "Less spicy"
}
{
  "success": true,
  "message": "Item added to cart successfully.",
  "data": {
    "id": 45,
    "cart_id": 55,
    "product_id": 4,
    "quantity": 2,
    "ori_price": 24.90,
    "price": 22.90,
    "total": 45.80,
    "note": "Less spicy",
    "product": {
      "id": 4,
      "name": "Chicken Ramen",
      "sku": "OUT2-CHICKENRAM",
      "price": 22.90,
      "normal_price": 24.90,
      "category": "Noodles"
    },
    "selected_options": []
  }
}
Cart Response → WhatsApp
Format cart response into WhatsApp confirmation
{
  "cart_id": 55,
  "item": "Chicken Ramen x2",
  "note": "Less spicy",
  "total": 45.80
}
POST/api/v1/customers/token
Create customer access token and return login_url for WhatsApp in-app browser
{
  "phone_number": "60123456789"
}
{
  "success": true,
  "customer": {
    "id": 1,
    "name": "John Doe"
  },
  "access_token": "43|...",
  "token_type": "Bearer",
  "login_url": "https://mini.cuscapi.com/wave-login?token=...",
  "expires_in_minutes": 10
}
-
POST/api/v1/notifications/wa
CUSCAPI → HypedMind
Send WhatsApp template message
{
  "type": "wa_template",
  "template": {
    "template_name": "sample_template_v1",
    "language": "en"
  },
  "data": {
    "body_params": [
      "John",
      "P000001"
    ],
    "buttons": [
      {
        "type": "url",
        "payload": "order/P000001"
      }
    ]
  }
}
Mini
Program
mini.cuscapi.com
Secure Checkout
WhatsApp In-App Browser
Cart #55
Chicken Ramen × 2
RM 45.80
Continue Payment
mini.cuscapi.com
In-App Payment
Continue from Cart #55
FPX / Credit Card
E-wallet
Confirm RM 45.80
mini.cuscapi.com
Order #0042
✓ Confirmed
Est. 15 min
Track Order
WA-2 Order Status Tracking Phase 1 MVP Reactive: customer asks status · Proactive: AI pushes live updates via order.updated webhook Click to highlight ▼
Path A Reactive — Customer-initiated status check
Customer
Action
Asks about order status
"where is my order?"
👀
Reads status message
Preparing · ~10 min
🔔
Receives "Ready for Pickup" notification with outlet info
WhatsApp
Chat
Where is my order? 🍽️11:05 ✓✓
Order #ORD-0042 🍚
Status: Preparing
Est. ready: ~10 min
11:05
✅ Ready for Pickup!
Order #ORD-0042 is ready for pickup at Taman Jaya Outlet 📍11:18
Get Directions
AI Engine
🔎
Intent Detection
intent = status_check
entity: order ref / latest
📊
Status Formatter
Format order state + ETA into interactive message
📡
Webhook Listener
order.updated received → trigger proactive push
Event-driven
Platform
APIs
POST/api/v1/webhooks/wa
HypedMind → CUSCAPI
Inbound WhatsApp message
GET/api/v1/orders/{id}
Fetch order status + ETA
POST/api/v1/notifications/wa
Push proactive template
Mini
Program
Path B Proactive — AI-initiated push notification on order state change
Customer
Action
🛎️
No action — waits for food
Passive state
🔔
Receives "Ready for Pickup" notification with outlet & order info
📦
Picks up order or awaits delivery
WhatsApp
Chat
Customer idle · no message
✅ Ready for Pickup!
Order #ORD-0042 is ready for pickup 🎉
📍 Taman Jaya Outlet · Counter 311:22
Get Directions
✅ Delivered!
Order #ORD-0042 has been collected. Enjoy your meal! 🍽️11:28
⭐ Leave a Review
AI Engine
📡
Event Bus
Listening for order.updated webhook from POS/kitchen
Reactive
📨
Push Dispatcher
Template selection based on new order status
Review Trigger
Post-delivery: queue review request message
Platform
APIs
POST/api/v1/webhooks/order
POS/kitchen fires order.updated
POST/api/v1/notifications/wa
Dispatch proactive update template
POST/api/v1/notifications/wa
Send delivery + review template
Mini
Program
mini.cuscapi.com
Order Status
✅ Ready for Pickup
📍 Taman Jaya Outlet
Order #ORD-0042 · Counter 3
Get Directions
⚡ Webhook Events · WA-2 order.status.queried order.updated order.out_for_delivery order.delivered notification.sent review.requested
WA-3 Loyalty Points & Redemption Phase 1 MVP Check balance → view vouchers → redeem points during checkout via WhatsApp Click to highlight ▼
Customer
Action
🏆
Asks about loyalty points balance
"how many points?"
👀
Views balance & available vouchers
🎟️
Selects voucher to redeem during order
Receives confirmation with updated balance
WhatsApp
Chat
How many points do I have? 🏆14:10 ✓✓
You have 275 points 🌟
Worth RM 2.75 · Tier: Silver14:10
☰ View Vouchers
💰 Redeem Points
Your Vouchers 🎟️
Select one to apply to your next order14:11
☰ Choose Voucher
🎉 Points Redeemed!
100 pts redeemed · RM 1.00 off
New balance: 175 points14:12
View All Vouchers
AI Engine
🏆
Loyalty Intent
intent = loyalty_check
resolve customer_id from WA number
📊
Balance Formatter
Format points, tier, value into interactive message
🎟️
Voucher Resolver
Match selected voucher to active order in cart
Redemption Confirm
Update balance, send confirmation template
Platform
APIs
GET/api/v1/loyalty/{customer_id}
Fetch points balance & tier
GET/api/v1/loyalty/{id}/vouchers
List redeemable vouchers
POST/api/v1/loyalty/redeem
Apply voucher to order
GET/api/v1/loyalty/{customer_id}
Fetch updated balance after redeem
Mini
Program
mini.cuscapi.com
Loyalty
🌟 275 pts · Silver
Next: Gold @ 325 pts
View History
mini.cuscapi.com
My Vouchers
RM1 off · 100 pts
RM3 off · 250 pts
Apply to Cart
⚡ Webhook Events · WA-3 loyalty.balance.checked points.redeemed voucher.applied tier.upgraded
WA-4 QR Code Table Ordering Phase 1 MVP Physical QR at table → WhatsApp pre-fill → table-linked order session → live tracking in Mini Program Click to highlight ▼
Customer
Action
📷
Scans physical QR code at table
Table 5
💬
WhatsApp opens with pre-filled context message
🍽️
Browses menu & places order
📱
Tracks live order status on Mini Program
WhatsApp
Chat
Hi! I'm at Table 5 📍
Outlet: Taman Jaya12:00 ✓✓
Welcome to Table 5! 🍽️
Outlet: Taman Jaya
What would you like to order?
12:00
📋 View Full Menu
🌟 Today's Specials
🍜 Menu — Taman Jaya
Table 5 · Dine-in12:01
☰ Browse Categories
📊 Order Received
Table 5 · #ORD-0055
Kitchen preparing your order12:05
View Status
AI Engine
🔗
QR Context Parser
Decode table_id, outlet_id from QR deep-link params
wa.me deep-link
🏪
Session Router
Bind WA session to table + outlet context
📋
Menu Presenter
Serve outlet-specific menu with dine-in pricing
📡
Order Broadcaster
Push real-time updates via WebSocket to Mini Program
Platform
APIs
GET/api/v1/outlets/{id}/tables/{n}
Resolve table from QR scan
POST/api/v1/sessions
Create table-linked WA session
GET/api/v1/menus?outlet={id}
Outlet-specific menu
POST/api/v1/orders
Create table order
GET/api/v1/orders/{id}
Fetch live order status
Mini
Program
mini.cuscapi.com
Menu
Chicken Rice RM12.90
Tom Yam RM14.90
Add to Cart
mini.cuscapi.com
Table 5 Order
🍳 Preparing
#ORD-0055
Live WebSocket ⚡
⚡ Webhook Events · WA-4 qr.scanned session.created order.created order.updated kitchen.ticket.fired
WA-5 AI Product Recommendation Phase 1 MVP Cart analysis + purchase history + time-of-day signals → contextual upsell product cards via WhatsApp Click to highlight ▼
Customer
Action
🛒
Adds chicken rice to cart
🤔
Reads AI recommendation
👆
Taps "Add to cart" on product card
WhatsApp
Chat
Add Roasted Chicken Rice to cart 🍚12:30 ✓✓
Added! 🛒 RM 12.9012:30
🧋
Teh Tarik Kaw
RM 4.50
Add to cart
Add Teh Tarik Kaw12:31 ✓✓
Done! Cart: RM 17.40 🛒12:31
AI Engine
🧠
Signal Aggregator
Inputs: cart items + order history + time-of-day
Rec Engine
🎯
Rec Scorer
Rank: "drink with rice" pairing · confidence 89%
🛒
Cart Updater
Add recommended product, recompute total
Platform
APIs
GET/api/v1/customers/{id}/orders
Fetch purchase history
GET/api/v1/cart/{session}
Current cart state
GET/api/v1/recommendations?cart={id}
Personalized product recs
POST/api/v1/cart/items
Add recommended item
Mini
Program
mini.cuscapi.com
My Cart
Chicken Rice × 1
RM 12.90
mini.cuscapi.com
My Cart
Chicken Rice × 1
Teh Tarik Kaw × 1
RM 17.40
Checkout
⚡ Webhook Events · WA-5 cart.item.added recommendation.triggered recommendation.accepted cart.upsell.completed
WA-6 One-Tap Reorder Phase 1 MVP Customer triggers reorder via natural language → AI fetches last order → confirm or modify → payment Click to highlight ▼
Customer
Action
🔄
Requests reorder of last order
"reorder my last order"
👀
Reviews last order summary
Confirms reorder or modifies items
💳
Completes payment on Mini Program
WhatsApp
Chat
Reorder my last order please 🔄13:00 ✓✓
Your last order 📋
• Roasted Chicken Rice × 2
• Teh Tarik Kaw × 1
Total: RM 30.30
📍 Outlet: Taman Jaya
13:00
✅ Confirm Reorder
✏️ Modify Order
Confirm Reorder ✅13:01 ✓✓
Creating your order now... 🔄13:01
💳 Payment Required
Order #ORD-0063 · RM 30.30
Tap to complete payment13:01
Pay RM 30.30 →
AI Engine
🔄
Reorder Intent
intent = reorder
resolve customer's last order
📋
Order Formatter
Format last order items + total for confirmation
🏗️
Order Builder
Clone last order items into new order
💸
Payment Orchestrator
Generate payment link, await webhook
Platform
APIs
GET/api/v1/customers/{id}/orders
Fetch last order details
GET/api/v1/orders/{id}/items
Fetch full item list
POST/api/v1/orders
Create new order (clone)
POST/api/v1/payments/link
Generate payment URL
Mini
Program
mini.cuscapi.com
Edit Order
Chicken Rice × 2
Teh Tarik × 1
Confirm
mini.cuscapi.com
Payment
RM 30.30
FPX / e-Wallet
Pay Now
⚡ Webhook Events · WA-6 reorder.initiated order.created payment.initiated payment.completed order.confirmed
WA-7 Walk-in Loyalty Points Claim Phase 1 MVP Three claim methods: Receipt number · Phone number POS match · Manual invoice with merchant approval Click to highlight ▼
Sub-flow A Receipt-based Claim
Customer
Action
🏃
Walk-in diner wants to claim loyalty points
"claim points for my meal"
🧾
Provides receipt number when prompted
RCP-20260421-0034
Points credited confirmation received
🌟
Views updated loyalty balance
WhatsApp
Chat
I want to claim points for my meal 🍽️15:05 ✓✓
Sure! Please share your receipt number 🧾15:05
RCP-20260421-003415:06 ✓✓
🌟 Points Earned!
You earned 45 points for receipt RCP-20260421-0034
New balance: 320 pts15:06
View My Points
Your balance 🏆
320 pts15:07
☰ View Vouchers
AI Engine
🏆
Claim Intent
intent = loyalty_claim
prompt for receipt number
🔍
Receipt Validator
Parse receipt ID format, look up POS transaction
🌟
Points Calculator
Bill amount × earn rate = points credited
📊
Balance Presenter
Show updated balance
Platform
APIs
POST/api/v1/webhooks/wa
Receive claim message
POST/api/v1/loyalty/claim
body: {type: "receipt", receipt_id}
GET/api/v1/loyalty/{customer_id}
Fetch updated balance
POST/api/v1/notifications/wa
Send balance update message
Mini
Program
mini.cuscapi.com
Loyalty
🌟 320 pts
+45 pts just earned
View History
Sub-flow B Phone Number POS Match
Customer
Action
📱
Provides registered phone number
+601X-XXXXXXX
🔗
AI matches phone to POS transaction
Receives confirmation with points earned
WhatsApp
Chat
My number is +6012-345678915:10 ✓✓
Looking up your recent transactions... 🔍15:10
Found a match! 🎉
Taman Jaya · 2:45 PM
Total: RM 28.50
Earn 28 points?
15:10
✅ Confirm
❌ Not mine
🌟 28 Points Earned!
Phone match successful.
Balance: 303 pts15:11
View Balance
AI Engine
🔍
Phone Lookup
Match phone → customer_id → POS transactions (last 2h)
🔗
POS Matcher
Fuzzy match time + outlet → candidate transaction
Claim Processor
Credit points on customer confirmation
Platform
APIs
GET/api/v1/customers?phone={n}
Lookup by phone number
GET/api/v1/pos/transactions?phone={n}
POS transactions last 2 hours
POST/api/v1/loyalty/claim
body: {type: "phone", tx_id}
Mini
Program
⚡ Webhook Events · WA-7 loyalty.claim.submitted points.earned notification.sent
WA-8 Table Reservations with Food Pre-order Phase 1 MVP QR touch point → Dine In or Take Away selection → outlet selector → reservation / mini-program ordering → payment → POS auto-push Click to highlight ▼
Path A Dine In — Table Reservation with Food Pre-order
Customer
Action
Scans QR, taps Dine In
Restaurant touch point
📍
Views outlet list, selects preferred outlet
Nearest recommended
🪑
Selects preferred table
Indoor / window / group
📅
Chooses reservation date and time
Availability checked
Confirms table reservation
Committed to middleware
🍽️
Continues with AI chat to pre-order food
💳
Pays for pre-ordered food online
🙌
Arrives at reserved time and enjoys session
POS order auto-pushed
WhatsApp
Chat
C
Cuscapi Reservations
WhatsApp Mini Program
🪑 Table Reservation
Welcome! How would you like to dine?18:04
🍽️ Dine In
🛍️ Take Away
📍 Select your outlet
🔵 Nearest: KLCC Bistro (0.4 km)18:04
☰ Choose Outlet
Which table would you like?
Available: Window 4, Table 8, Family Booth18:05
☰ Select Table
Choose your visit slot 📅
Today 7:30 PM · Tomorrow 12:30 PM · Custom date18:06
Today 7:30 PM
Pick Date & Time
✅ Table Reserved
Reservation #RSV-1008
Table 8 · 2 pax
Today, 7:30 PM18:07
Pre-order Food
Pre-order nasi lemak and two iced teas18:08 ✓✓
I found these menu items 🍽️
Nasi Lemak Special · Iced Lemon Tea18:08
☰ Add to Pre-order
💳 Pre-order Payment
Nasi Lemak Special × 1
Iced Lemon Tea × 2
Total: RM 31.7018:09
Pay Now →
🍽️ Reservation Ready
Your table and pre-order are ready.
Show #RSV-1008 when you arrive.19:30
View Reservation
AI Engine
QR Context Resolver
Decode outlet_id, campaign · present Dine In / Take Away
📍
Location Resolver
Rank outlets by proximity · surface nearest first
Geo-sort
🪑
Table Recommender
Filter table availability by pax, outlet and zone
📅
Slot Validator
Check date/time capacity before confirmation
📨
Reservation Commit
Call middleware API and send WA confirmation
API commit
🤖
Menu Assistant
Extract food intent and build pre-order basket
💸
Payment Orchestrator
Forward customer to online payment gateway
⏱️
POS Scheduler
Auto-push paid pre-order when reservation time is reached
Platform
APIs
POST/api/v1/webhooks/wa/qr
Receive QR launch context from WhatsApp
GET/api/v1/outlets?lat={}&lng={}
Fetch outlets sorted by proximity
POST/api/v1/reservations/sessions
Create dine-in reservation session
GET/api/v1/tables?outlet_id={id}
Fetch available tables
GET/api/v1/reservations/slots
Check date/time availability
POST/api/v1/reservations
Commit reservation to middleware
POST/api/v1/notifications/wa
Send reservation confirmation
GET/api/v1/menu?outlet_id={id}
Load menu for reservation session
POST/api/v1/reservations/{id}/preorder
Attach pre-order basket
POST/api/v1/payments/link
Generate online payment gateway URL
POST/api/v1/webhooks/payment
Confirm pre-order payment
POST/api/v1/pos/orders
Push paid pre-order to POS/kitchen
Mini
Program
QR opens Dine In / Take Away choice
mini.cuscapi.com
Select Outlet
📍 Nearest First
🔵 KLCC Bistro (0.4 km)
Bangsar (2.3 km)
Confirm Outlet
mini.cuscapi.com
Select Table
Table 8 · Window
2 pax · Available
Choose Table
mini.cuscapi.com
Date & Time
Today · 7:30 PM
Tomorrow · 12:30 PM
Confirm Slot
mini.cuscapi.com
Reservation
✓ #RSV-1008
Table 8 · 2 pax
Pre-order Food
mini.cuscapi.com
Pre-order Menu
Nasi Lemak Special
Iced Lemon Tea × 2
RM 31.70
mini.cuscapi.com
Payment
FPX / Card / eWallet
Pay RM 31.70
mini.cuscapi.com
Ready
POS pushed
Kitchen received order
View Details
Path B Take Away — Outlet Selection → Mini Program Direct Ordering
Customer
Action
Scans QR, taps Take Away
Restaurant touch point
📍
Views outlet list, selects pickup outlet
Nearest recommended
📱
Mini Program opens directly for ordering
Browses menu & adds to cart
Pays online and receives pickup notification
Collects at selected outlet
WhatsApp
Chat
C
Cuscapi Reservations
WhatsApp Mini Program
🛍️ Take Away
Great! Select your pickup outlet to continue.18:04
📍 Select your pickup outlet
🔵 Nearest: Taman Jaya (0.8 km)18:05
☰ Choose Outlet
Taman Jaya selected 📍 Opening menu for ordering...18:05
✅ Ready for Pickup!
Order #ORD-0080 is ready 🎉
📍 Taman Jaya · Counter 218:30
Get Directions
AI Engine
QR Context Resolver
Decode outlet_id, campaign · Take Away session initiated
📍
Location Resolver
Rank outlets by proximity · surface nearest first
Geo-sort
🔗
Session Router
Bind take-away session to selected outlet · open Mini Program for direct ordering
📡
Push Dispatcher
order.updated webhook → push "Ready for Pickup" template
Event-driven
Platform
APIs
POST/api/v1/webhooks/wa/qr
Receive QR launch context · mode=takeaway
GET/api/v1/outlets?lat={}&lng={}
Fetch outlets sorted by proximity
POST/api/v1/sessions
Create take-away session · outlet bound
GET/api/v1/menu?outlet_id={id}
Load outlet menu for Mini Program
POST/api/v1/notifications/wa
Push pickup-ready template
Mini
Program
mini.cuscapi.com
Select Outlet
📍 Nearest First
🔵 Taman Jaya (0.8 km)
Bangsar (2.1 km)
Confirm Outlet
mini.cuscapi.com
Take Away Order
📍 Taman Jaya
Chicken Rice RM12.90
Add to Cart
mini.cuscapi.com
Order #0080
✅ Ready for Pickup
📍 Taman Jaya · Counter 2
Get Directions
⚡ Webhook Events · WA-8 reservation.session.created outlet.selected table.selected reservation.committed preorder.created payment.completed pos.order.pushed notification.sent