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.com

Authentication

Secure your API requests with JWT tokens

Endpoints

POST/auth/login
Authenticate user and get JWT token
POST/auth/refresh
Refresh expired JWT token
POST/auth/logout
Invalidate JWT token

Code 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/orders
List all orders
POST/orders
Create a new order
GET/orders/{id}
Get order details
PUT/orders/{id}
Update order
DELETE/orders/{id}
Cancel order

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/voice/process
Process voice command
GET/voice/models
List available voice models
POST/voice/train
Train custom voice model

Code 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/analytics/sales
Get sales analytics
GET/analytics/customers
Get customer insights
GET/analytics/inventory
Get inventory analytics

Code 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/sdk

Python SDK

Python library for server-side integrations

pip install unified-spectrum-sdk

Postman Collection

Ready-to-use API collection for testing

Import collection

Need Help with Integration?

Our developer support team is here to help you build amazing integrations