Developer Portal

Complete API documentation for VBPi AI. Build powerful integrations with your restaurant management systems.

Base URL
https://your-server.com
Local (On-Premises)
http://localhost:8000
API Version
v2.5.0

šŸ” Authentication

VBPi AI uses local deployment - no external authentication required. All API calls are made within your secure network.

# All requests run on YOUR infrastructure # No API keys to external services # No data leaves your premises curl -X POST http://localhost:8000/api/v1/analyze_data \ -H "Content-Type: application/json" \ -d '{"query": "Show me today's sales"}'
šŸ”’ 100% Local & Secure

Your data stays on your infrastructure. No external APIs, no cloud storage, complete data sovereignty.

šŸ“” Core Endpoints

GET /

Get service information and status

Response 200

{ "service": "Restaurant BI Analyzer Tool Server", "version": "2.5.0", "status": "running", "docs": "/docs", "openapi": "/openapi.json", "deployment": "on-premises" }

GET /api/v1/health

Check service health and connectivity to Oracle Simphony APIs

Response 200

{ "status": "healthy", "version": "2.5.0", "timestamp": "2025-10-14T10:30:00Z", "services": { "bi_service": "up", "gen2_service": "up", "weather_service": "up", "news_service": "up" } }

Response 503

{ "status": "unhealthy", "version": "2.5.0", "timestamp": "2025-10-14T10:30:00Z", "services": { "bi_service": "down", "gen2_service": "up" }, "error": "BI service connection failed" }

šŸ¤– Data Analysis (Natural Language)

POST /api/v1/analyze_data

Analyze restaurant data using natural language queries. This is the primary endpoint for all AI-powered analytics.

Request Body

{ "query": "Show me sales for yesterday at all locations", "session_id": "optional-uuid-for-conversation-context" }
Parameter Type Required Description
query string Yes Natural language question about restaurant data
session_id string (UUID) No Session ID for conversation context and follow-up questions

Response 200

{ "result": "šŸ“Š Sales Analysis for Yesterday\n\nTotal Revenue: $12,450.00\nTransaction Count: 423\nAverage Check: $29.43\n\nšŸŖ By Location:\n• Downtown: $5,230 (178 transactions)\n• Uptown: $4,120 (145 transactions)\n• Suburban: $3,100 (100 transactions)\n\nšŸ’” Insights:\n• Downtown location up 15% vs previous day\n• Peak hours: 12-2pm and 6-8pm\n• Upsell opportunities in beverages", "success": true, "error": null, "metadata": { "query": "Show me sales for yesterday at all locations", "timestamp": "2025-10-14T10:30:00Z", "execution_time": 1.23, "tools_used": ["get_sales_summary", "get_locations"], "session_id": "550e8400-e29b-41d4-a716-446655440000" } }

Example Queries

# Sales Analysis "Show me sales for last week" "What was our revenue yesterday?" "Compare this week's sales to last week" # Employee Performance "Show me top 5 servers by tips" "Which employees worked overtime this month?" "List all servers scheduled for tomorrow" # Menu Analytics "What are our top 10 selling items?" "Which menu items have the highest waste?" "Show me items with low inventory" # Operations "Show all voids from yesterday" "What's our average table turn time?" "List all locations and their status"

šŸ’¬ Chat Session Management

GET /api/v1/chat/session/{session_id}/info

Get information about a chat session

Response 200

{ "session_id": "550e8400-e29b-41d4-a716-446655440000", "exists": true, "message_count": 5, "last_activity": "2025-10-14T10:30:00Z", "storage_type": "redis" }

DELETE /api/v1/chat/session/{session_id}

Clear chat history for a specific session

Response 200

{ "session_id": "550e8400-e29b-41d4-a716-446655440000", "cleared": true }

GET /api/v1/chat/stats

Get overall chat memory statistics

Response 200

{ "redis": { "active_sessions": 45, "total_messages": 234, "avg_messages_per_session": 5.2, "storage_type": "redis" }, "in_memory": { "active_sessions": 12, "total_messages": 67, "avg_messages_per_session": 5.6, "storage_type": "in-memory" } }

šŸ› ļø Available Tools & Capabilities

VBPi AI automatically selects the right tools based on your natural language query. Here are the available integrations:

Oracle Simphony BI API Tools

# Sales & Revenue get_sales_summary() # Daily sales totals by location get_revenue_centers() # Revenue center performance get_sales_by_period() # Sales trends over time # Employee Management get_employee_list() # All employees get_employee_performance() # Tips, hours, sales by employee get_timecards() # Clock in/out records # Menu & Items get_menu_items() # All menu items and pricing get_top_sellers() # Best-performing items get_item_sales() # Sales by menu item # Operations get_guest_checks() # Transaction details get_voids_and_comps() # Voids, comps, discounts get_payment_methods() # Payment type breakdown # Locations get_locations() # All restaurant locations get_location_details() # Specific location info

Oracle Simphony Gen2 API Tools

# Organization Management get_organizations() # All organizations get_organization_units() # Organizational structure # Configuration get_service_areas() # Service area setup get_order_types() # Available order types get_revenue_centers_gen2() # Gen2 revenue centers

External Intelligence (Optional)

# Weather Correlation (opt-in) get_weather_data() # Local weather for sales correlation # Industry News (opt-in) get_restaurant_news() # Industry trends and insights

āš ļø Error Handling

Error Response Format

{ "result": "", "success": false, "error": "Detailed error message", "metadata": { "error_code": "ERROR_TYPE", "timestamp": "2025-10-14T10:30:00Z", "details": { "service": "bi", "operation": "get_sales_summary" } } }

Common Error Codes

Error Code Description Resolution
BI_SERVICE_ERROR Oracle Simphony BI API unavailable Check BI service connectivity and credentials
GEN2_SERVICE_ERROR Oracle Simphony Gen2 API unavailable Verify Gen2 service is running
INVALID_QUERY Query cannot be understood Rephrase query with more specific details
NO_DATA_FOUND Query returned no results Verify date ranges and location references
TIMEOUT Query execution exceeded time limit Simplify query or reduce date range

šŸ’» Code Examples

Python

import requests # Base URL (your local server) BASE_URL = "http://localhost:8000" def analyze_sales(query): """Analyze restaurant data using natural language""" response = requests.post( f"{BASE_URL}/api/v1/analyze_data", json={"query": query} ) if response.status_code == 200: data = response.json() if data["success"]: print(data["result"]) return data else: print(f"Error: {data['error']}") else: print(f"HTTP Error: {response.status_code}") return None # Example usage analyze_sales("Show me sales for yesterday") analyze_sales("What are our top 10 menu items this week?") analyze_sales("List all employees who worked overtime")

JavaScript/Node.js

const axios = require('axios'); const BASE_URL = 'http://localhost:8000'; async function analyzeData(query) { try { const response = await axios.post( `${BASE_URL}/api/v1/analyze_data`, { query } ); if (response.data.success) { console.log(response.data.result); return response.data; } else { console.error('Error:', response.data.error); } } catch (error) { console.error('HTTP Error:', error.message); } } // Example usage analyzeData('Show me sales for yesterday'); analyzeData('What are our top servers by tips?');

cURL

# Simple query curl -X POST http://localhost:8000/api/v1/analyze_data \ -H "Content-Type: application/json" \ -d '{"query": "Show me sales for yesterday"}' # With session for follow-up questions curl -X POST http://localhost:8000/api/v1/analyze_data \ -H "Content-Type: application/json" \ -d '{ "query": "Show me sales for yesterday", "session_id": "550e8400-e29b-41d4-a716-446655440000" }' # Health check curl http://localhost:8000/api/v1/health # Get chat stats curl http://localhost:8000/api/v1/chat/stats

C# / .NET

using System; using System.Net.Http; using System.Text; using System.Text.Json; using System.Threading.Tasks; public class VBPiClient { private readonly HttpClient _client; private const string BaseUrl = "http://localhost:8000"; public VBPiClient() { _client = new HttpClient(); } public async Task AnalyzeData(string query) { var request = new { query }; var json = JsonSerializer.Serialize(request); var content = new StringContent(json, Encoding.UTF8, "application/json"); var response = await _client.PostAsync( $"{BaseUrl}/api/v1/analyze_data", content ); if (response.IsSuccessStatusCode) { var result = await response.Content.ReadAsStringAsync(); var data = JsonSerializer.Deserialize(result); return data.Result; } throw new Exception($"API Error: {response.StatusCode}"); } } // Usage var client = new VBPiClient(); var result = await client.AnalyzeData("Show me sales for yesterday"); Console.WriteLine(result);

šŸ“ž Developer Support

Need help integrating VBPi AI? Our developer support team is here to assist.

šŸ“§ Email Support

Technical questions and integration help

[email protected]

šŸ’¼ Enterprise Support

Dedicated support & custom implementations

[email protected]

šŸ“ž Phone

Direct support line

(718) 576-1224

šŸ“š Documentation

Interactive API docs

http://localhost:8000/docs