Billing#

Create Stripe Checkout sessions for paid Brandwave plans and process Stripe-driven billing synchronization.

Provider required

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

useCreateBillingCheckoutSession#

Create a Stripe Checkout session for an unpaid organization and a selected Brandwave paid plan.

Owner only
typescript
import { useCreateBillingCheckoutSession } from '@brandwave/react';

const { mutate, isPending } = useCreateBillingCheckoutSession();

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

Parameters#

NameTypeRequiredDescription
organizationIdstring (UUID)RequiredOrganization identifier to create Checkout for.
plan'starter' | 'growth' | 'scale'RequiredSelected paid plan.

Response#

Returns { data } with the result.

Underlying SDK method: bw.billing.createCheckoutSession(params)

useCreateBillingPortalSession#

Create a Stripe Customer Portal session for a paid organization.

Owner only
typescript
import { useCreateBillingPortalSession } from '@brandwave/react';

const { mutate, isPending } = useCreateBillingPortalSession();

mutate({
  organizationId: 'org_123',
});

Parameters#

NameTypeRequiredDescription
organizationIdstring (UUID)RequiredOrganization identifier to launch Stripe Customer Portal for.

Response#

Returns { data } with the result.

Underlying SDK method: bw.billing.createPortalSession(params)