| Step | Who | Action |
|---|---|---|
| 1 | Host | Load widget URL in WebView or iframe |
| 2 | Widget | Send SANAL_READY when widget is loaded |
| Step | Who | Action |
|---|---|---|
| 3 | Host | Send SANAL_INIT (user ID, auth token, language) |
| 4 | Host | Send SANAL_CART_SYNC (full cart + merchant ID) |
| Step | Who | Action |
|---|---|---|
| 5 | User | Chats with the AI |
| 6 | Widget | May send SANAL_CART_ADD SANAL_CART_REMOVE or SANAL_CART_CHANGE |
| 7 | Host | Update your cart, then send SANAL_CART_SYNC again |
SANAL_CART_ADD includes only uuid, quantity, modifiers, variant_groups, and variant_combinations. Your app resolves product details from your catalog.| Step | Who | Action |
|---|---|---|
| 8 | User | Can ask for 'Checkout', 'View Product' options in chat |
| 9 | Widget | May send SANAL_NAVIGATE_* (checkout, product, etc.) |
| 10 | Host | Open the matching user screen in your app |