Products

Manages an organization's products and services: a filterable, sortable table with create, edit, view and delete flows, plus measure-unit management.

Part ofFinOps

Manages an organization's products and services: a filterable, sortable table with create, edit, view and delete flows, plus measure-unit management.


Quick Start

import { ProductsWidget } from '@tesouro/embedded-components-react';

export function ProductsPage() {
  return (
    <ProductsWidget
      baseUrl="https://api.tesouro.com"
      widgetToken={widgetToken}
      organizationId={organizationId}
    />
  );
}

You supply only auth and optional label overrides; the widget owns data, loading, pagination and permissions.

Behaviour

  • The widget gates on invoice scopes, not product:*. invoice:read:org is required to view it (otherwise it shows "Access restricted"); invoice:write:org enables create, edit, delete and measure-unit management. A token carrying only product:* scopes is denied.
  • Prices are entered and shown in major units (such as dollars); the widget converts to the API's minor units.
  • Only Name is sortable. The filter bar has a name search and a Filters menu with type (product/service) and measure unit, each applied filter shown as a removable chip; pagination is Previous/Next.
  • A product is edited inline in its details sheet. Save stays disabled until a field changes, and Cancel or a successful save return to the product's details.
  • Deleting a measure unit that products use shows a warning listing the affected products.
  • Products are priced in USD. There is no currency picker: a new product is created in USD, and editing an existing product keeps the currency it was saved with.
  • The form's unit picker selects an existing measure unit only. Units are created, renamed and deleted from the list's Manage units of measure button.
  • When the API rejects a save, each validation error appears under the field that caused it; anything that names no field appears above the form.

Props

Widget props

Each label prop is merged over the English defaults; nested label groups merge per group.

PropTypeDefaultDescription
pageSizeOptionsnumber[][10, 25, 50, 100]Rows-per-page choices.
Label overrides
PropTypeDefaultDescription
screenLabelsLabelsPartialDeep<ProductsScreenLabels>English labelsTable/header/filter/empty/error copy.
formLabelsLabels
PartialDeep<ProductFormSheetLabels>
PartialDeep<ProductFormSheetLabels>
English labelsCreate sheet and inline edit form copy.
detailsLabelsLabels
PartialDeep<ProductDetailsSheetLabels>
PartialDeep<ProductDetailsSheetLabels>
English labelsDetails sheet copy.
deleteLabelsLabels
Partial<ProductDeleteDialogLabels>
Partial<ProductDeleteDialogLabels>
English labelsProduct delete confirmation copy.
measureUnitsLabelsLabels
Partial<MeasureUnitsManagerLabels>
Partial<MeasureUnitsManagerLabels>
English labelsMeasure-units manager copy.
measureUnitDeleteLabelsLabels
Partial<MeasureUnitDeleteDialogLabels>
Partial<MeasureUnitDeleteDialogLabels>
English labelsMeasure-unit delete confirmation copy.
messageLabelsLabelsPartial<ProductMessageLabels>English labelsValidation, error and toast messages produced by the widget.

TypeScript

import type {
  ProductsWidgetProps,
  ProductsScreenLabels,
  ProductFormSheetLabels,
  ProductDetailsSheetLabels,
  ProductDeleteDialogLabels,
  MeasureUnitsManagerLabels,
  MeasureUnitDeleteDialogLabels,
  ProductMessageLabels,
} from '@tesouro/embedded-components-react';

On this page