Back to arkyStore.io

Store

Manage store settings, subscriptions, and team access

The Store module handles store configuration, subscription management, team access, and webhooks.

Get Store

GET /v1/stores/{storeId}
SDK: sdk.store.getStore()

Retrieve the current store.

const store = await sdk.store.getStore({});

console.log(store.key, store.settings);

List Stores

GET /v1/stores
SDK: 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

POST /v1/stores
SDK: 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

PUT /v1/stores/{id}
SDK: 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

DELETE /v1/stores/{id}
SDK: sdk.store.deleteStore()

Permanently delete a store and all associated data.

Warning

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

GET /v1/stores/plans
SDK: 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

PUT /v1/stores/{storeId}/subscribe
SDK: 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

POST /v1/stores/{storeId}/subscription/portal
SDK: 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

POST /v1/stores/{storeId}/members
SDK: 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

DELETE /v1/stores/{storeId}/members/{accountId}
SDK: 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

POST /v1/stores/{storeId}/webhooks/test
SDK: 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

GET /v1/stores/{id}/media
SDK: 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

POST /v1/stores/{id}/refund
SDK: 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

GET /v1/stores/{storeId}/integrations
SDK: sdk.store.listIntegrations()
const integrations = await sdk.store.listIntegrations({
  storeId: 'store_abc123',
});

integrations.forEach(integration => {
  console.log(integration.key, integration.provider.type);
});

Create Integration

POST /v1/stores/{storeId}/integrations
SDK: 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

PUT /v1/stores/{storeId}/integrations/{id}
SDK: 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

DELETE /v1/stores/{storeId}/integrations/{id}
SDK: sdk.store.deleteIntegration()
await sdk.store.deleteIntegration({
  storeId: 'store_abc123',
  id: 'int_xyz789',
});

Get Integration Config

GET /v1/stores/{storeId}/integrations/config/{type}
SDK: 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

TypeCategoryKey Fields
stripePaymentsecret_key, publishable_key, webhook_secret, currency
shippoShippingapi_token, active_for_fulfillment
googleOAuthclient_id, client_secret, scopes
telegram_botChannelbot_token, action
open_aiAIapi_key, model
deep_seekAIapi_key, model
resendEmailapi_key
send_gridEmailapi_key
slackMessagingapi_key
discordMessagingapi_key
whats_appMessagingapi_key
vercel_deploy_hookDeployurl
netlify_deploy_hookDeployurl
cloudflare_deploy_hookDeployurl
custom_deploy_hookDeployurl

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

POST /v1/stores/{storeId}/oauth/connect
SDK: 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

POST /v1/stores/{storeId}/oauth/disconnect
SDK: sdk.store.oauthDisconnect()
await sdk.store.oauthDisconnect({
  storeId: 'store_abc123',
  provider: 'google',
});

Webhook CRUD

Manage webhook endpoints programmatically.

List Webhooks

GET /v1/stores/{storeId}/webhooks
SDK: sdk.store.listWebhooks()
const webhooks = await sdk.store.listWebhooks({
  storeId: 'store_abc123',
});

Create Webhook

POST /v1/stores/{storeId}/webhooks
SDK: 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

PUT /v1/stores/{storeId}/webhooks/{id}
SDK: 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

DELETE /v1/stores/{storeId}/webhooks/{id}
SDK: sdk.store.deleteWebhook()
await sdk.store.deleteWebhook({
  storeId: 'store_abc123',
  id: 'wh_xyz789',
});

Available Webhook Events

EventDescription
node.createdCMS node created
node.updatedCMS node updated
node.deletedCMS node deleted
form_submission.createdForm submission received
order.createdOrder created
order.updatedOrder status changed
order.reminderScheduled order item reminder due
product.createdProduct created
product.updatedProduct updated
product.deletedProduct deleted
audience.subscriber_addedNew audience subscriber
account.updatedStore account or team membership updated