Process SOP

ApIQ/Process SOP

HA

ApIQ — Process Invoice

How the automation handles one invoice, end to end: 26 steps across 6 phases.

What this automation does

Plain-language summary of the published SOP

Automates the complete Accounts Payable lifecycle for a single invoice: ingestion, AI extraction, vendor matching, duplicate and PO checks, VAT and math validation, confidence scoring, exception handling, approval routing, ERP booking, payment preparation, reporting and an immutable audit trail. The automation never invents invoice data, never bypasses approval rules and never releases payment without authorization.

Never invents invoice data — absent fields stay empty.
Never bypasses approval rules or tier limits.
Never releases payment without required authorization.
AI signals are decision support, never a fraud determination.

Phase 1 · Ingestion & Extraction

Capture the submission, assign an immutable ID and turn documents into scored fields.

6 steps
  1. 1

    Normalize invoice inputs

    Packages every directly provided field into one normalized map used by all later steps.

    • Only packages what was provided — no invented values
    • Currency falls back to the configured default currency
    • Absent numeric fields stored as 0.0; line items kept as raw JSON
  2. 2

    Assign ApIQ invoice ID

    Generates a new ID, or reuses the existing one on the approval path.

    • Format APIQ-YYYY-NNNNNN from the UTC timestamp
    • Once assigned, the ID is immutable
  3. 3

    Create master record (RECEIVED)

    Inserts the invoice row and writes the receipt audit and activity events.

    • Fields stored unmodified and tagged AI Extracted = FALSE
    • Source always captured; MANUAL is the default
    • Existing invoice IDs are reused, never duplicated
  4. 4

    Decode QR payload

    Best-effort parse of seller, VAT number, timestamp, total and VAT amount from the QR string.

    • Unparseable or absent payloads return empty without failing the run
    • QR fields tagged source = QR_CODE with high confidence
  5. 5

    IDP extraction & scoring

    Extracts all fields from the uploaded document with per-field confidence, or scores structured inputs.

    • Structured inputs always win; IDP fills the gaps
    • Manually supplied fields score 95
    • Overall confidence = average of the six critical fields
  6. 6

    Merge QR + AI and flag conflicts

    Reconciles both sources into the authoritative field set for the rest of the run.

    • Agreeing values keep the higher confidence
    • Conflicts beyond rounding tolerance → QR_DATA_MISMATCH (HIGH)
    • Critical field below 70% → LOW_OCR_CONFIDENCE (MEDIUM)
    • Status advances to EXTRACTED

Phase 2 · Vendor & Security

Confirm who is being paid, and that the payment details and the invoice itself are not a repeat.

3 steps
  1. 7

    Vendor master matching

    Matches by VAT number first, then fuzzy vendor name against the vendor master.

    • EXACT_MATCH: VAT equal or name score ≥ 95 → vendor assigned
    • LIKELY_MATCH: above threshold but < 95 → confirmation required (MEDIUM)
    • NO_MATCH → VENDOR_NOT_FOUND (HIGH); MULTIPLE_MATCHES → no auto-selection (HIGH)
  2. 8

    Bank detail anomaly check

    Compares invoice bank details against the vendor's approved record.

    • Runs only with a confirmed vendor and a provided bank account
    • New account, changed beneficiary or unexpected country are flagged
    • BANK_DETAILS_CHANGE is always HIGH; only masked references are logged
  3. 9

    Duplicate detection

    Searches the vendor's invoices for the same number, or same date and amount.

    • DUPLICATE_CONFIRMED (CRITICAL) on same vendor + invoice number
    • POSSIBLE_DUPLICATE (HIGH) on same date + total
    • REJECTED invoices and the current invoice are excluded

Phase 3 · Validation

Prove the numbers, the PO and the tax treatment hold together before anyone approves.

5 steps
  1. 10

    PO three-way matching

    Compares vendor, amount and line items against the purchase order within tolerance.

    • No PO number → N_A; needs an approval classification to auto-process
    • PARTIAL_MATCH records expected, invoice, variance and variance % per field
    • PO number without a PO → PO_NOT_FOUND (HIGH)
    • The more permissive of tolerance % and tolerance amount applies
  2. 11

    Line-item math validation

    Recomputes line totals, subtotal, VAT and total, and compares them with stated values.

    • All comparisons allow the configured rounding tolerance
    • Any mismatch → TOTAL_CALCULATION_MISMATCH (HIGH) with expected, stated and variance
    • Never adjusts amounts — validation only
  3. 12

    VAT validation

    Checks VAT number presence and format, rate, recalculated VAT and total consistency.

    • Missing vendor VAT number → VAT_INFORMATION_MISSING (HIGH)
    • Rate off the configured default → VAT_REVIEW_REQUIRED unless justified
    • Recalculated VAT mismatch → VAT_MISMATCH (HIGH)
    • Internal consistency only — not a regulatory compliance assertion
  4. 13

    Payment terms validation

    Resolves governing terms (invoice → PO → vendor master) and computes the due date.

    • Terms inconsistent with the vendor master → PAYMENT_TERMS_EXCEPTION (MEDIUM)
    • Due date always computed — aging and payment runs depend on it
    • Early payment discount flagged inside the configured window
  5. 14

    AI confidence scoring

    Aggregates every validation signal into a single explainable 0–100 score.

    • Weights: extraction 25, vendor 20, duplicate 15, PO 15, VAT 10, math 10, terms 5
    • HIGH > 90 · MEDIUM 70–90 · LOW < 70
    • Informs routing but never overrides mandatory controls

Phase 4 · Exceptions & Approval

Decide what can run itself, what a human must see, and record that human decision.

4 steps
  1. 15

    Manual override detection

    Logs any input that differs from the stored extraction, with original value, new value and reason.

    • Only runs on the approval path (existing invoice ID)
    • Numeric comparisons use the rounding tolerance
    • The original extraction is never modified
  2. 16

    Auto-process gate evaluation

    Evaluates every mandatory gate; a single failure blocks automatic processing.

    • Requires vendor match, no duplicates, PO pass or N_A, VAT valid, math pass
    • Requires all critical fields, confidence above threshold, no open bank-change exception
    • Every failing gate records a specific, user-facing reason
  3. 17

    Approval routing

    Auto-approves, or creates pending approvals for the tier implied by the invoice amount.

    • Auto: SYSTEM approver, status → APPROVED
    • Tier 1 department · Tier 2 department + finance · Tier 3 department + controller
    • Unroutable blocking exceptions set status → EXCEPTION
  4. 18

    Human reviewer decision

    Records APPROVED, REJECTED or REQUEST_INVESTIGATION alongside the AI result.

    • No decision provided → no-op, normal path continues
    • APPROVED lets booking proceed in the same run; REJECTED skips booking
    • REQUEST_INVESTIGATION escalates open exceptions to the security team

Phase 5 · Booking & Payment

Book the accounting entry and prepare — never release — the payment.

3 steps
  1. 19

    ERP booking

    Assembles period, cost center, GL account and VAT split, then books via ERP or locally.

    • Period derived from invoice date as YYYY-MM
    • Net amount and input VAT recorded separately
    • Status → BOOKED only on confirmed success; failure → ERP_BOOKING_FAILED
  2. 20

    Payment request creation

    Links the booked invoice into payment processing as READY or BLOCKED.

    • Created only after successful booking
    • Bank anomaly or critical exception → BLOCKED with a stated reason
    • Raw account numbers are never stored
  3. 21

    Aging bucket snapshot

    Maps days to or past the due date into a bucket and upserts the aging snapshot.

    • Buckets: Current · 1–30 · 31–60 · 61–90 · 90+
    • Days outstanding is positive when overdue, negative when not yet due

Phase 6 · Reporting & Intelligence

Feed VAT reporting, vendor intelligence, anomaly signals and the live dashboard.

5 steps
  1. 22

    VAT record for the period

    Writes input, recoverable and non-recoverable VAT with period, rate and exception flags.

    • Period derived from invoice date as YYYY-MM
    • Recoverable defaults to the full VAT unless flagged otherwise
    • No VAT return is filed — internal reporting only
  2. 23

    Vendor intelligence update

    Updates cumulative spend, exception and duplicate rates, and the vendor risk indicator.

    • Runs only for a matched vendor
    • HIGH: exception rate > 0.3 or > 2 bank changes · MEDIUM: > 0.1 or duplicates > 0.05
    • Risk explanation names the contributing metrics
  3. 24

    Payment anomaly detection

    Looks for unusual amounts, oversized first invoices and bank accounts shared across vendors.

    • MEDIUM unusual amount · HIGH cross-vendor account · CRITICAL large first invoice
    • Signal only — never automatic vendor suspension
  4. 25

    Dashboard aggregation

    Builds the live dashboard payload from aging, exceptions, payment requests and vendors.

    • Exceptions grouped by severity for queue prioritisation
    • Payment readiness split READY vs BLOCKED, per vendor by risk
    • Read-only — modifies nothing
  5. 26

    Final state & completion audit

    Writes the completion audit entry and returns the API-ready invoice object.

    • Output matches the ApIQ API contract exactly
    • Monetary values returned as-is, unrounded
    • Exceptions list contains all OPEN exceptions for the invoice