Billing Accounts
Billing accounts (BillingAccount) represent the financial relationship between an organization and its customer. Each account has subscriptions, invoices, payments, and payment methods.
Fields
| Field | Description |
|---|---|
| Organization | Owning organization (required) |
| Person | Associated customer (type=customer) |
| External ID | Identifier for integrations (unique per organization) |
| Currency | Billing currency (default: BRL) |
| Billing email | Email to receive invoices |
| Payment terms (days) | Payment deadline in days (default: 10) |
| Auto-charge | Whether invoices are charged automatically |
| Balance (cents) | Credit/debit balance of the account |
| Status | active, suspended, or closed |
Fiscal Configuration
| Field | Description |
|---|---|
| Tax exempt | Whether the customer is tax exempt |
| Exemption certificate | Tax exemption document |
| Customer tax type | Tax classification |
| Withhold ISS | ISS withholding flag |
| Withhold IRRF | IRRF withholding flag |
| Withhold CSRF | CSRF withholding flag |
| Withhold INSS | INSS withholding flag |
| Municipal registration | Municipal registration number |
Status and Lifecycle
active → suspended ↔ active
↓
closed
| Status | Description |
|---|---|
| active | Operational account |
| suspended | Suspended due to delinquency or manually. Subscriptions paused |
| closed | Permanently closed |
Suspension
- Sets
suspendedAtandsuspensionReason - All active subscriptions are paused
- Notification sent to the customer
- Can be reactivated manually
Closure
- All subscriptions must be inactive/canceled
- Permanent (soft delete via
deletedAt)
Uniqueness
- One billing account per customer per organization
- External ID unique per organization
- Customer document unique per organization
Statistics
The dashboard displays counters by status:
- Total accounts
- Active accounts
- Suspended accounts
- Accounts with active subscription