Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Automate invoice generation, billing workflows, payment tracking, and revenue recognition for SaaS and service businesses. Use when building billing pipelines, generating invoice PDFs, usage-based invoicing, subscription management, payment reminders, or financial reporting. Trigger words: invoice, billing, payment, subscription, usage billing, revenue recognition, accounts receivable, dunning, proration, Stripe billing, generate invoice, create bill.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 64% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 46% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 135% | 0% |
| case-18 | ✗→✓ | ▲ Improved | 2% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 51% | 0% |
Build automated billing workflows covering invoice generation, PDF rendering, payment processing, dunning (payment failure handling), and financial reporting. Handles proration, usage-based billing, multi-currency support, tax calculation, discounts, and professional invoice document generation.
sqlinvoices ( id, customer_id, invoice_number, status, billing_period_start, billing_period_end, subtotal, tax_amount, total, currency, due_date, paid_at, created_at ) invoice_line_items ( id, invoice_id, description, quantity, unit_price, amount, metadata_json ) payments ( id, invoice_id, amount, currency, method, processor_ref, status, paid_at )
For each billing cycle:
1. Aggregate usage events for the billing period
2. Apply pricing rules (tiers, discounts, proration)
3. Calculate taxes based on customer location
4. Generate invoice record with line items
5. Render PDF with company branding
6. Send via email and store in customer portal
7. Initiate payment collection (auto-charge or payment link)
8. Handle payment success/failure with appropriate follow-upGather required information and render professional documents:
pythondef calculate_invoice(items, tax_rate=0, discount=0): subtotal = sum(item['quantity'] * item['unit_price'] for item in items) discount_amount = subtotal * (discount / 100) taxable_amount = subtotal - discount_amount tax_amount = taxable_amount * (tax_rate / 100) total = taxable_amount + tax_amount return { "subtotal": round(subtotal, 2), "discount": round(discount_amount, 2), "tax": round(tax_amount, 2), "total": round(total, 2) }
For PDF rendering, use reportlab (Python) or PDFKit (Node.js) with a clean layout: header with company info, invoice metadata, bill-to section, line items table, totals, and payment terms.
Payment failed:
Day 0: Retry payment, send "payment failed" email
Day 3: Retry with updated payment method prompt
Day 7: Final retry, warn about service suspension
Day 14: Suspend service, send "account suspended" email
Day 30: Cancel subscription, final noticeUser prompt: "Generate monthly invoices for our API platform. Tiered pricing: first 10,000 calls free, 10,001-100,000 at $0.001 each, 100,001+ at $0.0005 each."
javascriptcalculateTieredPricing(totalCalls) { const items = []; if (totalCalls <= 10000) { items.push({ description: 'API calls (free tier)', quantity: totalCalls, unitPrice: 0, amount: 0 }); } else if (totalCalls <= 100000) { items.push({ description: 'API calls (free tier)', quantity: 10000, unitPrice: 0, amount: 0 }); const paid = totalCalls - 10000; items.push({ description: 'API calls (standard)', quantity: paid, unitPrice: 0.001, amount: paid * 0.001 }); } else { items.push({ description: 'API calls (free tier)', quantity: 10000, unitPrice: 0, amount: 0 }); items.push({ description: 'API calls (standard)', quantity: 90000, unitPrice: 0.001, amount: 90 }); const bulk = totalCalls - 100000; items.push({ description: 'API calls (volume)', quantity: bulk, unitPrice: 0.0005, amount: bulk * 0.0005 }); } return items; }
User prompt: "Invoice TechStart Ltd: website design $3,500, SEO setup $1,200, hosting 12 months at $29/mo. 20% VAT. 10% early payment discount. Currency EUR."
Output:
Invoice #INV-2025-002 | Currency: EUR
Website Design 1 x EUR 3,500.00 = EUR 3,500.00
SEO Setup 1 x EUR 1,200.00 = EUR 1,200.00
Web Hosting (12 months) 12 x EUR 29.00 = EUR 348.00
Subtotal: EUR 5,048.00
Discount: -EUR 504.80
VAT (20%): EUR 908.64
Total: EUR 5,451.84
Payment Terms: Net 30 — 10% early payment discount appliedUser prompt: "Implement a dunning workflow for failed subscription payments using Stripe."
The agent generates a dunning service with webhook handlers for invoice.payment_failed, configurable retry schedules, email templates for each escalation stage, and automatic subscription status management.
Other measured skills in the registry, with their headline benchmark lift.