Architecture
This page describes how Agile Receivables models customers, accounts, campaigns, payments, and disputes, and how external systems integrate with the API.
High-level system diagram
Entity relationship diagram
Customer field validations
| Field | Required | Rules |
|---|---|---|
first_name, last_name | No | Encrypted at rest |
email | No | Valid email format if provided; encrypted |
phone | No | Encrypted |
company_name | No | String |
external_id | No | String (for ERP linking) |
tags | No | Array of strings |
timezone | No | String |
communication_preferences | No | Object: {email, sms, voice, do_not_disturb} booleans |
custom_fields | No | JSONB dict |
Invoice (Account) field validations
| Field | Required | Rules |
|---|---|---|
invoice_number | Yes | String, indexed |
customer_id | Yes | UUID |
amount | Yes | Decimal(10,2) |
due_date | Yes | Date |
issue_date | Yes | Date |
currency | No | Default: USD |
paid_amount | No | Default: 0.00 |
status | No | Default: not_assigned |
source | No | Enum: api, sheets, in_app |
payment_terms | No | Int, default: 30 (days) |
description, line_items, notes | No | Encrypted |
custom_fields | No | JSONB |
is_written_off | No | Boolean, default: false |
Invoice status lifecycle
Multi-tenant and workspace model
Company= workspace.- API keys are permanently bound to one company/workspace.
- Users can be members of multiple companies with different roles.
- All data queries are implicitly filtered by
company_id. - Scopes are per-key, not per-tenant.