Conversions#

Track conversion events attributed to influencer marketing activities.

Provider required

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

useListConversions#

List conversion events with pagination, search, and sorting.

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

const { data, isLoading } = useListConversions({
  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.
searchTermstringFree-text search term to filter results (max 200 characters).
sortBystringColumn name to sort by.
sortDirection'asc' | 'desc'Sort direction: ascending or descending.
sourceIdstring (UUID)Filter by conversion source identifier.

Response#

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

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

useConversion#

Retrieve a single conversion by ID.

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

const { data, isLoading } = useConversion({
  id: 'abc-123',
});

Parameters#

NameTypeRequiredDescription
idstring (UUID)RequiredConversion identifier.

Response#

Returns { data } with the result.

Underlying SDK method: bw.conversions({ id })

useCreateConversion#

Record a new conversion event attributed to a conversion source, with optional external reference for deduplication and metadata.

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

const { mutate, isPending } = useCreateConversion();

mutate({
  organizationId: 'org_123',
  sourceId: '...',
  convertedAt: '...',
});

Parameters#

NameTypeRequiredDescription
organizationIdstring (UUID)RequiredOrganization identifier.
sourceIdstring (UUID)RequiredConversion source this event is attributed to.
convertedAtstring (ISO 8601)RequiredWhen the conversion occurred.
countintegerNumber of conversions in this event (must be greater than zero, defaults to 1, max 1M).
originstringOrigin or channel of the conversion, e.g. "website", "app" (max 50 characters).
externalRefstringExternal reference identifier for deduplication (max 255 characters).
metadataobjectArbitrary key-value metadata (max 50 keys, keys max 64 characters).

Response#

Returns { data } with the result.

Underlying SDK method: bw.conversions.create(params)

useUpdateConversion#

Update a conversion record, including its origin, external reference, metadata, and attribution details.

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

const { mutate, isPending } = useUpdateConversion();

mutate({
  id: 'abc-123',
});

Parameters#

NameTypeRequiredDescription
idstring (UUID)RequiredConversion identifier to update.
sourceIdstring (UUID)Updated conversion source.
convertedAtstring (ISO 8601)Updated conversion timestamp.
countintegerUpdated conversion count (must be greater than zero, max 1M).
originstringUpdated origin (max 50 characters).
externalRefstring | nullUpdated external reference (max 255 characters).
metadataobject | nullUpdated metadata (max 50 keys, keys max 64 characters).

Response#

Returns { data } with the result.

Underlying SDK method: bw.conversions.update(params)

useDeleteConversion#

Permanently delete a conversion record.

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

const { mutate, isPending } = useDeleteConversion();

mutate({
  id: 'abc-123',
});

Parameters#

NameTypeRequiredDescription
idstring (UUID)RequiredConversion identifier to delete.

Response#

Returns { data } with the result.

Underlying SDK method: bw.conversions.delete(params)