Commerce Invoices
Create invoices, send to customers, and record payments.
How It Works
- Create an invoice with line items, terms (
net_30, net_60), and due date.
- Send the invoice to the customer and track delivery status.
- Record full or partial payments against the invoice.
- Monitor overdue invoices and aging buckets (30/60/90+ days).
- Report outstanding balances and payment history.
Usage
- CLI:
stateset-invoices ... or stateset "create invoice for order ORD-123"
- Writes require
--apply.
- MCP tools:
list_invoices, create_invoice, send_invoice, record_invoice_payment, get_overdue_invoices.
Permissions
- Read:
list_invoices, get_overdue_invoices — no --apply needed.
- Write:
create_invoice, send_invoice, record_invoice_payment — requires --apply.
Examples
stateset invoices create --order ORD-123 --terms net_30 --apply
stateset invoices send --invoice inv_123 --apply
stateset invoices payment record --invoice inv_123 --amount 2500.00 --apply
stateset invoices list --status overdue --aging 60
Status Flows
Invoice: Draft -> Sent -> Partially Paid -> Paid (or Overdue/Voided)
Output
{"status":"sent","invoice_id":"inv_123","total":5000.00,"amount_paid":0,"amount_due":5000.00,"due_date":"2025-02-15"}
Present Results to User
- Invoice status, terms, totals, and due date.
- Payment records, partial payment amounts, or overdue flags.
- Aging bucket if overdue (30/60/90+ days).
- Next actions (send reminder, escalate to collections).
Troubleshooting
- Invoice already paid: show payment history with
record_invoice_payment.
- Missing customer: create or link a customer record before invoicing.
- Overdue not flagged: verify due date and current date calculation.
- Partial payment rounding: confirm line item amounts sum to invoice total.
Error Codes
INVOICE_ALREADY_PAID: Invoice has been fully settled; no further payments accepted.
MISSING_CUSTOMER: No customer record linked to the invoice.
AMOUNT_MISMATCH: Payment amount does not align with the outstanding balance.
Related Skills
- commerce-accounts-receivable — AR aging and collections workflows
- commerce-orders — orders that generate invoices
- commerce-tax — tax breakdown on invoice line items
- commerce-payments — payment processing for invoice settlement
References
- references/invoices-flow.md
- /home/dom/stateset-icommerce/cli/.claude/agents/invoices.md
1---2name: commerce-invoices3description: Manage invoices and overdue billing. Use when running `stateset-invoices`, creating invoices, recording payments, or reconciling invoice status and aging.4---56# Commerce Invoices78Create invoices, send to customers, and record payments.910## How It Works11121. Create an invoice with line items, terms (`net_30`, `net_60`), and due date.132. Send the invoice to the customer and track delivery status.143. Record full or partial payments against the invoice.154. Monitor overdue invoices and aging buckets (30/60/90+ days).165. Report outstanding balances and payment history.1718## Usage1920- CLI: `stateset-invoices ...` or `stateset "create invoice for order ORD-123"`21- Writes require `--apply`.22- MCP tools: `list_invoices`, `create_invoice`, `send_invoice`, `record_invoice_payment`, `get_overdue_invoices`.2324## Permissions2526- **Read:** `list_invoices`, `get_overdue_invoices` — no `--apply` needed.27- **Write:** `create_invoice`, `send_invoice`, `record_invoice_payment` — requires `--apply`.2829## Examples3031```bash32stateset invoices create --order ORD-123 --terms net_30 --apply33stateset invoices send --invoice inv_123 --apply34stateset invoices payment record --invoice inv_123 --amount 2500.00 --apply35stateset invoices list --status overdue --aging 6036```3738## Status Flows3940**Invoice:** Draft -> Sent -> Partially Paid -> Paid (or Overdue/Voided)4142## Output4344```json45{"status":"sent","invoice_id":"inv_123","total":5000.00,"amount_paid":0,"amount_due":5000.00,"due_date":"2025-02-15"}46```4748## Present Results to User4950- Invoice status, terms, totals, and due date.51- Payment records, partial payment amounts, or overdue flags.52- Aging bucket if overdue (30/60/90+ days).53- Next actions (send reminder, escalate to collections).5455## Troubleshooting5657- Invoice already paid: show payment history with `record_invoice_payment`.58- Missing customer: create or link a customer record before invoicing.59- Overdue not flagged: verify due date and current date calculation.60- Partial payment rounding: confirm line item amounts sum to invoice total.6162## Error Codes6364- `INVOICE_ALREADY_PAID`: Invoice has been fully settled; no further payments accepted.65- `MISSING_CUSTOMER`: No customer record linked to the invoice.66- `AMOUNT_MISMATCH`: Payment amount does not align with the outstanding balance.6768## Related Skills6970- commerce-accounts-receivable — AR aging and collections workflows71- commerce-orders — orders that generate invoices72- commerce-tax — tax breakdown on invoice line items73- commerce-payments — payment processing for invoice settlement7475## References76- references/invoices-flow.md77- /home/dom/stateset-icommerce/cli/.claude/agents/invoices.md