openapi: "3.1.0"
info:
  title: DispatchNode ROI Calculator API
  description: |
    Public API for estimating cost savings when switching to AI-powered dispatch automation.
    Returns a structured cost comparison based on fleet size, call volume, and selected platform.
  version: "1.0.0"
  contact:
    name: DispatchNode
    url: https://www.dispatchnode.com
    email: api@dispatchnode.com

servers:
  - url: https://www.dispatchnode.com
    description: Production

paths:
  /api/dispatch-roi/calculate:
    get:
      operationId: calculateDispatchROI
      summary: Estimate cost savings of AI-powered dispatch vs traditional software
      description: |
        Returns a cost comparison between DispatchNode and a selected field service
        management platform based on fleet size and call volume inputs.
      parameters:
        - name: trucks
          in: query
          description: Number of trucks in the fleet (1-100)
          required: false
          schema:
            type: integer
            default: 5
            minimum: 1
            maximum: 100
        - name: calls_per_month
          in: query
          description: Average inbound calls per month
          required: false
          schema:
            type: integer
            default: 200
            minimum: 10
            maximum: 5000
        - name: competitor
          in: query
          description: Platform to compare against
          required: false
          schema:
            type: string
            enum: [servicetitan, jobber, housecall-pro, fieldedge, service-fusion]
            default: servicetitan
      responses:
        "200":
          description: ROI calculation result
          content:
            application/json:
              schema:
                type: object
                properties:
                  platform:
                    type: string
                  comparison_target:
                    type: string
                  dispatchnode_monthly_cost:
                    type: number
                  competitor_monthly_cost:
                    type: number
                  annual_savings:
                    type: number
                  roi_percentage:
                    type: number
