# Reference

Definitions of all components in the Twisp Accounting Core and GraphQL API.

## Reference Sections

- [Ledger](https://www.twisp.com/docs/reference/ledger.md): Ledger resources in the Twisp accounting core.
- [ACH](https://www.twisp.com/docs/reference/ach.md): ACH resources in the Twisp accounting core.
- [GraphQL](https://www.twisp.com/docs/reference/graphql.md): Type definitions for the full GraphQL schema.
- [Actions](https://www.twisp.com/docs/reference/actions.md): Actions, tools, skills, models, agents, sessions, MCP servers, and their executions.
- [API](https://www.twisp.com/docs/reference/api.md): Key components and concepts for interacting with the API.
- [CEL](https://www.twisp.com/docs/reference/cel.md): Packages and functions available in the common expression language runtime.

## Type Diagrams

Use these diagrams for a high-level overview of the type system within the Twisp ledger.

### Basic Relationships

Simplified type relationship diagram showing basic connections between types.

- [Journals](https://www.twisp.com/docs/reference/graphql/types/object.md#journal) have many [Transactions](https://www.twisp.com/docs/reference/graphql/types/object.md#transaction) and [Entries](https://www.twisp.com/docs/reference/graphql/types/object.md#entry)
- [Transactions](https://www.twisp.com/docs/reference/graphql/types/object.md#transaction) are defined by their [TranCode](https://www.twisp.com/docs/reference/graphql/types/object.md#tran-code) and write multiple [Entries](https://www.twisp.com/docs/reference/graphql/types/object.md#entry) to the ledger.
- [Transactions](https://www.twisp.com/docs/reference/graphql/types/object.md#transaction) can be linked to other correlated [Transactions](https://www.twisp.com/docs/reference/graphql/types/object.md#transaction)
- [Entries](https://www.twisp.com/docs/reference/graphql/types/object.md#entry) are written to a specific [Account](https://www.twisp.com/docs/reference/graphql/types/object.md#account) and [Journal](https://www.twisp.com/docs/reference/graphql/types/object.md#journal)
- [Accounts](https://www.twisp.com/docs/reference/graphql/types/object.md#account) roll up a [Balance](https://www.twisp.com/docs/reference/graphql/types/object.md#balance) of all [Entries](https://www.twisp.com/docs/reference/graphql/types/object.md#entry) for each [Journal](https://www.twisp.com/docs/reference/graphql/types/object.md#journal)
- [Account Sets](https://www.twisp.com/docs/reference/graphql/types/object.md#account-set) are groupings of [Accounts](https://www.twisp.com/docs/reference/graphql/types/object.md#account) and/or other [Account Sets](https://www.twisp.com/docs/reference/graphql/types/object.md#account-set) which also roll up [Balances](https://www.twisp.com/docs/reference/graphql/types/object.md#balance)

![Simplified entity relationship diagram for Twisp core](https://www.twisp.com/docs/images/diagrams/core_erd_minimal.svg)

### Entity Relationship Diagram

Although the Twisp core is not a relational database, it does enforce referential integrity between related records and thus we can model it with an RDB-style ERD.

Only select fields for each type have been shown in this diagram to aid readability. For the full reference of each type, see the [GraphQL reference](https://www.twisp.com/docs/reference/graphql.md).

![RDB-style entity relationship diagram for Twisp core](https://www.twisp.com/docs/images/diagrams/core_erd.svg)
