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.

Header
Authorization: Bearer <API_KEY>
Generate your key in Store Admin > Settings > API > Generate key. Keep it secret; treat it like a password.
# 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.

Path params
Shown as {param} (required).
Query params
Optional unless stated. Arrays are CSV (a,b,c).
Booleans
true/false (case-insensitive).
Money
Use price_cents for exact math; price_formatted is display-only.
Envelope
{ ok, data, total? }. total appears on list endpoints.

Barcode

Create barcode images for labels and printing from EAN, ISBN, or SKU.

POST
/v1/barcode
Generate a barcode image from ISBN, SKU, or EAN.
Body: { 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.

GET
/v1/product/{handle}
Fetch a single product by handle.
Path: handle (string). Optional query: include_stock_by_loc.
GET
/v1/products
List products by location with stock context.
Query: loc (required), include_stock_by_loc (optional).
GET
/v1/products-all
List products 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; q; page, limit, sort.
GET
/v1/search/products
Search products by title or description (partial match).
Query: 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.

GET
/v1/category/{slug}
Fetch a single category by slug.
Path: slug (string). Returns category metadata and body.
GET
/v1/products-by-category/{slug}
List products in a category (hierarchy-aware).
Path: 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.

GET
/v1/products-by-collection/{slug}
List products in a collection.
Path: 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.

GET
/v1/assets/{id}
Fetch a single asset by id.
Path: id (int).
GET
/v1/assets?ids=1,2,3
Fetch multiple assets by id list (CSV).
Query: 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.

GET
/v1/orders
List or filter orders.
Query: id, order_ref, digital_string, status, customer_id, user_id, location_id, from, to, fulfilled, limit, offset, include_items, include_payments.
GET
/v1/orders/summary
Sales summary for a period.
Query: period=today|thisweek|thismonth|thisyear, loc=all|CODE|ID.
GET
/v1/orders/customer-report
Customer spend report.
Query: customer_id (required), period=week|month|all.
POST
/v1/orders/fulfill
Update line fulfillment and recalc order status.
Body: { 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.
POST
/v1/orders/shipments/create
Create a shipment record.
Body: { order_id, carrier?, tracking_number?, tracking_url?, status?, shipped_at?, delivered_at?, meta? }
GET
/v1/orders/shipments
List shipments for an order.
Query: order_id (required).
POST
/v1/new-order
Create an order.
Body: { 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.

GET
/v1/users
List users.
Query: q (search by name/email).
GET
/v1/users/{id}
Fetch a single user.
Path param: {id}.
POST
/v1/users
Create a user (sends welcome/reset email).
Body: { first_name, last_name, email_address, useradmin, user_active, permissions }.
POST
/v1/users/{id}
Update a user.
Body supports partial updates. Optional password for admin reset.
POST
/v1/users/{id}/delete
Delete a user.
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.

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

GET
/v1/locations
List locations (optionally filtered).
Query: status=active|all|archived, user (optional).
POST
/v1/locations/{id}
Update a location.
Path: id. Body: { "code":"WHS", "name":"Warehouse", "parent_id":0, "type":"" }
GET
/v1/locations/{id}/dry-run-archive
Pre-check if a location can be archived.
Query: user (required).
GET
/v1/locations/{id}/archive
Archive a location.
Path: 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.

POST
/v1/inventory/stocktakes
Create a stocktake batch for a location.
Body: { loc, user_id?, type?, focus?, category?, products?, abc_class?, range?, lock? }
GET
/v1/inventory/stocktakes
List stocktake batches.
Query: loc (optional), status (optional).
GET
/v1/inventory/stocktakes/{id}
Fetch a stocktake batch and its lines.
Path: id (int).
POST
/v1/inventory/stocktakes-line
Update counted qty for a line.
Body: { line_id, counted_qty, note?, user_id? }
POST
/v1/inventory/stocktakes-post
Apply variances to stock.
Body: { batch_id, user_id? }
POST
/v1/inventory/stocktakes-cancel
Cancel a stocktake batch.
Body: { batch_id, user_id? }

Transfers

Move stock between locations and track transfer status.

POST
/v1/inventory/create-transfer
Create a transfer (from → to).
POST
/v1/inventory/update-transfer
Update a pending transfer line qty.
{ id, qty, note?, user_id? }
POST
/v1/inventory/delete-transfer
Delete a pending transfer.
{ id, user_id? }
{ "from_location_id":2, "to_location_id":1, "product_id":110, "qty":10, "note":"Restock", "user_id":18 }
POST
/v1/inventory/receipt-transfer
Receive a pending transfer line.
{ "transfer_id":501, "transfer_line_id":1, "qty":5, "user_id":18 }
GET
/v1/inventory/transfers
Transfers where the location is source or destination.
Query: loc, prod (optional)
GET
/v1/inventory/pending
Inbound transfer lines expected at the location.
Query: 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.

GET
/v1/inventory/ops-flags
Operational flags for fulfilment, transfers, replenishment, and purchasing.
Query: 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.

POST
/v1/inventory/status
Update status for a transfer or purchase-order.
Body: { "type":"transfer|purchase-order", "id":123, "status":"..." , ... }
If type="transfer": include from_location, to_location; statusin_transit,received,partially_received.
If type="purchase-order": include reference; statusapproved,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.

GET
/v1/inventory/purchase-orders/find
Find PO lines by PO reference and/or delivery note.
Query: reference (string), delivery_note (string), location_id (int)
GET
/v1/inventory/purchase-orders/{id}
Retrieve a purchase order by ID.
Path: id (int)
GET
/v1/inventory/purchase-orders
List POs for a location with status filter.
Query: loc (int), status=open|partially_received|closed|cancelled|received|pending_approval|all, limit (optional)
POST
/v1/inventory/purchase-orders
Create a purchase order.
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 into a location (GRN).
Body: { "id":123, "reference":"PO-001", "lines":[{"line_id":1,"qty":5}], "note":"optional", "grn":"optional", "delivery_note":"optional" }
POST
/v1/inventory/purchase-orders/update
Update PO fields.
Body: { "id":123, "reference":"PO-001", "supplier_id":77, "expected_date":"2025/11/20", "status":"open", "note":"..." } (only supplied fields update)
POST
/v1/inventory/purchase-orders/attach-asn
Attach ASN/delivery note metadata to a PO.
Body: { "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.

GET
/v1/inventory/suppliers
List suppliers.
Returns id and supplier.

Products (Lookup)

Lookup products for inventory workflows such as transfers and receipts.

GET
/v1/inventory/products
Minimal product list for dropdowns.
Query: q (optional search).

Levels

Read per-location stock levels and availability.

GET
/v1/inventory/levels
On-hand, reserved, available for a location; optionally for a single product.
Query: 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.

GET
/v1/inventory/receipts
Supplier receipts into the location.
Query: 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.

POST
/v1/inventory/adjust
Adjust on-hand (+/-) with a reason.
{ "location_id":1, "product_id":110, "qty":-2, "reason":"stock_take", "note":"Counted", "user_id":18 }
GET
/v1/inventory/adjustments
Adjustments at the location.
Query: 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.

GET
/v1/inventory/audit
Movement log filtered by location and/or product.
Query: 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

POST
/v1/pos/auth
Authenticate a terminal and issue or rotate a POS token.
Body: { till, password, company } for login. For reconnection, include masterPin and send current token via X-POS-Token or Authorization.
POST
/v1/pos/terminal-activity
Log POS activity for a terminal.
Body: { 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

GET
/v1/pos/terminals
List POS terminals with last activity details.
Auth: API key.
POST
/v1/pos/terminals
Create a POS terminal.
Body: { username, password, master_pin, store_id, region_id?, is_active?, company? }
POST
/v1/pos/terminals/{id}
Update a POS terminal.
Path: id. Body supports username, store_id, region_id, is_active, password, master_pin.
POST
/v1/pos/terminals/{id}/delete
Delete a POS terminal.
Path: 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

GET
/v1/pos/user-profiles
List POS user profiles.
Auth: API key.
POST
/v1/pos/user-profiles
Create a user profile.
Body: { name, description?, active_days?, active_from?, active_to?, is_active? }
POST
/v1/pos/user-profiles/{id}
Update a user profile.
Path: id. Body supports name, description, active_days, active_from, active_to, is_active.
POST
/v1/pos/user-profiles/{id}/delete
Delete a user profile.
Path: 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

GET
/v1/pos/pins
List POS user PINs.
Query: profile_id (optional).
POST
/v1/pos/pins
Create a PIN.
Body: { user_profile_id, name, pin, is_active?, UUID? }
POST
/v1/pos/pins/{id}
Update PIN metadata.
Path: id. Body supports name, user_profile_id, is_active.
POST
/v1/pos/pins/{id}/reset
Reset a PIN.
Path: id. Body: { pin }.
POST
/v1/pos/pins/{id}/delete
Delete a PIN.
Path: 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

GET
/v1/pos/terminal-assignments
List terminal to user-profile assignments.
Query: terminal_id (optional).
POST
/v1/pos/terminal-assignments
Replace assignments for a terminal.
Body: { 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.

- Expect more pages? Temporarily set ?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
If your app runs on a different domain, proxy requests to 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.
Want something prioritized? Reach out to your Klarity account team.