Quick Start
Get up and running in 5 minutes
API Reference
Products, Receipts & Shifts
Offline Mode
How offline sync works
Getting Started
Welcome to SmartPOS AI! This guide will help you get your point of sale system up and running quickly.
Setup
SmartPOS AI is a cloud-based solution, so there's no software to install. Simply:
- Create your account at smartposai.com/register
- Verify your email address
- Set up your business profile
- Add your first products
Configuration
After registration, configure your settings in the Backoffice:
- Business Details: Name, address, tax information
- Tax Rates: Configure your regional tax rates
- Payment Methods: Enable cash, card, and other payment options
- Receipt Settings: Customize your receipt layout
API Authentication
The SmartPOS API provides read-only access to your products, receipts, and shifts. API access requires the Professional plan or above.
Getting Your API Key
- Log in to your Backoffice
- Go to Settings → API
- Click Generate API Key
- Copy the key immediately — it won't be shown in full again
Include your API key in the X-API-Key header with every request:
🔐 Keep Your API Key Secure
Never expose your API key in client-side code or public repositories. Use environment variables to store sensitive credentials. You can regenerate your key at any time in Settings → API.
Base URL
All API endpoints use your subdomain as the base URL:
Products API
Retrieve your product catalog and stock levels.
/api/v1/products
List all products with optional filtering
Query Parameters
store_id— Filter by store (integer)category_id— Filter by category (integer)status— Filter by status:activeorinactive(default: all)limit— Results per page (default: 50, max: 200)offset— Pagination offset (default: 0)
Example Response
/api/v1/products/{id}
Get a single product with per-store stock levels
Example Response
Receipts API
Access completed sales receipts and their line items.
/api/v1/receipts
List receipts with date range and store filtering
Query Parameters
start_date— Start date inYYYY-MM-DDformatend_date— End date inYYYY-MM-DDformatstore_id— Filter by store (integer)limit— Results per page (default: 50, max: 200)offset— Pagination offset (default: 0)
Example Response
/api/v1/receipts/{id}
Get a single receipt with all line items
Example Response
Shifts API
Access employee shift data including cash tracking and sales totals.
/api/v1/shifts
List shifts with filtering by date, store, and status
Query Parameters
start_date— Start date inYYYY-MM-DDformatend_date— End date inYYYY-MM-DDformatstore_id— Filter by store (integer)status— Filter by status:openorclosedlimit— Results per page (default: 50, max: 200)offset— Pagination offset (default: 0)
Example Response
/api/v1/shifts/{id}
Get shift details including sales breakdown
Example Response
Errors & Rate Limits
The API uses standard HTTP status codes. All error responses include a JSON body with a descriptive message.
Status Codes
200— Success401— Invalid or missing API key403— Feature not available on your plan404— Resource not found500— Internal server error
Error Response Format
Rate Limiting
API requests are limited to 100 requests per minute per API key. If you exceed this limit, you'll receive a 429 status code. Wait a moment before retrying.
Webhooks
Webhooks allow you to receive real-time HTTP notifications when events occur in your SmartPOS AI account. When an event is triggered, we send a POST request with a JSON payload to your registered URL.
Plan Requirement
Webhooks require the Professional plan or above. Free and Starter plans do not have webhook access.
Supported Events
order.created— A new receipt/sale has been completedorder.deleted— A receipt was voided/deletedproduct.created— A new product was addedproduct.updated— A product was modified (name, price, stock, etc.)product.deleted— A product was deletedinventory.low_stock— An item in a store reached or fell below its alert level (sent once, with store, stock and level; checked hourly)customer.created— A new customer was addedcustomer.updated— A customer record was modifiedshift.opened— A new shift was startedshift.closed— A shift was endedrefund.created— A refund was issued
/api/v1/webhooks
List all registered webhooks
Example Response
/api/v1/webhooks
Register a new webhook endpoint
Request Body
/api/v1/webhooks/{id}
Delete a webhook by ID
Webhook Payload Format
When an event occurs, we send a POST request to your URL with this JSON structure (example: order.created; the fields inside data depend on the event):
Receipts paid from a table (restaurant mode) send fewer fields in data:
- closing a table:
id,receipt_number,store_id,table_name,order_type(dine_in),subtotal,discount,total,payment_method,items_count,created_at - paying one part of a split bill:
id,receipt_number,store_id,order_type(dine_in),total,payment_method,is_split,split_number,created_at
Request Headers
Every webhook delivery includes these HTTP headers:
Content-Type: application/jsonUser-Agent: SmartPOS-Webhook/1.0X-SmartPOS-Event— The event name (e.g.order.created)X-SmartPOS-Signature—sha256=followed by the HMAC-SHA256 signature of the request body (see below)X-SmartPOS-Delivery— Unique delivery ID (the same for every attempt of one delivery)X-SmartPOS-Version— Payload version (currently1.0; not sent with the test ping)
Verifying the Signature (Recommended)
Each webhook is signed with HMAC-SHA256 using your webhook secret (it starts with whsec_; you can view it or generate a new one in Backoffice → Settings → API → Webhooks). The X-SmartPOS-Signature header has the form sha256=<hex>. Compute the signature over the raw request body exactly as received (not over re-encoded JSON) to confirm the request really came from SmartPOS AI.
🔐 Always use timing-safe comparison
Use crypto.timingSafeEqual() (Node) or hash_equals() (PHP) when comparing signatures. Plain string comparison is vulnerable to timing attacks.
Retry Policy
If your endpoint does not return a 2xx status code within 10 seconds, the attempt fails. A failed attempt is retried right away after a short pause (0.5 s, then 1 s, 1.5 s…), up to the webhook's max_retries attempts in total (1–5, default 3). A new attempt only starts while less than 9 seconds have passed, so an endpoint that does not answer in time (10 s) gets a single attempt. There are no later, delayed retries.
Every delivery is logged. You can view the log and re-send a failed delivery in Backoffice → Settings → API → Webhooks. All attempts of one delivery carry the same X-SmartPOS-Delivery ID; a manual re-send gets a new one.
/api/v1/webhooks/{id}/test
Send a test payload (event test.ping) to your webhook endpoint (useful for verifying your handler before going live)
Webhook Reliability
If your endpoint returns a non-2xx status code, the delivery is marked as failed. After 10 consecutive failures, the webhook is automatically deactivated. You can re-activate it from Settings → API → Webhooks.
Offline Mode
SmartPOS AI works even without an internet connection. Here's how it works:
- Transactions are stored locally using IndexedDB
- Data automatically syncs when connection is restored
- Products and prices are cached for offline access
- Receipts can be printed locally