Store
Manage store settings, subscriptions, and team access
The Store module handles store configuration, subscription management, team access, and webhooks.
Get Store
/v1/stores/{storeId} sdk.store.getStore() Retrieve the current store.
const store = await sdk.store.getStore({});
console.log(store.key, store.settings);List Stores
/v1/stores sdk.store.getStores() List all stores the current user has access to.
const result = await sdk.store.getStores({
query: 'store',
isNetwork: false,
status: 'ACTIVE',
limit: 20,
cursor: null,
sort_field: 'created_at',
sort_direction: 'desc'
});
result.items.forEach(store => {
console.log(store.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 |
sort_field optional | string | Sort field |
sort_direction optional | asc | desc | Sort direction |
Create Store
/v1/stores sdk.store.createStore() Create a new store.
const result = await sdk.store.createStore({
key: 'my-store',
timezone: 'America/New_York',
billing_email: '[email protected]',
languages: [{ id: 'en' }],
emails: {
billing: '[email protected]',
support: '[email protected]'
}
});Parameters
| Name | Type | Description |
|---|---|---|
key required | string | Unique store key identifier (min 3 chars, slug-format) |
timezone required | string | IANA timezone, e.g. 'America/New_York' |
billing_email required | string | Billing contact email |
languages optional | Language[] | Supported languages, e.g. `[{ id: 'en' }]` |
emails optional | StoreEmails | Billing and support emails |
Two default markets are auto-created with every store: us (USD, Exclusive) and eu (EUR, Inclusive). Fetch them with sdk.market.list() or create additional markets with sdk.market.create().
Update Store
/v1/stores/{id} sdk.store.updateStore() Update store settings.
const result = await sdk.store.updateStore({
id: 'store_abc123',
key: 'my-updated-store',
timezone: 'America/New_York',
languages: [{ id: 'en' }],
emails: {
billing: '[email protected]',
support: '[email protected]'
}
});Parameters
| Name | Type | Description |
|---|---|---|
id required | string | Store ID |
key optional | string | Store key |
timezone optional | string | Store timezone (IANA format) |
languages optional | Language[] | Supported languages |
emails optional | StoreEmails | Billing and support emails |
Delete Store
/v1/stores/{id} sdk.store.deleteStore() Permanently delete a store and all associated data.
This action is irreversible. All products, orders, services, and content will be permanently deleted.
await sdk.store.deleteStore({
id: 'store_abc123'
});
Subscriptions
Get Subscription Plans
/v1/stores/plans sdk.store.getSubscriptionPlans() List available subscription plans.
const plans = await sdk.store.getSubscriptionPlans({});
plans.forEach(plan => {
console.log(plan.name, plan.price, plan.features);
});
Subscribe to Plan
/v1/stores/{storeId}/subscribe sdk.store.subscribe() Subscribe a store to a plan. Returns a Stripe checkout URL for payment.
const result = await sdk.store.subscribe({
plan_id: 'plan_pro',
success_url: 'https://yourapp.com/subscription/success',
cancel_url: 'https://yourapp.com/subscription/cancel'
});
// Redirect to Stripe checkout
if (result.url) {
window.location.href = result.url;
}Parameters
| Name | Type | Description |
|---|---|---|
plan_id required | string | Plan ID to subscribe to |
success_url required | string | URL to redirect after successful payment |
cancel_url required | string | URL to redirect if payment is cancelled |
Create Billing Portal Session
/v1/stores/{storeId}/subscription/portal sdk.store.createPortalSession() Create a Stripe Profile Portal session for subscription management.
const result = await sdk.store.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
Add Member
/v1/stores/{storeId}/members sdk.store.addMember() Add a user to the store team immediately. If the account does not exist yet, it is created with the assigned store role. No confirmation email or accept step is sent.
await sdk.store.addMember({
email: '[email protected]',
role: 'admin' // 'admin' | 'owner' | 'super'
});Parameters
| Name | Type | Description |
|---|---|---|
email required | string | Member email address |
role optional | admin | owner | super | Role to assign (defaults to admin) |
Remove Member
/v1/stores/{storeId}/members/{accountId} sdk.store.removeMember() Remove a team member from the store.
await sdk.store.removeMember({
account_id: 'acc_abc123',
});
Parameters
| Name | Type | Description |
|---|---|---|
account_id required | string | Account ID of the member to remove |
Webhooks
Test Webhook
/v1/stores/{storeId}/webhooks/test sdk.store.testWebhook() Send a test webhook to verify your endpoint configuration.
await sdk.store.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 Store Media
/v1/stores/{id}/media sdk.store.getStoreMedia() List all media files for a store.
const result = await sdk.store.getStoreMedia({
id: 'store_abc123',
limit: 50,
cursor: null,
query: 'product',
mime_type: 'image/jpeg',
sort_field: 'created_at',
sort_direction: 'desc'
});
result.items.forEach(media => {
console.log(media.id, media.url);
});
Parameters
| Name | Type | Description |
|---|---|---|
id required | string | Store 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 |
mime_type optional | string | Filter by MIME type |
sort_field optional | string | Sort field |
sort_direction optional | asc | desc | Sort direction |
Refunds
Process Refund
/v1/stores/{id}/refund sdk.store.processRefund() Process a refund for a payment.
await sdk.store.processRefund({
id: 'store_abc123',
entity: 'ord_xyz789', // Order ID
amount: 1999 // Partial refund in cents
});Parameters
| Name | Type | Description |
|---|---|---|
id required | string | Store ID |
entity required | string | Order 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/stores/{storeId}/integrations sdk.store.listIntegrations() const integrations = await sdk.store.listIntegrations({
storeId: 'store_abc123',
});
integrations.forEach(integration => {
console.log(integration.key, integration.provider.type);
});
Create Integration
/v1/stores/{storeId}/integrations sdk.store.createIntegration() // Stripe payment integration
await sdk.store.createIntegration({
storeId: 'store_abc123',
key: 'stripe-payments',
provider: {
type: 'stripe',
secret_key: 'sk_live_...',
publishable_key: 'pk_live_...',
webhook_secret: 'whsec_...',
currency: 'USD',
activeForCardPayments: true,
},
});
// Telegram bot integration
await sdk.store.createIntegration({
storeId: 'store_abc123',
key: 'support-telegram',
provider: {
type: 'telegram_bot',
bot_token: '123456:ABC...',
},
});
Parameters
| Name | Type | Description |
|---|---|---|
storeId required | string | Store ID |
key required | string | Unique integration key |
provider required | IntegrationProvider | Provider configuration (type-specific fields) |
Update Integration
/v1/stores/{storeId}/integrations/{id} sdk.store.updateIntegration() await sdk.store.updateIntegration({
storeId: 'store_abc123',
id: 'int_xyz789',
provider: {
type: 'stripe',
publishable_key: 'pk_live_new...',
currency: 'EUR',
},
});
Delete Integration
/v1/stores/{storeId}/integrations/{id} sdk.store.deleteIntegration() await sdk.store.deleteIntegration({
storeId: 'store_abc123',
id: 'int_xyz789',
});
Get Integration Config
/v1/stores/{storeId}/integrations/config/{type} sdk.store.getIntegrationConfig() Get the active integration config for a specific category.
const paymentConfig = await sdk.store.getIntegrationConfig({
storeId: 'store_abc123',
type: 'payment', // 'payment' | 'shipping' | 'analytics'
});
Available Provider Types
| Type | Category | Key Fields |
|---|---|---|
stripe | Payment | secret_key, publishable_key, webhook_secret, currency |
shippo | Shipping | api_token, active_for_fulfillment |
google | OAuth | client_id, client_secret, scopes |
telegram_bot | Channel | bot_token, action |
open_ai | AI | api_key, model |
deep_seek | AI | api_key, model |
resend | api_key | |
send_grid | api_key | |
slack | Messaging | api_key |
discord | Messaging | api_key |
whats_app | Messaging | api_key |
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 channel_ids array. See AI Agents for setting up agent routing.
OAuth
Connect and disconnect OAuth providers (e.g. Google) for a store.
OAuth Connect
/v1/stores/{storeId}/oauth/connect sdk.store.oauthConnect() await sdk.store.oauthConnect({
store_id: 'store_abc123',
provider: 'google',
code: 'auth_code_from_oauth_callback',
redirect_uri: 'https://yourapp.com/oauth/callback',
});
Parameters
| Name | Type | Description |
|---|---|---|
store_id required | string | Store ID |
provider required | string | OAuth provider name |
code required | string | Authorization code from OAuth callback |
redirect_uri required | string | Redirect URI used in the OAuth flow |
OAuth Disconnect
/v1/stores/{storeId}/oauth/disconnect sdk.store.oauthDisconnect() await sdk.store.oauthDisconnect({
storeId: 'store_abc123',
provider: 'google',
});
Webhook CRUD
Manage webhook endpoints programmatically.
List Webhooks
/v1/stores/{storeId}/webhooks sdk.store.listWebhooks() const webhooks = await sdk.store.listWebhooks({
storeId: 'store_abc123',
});
Create Webhook
/v1/stores/{storeId}/webhooks sdk.store.createWebhook() await sdk.store.createWebhook({
storeId: 'store_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 |
|---|---|---|
storeId required | string | Store 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/stores/{storeId}/webhooks/{id} sdk.store.updateWebhook() await sdk.store.updateWebhook({
storeId: 'store_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/stores/{storeId}/webhooks/{id} sdk.store.deleteWebhook() await sdk.store.deleteWebhook({
storeId: 'store_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 |
order.reminder | Scheduled order item reminder due |
product.created | Product created |
product.updated | Product updated |
product.deleted | Product deleted |
audience.subscriber_added | New audience subscriber |
account.updated | Store account or team membership updated |