Back to Arky

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.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

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

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

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

GET /v1/stores/{storeId}/build-hooks
SDK: 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

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

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

GET /v1/stores/{storeId}/payment-providers
SDK: sdk.store.paymentProvider.list()
const providers = await sdk.store.paymentProvider.list({
	store_id: "store_abc123",
});
POST /v1/stores/{storeId}/payment-providers/stripe/connect
SDK: 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

DELETE /v1/stores/{storeId}/build-hooks/{id}
SDK: sdk.store.deleteBuildHook()
await sdk.store.deleteBuildHook({
	store_id: "store_abc123",
	id: "hook_xyz789",
});

Get Store Config

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

SurfaceSDK
Paymentssdk.store.paymentProvider
Social accountssdk.social.account
Social publicationssdk.social.publication
Shippingsdk.eshop.order
Build hookssdk.store.buildHook

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
collection.createdCMS collection created
collection.updatedCMS collection updated
collection.deletedCMS collection deleted
entry.createdCMS entry created
entry.updatedCMS entry updated
entry.deletedCMS entry 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
contact_list.contact_addedContact added to a Contact List
account.updatedStore account or team membership updated