Complete API documentation for VBPi AI. Build powerful integrations with your restaurant management systems.
https://your-server.com
http://localhost:8000
v2.5.0
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"}'
Your data stays on your infrastructure. No external APIs, no cloud storage, complete data sovereignty.
/
Get service information and status
{
"service": "Restaurant BI Analyzer Tool Server",
"version": "2.5.0",
"status": "running",
"docs": "/docs",
"openapi": "/openapi.json",
"deployment": "on-premises"
}
/api/v1/health
Check service health and connectivity to Oracle Simphony APIs
{
"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"
}
}
{
"status": "unhealthy",
"version": "2.5.0",
"timestamp": "2025-10-14T10:30:00Z",
"services": {
"bi_service": "down",
"gen2_service": "up"
},
"error": "BI service connection failed"
}
/api/v1/analyze_data
Analyze restaurant data using natural language queries. This is the primary endpoint for all AI-powered analytics.
{
"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 |
{
"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"
}
}
# 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"
/api/v1/chat/session/{session_id}/info
Get information about a chat session
{
"session_id": "550e8400-e29b-41d4-a716-446655440000",
"exists": true,
"message_count": 5,
"last_activity": "2025-10-14T10:30:00Z",
"storage_type": "redis"
}
/api/v1/chat/session/{session_id}
Clear chat history for a specific session
{
"session_id": "550e8400-e29b-41d4-a716-446655440000",
"cleared": true
}
/api/v1/chat/stats
Get overall chat memory statistics
{
"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"
}
}
VBPi AI automatically selects the right tools based on your natural language query. Here are the available integrations:
# 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
# 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
# Weather Correlation (opt-in)
get_weather_data() # Local weather for sales correlation
# Industry News (opt-in)
get_restaurant_news() # Industry trends and insights
{
"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"
}
}
}
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 |
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")
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?');
# 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
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);
Need help integrating VBPi AI? Our developer support team is here to assist.