Project Profile · AP Automation

PaperlessAP

End-to-end accounts payable automation — from email inbox to Sage export — built on React, Vite, and the Base44 serverless platform.

React 18 + Vite Base44 / Deno Functions AI Extraction Sage 300 Export Multi-Entity Zapier / Webhooks Role-Based Access Audit Trail
What is PaperLessAP?

PaperLessAP is a production-grade AP automation platform designed for multi-entity organizations running Sage 300. It eliminates paper-based invoice handling by providing a unified digital workflow — from the moment an invoice arrives by email through AI-powered data extraction, department coding, structured approval routing, and one-click Sage export.

The platform was built entirely on modern web standards: a React SPA frontend with Radix UI components, TanStack Query for server state, and a Deno/TypeScript serverless backend on Base44. It supports multiple business entities, configurable approval channels, delegation of authority, a full audit log, and an AI-powered operational chat assistant.

171
Source files across frontend & backend
14
Serverless backend functions (Deno/TypeScript)
19
Data entities in the domain model
4
Role levels with row-level security
Why customers choose PaperLessAP
📥

Zero-touch invoice intake

Invoices arriving by email are automatically intercepted via Zapier, routed through a webhook, and AI-extracted into structured records — no manual data entry.

Configurable approval routing

Rules engine supports single, sequential, and parallel approval chains. Amount thresholds and department scopes let finance teams enforce spending controls without IT involvement.

🏢

Multi-entity architecture

One deployment supports multiple business units or subsidiaries. Data is siloed per entity with per-user entity assignments, giving each division its own workspace.

📊

Real-time AP dashboard

Live KPIs — invoices due in 14 days, overdue payables, MTD processed volume, pipeline bottlenecks, and top vendor concentration — all visible at a glance.

📤

One-click Sage 300 export

Approved invoices batch-export to a Sage 300-formatted XLSX with all header, detail, and tax fields pre-populated. The system tracks export batches and prevents double-posting.

🔐

Compliance & audit trail

Every action — approval, rejection, delegation, unlock — is written to an immutable audit log with actor, timestamp, and before/after state. Segregation-of-duties rules prevent self-approval.

Invoice lifecycle

Every invoice travels through a structured, auditable pipeline enforced at the API layer — not just the UI.

01
Intake
Email → Zapier → Webhook → AI extraction
02
Review
Inbox triage, confidence scoring, field review wizard
03
Coding
GL account, department, optional fields, line items
04
Approval
Rule-matched channel, sequential/parallel routing
05
Export
Batch workbench, Sage 300 XLSX generation
06
Posted / Paid
Mark posted, then paid — locked record, full trail

Invoice status states

draft pending_coding pending_approval approved exported posted paid
rejected · overdue · error
Serverless functions (Deno / TypeScript)

All business logic lives in hardened serverless functions — not in the frontend. Each function re-validates authentication, entity access, and workflow state before touching data, making it safe to expose directly via API or webhook.

processIncomingInvoice
HMAC-validated webhook entry point. Handles idempotency via attachment hash, AI field extraction, and parks the invoice for human review.
auth AI extract deno
submitInvoiceForApproval
Validates GL, dept, amounts, and approver chain. Freezes the routing at submission time and writes the approval action to the audit log.
auth audit deno
approveInvoice
Enforces Segregation of Duties (creator cannot self-approve), respects active delegations, advances the sequential chain, and auto-completes parallel approvals.
SoD guard audit
generateSageExport
Produces a Sage 300-formatted XLSX batch file using SheetJS. Includes header rows, detail lines, payment schedules, and province-based tax groups for all Canadian provinces.
xlsx entity check deno
rejectInvoice
Records rejection reason, notifies the submitter, unlocks the invoice for re-submission after coding corrections.
audit
updateInvoiceWithValidation
Field-level validation guard on invoice edits. Prevents modification of locked invoices and enforces required-fields configuration.
lock guard audit
exportInvoices
Creates an ExportBatch record, marks invoices as exported, and prevents re-exporting already-batched invoices.
batch tracking
forwardInvoice
Re-assigns an invoice to a different approver without breaking the approval chain audit trail.
audit
markBatchPosted / markInvoicePaid
Terminal state transitions that lock records and timestamp completion, feeding the Dashboard MTD and YTD KPI computations.
lock audit
updateAssignedApprovers
Manages the live approval channel matching for an invoice, re-running rule selection when invoice data changes before submission.
deno
Domain entity model

19 entities with full field definitions, row-level security policies, and JSON schema validation.

Invoice
invoice_number vendor_code status (11 states) entity_id total_amount tax_total tax_group (18 CA provinces) approval_type assigned_approvers[] extraction_confidence locked source_channel
IncomingInvoice
from_email attachment_url status ai_extracted_data gmail_message_id promoted_invoice_id
ApprovalChannel
channel_name min_amount / max_amount approval_type approver_emails[] super_approver_override department_code sequence_number
ApprovalRule
rule_name min_amount / max_amount department_code approval_type priority active
Delegation
delegator_email delegate_email start_date / end_date entity_id active
ExportBatch
batch_number entity_id invoice_count status posted_date
AuditLog
entity_name action actor_email before_state (JSON) after_state (JSON) business_entity_id
+ 12 more: Vendor, User, Entity, Department, ChartOfAccount, InvoiceDetail, InvoicePaymentSchedule, UserEntity, RequiredFieldsConfig, InvoiceOptionalField, UserNotificationPreference, KnowledgeBase
Technology stack & capabilities
Frontend Framework
React 18 Vite 6 React Router v6 TanStack Query v5
UI Components
Radix UI (full suite) shadcn/ui Tailwind CSS 3 Lucide Icons
Backend Platform
Base44 Deno TypeScript @base44/sdk
Data & State
React Hook Form Zod validation date-fns lodash
Visualization
Recharts react-day-picker html2canvas jsPDF
Integrations
Zapier Webhooks Gmail (via Zapier) Sage 300 (XLSX) SheetJS / xlsx
Animation & UX
Framer Motion Sonner toasts @hello-pangea/dnd canvas-confetti
AI & Assistants
AI field extraction Operational chat agent KnowledgeBase entity react-markdown
Role hierarchy & permissions

Row-level security (RLS) is enforced at the data layer on every entity — not just the frontend routing.

System Admin
Platform-wide access. Manages all entities, users, and can unlock any locked invoice.
All entities, all data
Admin unlock invoices
User & entity management
Audit log access
AP Admin
Entity-scoped AP operations lead. Manages rules, vendors, exports, and the full invoice lifecycle.
Create, code, submit invoices
Configure approval channels
Export to Sage 300
Vendor & account management
Approver
Assigned to approval channels. Reviews, approves, or rejects invoices routed to them. Can delegate authority.
Approve / reject invoices
Delegation setup
Dashboard view
Cannot approve own invoices
User
Standard AP team member. Creates and tracks invoices they own within their assigned entities.
Create & submit invoices
View own invoices
Cannot approve or export
No admin panel access
External connectivity
Zapier + Gmail
Invoice emails arrive at a designated inbox, triggering a Zapier automation that POSTs structured data to the processIncomingInvoice webhook. Includes idempotency via Gmail message ID hash.
Gmail trigger → Webhooks by Zapier → POST with x-webhook-secret
Sage 300 Export
The Export Workbench batches approved invoices and generates a Sage 300-compatible XLSX file. All 18 Canadian provincial tax groups (GST, PST, HST, QST) are supported. Detail lines and payment schedules are included.
Approved → ExportBatch → generateSageExport → .xlsx download
AI Extraction Agent
Incoming PDF invoices are processed by an AI extraction pipeline that populates vendor, date, amounts, and line items with a confidence score (0–100). Low-confidence fields are flagged for human review in the Field Review Wizard.
PDF attachment → AI pipeline → extraction_confidence score → review queue
Who this is built for

For Finance & AP Teams

  • Eliminate manual data entry with AI-powered invoice capture from email
  • Route invoices automatically based on amount, department, and vendor
  • Approve or reject on any device — approvals are URL-accessible
  • Export directly to Sage 300 in the format your accountant already uses
  • Never lose track: dashboard shows every overdue and due-soon payable
  • Delegation of authority for vacation coverage — no approvals blocked
  • Full audit trail for every invoice for compliance and review

For Developers & Evaluators

  • React 18 + Vite + Tailwind + Radix UI — modern, maintainable SPA
  • Base44 serverless backend — Deno/TypeScript functions, no infra to manage
  • All business logic in server functions — frontend cannot bypass rules
  • Row-level security defined in entity schema — not in app code
  • Webhook integration with documented Zapier quickstart guide included
  • TanStack Query for optimistic UI and consistent cache invalidation
  • GitHub-backed source, local dev via npm run dev, deploy via Base44 Publish
Pages & admin modules
Core
Dashboard
Invoice List
Invoice Detail
New Invoice
Approvals
Invoice Inbox
Export Workbench
Audit Log
Admin Panel
Entity Management
User Management
User–Entity Assignment
Vendor Management
Account (GL) Management
Department Management
Approval Config
Approval Channel Mgmt
Approval Rule Mgmt
Delegation Management
Required Fields Config
Notification Preferences
Shared Components
Entity Switcher
AI Chat Widget
Attachment Viewer
Field Review Wizard
Approval Panel
Payment Schedules
Invoice Timeline