dolfindevelopers

Invoice payments

ComponentReceivablesSDK + UI

Payments received against an invoice (date, method, payer, reference, status, amount and receipt), with loading, empty and error states and a Record button for off-platform payments.

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/ar-invoice-payments

Also installs: badge, button, table, base-info-hint, base-money, base-states, ar-record-payment-dialog, ui-ar-invoice-payments.

Usage

screen.tsx
import { InvoicePayments } from "@/components/dolfin/ar/invoice-payments";

// Place it anywhere inside your <DolfinProvider>.
<InvoicePayments />

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
invoiceIdstringLoads the invoice's payments and offers Record payment when the role and the invoice's state allow it.
paymentsreadonly { id?: string; invoiceId?: string; organisationId?: string; accountingSync?: null | components["schemas"]["AccountingDocumentSyncRe…Your own payments: the card then makes no request.
invoicePick<{ id?: string; organisationId?: string; customerId?: string; documentNumber?: null | string; currency: string; issueDate?: string; dueD…The invoice the payments are for (its state picks the empty message).
loadingboolean
errorError
onRetry() => void
onRecordPayment() => voidShows Record payment (with your own payments); open your own dialog from it.
recordPaymentDisabledReasonstringWhy Record payment is unavailable; disables it and says why beside it.
headerActionsstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…More buttons in the card header (for example payment-link tools).
renderPaymentMeta(payment: InvoicePayment) => ReactNodeExtra content under a payment's amount, e.g. an accounting sync badge.
classNamestring

Customisation

Without editing the source, you can change:

Class names
className
Messages
ar.invoice.deniedar.invoice.paymentsbase.infoHint.moreAbout

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.

useDolfinLocaleuseInvoiceuseInvoicePaymentsuseInvoicePermissionsuseMessages

Files

Written to your app by the install command:

  • components/dolfin/ar/invoice-payments.tsx 121 lines