@get-asset/sdk

Account Checks

Headless compound for the checks written on one bank account. Each check reads as not cleared, not cleared past 90 days (one the payee may never cash, worth chasing), cleared or voided, with the date it settled. The footer counts what was still open when last month closed, which is what the month’s reconciliation allows for. The styled AssetStatementReconciliation shows it on the account’s Checks tab.

Anatomy

Import the primitive and compose the parts you need.

<AccountChecks.Root accountId={accountId}>
<AccountChecks.Loading>…</AccountChecks.Loading>
<AccountChecks.Error>
<AccountChecks.ErrorMessage />
<AccountChecks.Retry>Try again</AccountChecks.Retry>
</AccountChecks.Error>
<AccountChecks.Empty>…</AccountChecks.Empty>
<AccountChecks.Success>
<AccountChecks.Rows>
<AccountChecks.Row>
<AccountChecks.CheckNumber />
<AccountChecks.IssuedAt />
<AccountChecks.Payee />
<AccountChecks.Status />
<AccountChecks.DaysOpen />
<AccountChecks.Amount />
</AccountChecks.Row>
</AccountChecks.Rows>
</AccountChecks.Success>
<AccountChecks.NotClearedCount /> not cleared on <AccountChecks.AsOf />
<AccountChecks.NotClearedTotal />
<AccountChecks.UploadInput />
</AccountChecks.Root>

Required scopes

The access token used by AssetProvider must include these scopes for this primitive to fetch data successfully:

  • check:read
  • document:create

API reference

Root props

PropTypeDefaultDescription
accountIdrequiredstring—The bank account the checks were drawn on.
reconciledThroughstring | null—The account's last reconciled month (YYYY-MM). The footer counts open checks to its end; without one, to the end of last month.
checksCheckPublic[]—Override the fetched checks (testing/storybook).
checksToMatchstring[]—With checks: the ids of those whose bank payment is waiting to be matched (testing/storybook).
nownumber—“Today”, for ages and the footer (testing/storybook).
state"loading" | "error" | "empty"—Force a state for testing.
childrenrequiredReactNode—Compound parts.

Parts

States

PartDescription
AccountChecks.Loading / Error / Success / EmptyState gates for the checks.
AccountChecks.ErrorMessage / Retry
asChild?, format?
Error copy and retry.

Checks

Oldest first, as a register is kept.

PartDescription
AccountChecks.Rows / Row
asChild?
Iterates the checks. Row sets data-state (not_cleared | stale | cleared | voided) and data-tone (action | neutral | done | void).
AccountChecks.CheckNumber / IssuedAt / Payee
asChild?, format?
The check as written.
AccountChecks.Status
asChild?, format?
“Cleared Aug 7”, “Not cleared, past 90 days”, “Payment to match”. format receives the row; checkStateLabel words it. Sets data-state and data-tone.
AccountChecks.RowIs
state
Renders its children when the row is in one of the states: not_cleared, stale, to_match, cleared, voided.
AccountChecks.DaysOpen
asChild?, format?
Days since it was written, while it is open. Nothing once settled, or once its payment is waiting to be matched.
AccountChecks.Amount
asChild?, format?
Signed like the account: a check written is money out.

Footer

PartDescription
AccountChecks.NotClearedCount / NotClearedTotal / AsOf
asChild?, format?
Checks still open at the end of the last reconciled month (else last month), their total, and that day. One cleared since still counts.
AccountChecks.UploadInput / Uploading / NotUploading / UploadErrorMessageUpload check images for the account; each is read into a check.

Hooks

PartDescription
useAccountChecks() / useAccountChecksRow()The context, and the check being iterated.