%%{init: { "theme": "base", "themeVariables": { "fontSize": "18px", "background": "transparent", "actorBkg": "#038851", "actorTextColor": "#ffffff", "actorBorder": "#026139", "actorLineColor": "#94a3b8", "signalColor": "#64748b", "signalTextColor": "#059669", "noteBkgColor": "#e6f4ee", "noteTextColor": "#02502f", "noteBorderColor": "#038851", "activationBkgColor": "#c6ebdc", "activationBorderColor": "#026139", "sequenceNumberColor": "#ffffff" }, "sequence": { "useMaxWidth": true, "actorMargin": 70, "width": 150, "height": 60, "boxMargin": 12, "noteMargin": 14, "messageMargin": 50, "diagramMarginX": 20, "diagramMarginY": 20, "actorFontSize": 18, "actorFontWeight": 700, "noteFontSize": 15, "noteFontFamily": "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace", "messageFontSize": 16, "messageFontWeight": 700, "noteAlign": "left", "mirrorActors": false } }}%%
sequenceDiagram
autonumber
actor Customer
participant Channel as Channel Platform
participant Deliverect
participant POS
Note over Deliverect,Channel: 1. Channel Registration / Activation
Deliverect->>Channel: POST /register (status=register,<br/>channelLocationId, channelLinkId,<br/>locationId, channelLinkName)
Channel-->>Deliverect: 200 OK { statusUpdateURL, menuUpdateURL,<br/>snoozeUnsnoozeURL, busyModeURL,<br/>updatePrepTimeURL*, courierUpdateURL* }
Note right of Deliverect: Later calls reuse<br> same webhook with<br/>status=active (start orders) /<br/>status=inactive (stop orders)
Note over Deliverect,Channel: 2. Menu Push
Deliverect->>Channel: POST menuUpdateURL (menu + availabilities)
Channel-->>Deliverect: 200 OK
Channel->>Deliverect: POST /{channelName}/menustatus/{id}<br/>(async menu update callback)
Note over Customer,POS: 3. Order Creation
Customer->>Channel: Places an order
Channel->>Deliverect: POST /{channelName}/order/{channelLinkId}
Deliverect-->>Channel: 200 OK (order accepted)
Deliverect->>POS: Inject order into POS
Note over Channel,POS: 4. Order Status Updates (POS -> Channel)
POS->>Deliverect: Status update (ACCEPTED, PREP, READY, etc.)
Deliverect->>Channel: POST statusUpdateURL (order status)
Channel-->>Deliverect: 200 OK
Note over Channel,POS: 5. Cancellation (optional)
Channel->>Deliverect: POST /{channelName}/order/{channelLinkId}<br/>(same channelOrderId, status=100 Cancel)
Deliverect->>POS: Void / cancel order
POS->>Deliverect: Status CANCELED (110)
Deliverect->>Channel: POST statusUpdateURL (CANCELED)
Note over Deliverect,Channel: 6. Operational Webhooks (ongoing)
Deliverect->>Channel: POST snoozeUnsnoozeURL (snooze/unsnooze products)
Deliverect->>Channel: POST busyModeURL (paused / online)
Deliverect->>Channel: POST updatePrepTimeURL (prep time)* optional
Deliverect->>Channel: POST courierUpdateURL (courier status)* optional
Channel-->>Deliverect: 200 OK (per webhook)