dolfindevelopers

Receipt match card

ComponentExpensesSDK + UI

The card transaction a receipt is paired with, with a link to the expense; while unmatched, the closest card transactions with their match score and a Match button (the top three, the weaker ones one click away). Footer rows for upload date, source and file name.

Component: A piece you place inside your own screens: a table, a form, a card or a dialog. You decide the layout around it. Pages vs components

Choose your integration

Ready to connect to Dolfin. Loads data through SDK hooks, with appearance and behaviour you can customise. Requires DolfinProvider.

Loading preview…

Installation

Needs the Dolfin registry token. The CLI copies the source into your app.

Terminal
bunx --bun shadcn@4.23.0 add @dolfin/expenses-receipt-match-card

Also installs: button, card, expenses-receipt-parts, base-money, base-states, base-theme, ui-expenses-receipt-match-card.

Usage

screen.tsx
import { ReceiptMatchCard } from "@/components/dolfin/expenses/receipt-match-card";

// Place it anywhere inside your <DolfinProvider>.
<ReceiptMatchCard receipt={receipt} />

Renders inside DolfinProvider (set it up once). By default it loads its own data through the SDK. Supplied-data examples show how to override that behavior.

API reference

PropTypeDescription
receipt required{ id?: string; organisationId?: string; fileName?: null | string; contentType?: null | string; fileSizeBytes?: number | string; source?: com…
candidatesreadonly { cardTransactionId?: null | string; expenseId?: null | string; receiptId?: null | string; score?: number | string; withinAmountTol…Candidates you already hold: shown as given, nothing is fetched. Read for the receipt when omitted.
loadingboolean
errorError
onRetry() => void
onMatch(expenseId: string) => voidShows Match on each candidate. Wired to the SDK when the card reads its own candidates.
pendingIdstring
getExpenseRoute(expenseId: string) => DolfinRoute | nullWhere "Open the expense" goes; the expense page by default. Return null to hide the button.
metastring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Extra rows under Uploaded, Source and File.
classNamestring

Customisation

Without editing the source, you can change:

Class names
className
Messages
expenses.receipts

Or edit the installed file directly: it is your code. See theming for colours and fonts.

Hooks

The SDK hooks this component uses. Use them directly from @dolfinai/react to build your own version.

useDolfinLocaleuseMessagesuseReceiptMatchCandidatesuseReceiptMutations

Files

Written to your app by the install command:

  • components/dolfin/expenses/receipt-match-card.tsx 269 lines