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
| Module | What it covers |
|---|---|
| Account | Operator sign-in codes, sessions, account tokens and the account |
| Store | The store, its email sending, its Arky plan, roles and members, webhooks |
| Markets and Channels | Markets, sales channels, publishable keys, zones, tax categories |
| E-shop | Products, bookings, carts, orders, payments, returns, inventory, companies |
| Packages | Packages, priced and automatic items, prices, access, offerings, members, revisions, renewals and member changes |
| Shipping and Fulfillment | Shipping profiles and methods, routing, fulfillment jobs, deliveries and pickups |
| Promotions | Discounts with codes or applied automatically, and promotion codes |
| Content | Collections, entries and the block types |
| Media | Images, videos and PDFs with their smaller versions |
| Categories | Classifications with filter fields |
| Customers | Customers, sessions, sign-in codes and email changes, suppressions, notes |
| Forms | Forms, submissions with files, stages and notes |
| Store Email | The store’s Resend account, email addresses, templates and email settings |
| Broadcasts | One email to the members of packages |
| Outgoing Email And Webhooks | Every email Arky sends and every webhook post |
| Support | Fixed-step support flows and conversations by chat and email |
| Store Locations | The store’s places and country reference data |
| Platform | Currencies, 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_...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.
| Header | Meaning |
|---|---|
X-Arky-Locale | the language: one of the store’s languages (409 STORE.LANGUAGE_NOT_SUPPORTED otherwise), with no fallback |
X-Arky-Market | the 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-Token | the cart’s recovery token, sent by the SDK |
X-Arky-Order-Token | an 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_casefields; 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 with409. - Changes carry what they read. An update or an action carries
expected_updated_at, the record’supdated_atas read; a delete carries it in the query. A stale value is refused with409 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 itsaction_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(orX-Arky-Localeon 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": []
}
400a request that breaks a rule, withvalidation_errorsnaming the fields;401and403missing or insufficient access;404a record that isn’t there, or a reference to one;409withGENERAL.CONFLICT: a staleexpected_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 asPACKAGE_ITEM_PRICE.ALREADY_EXISTS;413withGENERAL.PAYLOAD_TOO_LARGE: an upload or form submission over its configured size limit, or an action tracking body over 16 KiB;402a store whose Arky plan has no access: the public storefront and every storefront change;429withGENERAL.RATE_LIMITEDandRetry-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;503withGENERAL.SERVICE_UNAVAILABLE: Arky is busy, such as reading too many request bodies at once; try again afterRetry-After.
See Error Handling for handling them in code.