Accounts & Integrations
Architecture

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

FieldRequiredRules
first_name, last_nameNoEncrypted at rest
emailNoValid email format if provided; encrypted
phoneNoEncrypted
company_nameNoString
external_idNoString (for ERP linking)
tagsNoArray of strings
timezoneNoString
communication_preferencesNoObject: {email, sms, voice, do_not_disturb} booleans
custom_fieldsNoJSONB dict

Invoice (Account) field validations

FieldRequiredRules
invoice_numberYesString, indexed
customer_idYesUUID
amountYesDecimal(10,2)
due_dateYesDate
issue_dateYesDate
currencyNoDefault: USD
paid_amountNoDefault: 0.00
statusNoDefault: not_assigned
sourceNoEnum: api, sheets, in_app
payment_termsNoInt, default: 30 (days)
description, line_items, notesNoEncrypted
custom_fieldsNoJSONB
is_written_offNoBoolean, 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.