ERP Core / Purchase

Purchase - Introduction & Executive Overview

Strategic architectural overview of the Procurement & Purchasing domain, exploring vendor lifecycle governance, 3-way matching, landed cost allocations, and spend control.

Procurement & Purchasing Domain Design

Controlling corporate expenditure, securing reliable supplier commitments, and ensuring transparent procurement operations are vital for protecting enterprise margins. In modern supply chains, purchasing interactions span diverse activities: manufacturing departments trigger raw material purchase requisitions, procurement teams negotiate multi-tier vendor rate cards, inbound logistics teams track international customs clearances, and accounts payable clerks verify supplier bills against receiving manifests.

The Procurement & Purchasing domain acts as the sovereign authority governing enterprise supplier relationships and spend management. It enforces vendor qualification registries, Request for Quotation (RFQ) bidding cycles, Purchase Order (PO) approval matrices, Three-Way Matching invariants, landed cost allocations, and purchase return compensating workflows.

By establishing an isolated Bounded Context, commercial supplier agreements and purchasing workflows remain cleanly insulated from inventory warehouse bin movements, finished goods sales operations, and double-entry general ledger postings.


1. Business Drivers & The Maverick Spend Problem

When organizations operate without an isolated procurement domain, commercial spending and vendor operations rapidly devolve into unauthorized purchases and invoice fraud:

flowchart TD
    subgraph Antipattern["Without Purchasing Domain: Maverick Spend & Friction"]
        MaverickSpend["Off-Contract Maverick Buying<br/>Employees purchasing supplies informally without approved contracts or volume discounts"]
        OverpayingBills["Blind Invoice Payments<br/>Accounts payable paying supplier invoices without verifying physical warehouse receipt"]
        HiddenLandedCosts["Untracked Landed Costs<br/>Freight, customs, and insurance omitted from product valuation, distorting gross profit margins"]
        GhostVendors["Unverified Supplier Directories<br/>Fraudulent or inactive vendor records created without tax verification or approval gates"]
    end

    subgraph Solution["With Purchasing Domain: Strict Domain-Driven Architecture"]
        RequisitionGates["Strict Requisition Governance<br/>Spend thresholds requiring multi-level management approvals before PO issuance"]
        ThreeWayMatching["Enforced 3-Way Matching<br/>Supplier bills programmatically verified against Purchase Order terms and Goods Receipts"]
        LandedCostEngine["Prorated Landed Cost Engine<br/>Import duties and freight distributed deterministically across product unit costs"]
        TieredVendorMaster["Qualified Vendor Directory<br/>Mandatory tax ID verification, payment terms, and vendor performance tiering"]
    end

    Antipattern -.->|Solved By Domain-Driven Design| Solution

The Cost of Procurement Entropy

  • Maverick Spending: Without formal purchase requisition workflows, departments purchase goods off-contract at elevated retail prices, forfeiting pre-negotiated enterprise volume discounts.
  • Invoicing Fraud & Discrepancies: Paying supplier invoices based solely on the paper bill (without programmatic verification against what the warehouse actually received) leads to paying for damaged, missing, or overpriced merchandise.
  • Distorted Product Margins: When freight forwarding, harbor handling, and customs duties are treated as generic operational expenses rather than capitalized into inventory landed costs, true product gross margins cannot be accurately evaluated.
  • Supplier Delivery Volatility: Failing to track vendor delivery timeliness and receipt quality metrics prevents strategic procurement decisions and leaves production lines vulnerable to supply disruptions.

Domain-Driven Design restores spend control through deterministic approval state machines, non-negotiable Three-Way Matching invariants, and immutable procurement contracts.


2. Core Strategic Pillars of the Purchasing Domain

The Purchasing bounded context is anchored by seven foundational architectural pillars:

flowchart TD
    Purchase["Purchasing Domain Core"]

    P1["1. Requisition vs. PO Dichotomy<br/>Internal intent cleanly separated from external contract"]
    P2["2. Strict 3-Way Matching<br/>PO, Goods Receipt (GRN), and Supplier Bill alignment"]
    P3["3. Approved Vendor Qualification<br/>Tax verification, currency rules, and commercial payment terms"]
    P4["4. Price Break Matrices<br/>Tiered volume discounts and contracted lead times"]
    P5["5. Landed Cost Capitalization<br/>Customs, duty, and freight prorated across item valuations"]
    P6["6. Asynchronous Fulfillment Ingestion<br/>Warehouse receipts consumed without database coupling"]
    P7["7. Debit Note Compensating Workflows<br/>Formal return documents for supplier chargebacks"]

    Purchase --> P1
    Purchase --> P2
    Purchase --> P3
    Purchase --> P4
    Purchase --> P5
    Purchase --> P6
    Purchase --> P7

1. Purchase Requisition vs. Purchase Order Separation

Purchasing maintains an explicit boundary between an internal request to buy (Purchase Requisition) and an external legally-binding commercial commitment (Purchase Order). Requisitions require internal cost-center approvals, while POs govern external vendor fulfillment.

2. The Three-Way Matching Invariant

A supplier invoice cannot be authorized for payment until the Three-Way Match satisfies quantity and price tolerances: $\text{Quantity Invoiced} \le \text{Quantity Received (GRN)} \le \text{Quantity Ordered (PO)}$. Discrepancies beyond configured thresholds automatically trigger payment holds.

3. Vendor Master Qualification

Suppliers must satisfy onboarding compliance (verified tax identification, legal business registration, standard payment terms, and banking coordinates) before entering an Active state capable of receiving Purchase Orders.

4. Volume Price Break Matrices

Purchasing evaluates vendor pricing contracts dynamically based on order volume breaks, contracted currencies, seasonal discounts, and supplier minimum order quantities (MOQ).

5. Landed Cost Capitalization

Ancillary shipping costs (ocean freight, customs tariffs, port handling, cargo insurance) are captured as landed cost vouchers and distributed across received inventory items based on monetary value, weight, or cubic volume.

6. Asynchronous Receipt Choreography

The warehouse receiving process does not manipulate purchase orders directly. When the receiving dock inspects goods, it publishes a GoodsReceivedNoteIssued event. Purchasing subscribes to this event to increment fulfillment progress.

7. Debit Note Compensating Workflows

When received goods are rejected due to quality defects or transit damage, Purchasing generates an immutable Debit Note that authorizes accounts payable to deduct the credit from pending vendor disbursements.


3. High-Level Inter-Domain Choreography

The Purchasing context interacts with warehouse operations, financial accounting, manufacturing, and order management:

flowchart TD
    Purchase["Procurement & Purchasing Domain<br/>Vendor Contracts & Purchase Orders"]

    Inventory["Inventory / WMS<br/>Receiving Docks & Stock Intake"]
    FMS["Accounting / FMS<br/>Accounts Payable & Ledgers"]
    MRP["Manufacturing / MRP<br/>Component Requisitions"]
    PIM["PIM / Catalog<br/>Canonical Item Masters"]

    MRP -->|"MaterialShortageDetected"| Purchase
    Purchase -->|"PurchaseOrderApproved"| Inventory
    Inventory -->|"GoodsReceivedNoteIssued"| Purchase
    Purchase -->|"BillMatched, LandedCostAllocated"| FMS
    PIM -.->|"ItemSpecification (via ACL)"| Purchase
Integrating ContextHandled InteractionDownstream Operational Materialization
Inventory / WMSPurchaseOrderApprovedEstablishes an expected inbound shipment profile on the warehouse receiving schedule.
Inventory / WMSConsumes GoodsReceivedNoteIssuedIncrements PO fulfillment quantities and updates the Three-Way Matching ledger.
Manufacturing (MRP)Consumes MaterialShortageDetectedAutomatically generates draft purchase requisitions to replenish manufacturing raw materials.
Accounting (FMS)Emits BillMatchedAndAuthorizedEstablishes Accounts Payable (AP) supplier liability and records input tax credits in the General Ledger.
Accounting (FMS)Emits LandedCostAllocatedAdjusts the inventory asset valuation in the balance sheet to reflect freight and duty capitalization.

4. Architectural Domain Blueprint Directory

Explore the tactical models, invariants, and workflows across the Purchasing domain chapters:

  1. Bounded Context & System Boundaries: Operational scope, spend boundaries, out-of-scope concerns, and Anti-Corruption Layer (ACL) translation interfaces.
  2. Ubiquitous Language & Domain Glossary: Canonical procurement terminology, vendor classifications, document statuses, and commercial payment terms.
  3. Structural Topology & Vendor Model: Vendor entity hierarchy, purchase order aggregates, line item entities, and landed cost distribution models.
  4. Domain Invariants & Business Rules (“The Law”): Three-Way Matching tolerance rules, PO price locks, vendor approval status constraints, and currency rounding.
  5. Operational Workflows & State Machines: Requisition-to-PO lifecycles, supplier quotation evaluation, bill verification, and return merchandise lifecycles.
  6. Domain Events & Integration Contracts: Catalog of emitted procurement domain events, downstream integration schemas, and payload specifications.
  7. Audit Trail, Governance & Compensation: Requisition approval audit trails, supplier dispute handling, and debit note compensation strategies.

Our Premium Sponsors

Obelaw is proudly open-source. Continued development, bug fixes, and community support are made possible by the generosity of our sponsors.

Sponsor Obelaw