Preview. Stack v4.0 has not been released, and what is documented here can still change before it does. The current release is v3.2, which covers this as Payments.Go to v3.2
Connectivity

What Connectivity Models

How a connector represents provider activity in Ledger: accounts, transactions, metadata, and reported balances.

A connector turns each provider record into accounts, transactions, and metadata in Ledger. For example, Stripe Payments keeps your available Stripe balance in stripe:<account>:balance:main and processing fees in stripe:<account>:fees:processing:main. A Stripe fee becomes a transaction that books the fee to the fees account, with the Stripe IDs and timestamps attached as metadata.

Each connector builds a model that fits its provider. A card payment, a bank statement line, and a cloud bill are recorded in their own terms, with their own units and timing.

What a connector profile contains#

Each connector has a profile: the rules that decide which Ledger accounts, transactions, and metadata each provider record becomes.

Not every record moves money. Stripe Payments records a charge changing state on a separate lifecycle account, so the state change never alters a money balance. A connector can also record measured quantities, such as compute time, in their own units.

Profile elementWhat it defines
Chart of accountsThe account addresses the connector uses: positions held at the provider, counterparties, fees, and accounts that track a record through its lifecycle.
Numscript templatesThe balanced postings for each kind of record that moves value or a measured quantity.
MetadataThe provider details and context attached to accounts and transactions, including information that has no posting of its own.
Prepared queries and indexesReady-made ways to look up records for operations, reporting, and comparison with other systems.
Assets and precisionThe unit of each amount, monetary or not, and the precision Ledger stores it with.

What metadata tells you#

Connectors follow shared metadata conventions, so the same kinds of information look alike from one provider to the next. The fields you get depend on the connector release you installed, the scope you configured, and what the provider exposes.

InformationWhat you can expect to learn
Provider factsThe provider's own objects, accounts, statuses, and references, with the meaning the provider gives them.
Observation contextWhich source and scope the record came from, when the connection read it, and the provider's own time when there is one. The two times can differ.
Shared interpretationHow the connector classifies the activity or account, such as its accounting role or lifecycle stage. This is the connector's reading, kept apart from what the provider stated.
Recording provenanceWhich connector and mapping produced the record.
Supporting evidenceBusiness records or report content kept alongside the queryable fields. Some connectors keep a normalized version in place of the original record.
Reported balancesWhere the connector supports it, the balance the provider reported at a point in time: its value, balance type, asset, and time. It is stored apart from the balance Ledger builds.

Transaction metadata describes one recorded activity. Account metadata, where present, describes the account or the latest report about it. Not every account carries metadata, so look at the transaction when you need the context of a movement.

A common structure does not make providers equivalent. A status or a balance type can mean something different at each provider, so compare values across providers with care. Two distinctions help when you read a record. A value that the connector derived is not a statement from the provider. The time a record was read can be later than the time the activity happened.

To learn what your own connection supplies, look up a few provider records you already know once the connection is running.

A connector update applies to what the connection writes from then on. Existing transactions keep the metadata they were written with. Account metadata can still change as newer reports arrive.

Three kinds of record#

Provider records fall into three broad kinds, and each is recorded differently. A connector may handle only some of them. Its catalog entry says which ones, and how.

Kind of recordHow it can be recordedWhat to keep in mind
MovementBalanced postings between accounts, linked to the source record.Which position changed, by how much, and in which unit.
Lifecycle changeA record of the status change, with postings only when the model calls for them.A status change alone does not establish that value moved or settled.
Measurement or snapshotA measured quantity or metadata, depending on the model.The scope, unit, and time of the reading, and whether it is a change or a point-in-time value.

Sometimes two sources report the same activity, such as a payment provider and the bank that receives its payout. Decide which source supplies each effect, so that your internal model counts it once. Matching records across sources and deciding how to handle differences stay with your own controls.

Two views of a balance#

When a connector records reported balances, an account can show two figures for the same point in time:

Built by Ledger: 1,240 USD

The result of the postings recorded on the account up to that time. It changes only when the connection records a movement on the account.

Reported by the provider: 1,250 USD

The figure the provider gave, stored separately with its context. Recording it never changes the balance built from postings.

Connectivity records both figures. It does not explain the 10 USD gap. Before you treat the gap as a discrepancy, check three things:

  • The two figures measure the same thing: the same accounts, unit, and balance type (available or pending, for example), read with the connector's sign and precision conventions. The connector's Coverage and Ledger Model tabs describe them.
  • The two figures refer to the same time, and the reported value is recent. A missing or stale report is different from a reported zero.
  • Ledger has the full history. An unknown opening position or incomplete activity can explain a difference. Equal totals do not prove that the history is complete.

Connectivity does not reconcile for you

Not every provider exposes a balance, and not every connector records one. Where a reported balance exists, it gives your reconciliation a figure to compare against. Choosing a tolerance, posting an adjustment, and deciding how to resolve a difference remain your decisions.

Different units keep separate balances#

Ledger balances each asset on its own. If a connector records GPU time and its cost, each is a separate balanced movement, and the source record or a declared rate links the two. An amount in one unit never offsets an amount in another.

Explore domains

See how activity from other industries could be modeled, by system, activity, and unit. The explorer is a design aid. The catalog lists the connectors you can install.

What a connector cannot do#

A connector records what its provider exposes, within its documented coverage. It cannot recover facts that the provider does not expose, establish an opening position without evidence, or make two different balance definitions comparable. Plan your own controls around these limits, and check each connector's Coverage tab for the specifics.

Next, read How Connectivity Works for checkpoints and retries, or open the Connector Catalog to see a real connector's model.