Back to Arky

API Reference

Every Arky module, its records and routes, and the rules every request follows

Reference documentation for the Arky SDK modules and their REST routes.

Modules

ModuleWhat it covers
AccountOperator sign-in codes, sessions, account tokens and the account
StoreThe store, its email sending, its Arky plan, roles and members, webhooks
Markets and ChannelsMarkets, sales channels, publishable keys, zones, tax categories
E-shopProducts, bookings, carts, orders, payments, returns, inventory, companies
PackagesPackages, priced and automatic items, prices, access, offerings, members, revisions, renewals and member changes
Shipping and FulfillmentShipping profiles and methods, routing, fulfillment jobs, deliveries and pickups
PromotionsDiscounts with codes or applied automatically, and promotion codes
ContentCollections, entries and the block types
MediaImages, videos and PDFs with their smaller versions
CategoriesClassifications with filter fields
CustomersCustomers, sessions, sign-in codes and email changes, suppressions, notes
FormsForms, submissions with files, stages and notes
Store EmailThe store’s Resend account, email addresses, templates and email settings
BroadcastsOne email to the members of packages
Outgoing Email And WebhooksEvery email Arky sends and every webhook post
SupportFixed-step support flows and conversations by chat and email
Store LocationsThe store’s places and country reference data
PlatformCurrencies, events, Arky plans, platform administrators

Base URL

https://api.arky.io

Authentication

Storefront routes (/v1/storefront/...) take the store’s public key on every request, and a customer session once the visitor has one:

X-Arky-Publishable-Key: arky_pk_...
Authorization: Bearer CUSTOMER_SESSION_TOKEN

Admin routes (/v1/stores/{store_id}/...), account routes (/v1/accounts/...) and platform routes (/v1/platform/...) take an account session; store routes also take an account token, which acts as its account in the stores it reaches, with its own permissions:

Authorization: Bearer ACCOUNT_ACCESS_TOKEN
Authorization: Bearer arky_at_...
Tip

Use initialize from arky-sdk/storefront with the publishable key in browsers, and createAdmin from arky-sdk/admin for operators and trusted jobs. Never put an account session or an account token in storefront code.

Storefront Context

Storefront requests carry their context in headers, set by the SDK from initialize options or setContext. The sales channel comes from the publishable key: each publishable key belongs to one channel, so there is no channel header.

HeaderMeaning
X-Arky-Localethe language: one of the store’s languages (409 STORE.LANGUAGE_NOT_SUPPORTED otherwise), with no fallback
X-Arky-Marketthe market key; every commercial request (packages, package items, products, bookings, carts and checkout) names it, even when the key’s channel lists one market: 409 SALES_CHANNEL.MARKET_REQUIRED without it, 409 SALES_CHANNEL.MARKET_NOT_LISTED for a market the channel doesn’t sell in; content reads need none
X-Arky-Cart-Tokenthe cart’s recovery token, sent by the SDK
X-Arky-Order-Tokenan order’s secret, for a guest reading or changing their order

A support chat has no token of its own: it belongs to the customer of the session that started it.

Requests

  • Bodies are JSON with snake_case fields; form submissions and uploads are multipart.
  • The app picks every id. A create carries the new record’s id, a canonical UUID v4 the app makes once per user action (crypto.randomUUID()) and sends again on every retry. The same request under the same id returns the existing record; a different request under it is refused with 409.
  • Changes carry what they read. An update or an action carries expected_updated_at, the record’s updated_at as read; a delete carries it in the query. A stale value is refused with 409 GENERAL.CONFLICT, so a repeated action can’t apply twice. A few actions name the value they read instead: a stock action names the stock level and its action_id (an adjustment also the count it corrects, expected_count), assigning a conversation the assignee it read (expected_account_id) and changing its reply email the selection it read (expected_reply). A package’s access row has no version, so its delete names only its id.
  • Language is explicit. A request that stores or renders text in a language names it in language (or X-Arky-Locale on storefront reads). It must be one of the store’s languages.
  • Enums are objects tagged by type: { "type": "scheduled", "send_at": 1767254400000 }.
  • Moments are integer epoch milliseconds; days are "YYYY-MM-DD"; money is integer minor units of its currency.

Responses

A response is the record itself, without secrets such as tokens and keys. A storefront call answers the buyer’s copy: the same fields without any team member, customer session or internal note, reason, reference or provider error (StorefrontOrder, StorefrontPayment, StorefrontPaymentMethod, StorefrontCart, StorefrontReturn, StorefrontForm). Lists are paged:

{
	"items": [],
	"cursor": "next_page_cursor"
}

Follow cursor until it is null, even after an empty page.

Errors

{
	"error": "STORE.DELETING",
	"message": "This store is being closed and can't change",
	"status_code": 409,
	"validation_errors": []
}
  • 400 a request that breaks a rule, with validation_errors naming the fields;
  • 401 and 403 missing or insufficient access;
  • 404 a record that isn’t there, or a reference to one;
  • 409 with GENERAL.CONFLICT: a stale expected_updated_at, a stale value an action names, or another request under a used id; with a named code: a record that is being deleted (REFERENCE.DELETING), a delete refused because something points at the record (REFERENCE.STILL_REFERENCED, the message names who), or a business rule such as PACKAGE_ITEM_PRICE.ALREADY_EXISTS;
  • 413 with GENERAL.PAYLOAD_TOO_LARGE: an upload or form submission over its configured size limit, or an action tracking body over 16 KiB;
  • 402 a store whose Arky plan has no access: the public storefront and every storefront change;
  • 429 with GENERAL.RATE_LIMITED and Retry-After: too many requests. An account token has its own quota of about 10,000 a minute; every other caller counts against its client address, an IPv6 one by its /64, about 600 a minute, and a few public routes, such as sign-in codes, forms, chat, page views and action tracking, have lower limits of their own;
  • 503 with GENERAL.SERVICE_UNAVAILABLE: Arky is busy, such as reading too many request bodies at once; try again after Retry-After.

See Error Handling for handling them in code.