Costs#

Read-only access to cost records across activities for reporting and analysis.

Provider required

All hooks require a BrandwaveProvider ancestor in your component tree. See the React Hooks overview for setup instructions.

useListCosts#

List cost records across activities, including creator details.

typescript
import { useListCosts } from '@brandwave/react';

const { data, isLoading } = useListCosts({
  pageIndex: 0,
  pageSize: 25,
  organizationId: 'org_123',
});

Parameters#

NameTypeRequiredDescription
pageIndexintegerRequiredZero-based page index for pagination.
pageSizeintegerRequiredNumber of items per page (1-100).
organizationIdstring (UUID)RequiredOrganization identifier.
activityIdstring (UUID)Filter by activity identifier.
creatorIdstring (UUID)Filter by creator identifier.
campaignIdstring (UUID)Filter by campaign identifier.

Response#

Returns { items, totalCount, facets } with paginated results.

Underlying SDK method: bw.costs.list(params)

useCountCosts#

Count cost records with optional activity and creator filters.

typescript
import { useCountCosts } from '@brandwave/react';

const { data, isLoading } = useCountCosts({
  organizationId: 'org_123',
});

Parameters#

NameTypeRequiredDescription
organizationIdstring (UUID)RequiredOrganization identifier.
activityIdstring (UUID)Filter by activity identifier.
creatorIdstring (UUID)Filter by creator identifier.
campaignIdstring (UUID)Filter by campaign identifier.

Response#

Returns { count } with the total number of matching records.

Underlying SDK method: bw.costs.count(params)

useListCostTypes#

Retrieve distinct cost type labels used across the organization.

typescript
import { useListCostTypes } from '@brandwave/react';

const { data, isLoading } = useListCostTypes({
  pageIndex: 0,
  pageSize: 25,
  organizationId: 'org_123',
});

Parameters#

NameTypeRequiredDescription
pageIndexintegerRequiredZero-based page index for pagination.
pageSizeintegerRequiredNumber of items per page (1-100).
organizationIdstring (UUID)RequiredOrganization identifier.

Response#

Returns { items, totalCount, facets } with paginated results.

Underlying SDK method: bw.costs.types.list(params)

Autocomplete

Use this endpoint to populate autocomplete suggestions when creating or editing cost records.