7 min read•Updated: 2026-11-24

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:

  1. 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.

  1. 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.

  1. Customer & Product Resolution:

The customer is matched by phone (+966), and each line item is resolved by SKU (default_code) in Odoo.

  1. Sales Order Provisioning:

The engine generates a sale.order record in Odoo containing line items, VAT, and custom reference fields.

  1. Workflow Execution (per settings):

* Sales order confirmation (action_confirm).

* Stock delivery creation (stock.picking).

* Customer invoice generation and payment allocation.

  1. 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_key combining 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.

Contact Support
    Order Synchronization Lifecycle | ERP Link Docs | ErpLink