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.subscription.subscribe() Subscribe a store to a plan. Returns a Stripe checkout URL for payment.
const result = await sdk.store.subscription.subscribe({
plan_id: 'plan_pro',
action: 'select_plan',
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 Customer 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 |
Build Hooks
Build hooks are store deploy endpoints. Arky resolves build hook URLs and headers server-side when a workflow uses a deploy_webhook node.
List Build Hooks
/v1/stores/{storeId}/build-hooks sdk.store.listBuildHooks() const hooks = await sdk.store.listBuildHooks({
store_id: "store_abc123",
});
hooks.forEach((hook) => {
console.log(hook.key, hook.type, hook.active);
});
Create Build Hook
/v1/stores/{storeId}/build-hooks sdk.store.createBuildHook() await sdk.store.createBuildHook({
store_id: "store_abc123",
key: "production-deploy",
type: "vercel",
url: "https://deploy.example.com/hooks/production",
active: true,
});
Update Build Hook
/v1/stores/{storeId}/build-hooks/{id} sdk.store.updateBuildHook() await sdk.store.updateBuildHook({
store_id: "store_abc123",
id: "hook_xyz789",
key: "production-deploy",
type: "custom",
url: "https://deploy.example.com/hooks/arky",
});
Payment Providers
/v1/stores/{storeId}/payment-providers sdk.store.paymentProvider.list() const providers = await sdk.store.paymentProvider.list({
store_id: "store_abc123",
});
/v1/stores/{storeId}/payment-providers/stripe/connect sdk.store.paymentProvider.connectStripe() const { onboarding_url } = await sdk.store.paymentProvider.connectStripe({
store_id: "store_abc123",
return_url: "https://admin.example.com/payments?stripe=return",
refresh_url: "https://admin.example.com/payments?stripe=refresh",
});
window.location.href = onboarding_url;
Delete Build Hook
/v1/stores/{storeId}/build-hooks/{id} sdk.store.deleteBuildHook() await sdk.store.deleteBuildHook({
store_id: "store_abc123",
id: "hook_xyz789",
});
Get Store Config
/v1/stores/{storeId}/config/{type} sdk.store.getStoreConfig() Get the active public config for a specific category. Payment config is intentionally small: storefronts need the publishable key and currency, while Arky keeps provider account routing on the server.
const paymentConfig = await sdk.store.getStoreConfig({
store_id: "store_abc123",
type: "payment",
});
// {
// provider: 'stripe',
// publishable_key: 'pk_live_...',
// currency: 'usd'
// }
Managed Provider Surfaces
| Surface | SDK |
|---|---|
| Payments | sdk.store.paymentProvider |
| Social accounts | sdk.social.account |
| Social publications | sdk.social.publication |
| Shipping | sdk.eshop.order |
| Build hooks | sdk.store.buildHook |
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 |
|---|---|
collection.created | CMS collection created |
collection.updated | CMS collection updated |
collection.deleted | CMS collection deleted |
entry.created | CMS entry created |
entry.updated | CMS entry updated |
entry.deleted | CMS entry 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 |
contact_list.contact_added | Contact added to a Contact List |
account.updated | Store account or team membership updated |