Sign in →

Invoices & Billing

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

Updated 2026-06-15Suggest 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 5 dunning steps. Write-off candidate.
VOIDCancelled before collection.

Line Item Types

Each invoice contains line items describing individual charges:

TypeDescription
CHARGEStandard usage or flat fee
USAGE_FEEMetered usage charge
SETUP_FEEOne-time activation fee
DISCOUNTApplied discount
TAX_ADJUSTMENTTax line
CREDITCredit note applied
PRORATIONMid-period adjustment

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 (Avalara AvaTax or Vertex)
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

By default, only one ERP can be connected at a time (single-ERP invariant). Enable multi-ERP mode in Settings → Billing → Advanced if you need simultaneous sync to multiple systems.

Connect an ERP:

  1. Go to Pricing Studio → Invoices → ERP Sync
  2. Select your ERP provider
  3. Complete the OAuth flow
  4. Aforo automatically syncs new invoices within 60 seconds of finalization

Tax Engine

Aforo integrates with:

  • Avalara AvaTax v2 — tax calculation and filing
  • Vertex O Series — enterprise tax management

Tax calculations are cached for 24 hours per unique line item combination. Override tax amounts directly on invoices if needed.

CSV Export

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