---
name: accounts-payable
description: Automate accounts payable operations including invoice processing, 3-way matching, payment optimization, vendor management, and approval workflows. Use when processing vendor invoices, matching POs to receipts and invoices, optimizing payment timing to capture discounts, managing approval hierarchies, handling duplicate detection, GL coding, payment scheduling, or vendor master data maintenance. Triggers on phrases like "process invoice", "AP workflow", "invoice approval", "vendor payment", "3-way match", "payment terms", "AP automation", "invoice matching", "accounts payable".
---

# Accounts Payable Automation

Streamline the entire AP lifecycle from invoice receipt to payment execution.

## Invoice Processing Workflow

### Phase 1: Invoice Capture & Extraction

Trigger on invoice receipt via email, portal upload, or EDI:

1. **Capture & Triage**:
   - Email gateway: Parse incoming emails, extract attachments (PDF, image, XML)
   - Vendor portal: Accept direct uploads with metadata
   - EDI feeds: Auto-ingest structured invoices from EDI-enabled vendors
   - OCR/IDR extraction: AI extracts vendor name, invoice number, date, due date, total amount, line items, tax, PO number

2. **Validation & Quality Check**:
   - Verify required fields present (vendor, amount, date)
   - Cross-reference vendor against approved vendor master
   - Flag missing PO number if PO-required vendor
   - Check for duplicate invoice number from same vendor
   - Validate tax amounts against tax rate tables

3. **Auto-Coding & GL Mapping**:
   - AI suggests GL account codes based on vendor category, line item description, and historical coding
   - Cost center assignment from PO or department routing
   - Tax code validation by vendor location and jurisdiction

### Phase 2: Matching & Approval

4. **3-Way Match Engine**:
   ```
   MATCH CHECKLIST:
   ────────────────
   Purchase Order (PO):
     [ ] PO number matches invoice
     [ ] PO quantity matches received quantity
     [ ] PO unit price within tolerance of invoiced price
     
   Receiving Report:
     [ ] Goods/services confirmed received
     [ ] Received quantity matches invoice quantity
     [ ] Receipt date within expected delivery window
     
   Invoice:
     [ ] Invoice total = sum of line items + tax
     [ ] Tax calculation correct per jurisdiction rules
     [ ] Invoice within PO open balance
   ```

   - **Tolerance Rules**: Auto-approve if variance < 2% or <$50; flag for review if within extended tolerance; reject if outside tolerance
   - **Partial Match**: Allow partial payment for quantities received; flag balance for follow-up
   - **No PO Match**: Route to department head for approval with spend policy check

5. **Approval Workflow**:
   ```
   APPROVAL MATRIX:
   ────────────────
   Amount Range        | Approver Level
   $0 — $2,500         | Department Manager
   $2,501 — $10,000    | Department Manager + Finance Manager
   $10,001 — $50,000   | VP / Director
   $50,001 — $100,000  | CFO
   >$100,000           | CFO + CEO
   
   Emergency/Urgent:   | Skip one level (logged with justification)
   Non-PO invoice:     | Additional department approval required
   ```

### Phase 3: Payment Execution

6. **Payment Scheduling & Optimization**:
   - Schedule payments per vendor terms (Net 30, Net 60, 2/10 Net 30)
   - Early payment discount engine: Auto-pay if discount ROI > cost of capital
   - Cash position check: Ensure sufficient liquidity for scheduled payments
   - Payment method assignment: ACH (default), wire (international/high-value), check (no-bank vendors), virtual card (discount-eligible vendors)

7. **Payment Execution**:
   ```
   PAYMENT BATCH — Weekly Run (Tuesday/Thursday)
   ─────────────────────────────────────────────
   1. Generate payment batch file
   2. CFO approval for batch totals (if > threshold)
   3. Submit to bank/payment processor
   4. Generate vendor payment advices
   5. Update invoice status → "Paid"
   6. Post payment entries to GL
   7. Confirm transmission/receipt
   ```

## Payment Optimization Framework

### Discount Capture Analysis

```
EARLY PAYMENT DISCOUNT EVALUATION:
══════════════════════════════════
Invoice: INV-2025-4521
Vendor: Acme Supplies
Terms: 2/10 Net 30
Amount: $15,000
Discount: $300 (if paid within 10 days)
Annualized ROI: 36.7%

Decision: PAY EARLY ✓
Rationale: ROI (36.7%) > cost of capital (8%)
Cash impact: $14,700 due in 8 days
```

### Cash Flow Impact Modeling

```
PAYMENT SCENARIOS:
══════════════════
Scenario A: Pay all at earliest date
  Cash out this week: $425,000
  Discounts captured: $12,400
  Net impact: -$412,600
  
Scenario B: Pay at term maturity
  Cash out this week: $0
  Discounts captured: $0
  Cash out next 30 days: $425,000
  Net impact: -$425,000
  
Scenario C: Hybrid (discount + cash preservation)
  Cash out this week: $180,000 (discount-eligible only)
  Discounts captured: $8,100
  Deferred: $245,000 (non-discount vendors)
  Net impact: -$171,900
```

## Duplicate Invoice Detection

### Detection Rules

```
DUPLICATE CHECKS:
════════════════
[ ] Same invoice number from same vendor
[ ] Same amount, same vendor, within 7 days
[ ] Same amount, same vendor, same PO number
[ ] Fuzzy match: similar invoice number, same vendor, amount within 1%
[ ] Re-scanned invoice: same OCR-extracted data within 24 hours

ACTION ON DETECTED DUPLICATE:
  1. Auto-hold payment
  2. Flag in AP queue with duplicate details
  3. Notify AP analyst for confirmation
  4. If confirmed duplicate: void hold, log in duplicate register
  5. If false positive: clear flag, resume processing
```

## Exception Handling

### Common Exceptions & Resolution Paths

| Exception Type | Action | Owner | SLA |
|---|---|---|---|
| PO price variance | Compare to contract; approve if within tolerance, else request PO revision | AP Analyst | 2 days |
| Missing PO | Route to department for retroactive approval | Dept. Manager | 3 days |
| Short payment dispute | Verify against contract; issue credit memo or process adjustment | AP + Vendor Mgmt | 5 days |
| Vendor master mismatch | Verify vendor identity; update master data | AP Supervisor | 1 day |
| Tax discrepancy | Validate against tax tables; escalate to tax team if material | Tax Team | 3 days |
| Approval overdue | Escalate to approver's manager | AP Manager | Same day |

## Vendor Master Data Management

### Vendor Onboarding Checklist

```
NEW VENDOR SETUP:
════════════════
  [ ] W-9 or W-8BEN on file (tax form)
  [ ] Bank account details verified (ACH/wire)
  [ ] Vendor classification assigned (goods, services, professional)
  [ ] Payment terms agreed and entered
  [ ] Tax jurisdiction codes assigned
  [ ] 1099 reporting flag set (if applicable)
  [ ] Approved by finance (dual verification for new vendors)
  [ ] Duplicate vendor check completed
  [ ] Sanctions/PEP screening passed
  [ ] Initial credit check (for net terms > 30 days)
```

## Output

### AP Dashboard View

```
AP OPERATIONS DASHBOARD — Week of Jan 27, 2025
══════════════════════════════════════════════════

Key Metrics:
  Invoices processed (MTD): 1,247          Avg processing time: 2.3 days
  Auto-approved: 89%                       Exception rate: 4.1%
  Discount capture rate: 94%               Duplicate prevention: 12 caught
  
Current Queue:
  Pending approval: 34 invoices ($287,500)
  Exception queue: 8 items                Requires PO: 5 items
  Ready for payment: 42 invoices ($156,200)

Upcoming Payments:
  This week: $312,000 (18 invoices)
  Next week: $528,000 (31 invoices)
  Early payment eligible: 7 invoices ($194,000) — discounts worth $6,800

Aging Summary:
  < 30 days: 89%                          > 60 days: 3%
  31-45 days: 6%                          > 90 days: 1%
  46-60 days: 2%
```

## Integration Points

- ERP/GL (NetSuite, SAP, Oracle): Invoice posting, GL coding, payment execution
- OCR/IDR platforms (ABBYY, Rossum, Hyperscience): Invoice data extraction
- eProcurement (Coupa, Workday Procure): PO integration, vendor catalog
- Payment processors (Bill.com, Tipalti, Airbase): Payment execution, virtual cards
- Bank APIs: Payment file transmission, confirmation tracking
- Approval systems (DocuSign, Conga): Digital approvals
- Tax engines (Avalara, Vertex): Tax validation and calculation

## Edge Cases

- **PO-less spending**: Enforce purchase requisition policy; set department spend thresholds
- **International vendors**: Multi-currency handling, FX rate capture at payment date, local tax compliance
- **Intercompany invoices**: Separate from external AP; auto-reconcile with intercompany AR
- **One-time/emergency vendors**: Expedited onboarding with enhanced approval (CFO + controller)
- **Consolidated vendor statements**: Handle utilities/telecom statements with multiple line items
- **Credit memos**: Apply against open invoices; track net balance per vendor
- **Prepayment management**: Track and reconcile prepayments against future invoices
- **Month-end accruals**: Auto-generate accrual entries for goods received but not invoiced (GRNI)
