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#
| Name | Type | Required | Description |
|---|---|---|---|
| pageIndex | integer | Required | Zero-based page index for pagination. |
| pageSize | integer | Required | Number of items per page (1-100). |
| organizationId | string (UUID) | Required | Organization identifier. |
| activityId | string (UUID) | — | Filter by activity identifier. |
| creatorId | string (UUID) | — | Filter by creator identifier. |
| campaignId | string (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#
| Name | Type | Required | Description |
|---|---|---|---|
| organizationId | string (UUID) | Required | Organization identifier. |
| activityId | string (UUID) | — | Filter by activity identifier. |
| creatorId | string (UUID) | — | Filter by creator identifier. |
| campaignId | string (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#
| Name | Type | Required | Description |
|---|---|---|---|
| pageIndex | integer | Required | Zero-based page index for pagination. |
| pageSize | integer | Required | Number of items per page (1-100). |
| organizationId | string (UUID) | Required | Organization 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.