account

General account information.

Column name Description Data type
account Primary key.

The account uid. Internal account identifier, not exposed in Smile's UI or external APIs.

integer
usn Uniquely identifies the account. Used by Smile's SOAP API and message bus. text
company Company configuration identifier.

Reference to company.

smallint
alternate_account_number A user-defined alternative account number. This number can be used to link legacy account numbers during migration to Smile. text *
account_type The type of account.

Reference to account_type.

integer
account_terms The terms applied to this account.

Reference to account_terms.

integer
account_disposition The payment status (settled, etc) for this account.

Reference to account_disposition.

integer
discount The discount category applied to this account.

Reference to discount.

integer *
creation_time The time at which this account was created. timestamp with time zone
account_cost_centre The local cost centre for this account.

Reference to account_cost_centre.

integer *
description A user-definable description for the account. text *
taxable A boolean flag indicating if sales tax should be applied to transactions against this account. boolean
tax_schedule The applicable sales tax schedule to apply to this account.

Reference to tax_schedule.

integer
currency The currency that this account operates in.

Reference to currency.

character varying (3) *
timezone The timezone that this account operates in.

Reference to timezone.

integer
Note: The account information provided in this table does not include demographic information such as names and addresses - these can be obtained using the custom field functions listed elsewhere in this documentation.

The account table is most useful when joining multiple other tables together; for example, to find the balance and disposition of all accounts you might use:

SELECT usn(account), cf(account, 'contactNameFamily') AS "family name", cf(account, 'contactNameGiven') AS "given name", name AS "status", balance FROM account JOIN account_balance USING (account) LEFT JOIN account_disposition USING (account_disposition);



   usn     |  family name  |  given name   |   status   |   balance   
-----------+---------------+---------------+------------+------------
2142420872 | Bush          | George        | Settled    |    900.00
2142421037 | Bush          | George W      | Settled    |    900.00
2142420898 | Fraser        | Malcolm       | Settled    |    900.00
2142420914 | Clinton       | Bill          | Delinquent |    825.00