1
Create a thread when the order is confirmed
One call, at the same place in your backend where you confirm the order. The customer↔merchant lane is live immediately. The customer↔courier lane exists but waits — there’s no courier yet.
reference is your order ID — calls with the same reference are idempotent, so retries are safe.2
Add the courier when you assign one
active. If you reassign the order, remove the courier and add the new one — the lane’s history stays with the thread, the old courier loses access instantly.3
Render the thread in your apps
Mint a scoped token per participant, then mount the drop-in component. The token only grants that participant’s view — their lanes, their language, nothing else.The component ships message list, composer, quick replies, attachment upload, read receipts, RTL layout, and the Supervisor’s presence — themed by the same options as the chat widget.Building your own UI? Skip the component and go headless: send messages server-side and receive them via webhooks or the token-scoped WebSocket.
4
Let order status drive the lifecycle
Tell Connect what the order is doing; it handles what that means for the conversation.On
delivered, participants get a wrap-up window (default 24 hours) for “the gate code didn’t work”-type follow-ups, then the thread locks itself read-only. On cancelled, it locks immediately. Full state machine in Threads.5
Tune the Supervisor — or don't
Every thread already has the AI Supervisor in Org-wide defaults live in the dashboard under Connect → Supervisor. The modes —
resolve mode: it answers order questions from your Actions, translates between participants, nudges a silent merchant, and escalates to your inbox when a human is needed.Dial it per lane if you want different behavior:observe, assist, resolve — are covered in AI Supervisor.That’s the integration
Two API calls per order (create thread, add courier), one component per app, one PATCH per status change. Compare that to running a chat SDK: provisioning channels per pair, syncing membership, scheduling freezes and deletes, wiring moderation, and building the support handoff yourself.Threads and lifecycle
Lanes, roles, visibility, the order-driven state machine, retention.
AI Supervisor
What resolve mode does, when it intervenes, and how escalation lands in your inbox.