Sign in →

Invoices & Billing

Manage the full invoice lifecycle — from generation through settlement — including bill runs, credit notes, and ERP integration.

Updated 2026-07-29Suggest edits

Invoices & Billing

Aforo handles the complete invoicing lifecycle: automatic invoice generation via bill runs, dunning, credit notes, ERP sync, and payment processing.

Invoice States

DRAFT → OPEN → PAID
              ↘ OVERDUE → UNCOLLECTIBLE
              ↘ VOID
StateDescription
DRAFTBeing assembled. Not yet sent to customer.
OPENFinalized and sent. Awaiting payment.
PAIDFully collected.
OVERDUEPayment not received by due date.
UNCOLLECTIBLEEscalated after dunning is exhausted (4 steps by default). Write-off candidate.
VOIDCancelled before collection.

Line Item Types

Each invoice contains line items describing individual charges:

TypeDescription
USAGEMetered usage charge
FIXEDFlat / recurring fee (base fee, platform fee)
PRORATIONMid-period adjustment
DISCOUNTApplied discount
TAXTax line
CREDITCredit note applied

Bill Runs

Bill runs batch-generate invoices for all customers in a billing period. Run them manually or let Aforo's scheduler trigger automatically at period close.

Creating a Bill Run

  1. Navigate to Pricing Studio → Invoices → Bill Runs
  2. Click + New Bill Run
  3. Select the billing period
  4. Click Execute

Aforo processes each customer subscription, calculates charges using the 10-stage billing pipeline, and generates individual invoices.

Billing Pipeline Stages

Quota Check → Rollover → Aggregate → Allowance → Rate →
Commit → Discount → Tax → Route → Settle
StageWhat it Does
Quota CheckEnforces hard usage caps
RolloverApplies carried-over included quota
AggregateSums raw metered usage events
AllowanceSubtracts included free quantities
RateApplies pricing model calculations
CommitEnforces minimum spend / maximum spend
DiscountApplies percentage or fixed discounts
TaxCalculates tax via the Avalara provider (or $0 when no provider is configured)
RouteSplits between wallet and invoice
SettleCreates invoice line items and commits

Credit Notes

Issue credit notes to refund or adjust charges:

  1. Draft the credit note with amount and reason
  2. Issue it to make it customer-visible
  3. Apply to Invoice to reduce the outstanding balance

If applying a credit note brings an invoice to $0, it is automatically marked PAID.

curl -X POST https://billing.aforo.ai/api/v1/credit-notes \
  -H "Authorization: Bearer $AFORO_API_KEY" \
  -H "X-Tenant-Id: $TENANT_ID" \
  -d '{
    "invoiceId": "inv_abc123",
    "amount": 50.00,
    "reason": "PRORATION",
    "description": "Pro-rated refund for plan downgrade"
  }'

ERP Integration

Sync invoices automatically to your accounting system:

ERPAuth Method
QuickBooksOAuth 2.0
XeroOAuth 2.0 + PKCE
NetSuiteToken-Based Auth (TBA)
Custom WebhookHMAC-SHA256
ℹ

The single-ERP invariant is per billing entity — each legal entity can wire its own ERP (Acme US → QuickBooks, Acme EU → Xero). There is no separate "multi-ERP mode" toggle; you get multiple ERPs by giving each billing entity its own connection.

Connect an ERP:

  1. Go to Pricing Studio → Invoices → ERP Sync
  2. Select your ERP provider
  3. Complete the OAuth flow
  4. Aforo syncs finalized invoices on the connection's configured schedule (sync frequency + time), retrying failed syncs with backoff

Tax Engine

Tax is computed through a pluggable provider. The shipped provider is Avalara AvaTax; when no provider is configured the default returns $0 (a no-op), preserving untaxed behaviour. Avalara quotes are cached for 24 hours per unique line-item combination, and voiding an invoice fans the void out to Avalara so the transaction is reversed there too.

Other providers (e.g. Vertex) are a provider-interface extension — not shipped today; add one when a customer needs it.

CSV Export

Export invoices for manual import into any accounting or reporting system: