%%{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 Platform
participant Deliverect
participant KDS
Note over Deliverect,KDS: 1. Registration / Onboarding
Note right of Deliverect: externalReference is set in Deliverect location settings
Deliverect->>KDS: POST /register accountId, locationId, externalReference
KDS-->>Deliverect: 200 OK productSyncUrl, orderWebhookUrl, orderStatusUpdateUrl
Note right of Deliverect: Returned URLs are saved in the location settings
Note over Deliverect,KDS: 2. Product Update user-initiated from Deliverect
Deliverect->>KDS: POST productSyncUrl products and modifiers
KDS-->>Deliverect: 200 / 201 / 204
Note over Customer,KDS: 3. Order Injection
Customer->>Channel Platform: Places an order
Channel Platform->>Deliverect: New order
Deliverect->>KDS: POST orderWebhookUrl items, prices, payment, customer
KDS-->>Deliverect: 200 / 201 / 204
Note over Deliverect,KDS: 4. Order Status Updates from KDS
KDS->>Deliverect: POST /kds/orderStatus/orderId status PREPARING 50
Deliverect-->>KDS: 200 OK
Deliverect->>Channel Platform: Relay status
KDS->>Deliverect: POST /kds/orderStatus/orderId status PREPARED 60
Deliverect-->>KDS: 200 OK
Deliverect->>Channel Platform: Relay status
KDS->>Deliverect: POST /kds/orderStatus/orderId status PICKUP_READY 70
Deliverect-->>KDS: 200 OK
Deliverect->>Channel Platform: Relay status
Note over Deliverect,KDS: 5. Order Status Updates to KDS
Deliverect->>KDS: POST orderStatusUpdateUrl status update
KDS-->>Deliverect: 200 OK
Note over Deliverect,KDS: 6. Cancellation
Channel Platform->>Deliverect: Cancellation request
Deliverect->>KDS: POST orderWebhookUrl (cancellation - status 100)
KDS-->>Deliverect: 200 OK