API Documentation
Build powerful integrations with Unified Spectrum POS. Our REST API provides access to all core functionality.
API Reference
Base URL
https://api.unifiedspectrum.comAuthentication
Secure your API requests with JWT tokens
Endpoints
POST
Authenticate user and get JWT token/auth/loginPOST
Refresh expired JWT token/auth/refreshPOST
Invalidate JWT token/auth/logoutCode Example
// Authenticate and get JWT token
const response = await fetch('https://api.unifiedspectrum.com/auth/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
email: 'user@example.com',
password: 'your-password'
})
});
const { token } = await response.json();
// Use token in subsequent requests
const ordersResponse = await fetch('https://api.unifiedspectrum.com/orders', {
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
}
});Response Example
{
"success": true,
"data": {
"id": "order_123456",
"status": "completed",
"total": 31.98,
"created_at": "2024-01-15T10:30:00Z"
},
"meta": {
"request_id": "req_789012",
"timestamp": "2024-01-15T10:30:00Z"
}
}Orders
Manage orders and transactions
Endpoints
GET
List all orders/ordersPOST
Create a new order/ordersGET
Get order details/orders/{id}PUT
Update order/orders/{id}DELETE
Cancel order/orders/{id}Code Example
// Create a new order
const order = await fetch('https://api.unifiedspectrum.com/orders', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_JWT_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customer_id: 'cust_123',
items: [
{
product_id: 'prod_456',
quantity: 2,
price: 15.99
}
],
payment_method: 'card',
location_id: 'loc_789'
})
});
const orderData = await order.json();
console.log('Order created:', orderData);Response Example
{
"success": true,
"data": {
"id": "order_123456",
"status": "completed",
"total": 31.98,
"created_at": "2024-01-15T10:30:00Z"
},
"meta": {
"request_id": "req_789012",
"timestamp": "2024-01-15T10:30:00Z"
}
}Voice Commands
Process voice commands and natural language
Endpoints
POST
Process voice command/voice/processGET
List available voice models/voice/modelsPOST
Train custom voice model/voice/trainCode Example
// Process voice command
const voiceResponse = await fetch('https://api.unifiedspectrum.com/voice/process', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_JWT_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
audio_data: 'base64_encoded_audio',
language: 'en-US',
context: 'restaurant_order'
})
});
const result = await voiceResponse.json();
console.log('Voice command result:', result);Response Example
{
"success": true,
"data": {
"id": "order_123456",
"status": "completed",
"total": 31.98,
"created_at": "2024-01-15T10:30:00Z"
},
"meta": {
"request_id": "req_789012",
"timestamp": "2024-01-15T10:30:00Z"
}
}Analytics
Access business intelligence and reports
Endpoints
GET
Get sales analytics/analytics/salesGET
Get customer insights/analytics/customersGET
Get inventory analytics/analytics/inventoryCode Example
// Get sales analytics
const analytics = await fetch('https://api.unifiedspectrum.com/analytics/sales', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_JWT_TOKEN'
},
params: new URLSearchParams({
start_date: '2024-01-01',
end_date: '2024-01-31',
location_id: 'loc_789'
})
});
const salesData = await analytics.json();
console.log('Sales analytics:', salesData);Response Example
{
"success": true,
"data": {
"id": "order_123456",
"status": "completed",
"total": 31.98,
"created_at": "2024-01-15T10:30:00Z"
},
"meta": {
"request_id": "req_789012",
"timestamp": "2024-01-15T10:30:00Z"
}
}SDKs and Tools
JavaScript SDK
Official SDK for Node.js and browser applications
npm install @unified-spectrum/sdkPython SDK
Python library for server-side integrations
pip install unified-spectrum-sdkPostman Collection
Ready-to-use API collection for testing
Import collectionNeed Help with Integration?
Our developer support team is here to help you build amazing integrations