Business
Manage business settings, subscriptions, and team invitations
The Business module handles business configuration, subscription management, team invitations, and webhooks.
Get Business
/v1/businesses/{businessId} sdk.business.getBusiness() Retrieve the current business.
const business = await sdk.business.getBusiness({});
console.log(business.key, business.settings);List Businesses
/v1/businesses sdk.business.getBusinesses() List all businesses the current user has access to.
const result = await sdk.business.getBusinesses({
query: 'store',
isNetwork: false,
status: 'ACTIVE',
limit: 20,
cursor: null,
sortField: 'createdAt',
sortDirection: 'desc'
});
result.items.forEach(business => {
console.log(business.key);
});Parameters
| Name | Type | Description |
|---|---|---|
query optional | string | Search query |
isNetwork optional | boolean | Filter by network status |
status optional | DRAFT | ACTIVE | ARCHIVED | Filter by status |
limit optional | number | Items per page |
cursor optional | string | Pagination cursor |
sortField optional | string | Sort field |
sortDirection optional | asc | desc | Sort direction |
Create Business
/v1/businesses sdk.business.createBusiness() Create a new business.
const result = await sdk.business.createBusiness({
key: 'my-store',
timezone: 'America/New_York',
billingEmail: 'billing@mystore.com',
languages: [{ id: 'en' }],
emails: {
billing: 'billing@mystore.com',
support: 'support@mystore.com'
}
});Parameters
| Name | Type | Description |
|---|---|---|
key required | string | Unique business key identifier (min 3 chars, slug-format) |
timezone required | string | IANA timezone, e.g. 'America/New_York' |
billingEmail required | string | Billing contact email |
languages optional | Language[] | Supported languages, e.g. `[{ id: 'en' }]` |
emails optional | BusinessEmails | Billing and support emails |
Three default markets are auto-created with every business: us (USD, Exclusive), eu (EUR, Inclusive), and booking (USD, Exclusive, no zones). Fetch them with sdk.market.list() or create additional markets with sdk.market.create().
Update Business
/v1/businesses/{id} sdk.business.updateBusiness() Update business settings.
const result = await sdk.business.updateBusiness({
id: 'biz_abc123',
key: 'my-updated-store',
timezone: 'America/New_York',
languages: [{ id: 'en' }],
emails: {
billing: 'billing@yourstore.com',
support: 'support@yourstore.com'
}
});Parameters
| Name | Type | Description |
|---|---|---|
id required | string | Business ID |
key optional | string | Business key |
timezone optional | string | Business timezone (IANA format) |
languages optional | Language[] | Supported languages |
emails optional | BusinessEmails | Billing and support emails |
Delete Business
/v1/businesses/{id} sdk.business.deleteBusiness() Permanently delete a business and all associated data.
This action is irreversible. All products, orders, bookings, and content will be permanently deleted.
await sdk.business.deleteBusiness({
id: 'biz_abc123'
});
Subscriptions
Get Subscription Plans
/v1/businesses/plans sdk.business.getSubscriptionPlans() List available subscription plans.
const plans = await sdk.business.getSubscriptionPlans({});
plans.forEach(plan => {
console.log(plan.name, plan.price, plan.features);
});
Subscribe to Plan
/v1/businesses/{businessId}/subscribe sdk.business.subscribe() Subscribe a business to a plan. Returns a Stripe checkout URL for payment.
const result = await sdk.business.subscribe({
planId: 'plan_pro',
successUrl: 'https://yourapp.com/subscription/success',
cancelUrl: 'https://yourapp.com/subscription/cancel'
});
// Redirect to Stripe checkout
if (result.url) {
window.location.href = result.url;
}Parameters
| Name | Type | Description |
|---|---|---|
planId required | string | Plan ID to subscribe to |
successUrl required | string | URL to redirect after successful payment |
cancelUrl required | string | URL to redirect if payment is cancelled |
Create Billing Portal Session
/v1/businesses/{businessId}/subscription/portal sdk.business.createPortalSession() Create a Stripe Customer Portal session for subscription management.
const result = await sdk.business.createPortalSession({
returnUrl: 'https://yourapp.com/settings/billing'
});
// Redirect to Stripe portal
window.location.href = result.url;
Parameters
| Name | Type | Description |
|---|---|---|
returnUrl required | string | URL to return to after portal session |
Team Management
Invite User
/v1/businesses/{businessId}/invitation sdk.business.inviteUser() Send an invitation to join the business team.
await sdk.business.inviteUser({
email: 'teammate@example.com',
role: 'Admin' // 'Admin' | 'Owner' | 'Super'
});Parameters
| Name | Type | Description |
|---|---|---|
email required | string | Invitee email address |
role optional | Admin | Owner | Super | Role to assign (defaults to Admin) |
Handle Invitation
/v1/businesses/{businessId}/invitation sdk.business.handleInvitation() Accept or decline an invitation.
// Accept invitation
await sdk.business.handleInvitation({
token: 'invitation_token_from_email',
action: 'ACCEPT'
});
// Reject invitation
await sdk.business.handleInvitation({
token: 'invitation_token_from_email',
action: 'REJECT'
});Parameters
| Name | Type | Description |
|---|---|---|
token required | string | Invitation token from email |
action required | ACCEPT | REJECT | Action to take |
Remove Member
/v1/businesses/{businessId}/members/{accountId} sdk.business.removeMember() Remove a team member from the business.
await sdk.business.removeMember({
accountId: 'acc_abc123',
});
Parameters
| Name | Type | Description |
|---|---|---|
accountId required | string | Account ID of the member to remove |
Webhooks
Test Webhook
/v1/businesses/{businessId}/webhooks/test sdk.business.testWebhook() Send a test webhook to verify your endpoint configuration.
await sdk.business.testWebhook({
webhook: {
url: 'https://yourapp.com/webhooks',
events: ['order.created', 'order.paid'],
secret: 'whsec_...'
}
});
console.log('Webhook test sent successfully');Parameters
| Name | Type | Description |
|---|---|---|
webhook required | object | Webhook configuration object with url, events, and optional secret |
Media
Get Business Media
/v1/businesses/{id}/media sdk.business.getBusinessMedia() List all media files for a business.
const result = await sdk.business.getBusinessMedia({
id: 'biz_abc123',
limit: 50,
cursor: null,
query: 'product',
mimeType: 'image/jpeg',
sortField: 'createdAt',
sortDirection: 'desc'
});
result.items.forEach(media => {
console.log(media.id, media.url);
});
Parameters
| Name | Type | Description |
|---|---|---|
id required | string | Business ID |
limit required | number | Items per page |
cursor optional | string | Pagination cursor |
ids optional | string[] | Filter by specific media IDs |
query optional | string | Search query |
mimeType optional | string | Filter by MIME type |
sortField optional | string | Sort field |
sortDirection optional | asc | desc | Sort direction |
Refunds
Process Refund
/v1/businesses/{id}/refund sdk.business.processRefund() Process a refund for a payment.
await sdk.business.processRefund({
id: 'biz_abc123',
entity: 'ord_xyz789', // Order or booking ID
amount: 1999 // Partial refund in cents
});Parameters
| Name | Type | Description |
|---|---|---|
id required | string | Business ID |
entity required | string | Order or booking ID to refund |
amount required | number | Amount in cents to refund |
Integrations
Manage third-party service integrations (Stripe, Shippo, Telegram, OpenAI, etc.).
List Integrations
/v1/businesses/{businessId}/integrations sdk.business.listIntegrations() const integrations = await sdk.business.listIntegrations({
businessId: 'biz_abc123',
});
integrations.forEach(integration => {
console.log(integration.key, integration.provider.type);
});
Create Integration
/v1/businesses/{businessId}/integrations sdk.business.createIntegration() // Stripe payment integration
await sdk.business.createIntegration({
businessId: 'biz_abc123',
key: 'stripe-payments',
provider: {
type: 'stripe',
secretKey: 'sk_live_...',
publishableKey: 'pk_live_...',
webhookSecret: 'whsec_...',
currency: 'USD',
activeForCardPayments: true,
},
});
// Telegram bot integration
await sdk.business.createIntegration({
businessId: 'biz_abc123',
key: 'support-telegram',
provider: {
type: 'telegram_bot',
botToken: '123456:ABC...',
},
});
Parameters
| Name | Type | Description |
|---|---|---|
businessId required | string | Business ID |
key required | string | Unique integration key |
provider required | IntegrationProvider | Provider configuration (type-specific fields) |
Update Integration
/v1/businesses/{businessId}/integrations/{id} sdk.business.updateIntegration() await sdk.business.updateIntegration({
businessId: 'biz_abc123',
id: 'int_xyz789',
provider: {
type: 'stripe',
publishableKey: 'pk_live_new...',
currency: 'EUR',
},
});
Delete Integration
/v1/businesses/{businessId}/integrations/{id} sdk.business.deleteIntegration() await sdk.business.deleteIntegration({
businessId: 'biz_abc123',
id: 'int_xyz789',
});
Get Integration Config
/v1/businesses/{businessId}/integrations/config/{type} sdk.business.getIntegrationConfig() Get the active integration config for a specific category.
const paymentConfig = await sdk.business.getIntegrationConfig({
businessId: 'biz_abc123',
type: 'payment', // 'payment' | 'shipping' | 'analytics'
});
Available Provider Types
| Type | Category | Key Fields |
|---|---|---|
stripe | Payment | secretKey, publishableKey, webhookSecret, currency |
shippo | Shipping | apiToken, activeForFulfillment |
google | OAuth | clientId, clientSecret, scopes |
google_analytics4 | Analytics | measurementId, activeForTracking |
telegram_bot | Channel | botToken, action |
open_ai | AI | apiKey, model |
deep_seek | AI | apiKey, model |
resend | apiKey | |
send_grid | apiKey | |
slack | Messaging | apiKey |
discord | Messaging | apiKey |
whats_app | Messaging | apiKey |
vercel_deploy_hook | Deploy | url |
netlify_deploy_hook | Deploy | url |
cloudflare_deploy_hook | Deploy | url |
custom_deploy_hook | Deploy | url |
Plus 20+ more API-key providers (Airtable, Linear, GitHub, Notion, HubSpot, etc.).
Channel Integrations
For messaging channels (telegram_bot), incoming messages are routed to AI agents that have the integration’s ID in their channelIds array. See AI Agents for setting up agent routing.
OAuth
Connect and disconnect OAuth providers (e.g. Google) for a business.
OAuth Connect
/v1/businesses/{businessId}/oauth/connect sdk.business.oauthConnect() await sdk.business.oauthConnect({
businessId: 'biz_abc123',
provider: 'google',
code: 'auth_code_from_oauth_callback',
redirectUri: 'https://yourapp.com/oauth/callback',
});
Parameters
| Name | Type | Description |
|---|---|---|
businessId required | string | Business ID |
provider required | string | OAuth provider name |
code required | string | Authorization code from OAuth callback |
redirectUri required | string | Redirect URI used in the OAuth flow |
OAuth Disconnect
/v1/businesses/{businessId}/oauth/disconnect sdk.business.oauthDisconnect() await sdk.business.oauthDisconnect({
businessId: 'biz_abc123',
provider: 'google',
});
Webhook CRUD
Manage webhook endpoints programmatically.
List Webhooks
/v1/businesses/{businessId}/webhooks sdk.business.listWebhooks() const webhooks = await sdk.business.listWebhooks({
businessId: 'biz_abc123',
});
Create Webhook
/v1/businesses/{businessId}/webhooks sdk.business.createWebhook() await sdk.business.createWebhook({
businessId: 'biz_abc123',
key: 'order-notifications',
url: 'https://yourapp.com/webhooks/orders',
events: [
{ event: 'order.created' },
{ event: 'order.updated' },
],
headers: { 'X-Custom-Header': 'value' },
secret: 'whsec_my_secret',
enabled: true,
});
Parameters
| Name | Type | Description |
|---|---|---|
businessId required | string | Business ID |
key required | string | Unique webhook key |
url required | string | Webhook endpoint URL |
events required | WebhookEventSubscription[] | Events to subscribe to |
headers required | Record<string, string> | Custom headers sent with each request |
secret required | string | Signing secret for verifying webhook payloads |
enabled required | boolean | Whether the webhook is active |
Update Webhook
/v1/businesses/{businessId}/webhooks/{id} sdk.business.updateWebhook() await sdk.business.updateWebhook({
businessId: 'biz_abc123',
id: 'wh_xyz789',
key: 'order-notifications',
url: 'https://yourapp.com/webhooks/v2/orders',
events: [
{ event: 'order.created' },
{ event: 'order.updated' },
{ event: 'order.cancelled' },
],
headers: {},
secret: 'whsec_new_secret',
enabled: true,
});
Delete Webhook
/v1/businesses/{businessId}/webhooks/{id} sdk.business.deleteWebhook() await sdk.business.deleteWebhook({
businessId: 'biz_abc123',
id: 'wh_xyz789',
});
Available Webhook Events
| Event | Description |
|---|---|
node.created | CMS node created |
node.updated | CMS node updated |
node.deleted | CMS node deleted |
form_submission.created | Form submission received |
order.created | Order created |
order.updated | Order status changed |
booking.created | Booking created |
booking.updated | Booking status changed |
product.created | Product created |
product.updated | Product updated |
product.deleted | Product deleted |
audience.subscriber_added | New audience subscriber |