---
name: accounts-receivable
description: Manage accounts receivable operations including automated invoicing, smart collections, cash application, credit management, DSO optimization, and customer billing. Use when generating customer invoices, managing collections workflow, applying cash receipts, setting credit limits, resolving billing disputes, tracking AR aging, or optimizing DSO. Triggers on phrases like "send invoice", "collections", "AR aging", "cash application", "billing dispute", "credit limit", "DSO", "accounts receivable", "customer billing", "payment reminder", "bad debt".
---

# Accounts Receivable Optimization

Accelerate cash collection and streamline the entire order-to-cash cycle.

## Automated Invoicing Workflow

### Invoice Generation

Trigger based on billing trigger (time-based, usage-based, milestone-based, event-driven):

1. **Invoice Trigger Detection**:
   - **Time-based**: Recurring invoices on set schedule (monthly, quarterly, annual)
   - **Usage-based**: API pull from usage metering systems (SaaS, cloud, telecom)
   - **Milestone-based**: Project completion triggers, delivery confirmations
   - **Event-driven**: Contract start/renewal, one-time service completion

2. **Data Aggregation**:
   ```
   INVOICE DATA SOURCES:
   ────────────────────
   Contract Management: Pricing terms, rates, discounts, payment terms
   CRM System: Customer billing address, contact info, billing preferences
   Usage Systems: Consumption data, meter readings, API call counts
   Project Management: Milestone completion, billable hours, deliverables
   Inventory/Shipping: Quantity shipped, delivery confirmation
   Tax Engine: Tax rates by customer jurisdiction, tax-exempt status
   ```

3. **Invoice Generation & Validation**:
   - Auto-populate invoice template with correct header and line items
   - Apply contract pricing, volume discounts, loyalty discounts
   - Calculate tax by jurisdiction; verify tax-exempt certificates
   - Validate: totals match, no negative balances, currency correct
   - Generate PDF with company branding, payment instructions, due date

4. **Invoice Delivery**:
   - Email delivery with embedded payment link
   - Customer portal upload (self-service access)
   - EDI 810 transmission for EDI-enabled customers
   - Physical mail (fallback for specific customers/regions)
   - Delivery confirmation tracking

### Invoice Quality Checks

```
PRE-DELIVERY VALIDATION:
════════════════════════
  [ ] Customer details accurate (name, address, tax ID)
  [ ] Line items match PO/contract (qty, unit price, total)
  [ ] Discounts correctly applied per agreement
  [ ] Tax calculation validated against tax engine
  [ ] Payment terms per contract (Net 30, Net 45, etc.)
  [ ] Invoice number unique and sequential
  [ ] Currency and exchange rate correct (multi-currency)
  [ ] Attachment/receipt included if required
  [ ] Regulatory compliance (e-invoicing mandates, e.g., EU, Brazil)
  [ ] Duplicate check: no prior invoice for same period/items
```

## Smart Collections Management

### Collections Workflow

```
COLLECTIONS ESCALATION LADDER:
══════════════════════════════

Day 0 (Due Date):
  ── Invoice due date reached
  ── Payment link auto-embedded in invoice

Day 1-3 (Grace Period):
  ── No action (allow processing time)
  ── Track payment in real-time via payment gateway

Day 4-7 (Friendly Reminder):
  ── Automated email: "Invoice #12345 — Reminder: Payment due soon"
  ── Include payment link, due date, amount, brief line item summary
  ── Tone: Professional, helpful, non-confrontational

Day 8-14 (Second Reminder):
  ── Automated email: "Invoice #12345 — Overdue by 8 days"
  ── CC customer success manager
  ── Offer payment plan option if balance > $10,000

Day 15-30 (Escalation):
  ── Phone call from collections specialist
  ── Document all communication (date, time, outcome,承诺)
  ── If disputed: route to dispute resolution workflow
  ── If no response: second phone call + formal notice email

Day 31-45 (Senior Escalation):
  ── VP/Director-level contact (if appropriate relationship)
  ── Formal dunning letter via postal mail
  ── Review for credit hold on future orders
  ── Assess for write-off vs. continued collection

Day 46-60 (Final Actions):
  ── Internal review: continue collection vs. write-off vs. legal
  ── If <$5,000 and no response: recommend write-off
  ── If >$5,000: engage collections agency or legal counsel
  ── Credit bureau reporting (if policy allows)
```

### Customer Risk Scoring

```
COLLECTION RISK SCORE:
══════════════════════
Score factors:
  Payment history (40%): On-time %, average days late
  Account age (15%): New vs. established relationship
  Credit score (20%): External credit bureau data
  Current balance (15%): Outstanding amount relative to credit limit
  Engagement level (10%): Response rate to communications

Risk Tiers & Actions:
  Green (Score 1-3): Standard terms, auto-reminder workflow
  Yellow (Score 4-6): Enhanced monitoring, earlier reminders, manual follow-up
  Red (Score 7-10): Credit hold, payment required upfront, escalated collection
  Critical (Score 11+): Legal review, collections agency, write-off assessment
```

## Cash Application & Reconciliation

### Auto-Cash Application

```
CASH APPLICATION ENGINE:
════════════════════════

Step 1: Payment Receipt Detection
  Sources: Bank feed, lockbox file, payment gateway (Stripe, PayPal), wire notification
  Capture: Amount, date, payer name/reference, bank reference number

Step 2: Payment Identification
  Extract remittance info from:
    - Bank statement memo/notes
    - Lockbox OCR scan
    - Payment gateway customer ID
    - Wire transfer reference line

Step 3: AI Invoice Matching
  Match criteria:
    Exact amount match → Auto-apply
    Amount within $0.01 tolerance → Auto-apply
    Partial payment → Apply largest invoices first (or per customer instructions)
    Multiple invoices → Split payment across invoices
    Overpayment → Apply to invoices, remainder as credit balance

Step 4: Exception Handling
  Unapplied cash queue:
    - Payment with no matching invoice → Flag for manual review
    - Amount doesn't match → Suggest closest match with variance explanation
    - Unknown payer → Cross-reference customer master (fuzzy name match)
    - Currency mismatch → Check for FX conversion discrepancy

Step 5: Posting & Confirmation
  Post applied cash to GL (Dr Cash, Cr AR)
  Update customer account balance
  Send payment confirmation receipt (if enabled)
  Update AR aging report
```

### Short Payment Analysis

```
SHORT PAYMENT TRACKING:
═══════════════════════
Invoice: INV-2025-1123
Customer: GlobalTech Corp
Invoice amount: $45,000
Amount received: $42,500
Shortfall: $2,500

Possible reasons:
  [ ] Early payment discount claimed (verify if eligible)
  [ ] Partial delivery/short shipment
  [ ] Quality dispute
  [ ] Pricing disagreement
  [ ] Deduction for return/credit
  [ ] Administrative error

Resolution:
  Action: Contact customer to determine reason
  Owner: Collections specialist
  Deadline: Within 3 business days
```

## Credit Management

### Credit Assessment Framework

```
NEW CUSTOMER CREDIT REVIEW:
════════════════════════════

Credit Information Gathered:
  D&B Score: __________
  Years in business: __________
  Annual revenue: __________
  Payment terms requested: __________
  Initial order value: __________

Credit Decision Matrix:
  ┌─────────────┬──────────────┬──────────────────────┐
  │ D&B Score   │ Credit Limit │ Additional Req.      │
  ├─────────────┼──────────────┼──────────────────────┤
  │ 7,200+      │ $100,000     │ Standard             │
  │ 6,000-7,199 │ $50,000      │ Trade reference check│
  │ 4,500-5,999 │ $25,000      │ Personal guarantee   │
  │ 3,000-4,499 │ $10,000      │ Prepayment required  │
  │ <3,000      │ $0           │ Cash in advance only │
  └─────────────┴──────────────┴──────────────────────┘

Annual credit review triggers:
  - Credit utilization > 80% of limit
  - Payment history deteriorates (>30 days late twice in 6 months)
  - Negative news/credit event
  - Annual review cycle
  - Customer requests limit increase
```

## AR Aging & DSO Optimization

### DSO Reduction Strategies

```
DSO OPTIMIZATION PLAYBOOK:
══════════════════════════

Current DSO: 47 days
Target DSO: 35 days
Potential cash freed: ~$1.2M

Initiatives:

1. Electronic Payments (Priority: HIGH)
   Action: Migrate 50% of customers to online payment portal
   Impact: Reduce DSO by 3-5 days
   Timeline: Q1 implementation

2. Invoice Accuracy Improvement (Priority: HIGH)
   Action: Reduce billing errors from 4% to 1%
   Impact: Reduce dispute-driven delays by 8-12 days for affected invoices
   Timeline: Ongoing

3. Early Payment Incentive (Priority: MEDIUM)
   Action: Offer 1/10 Net 30 for select customer segments
   Impact: Accelerate 15% of AR by ~20 days; cost = 1% of eligible AR
   Timeline: Pilot in Q2

4. Credit Hold Policy (Priority: MEDIUM)
   Action: Auto-hold orders when account > 45 days past due
   Impact: Pressure overdue accounts; reduce chronic late payers
   Timeline: Q1

5. Dispute Resolution SLA (Priority: HIGH)
   Action: Resolve disputes within 5 business days (from 12 days)
   Impact: Free $300K in held invoices monthly
   Timeline: Q1

6. Automated Dunning (Priority: LOW)
   Action: Implement tiered automated dunning for all customers
   Impact: Reduce manual collection effort by 40%
   Timeline: Q3
```

## Dispute Resolution

### Dispute Management Workflow

```
BILLING DISPUTE RESOLUTION:
════════════════════════════

Step 1: Dispute Intake
  Source: Customer email, portal submission, collections call
  Capture: Invoice number, dispute reason, amount in dispute, supporting docs
  Auto-create dispute ticket with priority assignment

Step 2: Investigation
  Owner: Billing specialist (24-48 hours)
  Actions:
    - Verify invoice details against contract
    - Check shipment/delivery records
    - Review quality/return documentation
    - Consult sales/customer success if needed

Step 3: Resolution
  If customer is correct:
    → Issue credit memo or revised invoice
    → Root cause analysis to prevent recurrence
    → Notify process owner
  
  If invoice is correct:
    → Prepare evidence package for customer
    → Communicate resolution with supporting documentation
    → Offer goodwill credit if appropriate (per authority matrix)

Step 4: Close & Track
  Update dispute ticket with resolution details
  Track dispute metrics: resolution time, volume, common causes
  Monthly dispute trend report to finance leadership
```

## Output

### AR Dashboard View

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

Key Metrics:
  Total AR: $4.8M                 DSO: 43 days (target: 35)
  Current month invoices: 892     Auto-cash application rate: 82%
  Disputed amount: $67,200        Collection effectiveness: 91%

AR Aging Summary:
  Current (0-30 days): $3.1M (65%)    ✓ On track
  31-60 days: $980K (20%)            ⚠ Monitor
  61-90 days: $420K (9%)            ⚠ Elevated
  91-120 days: $165K (3%)          ⚠ High risk
  >120 days: $135K (3%)            ✖ Write-off review

Top Overdue Accounts:
  1. MegaCorp — $89,400 (67 days) — Dispute under review
  2. TechStart Inc — $52,100 (73 days) — Payment plan active
  3. GlobalRetail — $34,800 (41 days) — Reminder sent, awaiting payment
  4. SmallBiz LLC — $28,600 (95 days) — Final notice sent
  5. Enterprise Co — $21,300 (58 days) — Collections call scheduled

Collections Pipeline:
  Auto-reminders active: 34 accounts
  Manual follow-up this week: 18 accounts
  Payment plans active: 5 accounts ($94,000 total)
  Legal review: 2 accounts ($37,500 total)
```

## Integration Points

- ERP/GL (NetSuite, SAP, Oracle): Invoice posting, AR ledger, cash posting
- CRM (Salesforce, HubSpot): Customer data, contract terms, account health
- Payment gateways (Stripe, PayPal, Square): Payment processing, confirmation
- Billing platforms (Chargebee, Zuora, Bill.com): Subscription billing, usage-based
- Lockbox services: Physical check processing
- D&B/Credit bureaus: Credit scoring and monitoring
- Tax engines (Avalara, Vertex): Tax calculation and compliance
- E-invoicing networks (PEPPOL, Xendit): Regulatory e-invoicing

## Edge Cases

- **Partial payments**: Apply per customer payment instructions or default to oldest-first method
- **Overpayments**: Hold as customer credit; auto-apply to next invoice; refund if not used within 90 days
- **Multi-entity billing**: Separate invoices per entity; handle intercompany billing separately
- **Multi-currency invoicing**: Lock FX rate at invoice date; track FX gains/losses on settlement
- **Contract amendments mid-cycle**: Prorate charges/credits; issue true-up invoice
- **Write-offs**: Follow approval matrix (>$5K: CFO; >$25K: CEO); document business justification; tax treatment
- **Rebilling/re-invoicing**: Link new invoice to original; clear dispute history; avoid double-charge appearance
- **Government/regulatory invoicing**: Strict format compliance; unique numbering; audit trail requirements
