| Event | Purpose |
| menu_update | Sync products, categories, modifiers, relations, images, and availabilities. |
| opening_hours | Sync Deliverect opening hours into OrderLemon. |
| order_status_update | Update OrderLemon order status from Deliverect. |
| busy_mode | Update busy delay and shop availability state. |
| snooze_unsnooze | Handle temporary product unavailability. |
| payment_completed | Send a paid OrderLemon order to Deliverect. |
| order_updated | Send OrderLemon status changes to Deliverect. |
| channel_registration | Handle Deliverect channel registration and return event-specific webhook URLs. |
| sync_opening_hours | Opening-hours sync from OrderLemon to Deliverect. Not tested, blocked - no OL webhook event available |
Deliverect and OrderLemon use different status codes. Below are both systems and the mapping between them.
| Deliverect Status | Meaning | OrderLemon View |
| 0-7 | system/initial | order just created, not yet proccesed by POS |
| 10 | new (received at POS) | received at POS |
| 20 | accepted | accepted by store |
| 25 | scheduled | scheduled for later |
| 35 | denied | denied by store |
| 40 | printed | printed at POS |
| 50 | preparing | in preparation |
| 60 | prepared | prepared |
| 70 | pickup_ready | ready for pickup |
| 80-89 | in_delivery / courier | in delivery |
| 90 | delivered / finalized | delivered or completed |
| 95 | auto_finalized | auto-finalized |
| 100 | cancel (void request) | cancelled (channel cancel) |
| 110 | canceled | cancelled |
| 115 | delivery canceled | cancelled |
| 120 | failed | failed |
| 121 | failed (denied) | failed |
| 122 | failed (error) | failed |
| 124 | failed (other) | failed |
| Deliverect values | OrderLemon status_id | OrderLemon label |
| 0, 1, 2, 3, 4, 5, 6, 7, 10, 20, 25 and new, parsed, received, accepted, scheduled | 2 | ordered |
| 40, 50 and printed, preparing | 3 | packed |
| 60 and prepared | 4 | packed |
| 70 and ready, pickup_ready | 5 | readyfordelivery |
| 80, 81, 83, 84, 85, 87, 89 and in_delivery | 6 | shipped |
| 90, 95 and delivered, finalized, auto_finalized | 7 | done |
| 35, 100, 110, 115 and cancelled, canceled, denied | 8 | cancelled |
| 120, 121, 122, 124 and failed | 9 | lost |
The __G_ suffix in an OrderLemon product reference means that the row is group-scoped.
Example: XTRA-CHEESE__G_fb271dcb
Base reference: XTRA-CHEESE.
The suffix identifies a specific modifier-group or upsell-group context.
This exists because the same Deliverect item can appear in more than one group with different sync context.
A scoped __G_ row allows OrderLemon to store group-specific assignment, pricing, and availability behavior without overwriting the base reference.
Important: when checking product identity, compare the base reference (before __G_). These rows are expected in modifier and upsell sync — they are not random duplicates and should not be skipped or deleted.
Prices are handled in cents. Example: 10.50 becomes 1050.
Deliverect datetime values use UTC ISO 8601 format: Y-m-d\TH:i:s\Z
Tax is in permyriad (divide by 1000 to get percentage). Example: 9000 = 9%.
Opening-hours day mapping: Deliverect uses 1..7 for Monday..Sunday, OrderLemon uses 0..6.
| Deliverect | OrderLemon |
| 1 | 0 |
| 2 | 1 |
| 3 | 2 |
| 4 | 3 |
| 5 | 4 |
| 6 | 5 |
| 7 | 6 |
Paid orders are sent from OrderLemon to Deliverect.
Pickup and delivery timestamps are stored in shop timezone and must be converted to UTC.
Items with parent_id become nested subItems[].
Negative discount rows are not sent as regular cart items.
Promotions are aggregated into one discount line named OrderLemon Promotion.
Delivery fee is sent as deliveryCost.
Required fields include decimalDigits and orderIsAlreadyPaid.
Deliverect sends order status updates back to OrderLemon through webhook events.
The microservice converts Deliverect status codes to OrderLemon status_id and updates the order.
The same router also handles webhooks sent by OrderLemon.
payment_completed - Orderlemon sends a paid order to Deliverect.
order_updated - OrderLemon sends order status changes to Deliverect.
Example URL: /v1/webhooks/deliverect?event=payment_completed
menu_update synchronizes: products, categories, modifier groups, modifier products, relations, images, and availabilities.
Product reference is resolved in this order: plu → referenceId → productId.
In OrderLemon, modifiers are stored as categories (not as product-level items).
Scoped __G_* references are created when the same product appears in multiple groups with different context.
snoozedProducts from the menu payload should not change the enabled state — snooze is handled by a separate snooze_unsnooze event.
Busy mode changes the temporary delay or availability state of a shop.
Example payload: type = busy_mode, status = BUSY, delay = 15.
BUSY, PAUSED, CLOSED, and OFFLINE increase busy delay.
ONLINE, ACTIVE, OPEN, AVAILABLE, UNPAUSED, and OFF revert previously added delay.
In OrderLemon this affects shop operational timing, typically by updating min_timeframe.
Opening hours sync goes from Deliverect to OrderLemon.
If a weekday is missing from the payload, that day is treated as Closed.
The weekly availability from Deliverect overwrites whatever was in OrderLemon before.
Holiday or special hours are not supported — Deliverect Channel API only sends weekly availability.
| File | Responsibility |
| v1/general/deliverect_functions.php | Deliverect Channel API communication, OAuth2, order sending. |
| v1/general/deliverect_catalog_functions.php | Catalog and menu sync helpers. |
| v1/general/deliverect_sync_functions.php | Sync utilities, mapping, relation logic. |
| v1/general/deliverect_order_functions.php | Order transformation and status mapping. |
| v1/general/ms_functions.php | Main microservice logic. |
| v1/webhooks/deliverect.php | Main webhook entry point and router. |
| v1/webhooks/deliverect/*.php | Event-specific webhook handlers. |
| v1/POST/send_order_to_deliverect.php | Direct order send endpoint. |
DEV endpoint: https://deliverect.ms.orderlemon.dev/v1/
PROD endpoint: https://deliverect.ms.orderlemon.com/v1/
Main webhook: https://deliverect.ms.orderlemon.{dev|com}/v1/webhooks/deliverect
Holiday hours are not supported because Deliverect Channel API does not expose holiday context.
Automatic OrderLemon to Deliverect opening-hours sync is blocked by missing OrderLemon webhook events.
Exact HMAC validation details still depend on confirmed header and secret configuration.