Invoicing
Lists, creates, edits and acts on an organization's invoices, including sending by email and recording payments.
Part ofFinOps
Lists, creates, edits and acts on an organization's invoices, including sending by email and recording payments.
Quick Start
import { ReceivablesWidget } from '@tesouro/embedded-components-react';
export function ReceivablesPage({ widgetToken }: { widgetToken: string }) {
return (
<ReceivablesWidget
baseUrl="https://api.tesouro.com"
widgetToken={widgetToken}
organizationId="org_..."
/>
);
}The widget loads the first page once auth and organization scope resolve, and opens its own sheets and dialogs for details, create/edit, send and payment.
Behaviour
- This replaces the earlier
InvoicingWidget, which tookpageTitleComponentandfinopsThemeColors. Neither exists now: pass your page title asheaderStart. - The widget handles invoices only: there are no quote or credit-note tabs, and create always makes an invoice.
- After a create succeeds, the widget calls
onReceivableCreated. A duplicate does not call it, as in the legacy widget. A duplicate, draft or recurring series opens its details. Issuing an invoice doesn't: a follow-up modal offers to email it when the customer has an email address. After any create, the modal also offers to save typed items that aren't in the catalog as products. - The list matches the Monite one: due date, status, number, customer, issue date and amount, with "Pending" for a number or date not yet set. It opens sorted by due date, newest first, and clearing a sort returns to that order. With no status picked, it hides canceled, recurring and failed invoices.
- Changing sort, page size, any filter or search returns to the first page.
- A filter bar offers search, plus a Filters menu for due date, created on and issue date ranges, multi-select status, amount (exact or range) and customer. Each applied filter shows as a dismissible chip, and Clear all removes every one.
- The widget renders no heading of its own. Pass your page title as
headerStart, and the sponsor bank's logo asbankAttributionfor the "Business Banking provided by" line beneath it. Both sit in a header row with the invoice settings button and "Create Invoice". - The widget reads the widget token's scopes. Without
invoice:read:orgit shows an access-restricted state instead of the list. Withoutinvoice:write:orgit hides Create and the details panel's actions, so a read-only user can browse and open invoices but not change them. The invoice settings button needsorganization_settings:write:orgas well as a handler. - The invoice form sets payment reminders (before the due date and overdue); issuing is blocked when the customer has reminders off or no email.
Props
Widget props
Each label prop is merged over the English defaults, so pass only the strings you want to change.
See the exported label types listed under TypeScript for every key.
| Prop | Type | Default | Description |
|---|---|---|---|
initialView | 'create' | undefined | Opens the create-invoice form once on mount, when the user can create invoices. Closing it does not reopen it. |
initialCounterpartId | string | undefined | With initialView: 'create', preselects this customer in that first create form only. Otherwise, opens the invoice list filtered to this customer, with a chip naming them. Clear all removes it. |
pageSizeOptions | number[] | [10, 25, 50, 100] | Rows-per-page choices. The first page loads at the first choice, or 10 when the list is empty. |
onReceivableCreatedEvent |
| undefined | Called after a create succeeds. Not called for a duplicate. |
onReceivableOpenedEvent |
| undefined | Called when the user opens a row's details panel. |
onTemplateSettingsClickEvent | () => void | undefined | Shows the invoice settings button in the header, for users holding organization_settings:write:org, and calls this when it is clicked. |
headerStartSlot | ReactNode | undefined | Rendered at the start of the header row. The widget renders no heading of its own, so pass your page title here. |
bankAttribution | ReceivableBankAttribution | undefined | { logoSrc, logoAlt } for the sponsor bank. Shows "Business Banking provided by" and the logo under headerStart. |
embeddedBankName | string | undefined | Sponsor bank name shown as "Powered by {embeddedBankName}" next to embedded accounts in the invoice payment-account picker. Omitted when unset. |
Label overrides
| Prop | Type | Default | Description |
|---|---|---|---|
screenLabelsLabels | ReceivablesScreenLabelOverrides | English labels | Header, table, empty, error and status badge copy. |
filterBarLabelsLabels | InvoicesFilterBarLabelOverrides | English labels | Invoice filter bar copy: field names, search, amount bounds, the customer panel and Clear all. |
filterLabelsLabels | InvoicesFilterLabelOverrides | English labels | Invoice filter copy built from state: date presets, status descriptions and chip wording. |
formLabelsLabels |
| English labels | Create/edit form copy, including the unsaved-changes prompt; the save and issue buttons are in messageLabels. |
previewLabelsLabels | Partial<ReceivablePreviewLabels> | English labels | Copy of the live invoice preview beside the create/edit form. |
detailsLabelsLabels |
| English labels | Details panel copy. Status badge copy comes from screenLabels.statusBadge. |
auditHistoryLabelsLabels |
| English labels | Audit history row copy. Document and status names follow messageLabels and screenLabels.statusBadge unless overridden here. |
paymentLabelsLabels |
| English labels | Manual payment dialog copy. |
actionLabelsLabels |
| English labels | Confirmation dialog buttons; per-action titles come from messageLabels. |
actionsModalLabelsLabels |
| English labels | Copy of the modal shown after a create, and of its email step on Send for an issued invoice: the email step and the save-items-as-products step. Its titles, email-step dismiss buttons, toasts and select-all toggle are in messageLabels. |
counterpartFormLabelsLabels |
| English labels | Inline customer creation copy. |
measureUnitsLabelsLabels |
| English labels | Measure-unit manager copy. |
measureUnitDeleteLabelsLabels |
| English labels | Measure-unit delete confirmation copy. |
messageLabelsLabels | Partial<ReceivableMessageLabels> | English labels | Validation, fallback, details panel, reminder and confirmation messages, including the form's save and issue buttons and a new reminder's subject and body. |
productMessageLabelsLabels | Partial<ProductMessageLabels> | English labels | Product validation and error messages, and the measure-unit toasts. |
counterpartMessageLabelsLabels | Partial<CounterpartMessageLabels> | English labels | Customer validation and error messages. |
Examples
With a page title and bank attribution
<ReceivablesWidget
headerStart={<h1>Invoicing</h1>}
bankAttribution={{ logoSrc: bankLogoUrl, logoAlt: `${bankName} logo` }}
onTemplateSettingsClick={() => router.push('/settings/invoice')}
/>Custom labels
<ReceivablesWidget
screenLabels={{
createInvoiceButton: 'New invoice',
statusBadge: { issued: 'Sent', partially_paid: 'Part paid' },
}}
messageLabels={{ genericError: 'Unable to complete this action.' }}
/>TypeScript
import type {
ReceivablesWidgetProps,
ReceivableDocumentType,
ReceivablesScreenLabels,
ReceivablesScreenLabelOverrides,
ReceivableStatusBadgeLabels,
InvoicesFilterBarLabelOverrides,
InvoicesFilterLabelOverrides,
ReceivableFormDialogLabels,
ReceivablePreviewLabels,
ReceivableDetailsPanelLabels,
ReceivableDetailsPanelLabelOverrides,
ReceivablePaymentDialogLabels,
ReceivableActionDialogLabels,
ReceivableActionsModalLabels,
ReceivableBankAttribution,
ReceivableMessageLabels,
CounterpartFormSheetLabels,
CounterpartMessageLabels,
MeasureUnitsManagerLabels,
MeasureUnitDeleteDialogLabels,
ProductMessageLabels,
} from '@tesouro/embedded-components-react';