Skip to content

app.org_legal_entities

TableRow level security on

Legal entities an org trades as, with their tax identifier, fiscal year start and base currency (Section 4.5.6 item 3, Section 7.3). One live entity per org is primary and is printed on generated documents. The tax identifier is Restricted and encrypted: read it through app.org_legal_entities_masked.

Primary key: id

Columns of app.org_legal_entities
ColumnTypeNullableDescription
iduuidNoPrimary key, UUID v7.
org_iduuidNoOwning org. A row never moves to another org.References app.organizations.id
legal_nametextNoRegistered legal name, for example Northwind Live LLC. Unique per org among live entities.
country_codecharacter(2)NoISO 3166-1 alpha-2 country of registration.
tax_identifierbyteaYesTax identifier (EIN, VAT or GST number) encrypted with pgp_sym_encrypt under the Vault key xos_org_tax_identifier_key. Restricted (data.restricted.read.tax): never selectable or writable by signed-in callers; written through app.set_org_legal_entity_tax_identifier and read through app.org_legal_entities_masked.
tax_identifier_last4textYesLast four characters of the tax identifier, shown to every reader; NULL when none is recorded.
fiscal_year_start_monthsmallintNoMonth the entity's fiscal year starts, 1 for January through 12 for December.
base_currencycharacter(3)NoISO 4217 currency the entity keeps its books in.References private.currencies.currency_code
is_primarybooleanNoTrue for the org's primary entity, printed on generated documents. Exactly one live entity per org is primary once any exists.
deleted_attimestamp with time zoneYesSoft delete time. A row with deleted_at set is ignored by every access helper.
created_attimestamp with time zoneNoWhen the row was inserted. Set by the database.
created_byuuidYesPerson who inserted the row, or null for a platform process. Set by the database.References app.people.id
updated_attimestamp with time zoneNoWhen the row last changed. Set by the database.
updated_byuuidYesPerson who last changed the row, or null for a platform process. Set by the database.References app.people.id