Skip to main content

Salsa as a Service API v2.0

The v2.0 API adds GraphQL support, enhanced webhooks, and new AI forecasting endpoints.

Base URL

https://api.salsaasaservice.com/v2
New in v2.0: GraphQL endpoint at https://api.salsaasaservice.com/graphql

Authentication

All API requests require authentication using your API key.
API Key: Get your API key from the Developer Settings in your dashboard.

Authentication Header

Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY

Rate Limits

  • Free Plan: 1,000 requests per hour
  • Professional Plan: 10,000 requests per hour
  • Enterprise Plan: 100,000 requests per hour
Rate limit headers are included in all responses:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1640995200

Core Endpoints

Inventory Management
Manage salsa ingredients, track stock levels, and monitor freshness.
Recipe Management
Create, update, and manage salsa recipes and production workflows.
Production Tracking
Track salsa production batches, quality metrics, and yield data.
Analytics & Reporting
Access detailed analytics and generate custom reports.

Inventory Management

Get All Ingredients

Retrieve a list of all ingredients in your inventory.
GET /ingredients
Response:
{
  "data": [
    {
      "id": "ing_123",
      "name": "Roma Tomatoes",
      "category": "vegetables",
      "current_stock": 25.5,
      "unit": "lbs",
      "supplier": "Fresh Farms Co.",
      "last_updated": "2024-01-15T10:30:00Z",
      "expiry_date": "2024-01-20T00:00:00Z",
      "quality_score": 8.5
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 50,
    "total": 1
  }
}

Update Ingredient Stock

Update the stock level for a specific ingredient.
PUT /ingredients/{ingredient_id}/stock
Request Body:
{
  "quantity": 30.0,
  "unit": "lbs",
  "notes": "New shipment received"
}
Response:
{
  "id": "ing_123",
  "name": "Roma Tomatoes",
  "current_stock": 30.0,
  "unit": "lbs",
  "updated_at": "2024-01-15T11:00:00Z"
}

Add New Ingredient

Add a new ingredient to your inventory.
POST /ingredients
Request Body:
{
  "name": "Jalapeño Peppers",
  "category": "vegetables",
  "initial_stock": 5.0,
  "unit": "lbs",
  "supplier": "Spice Garden",
  "expiry_date": "2024-01-25T00:00:00Z"
}

Recipe Management

Get All Recipes

Retrieve all salsa recipes in your account.
GET /recipes
Response:
{
  "data": [
    {
      "id": "rec_456",
      "name": "House Salsa",
      "description": "Our signature medium-spice salsa",
      "spice_level": "medium",
      "batch_size": 5.0,
      "yield": "gallons",
      "prep_time": 30,
      "ingredients": [
        {
          "ingredient_id": "ing_123",
          "name": "Roma Tomatoes",
          "quantity": 2.0,
          "unit": "lbs"
        }
      ],
      "created_at": "2024-01-10T09:00:00Z",
      "updated_at": "2024-01-15T14:30:00Z"
    }
  ]
}

Create New Recipe

Create a new salsa recipe.
POST /recipes
Request Body:
{
  "name": "Spicy Chipotle Salsa",
  "description": "Smoky and spicy chipotle-based salsa",
  "spice_level": "hot",
  "batch_size": 3.0,
  "yield": "gallons",
  "prep_time": 45,
  "ingredients": [
    {
      "ingredient_id": "ing_789",
      "quantity": 1.5,
      "unit": "lbs"
    }
  ]
}

Update Recipe

Update an existing recipe.
PUT /recipes/{recipe_id}

Production Tracking

Start Production Batch

Begin tracking a new salsa production batch.
POST /production/batches
Request Body:
{
  "recipe_id": "rec_456",
  "batch_number": "BATCH-2024-001",
  "planned_quantity": 5.0,
  "production_date": "2024-01-15T08:00:00Z",
  "assigned_chef": "chef_123"
}
Response:
{
  "id": "batch_789",
  "recipe_id": "rec_456",
  "batch_number": "BATCH-2024-001",
  "status": "in_progress",
  "started_at": "2024-01-15T08:00:00Z",
  "assigned_chef": "chef_123"
}

Complete Production Batch

Mark a production batch as completed with quality metrics.
PUT /production/batches/{batch_id}/complete
Request Body:
{
  "actual_quantity": 4.8,
  "quality_score": 9.2,
  "notes": "Excellent batch, perfect consistency",
  "completed_at": "2024-01-15T09:30:00Z"
}

Get Production History

Retrieve production history with filtering options.
GET /production/batches?start_date=2024-01-01&end_date=2024-01-31&recipe_id=rec_456

Analytics & Reporting

Get Production Analytics

Retrieve analytics data for salsa production.
GET /analytics/production?period=30d&recipe_id=rec_456
Response:
{
  "period": "30d",
  "total_batches": 45,
  "total_quantity": 225.0,
  "average_quality_score": 8.7,
  "waste_percentage": 2.3,
  "top_performing_recipes": [
    {
      "recipe_id": "rec_456",
      "name": "House Salsa",
      "batches": 30,
      "avg_quality": 9.1
    }
  ]
}

Get Inventory Analytics

Get insights into inventory usage and optimization opportunities.
GET /analytics/inventory?period=7d

Error Handling

The API uses standard HTTP status codes and returns detailed error information.

Error Response Format

{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "The request body is missing required fields",
    "details": {
      "missing_fields": ["name", "category"]
    }
  }
}

Common Error Codes

Client Errors

  • 400 Bad Request - Invalid request data
    • 401 Unauthorized - Missing or invalid API key
    • 403 Forbidden - Insufficient permissions
    • 404 Not Found - Resource not found
    • 422 Unprocessable Entity - Validation errors
    • 429 Too Many Requests - Rate limit exceeded

Server Errors

  • 500 Internal Server Error - Server error
    • 502 Bad Gateway - Upstream service error
    • 503 Service Unavailable - Service temporarily unavailable

SDKs and Libraries

We provide official SDKs for popular programming languages: JavaScript/Node.js
Official SDK for JavaScript and Node.js applications.
Python
Python SDK for data analysis and automation.
PHP
PHP SDK for web applications and WordPress plugins.

Webhooks

Configure webhooks to receive real-time notifications about important events.

Supported Events

  • ingredient.low_stock - When ingredient stock falls below threshold
  • production.batch_completed - When a production batch is completed
  • quality.alert - When quality scores fall below acceptable levels
  • inventory.expiry_warning - When ingredients are approaching expiry

Webhook Configuration

POST /webhooks
Request Body:
{
  "url": "https://your-app.com/webhooks/salsa",
  "events": ["ingredient.low_stock", "production.batch_completed"],
  "secret": "your_webhook_secret"
}

Testing

Use our sandbox environment for testing your integrations: Sandbox Base URL:
https://api-sandbox.salsaasaservice.com/v1
Warning: Sandbox Data: The sandbox environment uses test data and doesn’t affect your production account.

Support

Need help with the API? We’re here to assist:
  • 📧 Email: api-support@salsaasaservice.com
  • 📚 Documentation: Browse our comprehensive guides
  • 💬 Developer Community: Join our Discord server
  • 🎥 Video Tutorials: Watch integration tutorials
I