ADOC Webhook Integration Architecture
Date: 2026-02-07
Prepared For: ADOC Integration Stakeholders
This documentation includes interactive elements to help you understand the webhook payload structures and event flows.
1. Executive Summary
This document outlines the architecture for a real-time webhook integration between HotWax OMS and ADOC's Data Warehouse. The goal is to provide ADOC with immediate visibility into order lifecycle events (Approvals, Shipments, Rejections) without impacting OMS performance.
We utilize the Moqui SystemMessage Framework to ensure high reliability, automatic retries, and comprehensive audit trails.
2. High-Level Architecture
The system acts as a "News Reporter," listening for key business events and dispatching JSON reports to ADOC asynchronously.
3. Core Design Decisions
A. The "Base Payload" Pattern (Reliability & Consistency)
Every single event sent to ADOC requires a standard set of 9 contextual fields (Order Name, Brand, Price, Currency, etc.). To guarantee 100% consistency and eliminate code duplication, we implemented a Base Payload Service.
Ensures that Financials and Customer Context are identical across all event types, reducing reconciliation errors.
- How it works: Every event service (Approved, Shipped, etc.) first calls
prepare#OrderBasePayloadto fetch the common data, then adds its specific details.
B. Asynchronous Processing (Performance)
We invoke the webhook logic asynchronously via Moqui's SystemMessage queue.
Do not block the user interface while waiting for ADOC's response. If ADOC is slow or down, the Warehouse Staff can continue working without interruption. The system will retry sending the message in the background.
C. Snapshot vs. Delta Strategy (Data Precision)
The ADOC API expects a uniform JSON structure, but the business meaning differs by event. We use two main strategies:
- Full Snapshot
- Delta Update
Used for: Order Approved, Order Completed
Sends ALL items in the order. This acts as the "State of the Union" for the order.
- Pros: Complete picture, self-healing if previous messages were lost.
- Cons: Larger payload size.
Used for: Item Brokered, Item Rejected, Item Shipped
Sends ONLY the specific item(s) that changed state.
- Pros: Lightweight, precise tracking of individual item movements.
- Cons: Requires receiver to maintain state.
D. Idempotency & Tracing
- Event ID: We map the Moqui
systemMessageIddirectly to theevent_idfield in the JSON. - Benefit: This guarantees a globally unique ID for every attempt. If we retry a failed message, the ID remains the same, allowing ADOC to safely de-duplicate.
4. Security & Error Handling
Authentication
- Mechanism: API Key via
x-api-keyheader. - Storage: The key is stored in the Encrypted
passwordfield of theSystemMessageRemoteentity. It is never exposed in logs or plain text.
Failure Recovery
- Scenario: ADOC API returns
500 Erroror times out. - Response: The system marks the message as
Error. Moqui'sSystemMessageservice automatically retries the delivery on a scheduled interval (Exponential Backoff). - Alerting: Failures are logged in
SystemMessageErrorfor administrator review.
5. Event Specifications & Simulator
Use the interactive simulator below to understand the JSON structure for different event types.
Webhook Simulator
Select an event type to see the generated JSON structure.
{
"event_id": "evt_1773140506330",
"event_type": "ORDER_APPROVED",
"order_id": "ORD-2024-001",
"timestamp": "2026-03-10T11:01:46.330Z",
"payload": {
"order_name": "10001",
"grand_total": 150,
"currency": "USD",
"items": [
{
"sku": "10001",
"quantity": 1,
"unit_price": 50
},
{
"sku": "10002",
"quantity": 2,
"unit_price": 50
}
]
}
}
Detailed Triggers
Click to see detailed trigger logic
| Event | Status Change Trigger | Payload Focus |
|---|---|---|
| Order Approved | ORDER_APPROVED | Full Order + All Items |
| Item Brokered | Item Assigned to Facility | Single Item + facility_id |
| Item Rejected | Item Rejected | Single Item + reason |
| Item Shipped | Shipment PACKED -> SHIPPED | Shipped Items + tracking_code |
| Order Completed | ORDER_COMPLETED | Full Order (Final State) |
Scenario 6: Item Brokered Sequence (Example)
This diagram shows the "Delta" logic where only ONE item is processed.
7. Data Model Relationship
How the System Message components interact with your Orders.
8. Implementation Plan Summary
- Configure Environment: Set up ADOC Remote Connection & API Key.
- Develop Services: Implement Base Payload and 4 Event-Specific Builders.
- Deploy Triggers: Activate SECA rules for live monitoring.
- Verify: End-to-End testing with Mock Endpoint.
Ready for Implementation.