Order Synchronization Lifecycle
In-depth explanation of end-to-end order sync: webhook ingestion, financial reconciliation, sales order creation, stock delivery, and invoicing.
End-to-End Processing Pipeline
Every checkout on your storefront passes through an automated pipeline into Odoo:
- Webhook Ingestion:
Upon checkout completion, your store dispatches an instant webhook to ERP Link. The engine verifies security signatures and stages the payload in sync_queue.
- Payload Enrichment:
The engine extracts customer details, items, prices, shipping fees, COD surcharges, and discounts. If thin payloads are received, full payloads are fetched via store APIs.
- Customer & Product Resolution:
The customer is matched by phone (+966), and each line item is resolved by SKU (default_code) in Odoo.
- Sales Order Provisioning:
The engine generates a sale.order record in Odoo containing line items, VAT, and custom reference fields.
- Workflow Execution (per settings):
* Sales order confirmation (action_confirm).
* Stock delivery creation (stock.picking).
* Customer invoice generation and payment allocation.
- Log Finalization:
The transaction is finalized in Sync Logs linking the Odoo order ID.
Anti-Data-Loss & Idempotency Guards
ERP Link enforces rigorous safety standards:
- Idempotency Deduplication Key: Every order generates a deterministic
dedup_keycombining store identity and order ID. Redelivered webhooks are recognized and safely deduplicated. - Empty Order Guard: If a webhook payload lacks line items, the engine refuses to persist an empty order and re-queries the storefront API for full lines.
Line Items, Shipping & Discounts
- Shipping Fees: Injected as a dedicated service line item with accurate 15% VAT calculation.
- COD Surcharges: Mapped as an auxiliary service fee ensuring invoice total parity.
- Discounts: Distributed proportionally across items or booked as discount lines.
Order State Transitions
Track order lifecycle directly within Odoo views:
Quotation (draft)->Sales Order (sale)->Invoiced->Delivered.
Encountered an issue applying this guide?
Open a support ticket to have our engineering desk inspect logs directly.