{
  "openapi": "3.1.0",
  "info": {
    "title": "Vroam Public API",
    "version": "1.0.0",
    "summary": "Read-only API for Bali scooter & motorbike rental discovery.",
    "description": "Public, read-only endpoints exposing Vroam's scooter catalog, supported locations and indicative price estimates. Designed for AI agents and LLMs. The API never creates bookings; final availability is confirmed by the supplier.",
    "contact": {
      "name": "Vroam",
      "url": "https://ridevroam.com"
    },
    "license": {
      "name": "Vroam Terms",
      "url": "https://ridevroam.com/terms-and-conditions"
    }
  },
  "servers": [
    {
      "url": "https://ridevroam.com/api",
      "description": "Production (static snapshot \u2014 see live function for dynamic data)"
    },
    {
      "url": "https://yjahgjlsvggmxtctftje.supabase.co/functions/v1/api",
      "description": "Live edge function (dynamic)"
    }
  ],
  "tags": [
    {
      "name": "system"
    },
    {
      "name": "catalog"
    },
    {
      "name": "prices"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "Health probe",
        "responses": {
          "200": {
            "description": "Service up",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok"
                      ]
                    },
                    "time": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/catalog/models": {
      "get": {
        "tags": [
          "catalog"
        ],
        "summary": "List all active scooter / motorbike models",
        "responses": {
          "200": {
            "description": "Array of models",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "models": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Model"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/catalog/categories": {
      "get": {
        "tags": [
          "catalog"
        ],
        "summary": "List all bike categories (Budget, Comfort, Premium, Sport, \u2026)",
        "responses": {
          "200": {
            "description": "Array of categories",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "categories": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Category"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/catalog/locations": {
      "get": {
        "tags": [
          "catalog"
        ],
        "summary": "Supported Bali areas for delivery / pickup",
        "responses": {
          "200": {
            "description": "Array of locations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "locations": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Location"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/prices/estimate": {
      "get": {
        "tags": [
          "prices"
        ],
        "summary": "Indicative price estimate for a rental period",
        "parameters": [
          {
            "in": "query",
            "name": "location",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Canggu"
          },
          {
            "in": "query",
            "name": "start_date",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "example": "2026-06-01"
          },
          {
            "in": "query",
            "name": "end_date",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "example": "2026-06-08"
          },
          {
            "in": "query",
            "name": "category",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "Premium"
          },
          {
            "in": "query",
            "name": "delivery",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "surf_rack",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Estimate",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Estimate"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Model": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "brand": {
            "type": "string",
            "description": "Manufacturer (Honda, Yamaha, \u2026)"
          },
          "name": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "description": "Bike category id (budget/medium/premium/large)"
          },
          "cc": {
            "type": "integer"
          },
          "image_url": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "id",
          "name",
          "category",
          "cc"
        ]
      },
      "Category": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "engine_range": {
            "type": "string"
          },
          "best_for": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "pricing_tiers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "min_days": {
                  "type": "integer"
                },
                "price_per_day": {
                  "type": "integer"
                }
              }
            }
          },
          "currency": {
            "type": "string",
            "enum": [
              "IDR"
            ]
          }
        }
      },
      "Location": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "lat": {
            "type": "number"
          },
          "lng": {
            "type": "number"
          }
        }
      },
      "Estimate": {
        "type": "object",
        "properties": {
          "location": {
            "type": "string"
          },
          "start_date": {
            "type": "string",
            "format": "date"
          },
          "end_date": {
            "type": "string",
            "format": "date"
          },
          "duration_days": {
            "type": "integer"
          },
          "requested_category": {
            "type": "string",
            "nullable": true
          },
          "currency": {
            "type": "string",
            "enum": [
              "IDR"
            ]
          },
          "estimated_customer_price_total": {
            "type": "integer"
          },
          "estimated_customer_price_per_day": {
            "type": "integer"
          },
          "base_price_per_day": {
            "type": "integer"
          },
          "one_day_surcharge_applied": {
            "type": "boolean"
          },
          "delivery_fee_estimate": {
            "type": "integer"
          },
          "surf_rack_fee_estimate": {
            "type": "integer"
          },
          "damage_protection_per_day": {
            "type": "integer",
            "description": "Optional add-on, not included in total"
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "last_updated": {
            "type": "string",
            "format": "date"
          }
        }
      }
    }
  }
}