@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:readdocument:create
API reference
Root props
| Prop | Type | Default | Description |
|---|---|---|---|
accountIdrequired | string | — | The bank account the checks were drawn on. |
reconciledThrough | string | 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. |
checks | CheckPublic[] | — | Override the fetched checks (testing/storybook). |
checksToMatch | string[] | — | With checks: the ids of those whose bank payment is waiting to be matched (testing/storybook). |
now | number | — | “Today”, for ages and the footer (testing/storybook). |
state | "loading" | "error" | "empty" | — | Force a state for testing. |
childrenrequired | ReactNode | — | Compound parts. |
Parts
States
| Part | Description |
|---|---|
AccountChecks.Loading / Error / Success / Empty | State gates for the checks. |
AccountChecks.ErrorMessage / RetryasChild?, format? | Error copy and retry. |
Checks
Oldest first, as a register is kept.
| Part | Description |
|---|---|
AccountChecks.Rows / RowasChild? | Iterates the checks. Row sets data-state (not_cleared | stale | cleared | voided) and data-tone (action | neutral | done | void). |
AccountChecks.CheckNumber / IssuedAt / PayeeasChild?, format? | The check as written. |
AccountChecks.StatusasChild?, 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.RowIsstate | Renders its children when the row is in one of the states: not_cleared, stale, to_match, cleared, voided. |
AccountChecks.DaysOpenasChild?, format? | Days since it was written, while it is open. Nothing once settled, or once its payment is waiting to be matched. |
AccountChecks.AmountasChild?, format? | Signed like the account: a check written is money out. |
Footer
| Part | Description |
|---|---|
AccountChecks.NotClearedCount / NotClearedTotal / AsOfasChild?, 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 / UploadErrorMessage | Upload check images for the account; each is read into a check. |
Hooks
| Part | Description |
|---|---|
useAccountChecks() / useAccountChecksRow() | The context, and the check being iterated. |