ifixkart-admin/docs/commerce/checkout.md
Adithiyan bbd3a3e959 feat: initial commit — full platform snapshot
- Backend: FastAPI app with all models, services, schemas, routes
- Admin Panel: Next.js dashboard with all modules
  (CRM, POS, repairs, warranties, billing, notifications, etc.)
- Ecommerce: storefront (submodule) + product catalog
- AI Agents: .agents/ skill library for Antigravity IDE
- Docs: architecture, billing, notification gateway markdown
- Submodules: Backend/OpenWA, Ecommerce/File 2/storefront
2026-10-13 12:59:47 +05:30

824 B

Checkout Engine Architecture

Checkout Pipeline & Validation

Managed via CheckoutRouter.py. Executes strict validation before order creation.

flowchart TD
    Req["POST /api/v1/checkout/create"] --> CartVal["1. Cart Non-Empty & Price Check"]
    CartVal --> StockVal["2. Inventory Ledger Stock Check\n(Available Stock >= Qty)"]
    StockVal --> AddrVal["3. Delivery Pincode & Address Validation"]
    AddrVal --> TaxVal["4. Tax Engine Calculation (GST)"]
    TaxVal --> ResStock["5. Create ONLINE_RESERVE Ledger Entry"]
    ResStock --> CreateOrd["6. Write Order Record (ORDER_CREATED)"]

Concurrency Protection

Stock reservation during checkout uses Redis distributed locking (lock:variant:{variant_id}) with a 5-second TTL to prevent double-reservation under concurrent checkout spikes.