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
receipt.created— A new receipt/sale has been completedproduct.created— A new product was addedproduct.updated— A product was modified (name, price, stock, etc.)product.deleted— A product was deletedshift.opened— A new shift was startedshift.closed— A shift was endedcustomer.created— A new customer was addedcustomer.updated— A customer record was modifiedstock.adjusted— Stock level was manually adjustedrefund.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:
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.receipt.created)X-SmartPOS-Signature— HMAC-SHA256 signature of the request body (see below)X-SmartPOS-Delivery-Id— Unique delivery ID for idempotencyX-SmartPOS-Timestamp— Unix timestamp of when the event was generated
Verifying the Signature (Recommended)
Each webhook is signed with HMAC-SHA256 using your webhook secret (shown once when you create the webhook). Verify the X-SmartPOS-Signature header 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 delivery is marked as failed and retried with exponential backoff:
- 1st retry: after 1 minute
- 2nd retry: after 5 minutes
- 3rd retry: after 30 minutes
- 4th retry: after 2 hours
- 5th retry: after 12 hours
After 5 failed retries (or 10 total consecutive failures across deliveries), the webhook is automatically deactivated. Use the X-SmartPOS-Delivery-Id header to handle duplicates idempotently if a retry succeeds after you already processed it.
/api/v1/webhooks/{id}/test
Send a test payload 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