Conversions#
Track conversion events attributed to influencer marketing activities.
Provider required
BrandwaveProvider ancestor in your component tree. See the React Hooks overview for setup instructions.useListConversions#
List conversion events with pagination, search, and sorting.
import { useListConversions } from '@brandwave/react';
const { data, isLoading } = useListConversions({
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. |
| searchTerm | string | — | Free-text search term to filter results (max 200 characters). |
| sortBy | string | — | Column name to sort by. |
| sortDirection | 'asc' | 'desc' | — | Sort direction: ascending or descending. |
| sourceId | string (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.
import { useConversion } from '@brandwave/react';
const { data, isLoading } = useConversion({
id: 'abc-123',
});Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| id | string (UUID) | Required | Conversion 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.
import { useCreateConversion } from '@brandwave/react';
const { mutate, isPending } = useCreateConversion();
mutate({
organizationId: 'org_123',
sourceId: '...',
convertedAt: '...',
});Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| organizationId | string (UUID) | Required | Organization identifier. |
| sourceId | string (UUID) | Required | Conversion source this event is attributed to. |
| convertedAt | string (ISO 8601) | Required | When the conversion occurred. |
| count | integer | — | Number of conversions in this event (must be greater than zero, defaults to 1, max 1M). |
| origin | string | — | Origin or channel of the conversion, e.g. "website", "app" (max 50 characters). |
| externalRef | string | — | External reference identifier for deduplication (max 255 characters). |
| metadata | object | — | Arbitrary 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.
import { useUpdateConversion } from '@brandwave/react';
const { mutate, isPending } = useUpdateConversion();
mutate({
id: 'abc-123',
});Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| id | string (UUID) | Required | Conversion identifier to update. |
| sourceId | string (UUID) | — | Updated conversion source. |
| convertedAt | string (ISO 8601) | — | Updated conversion timestamp. |
| count | integer | — | Updated conversion count (must be greater than zero, max 1M). |
| origin | string | — | Updated origin (max 50 characters). |
| externalRef | string | null | — | Updated external reference (max 255 characters). |
| metadata | object | null | — | Updated 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.
import { useDeleteConversion } from '@brandwave/react';
const { mutate, isPending } = useDeleteConversion();
mutate({
id: 'abc-123',
});Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| id | string (UUID) | Required | Conversion identifier to delete. |
Response#
Returns { data } with the result.
Underlying SDK method: bw.conversions.delete(params)