Klarity Storefront API
Secure, header-key API for pages, products, categories, collections, assets, orders, and inventory operations.
Authentication
Send your key as a Bearer token.
Authorization: Bearer <API_KEY># curl
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.myklarity.store/v1/products-by-category/snacks?limit=4"
Conventions
Shared rules for parameters, formats, and response envelopes across the API.
{param} (required).a,b,c).true/false (case-insensitive).price_cents for exact math; price_formatted is display-only.{ ok, data, total? }. total appears on list endpoints.Barcode
Create barcode images for labels and printing from EAN, ISBN, or SKU.
{ source?, format?, isbn?, sku?, ean?, product_id? }| Field | Type | Notes |
|---|---|---|
source |
string | auto | ean | isbn | sku (default: auto) |
format |
string | auto | ean13 | code128 (default: auto) |
isbn |
string | 10 or 13 digits (auto converts ISBN‑10 to ISBN‑13) |
ean |
string | 12 or 13 digits (EAN‑13 check digit is calculated if 12 digits) |
sku |
string | 1–50 chars, alphanumeric plus -_. / (for Code128) |
product_id |
int | Optional, used for filename generation |
Examples
# EAN (auto)
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{ "ean":"6001234567890" }' \
"https://api.myklarity.store/v1/barcode"
# SKU (Code128)
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{ "source":"sku", "format":"code128", "sku":"SKU-1001" }' \
"https://api.myklarity.store/v1/barcode"
# Response
{
"ok": true,
"image": "barcode_42_ean13_6001234567890.png",
"format": "ean13",
"value": "6001234567890"
}
Quickstart
A minimal request/response to validate auth and see the API shape.
Fetch four items from a category.
GET https://api.myklarity.store/v1/products-by-category/snacks?limit=4
Authorization: Bearer YOUR_API_KEY
200 OK
{
"ok": true,
"data": [
{
"id": 501,
"handle": "crunchy-bites",
"sku": "CRN-501",
"title": "Crunchy Bites",
"description": "Small bag, big crunch.",
"price": "22.98",
"price_cents": 2298,
"currency": "GBP",
"currency_symbol": "GBP",
"price_formatted": "GBP 22.98",
"image": "https://cdn.mystockly.store/client/your-tenant/products/p-501.jpg",
"qty_on_hand": 20,
"qty_reserved": 6,
"qty_available": 14,
"categories": [
{ "id": 10, "slug": "snacks", "title": "Snacks" }
],
"created_at": "...",
"updated_at": "..."
}
],
"total": 1
}
Products
Read product catalog data for storefronts, apps, and reporting.
handle (string). Optional query: include_stock_by_loc.loc (required), include_stock_by_loc (optional).include_category, exclude_category, include_collection, exclude_collection, include_handle, exclude_handle (CSV); min_price_cents, max_price_cents; q; page, limit, sort.q, page, limit, sort=relevance|price_asc|price_desc| Method | Path | Description | Params |
|---|---|---|---|
| GET | /v1/product/{handle} |
Fetch a single product by its handle. | Path: handle (string) Query: include_stock_by_loc (optional) |
| GET | /v1/products |
List products for a location. | Query: loc (string|int, required), include_stock_by_loc (optional) |
| GET | /v1/products-all |
General listing with include/exclude filters and price bounds. |
Query: include_category, exclude_category, include_collection, exclude_collection, include_handle, exclude_handle (CSV);
min_price_cents, max_price_cents (int); q (string); page (int), limit (int), sort (string)
|
| GET | /v1/search/products |
Search by title or description (LIKE). | Query: q (string), page (int), limit (int), sort (enum: relevance|price_asc|price_desc) |
Examples
# Single product by handle
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.myklarity.store/v1/product/sea-salt-chips"
# Products by location
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.myklarity.store/v1/products?loc=MAIN&include_stock_by_loc=1"
# Filtered list (include categories + price range)
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.myklarity.store/v1/products-all?include_category=chocolate,sweets&min_price_cents=1000&max_price_cents=3000&sort=price_asc"
# Search (title/description)
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.myklarity.store/v1/search/products?q=caramel&page=1&limit=6"
Categories
Browse category structures and fetch their product groupings.
slug (string). Returns category metadata and body.slug (string). Query: page, limit, sort=newest|price_asc|price_desc| Method | Path | Description | Params |
|---|---|---|---|
| GET | /v1/category/{slug} |
Fetch a single category by slug. | Path: slug (string) |
| GET | /v1/products-by-category/{slug} |
List products in a category (hierarchy-aware). |
Path: slug (string)Query: page (int), limit (int), sort (enum)
|
Examples
# Category details
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.myklarity.store/v1/category/snacks"
# Category listing, page 2, 12 per page, highest price first
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.myklarity.store/v1/products-by-category/snacks?page=2&limit=12&sort=price_desc"
Collections
Work with curated collections for merchandising and navigation.
slug (string). Query: page, limit, sort.| Method | Path | Description | Params |
|---|---|---|---|
| GET | /v1/products-by-collection/{slug} |
List products in a collection. |
Path: slug (string)Query: page (int), limit (int), sort (string)
|
Examples
# Collection listing (newest first)
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.myklarity.store/v1/products-by-collection/gifts?limit=8&sort=newest"
Images & Assets
Retrieve image and asset metadata for product and content displays.
Resolve image IDs into full URLs (plus slug and alt text) via single or batch lookups.
id (int).ids (CSV of ints).| Method | Path | Description | Params |
|---|---|---|---|
| GET | /v1/assets/{id} |
Single asset | Path: id (int) |
| GET | /v1/assets?ids=1,2,3 |
Batch assets | Query: ids (CSV) |
GET /v1/assets?ids=42,99
200 OK
{
"ok": true,
"data": [
{ "id": 42, "url": "https://cdn.mystockly.store/client/<tenant>/assets/42.jpg", "slug": "classic-tee-blue", "alt": "Classic Tee - Blue" },
{ "id": 99, "url": "https://cdn.mystockly.store/client/<tenant>/assets/99.jpg", "slug": "eco-tote", "alt": "Eco Tote (reusable)" }
]
}
Orders
Read orders, line items, and fulfilment state for customer workflows.
id, order_ref, digital_string, status, customer_id, user_id, location_id, from, to, fulfilled, limit, offset, include_items, include_payments.period=today|thisweek|thismonth|thisyear, loc=all|CODE|ID.customer_id (required), period=week|month|all.{ type, id, status, ... }If
type="transfer": include from_location, to_location; status in in_transit,received,partially_received.If
type="purchase-order": include reference; status in approved,open,cancelled,received,partially_received.
{ order_id, carrier?, tracking_number?, tracking_url?, status?, shipped_at?, delivered_at?, meta? }order_id (required).{ order_ref, items:[...], payments:[...], totals, currency, customer?, shipping?, meta? }| Method | Path | Description | Params |
|---|---|---|---|
| GET | /v1/orders |
List or filter orders | Query: filters + paging + include flags |
| GET | /v1/orders/summary |
Sales summary | Query: period, loc |
| GET | /v1/orders/customer-report |
Customer spend report | Query: customer_id, period |
| POST | /v1/orders/fulfill |
Update fulfillment | Body: { order_id, items:[...] } |
| POST | /v1/orders/shipments/create |
Create shipment | Body: { order_id, ... } |
| GET | /v1/orders/shipments |
List shipments | Query: order_id |
| POST | /v1/new-order |
Create order | Body: { order_ref, items, payments, totals, currency } |
Examples
# List orders with items
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.myklarity.store/v1/orders?limit=20&include_items=1"
# Create an order
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{ "order_ref":"WEB-1001", "currency":"GBP", "items":[{"product_id":110,"name":"Item","qty":1,"price":9.99}], "payments":[{"method":"card","amount":9.99,"status":"paid"}] }' \
"https://api.myklarity.store/v1/new-order"
Users
Manage staff users and permissions.
q (search by name/email).{id}.{ first_name, last_name, email_address, useradmin, user_active, permissions }.password for admin reset.| Method | Path | Description | Params |
|---|---|---|---|
| GET | /v1/users |
List users | Query: q (optional) |
| GET | /v1/users/{id} |
Get user detail | Path: {id} |
| POST | /v1/users |
Create user | Body: { first_name, last_name, email_address, permissions } |
| POST | /v1/users/{id} |
Update user | Body: partial fields + optional password |
| POST | /v1/users/{id}/delete |
Delete user | Path: {id} |
Example
# Create a user
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{ "first_name":"Ava", "last_name":"Wells", "email_address":"ava@example.com", "useradmin":0, "user_active":1, "permissions":{"orders":1,"inventory":1} }' \
"https://api.myklarity.store/v1/users"
Inventory (GET & POST)
Inventory operations including locations, stocktakes, transfers, and purchasing.
Server-side reads and writes for multi-location stock. Endpoints are grouped by domain for clarity.
Required query params are listed without brackets; optional params are shown in square brackets in the docs only (not in URLs).
loc = location code (e.g., MAIN) or location id (integer). prod = product id (integer).
Locations
Create and manage stock locations used across transfers and reporting.
status=active|all|archived, user (optional).id. Body: { "code":"WHS", "name":"Warehouse", "parent_id":0, "type":"" }user (required).id.| Method | Path | Description | Params |
|---|---|---|---|
| GET | /v1/locations |
List locations | Query: status, user |
| POST | /v1/locations/{id} |
Update location | Path: id Body: { code?, name?, parent_id?, type? } |
| GET | /v1/locations/{id}/dry-run-archive |
Archive pre-check | Path: id Query: user |
| GET | /v1/locations/{id}/archive |
Archive location | Path: id |
Examples
# List locations
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.myklarity.store/v1/locations?status=active"
# Dry-run archive
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.myklarity.store/v1/locations/3/dry-run-archive?user=18"
# Archive a location
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.myklarity.store/v1/locations/3/archive"
Stocktakes
Create and review stocktake batches and their counted lines.
{ loc, user_id?, type?, focus?, category?, products?, abc_class?, range?, lock? }loc (optional), status (optional).id (int).{ line_id, counted_qty, note?, user_id? }{ batch_id, user_id? }{ batch_id, user_id? }Transfers
Move stock between locations and track transfer status.
{ id, qty, note?, user_id? }{ id, user_id? }{ "from_location_id":2, "to_location_id":1, "product_id":110, "qty":10, "note":"Restock", "user_id":18 }{ "transfer_id":501, "transfer_line_id":1, "qty":5, "user_id":18 }loc, prod (optional)loc, prod (optional)| Method | Path | Description | Params |
|---|---|---|---|
| POST | /v1/inventory/create-transfer |
Create transfer | Body: { from_location_id, to_location_id, product_id, qty, note?, user_id? } |
| POST | /v1/inventory/update-transfer |
Update transfer | Body: { id, qty, note?, user_id? } |
| POST | /v1/inventory/delete-transfer |
Delete transfer | Body: { id, user_id? } |
| POST | /v1/inventory/receipt-transfer |
Receive transfer line | Body: { transfer_id, transfer_line_id?, qty, user_id? } |
| GET | /v1/inventory/transfers |
Transfers | Query: loc (string|int, required), prod (optional) |
| GET | /v1/inventory/pending |
Pending inbound | Query: loc (string|int, required), prod (optional) |
Examples
# Create a transfer WHS -> MAIN
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{ "from_location_id":2, "to_location_id":1, "product_id":110, "qty":10, "note":"Restock" }' \
"https://api.myklarity.store/v1/inventory/create-transfer"
# Receive a pending transfer line
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{ "transfer_id":501, "transfer_line_id":1, "qty":5 }' \
"https://api.myklarity.store/v1/inventory/receipt-transfer"
Ops Flags
Dashboard-ready summaries for operational attention and prioritisation.
loc (optional), period (optional: week, month, year).| Field | Type | Notes |
|---|---|---|
stocktake_locks[] |
array | Active stocktake locks by location (if any). |
pending_orders.total |
int | Paid orders awaiting fulfilment. |
pending_transfers.total |
int | Transfers pending approval or in transit. |
pending_transfer_orders.total |
int | Paid orders waiting on transfers. |
prod_replens.total |
int | Products at or below replenish threshold. |
open_pos.total |
int | Open purchase orders (not received/cancelled). |
open_pos.units_open |
int | Total units outstanding across open POs. |
overdue_pos.total |
int | Open POs past expected date. |
top_locations.items[] |
array | Top locations by paid order value in the requested period (defaults to 14 days). |
top_channels.items[] |
array | Top channels by paid order value in the requested period (defaults to 14 days). |
Example response
Example request
# Ops flags for MAIN, weekly window
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.myklarity.store/v1/inventory/ops-flags?loc=MAIN&period=week"
# Ops flags for all locations, monthly window
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.myklarity.store/v1/inventory/ops-flags?period=month"
{
"ok": true,
"stocktake_locks": [],
"pending_orders": { "total": 12 },
"pending_transfers": { "total": 3, "items": [ { "risk": "high" } ] },
"pending_transfer_orders": { "total": 1 },
"prod_replens": { "total": 5 },
"open_pos": { "total": 2, "units_open": 140 },
"overdue_pos": { "total": 1 },
"top_locations": {
"period_days": 14,
"items": [ { "location_id": 1, "code": "MAIN", "orders": 22, "total": 15420.50 } ]
},
"top_channels": {
"period_days": 14,
"items": [ { "channel": "online", "orders": 18, "total": 12010.00 } ]
}
}
Status
Update status for transfers and purchase orders.
{ "type":"transfer|purchase-order", "id":123, "status":"..." , ... }If
type="transfer": include from_location, to_location; status ∈ in_transit,received,partially_received.If
type="purchase-order": include reference; status ∈ approved,open,cancelled,received,partially_received.
| Method | Path | Description | Params |
|---|---|---|---|
| POST | /v1/inventory/status |
Update status (transfer or purchase-order) | Body: { type, id, status, from_location?, to_location?, reference? } |
Examples
# Update status: transfer -> in_transit
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{ "type":"transfer", "id":702, "from_location":"WHS", "to_location":"MAIN", "status":"in_transit" }' \
"https://api.myklarity.store/v1/inventory/status"
# Update status: purchase order -> approved
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{ "type":"purchase-order", "id":301, "reference":"PO-301", "status":"approved" }' \
"https://api.myklarity.store/v1/inventory/status"
Purchase Orders
Create, retrieve, and update purchase orders and their lines.
reference (string), delivery_note (string), location_id (int)id (int)loc (int), status=open|partially_received|closed|cancelled|received|pending_approval|all, limit (optional){ to_location_id, supplier_id?, expected_date?, reference?, note?, lines:[{ product_id, qty_ordered, cost_each? }], user_id? }{ "id":123, "reference":"PO-001", "lines":[{"line_id":1,"qty":5}], "note":"optional", "grn":"optional", "delivery_note":"optional" }{ "id":123, "reference":"PO-001", "supplier_id":77, "expected_date":"2025/11/20", "status":"open", "note":"..." } (only supplied fields update){ "id":123, "asn":"ASN-889", "delivery_note":"DN-556", "external_ref":"ERP-42" } (optional fields accepted)| Method | Path | Description | Params |
|---|---|---|---|
| GET | /v1/inventory/purchase-orders/find |
Find PO lines | Query: reference, delivery_note, location_id |
| GET | /v1/inventory/purchase-orders/{id} |
Get PO by id | Path: id |
| GET | /v1/inventory/purchase-orders |
List POs for location | Query: loc, status (enum incl. all), limit? |
| POST | /v1/inventory/purchase-orders |
Create PO | Body: { to_location_id, supplier_id?, expected_date?, reference?, note?, lines:[{ product_id, qty_ordered, cost_each? }], user_id? } |
| POST | /v1/inventory/purchase-orders/receive |
Receipt PO lines | Body: { id, reference, lines:[{ line_id, qty }], note?, grn?, delivery_note? } |
| POST | /v1/inventory/purchase-orders/update |
Update PO | Body: { id, reference, supplier_id?, expected_date?, status?, note? } |
| POST | /v1/inventory/purchase-orders/attach-asn |
Attach ASN / delivery note | Body: { id, asn?, delivery_note?, external_ref? } |
Examples
# Find PO lines by reference + delivery note
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.myklarity.store/v1/inventory/purchase-orders/find?reference=PO-001&delivery_note=DN-888&location_id=1"
# Receipt PO lines (GRN)
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{ "id":123, "reference":"PO-001", "lines":[{"line_id":7,"qty":5},{"line_id":8,"qty":2}], "grn":"GRN-009", "delivery_note":"DN-888", "note":"partial receipt" }' \
"https://api.myklarity.store/v1/inventory/purchase-orders/receive"
# Attach ASN metadata
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{ "id":123, "asn":"ASN-889", "delivery_note":"DN-888", "external_ref":"ERP-42" }' \
"https://api.myklarity.store/v1/inventory/purchase-orders/attach-asn"
# Update PO fields
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{ "id":123, "reference":"PO-001", "supplier_id":77, "expected_date":"2025/11/20", "status":"open", "note":"ETA confirmed" }' \
"https://api.myklarity.store/v1/inventory/purchase-orders/update"
Suppliers
List supplier records used on purchase orders.
id and supplier.Products (Lookup)
Lookup products for inventory workflows such as transfers and receipts.
q (optional search).Levels
Read per-location stock levels and availability.
loc (required), product or prod (optional)| Method | Path | Description | Params |
|---|---|---|---|
| GET | /v1/inventory/levels |
Levels | Query: loc (string|int, required), product or prod (int, optional) |
Examples
# Levels for a location (all products)
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.myklarity.store/v1/inventory/levels?loc=MAIN"
# Levels for a location and a single product
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.myklarity.store/v1/inventory/levels?loc=MAIN&product=110"
Receipts
List inventory receipts and inbound stock history.
loc (required), prod (optional)| Method | Path | Description | Params |
|---|---|---|---|
| GET | /v1/inventory/receipts |
Supplier receipts | Query: loc (string|int, required), prod (optional) |
Examples
# Receipts for a location
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.myklarity.store/v1/inventory/receipts?loc=MAIN"
Adjustments
Track manual adjustments to inventory levels.
{ "location_id":1, "product_id":110, "qty":-2, "reason":"stock_take", "note":"Counted", "user_id":18 }loc (required), prod (optional)| Method | Path | Description | Params |
|---|---|---|---|
| POST | /v1/inventory/adjust |
Adjust +/- | Body: { location_id, product_id, qty, reason, note?, user_id? } |
| GET | /v1/inventory/adjustments |
Adjustments | Query: loc (string|int, required), prod (optional) |
Examples
# Adjustment (stock take)
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{ "location_id":1, "product_id":110, "qty":-2, "reason":"stock_take", "note":"Counted" }' \
"https://api.myklarity.store/v1/inventory/adjust"
Audit
Audit trail of inventory changes by product and location.
loc (optional), prod (optional)| Method | Path | Description | Params |
|---|---|---|---|
| GET | /v1/inventory/audit |
Movement log | Query: loc (string|int, optional), prod (int, optional) |
POS Terminals
Endpoints for managing POS terminals, user profiles, PINs, assignments, and terminal activity.
Admin endpoints require API key auth. POS sessions use the token issued by /v1/pos/auth.
Authentication
{ till, password, company } for login. For reconnection, include masterPin and send current token via X-POS-Token or Authorization.{ UUID?, name?, terminal_id? }. With POS token, terminal is inferred; with API key, pass terminal_id.| Method | Path | Description | Params |
|---|---|---|---|
| POST | /v1/pos/auth |
Authenticate and issue/rotate POS token. | Body: { till, password, company } or { masterPin } with token header. |
| POST | /v1/pos/terminal-activity |
Log terminal activity. | Body: { UUID?, name?, terminal_id? } |
Terminals
{ username, password, master_pin, store_id, region_id?, is_active?, company? }id. Body supports username, store_id, region_id, is_active, password, master_pin.id.| Method | Path | Description | Params |
|---|---|---|---|
| GET | /v1/pos/terminals |
List terminals | Auth: API key |
| POST | /v1/pos/terminals |
Create terminal | Body: { username, password, master_pin, store_id, region_id?, is_active?, company? } |
| POST | /v1/pos/terminals/{id} |
Update terminal | Path: id Body: { username?, store_id?, region_id?, is_active?, password?, master_pin? } |
| POST | /v1/pos/terminals/{id}/delete |
Delete terminal | Path: id |
User Profiles
{ name, description?, active_days?, active_from?, active_to?, is_active? }id. Body supports name, description, active_days, active_from, active_to, is_active.id.| Method | Path | Description | Params |
|---|---|---|---|
| GET | /v1/pos/user-profiles |
List user profiles | Auth: API key |
| POST | /v1/pos/user-profiles |
Create user profile | Body: { name, description?, active_days?, active_from?, active_to?, is_active? } |
| POST | /v1/pos/user-profiles/{id} |
Update user profile | Path: id Body: { name?, description?, active_days?, active_from?, active_to?, is_active? } |
| POST | /v1/pos/user-profiles/{id}/delete |
Delete user profile | Path: id |
PINs
profile_id (optional).{ user_profile_id, name, pin, is_active?, UUID? }id. Body supports name, user_profile_id, is_active.id. Body: { pin }.id.| Method | Path | Description | Params |
|---|---|---|---|
| GET | /v1/pos/pins |
List PINs | Query: profile_id |
| POST | /v1/pos/pins |
Create PIN | Body: { user_profile_id, name, pin, is_active?, UUID? } |
| POST | /v1/pos/pins/{id} |
Update PIN | Path: id Body: { name?, user_profile_id?, is_active? } |
| POST | /v1/pos/pins/{id}/reset |
Reset PIN | Path: id Body: { pin } |
| POST | /v1/pos/pins/{id}/delete |
Delete PIN | Path: id |
Assignments
terminal_id (optional).{ terminal_id, user_profile_ids:[...] }| Method | Path | Description | Params |
|---|---|---|---|
| GET | /v1/pos/terminal-assignments |
List terminal assignments | Query: terminal_id |
| POST | /v1/pos/terminal-assignments |
Replace terminal assignments | Body: { terminal_id, user_profile_ids:[...] } |
Examples
# POS login
curl -X POST -H "Content-Type: application/json" \
-d '{ "till":"till-01", "password":"secret", "company":"acme" }' \
"https://api.myklarity.store/v1/pos/auth"
# Refresh token with master pin
curl -X POST -H "Content-Type: application/json" -H "X-POS-Token: CURRENT_TOKEN" \
-d '{ "masterPin":"1234" }' \
"https://api.myklarity.store/v1/pos/auth"
Pagination & Sorting
Use paging and sorting parameters for list endpoints.
- Pagination:
page(1-based),limit(1-60). Defaults vary by endpoint (commonly 24). - Sorting:
sort=newest|price_asc|price_desc(where supported).
# Top 4 newest items in "drinks"
GET /v1/products-by-category/drinks?limit=4&sort=newest
Debugging pagination
Quick checks when results look incomplete.
?limit=1 to confirm paging.- In storefront templates using
page-limit markup, that value overrides the URL limit unless you explicitly set ?limit=1.
Error Model
Errors include an HTTP status and a short machine-readable code.
401 Unauthorized
{
"ok": false,
"error": "unauthorized",
"hint": "invalid_api_key"
}
404 Not Found
{
"ok": false,
"error": "not_found"
}
405 Method Not Allowed
{
"ok": false,
"error": "method_not_allowed"
}
CORS & Preflight
How browsers should preflight and access the API from web apps.
Allowed origins reflect https://*.myklarity.store. Preflight (OPTIONS) returns 204 with:
Access-Control-Allow-Origin: https://<sub>.myklarity.store
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization
Access-Control-Max-Age: 86400
api.myklarity.store from your server.
API Roadmap
Planned improvements and upcoming capabilities.
- Webhook Notifications for inventory updates and price changes.
- Batch Endpoints (e.g., multiple handles in one request).
- Variant/Options API with SKU-level availability.
- Expanded Search (full-text and suggestions).
- Rate Limit Headers for proactive client handling.
- Signed Media URLs for private asset delivery.