Billing#
Create Stripe Checkout and customer portal sessions for Brandwave plans.
Create billing checkout session#
Create a Stripe Checkout session for an unpaid organization and a selected Brandwave paid plan.
Owner only
typescript
const { data } = await bw.billing.createCheckoutSession({
organizationId: 'org_123',
plan: '...',
});Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| organizationId | string (UUID) | Required | Organization identifier to create Checkout for. |
| plan | 'starter' | 'growth' | 'scale' | Required | Selected paid plan. |
Response#
Returns { data } with the result.
Create billing portal session#
Create a Stripe Customer Portal session for a paid organization, optionally deep-linked to subscription plan updates.
Owner only
typescript
const { data } = await bw.billing.createPortalSession({
organizationId: 'org_123',
});Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| organizationId | string (UUID) | Required | Organization identifier to launch Stripe Customer Portal for. |
| flow | 'subscription_update' | — | Optional Stripe Customer Portal deep-link flow to launch. |
Response#
Returns { data } with the result.
Sync billing checkout session#
Update billing from a successful Stripe Checkout session, remove Brandwave Demo access, and activate the paid workspace.
Owner only
typescript
const { data } = await bw.billing.syncCheckoutSession({
organizationId: 'org_123',
sessionId: '...',
});Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| organizationId | string (UUID) | Required | Organization identifier bound to Checkout. |
| sessionId | string | Required | Stripe Checkout session identifier returned to Brandwave. |
Response#
Returns { data } with the result.