{
  "openapi": "3.1.0",
  "info": {
    "title": "Business valuation calculator",
    "version": "1.0.0",
    "summary": "What a buyer might pay for a small service or software business.",
    "description": "Estimates a worst case, a base case and a best case from published US sale prices. All figures are US dollars. The sale data is from the US. An estimate, not a formal valuation. The method and the sources: https://productize.co/business-valuation-calculator/",
    "contact": {
      "name": "Alex McClafferty",
      "url": "https://productize.co/"
    }
  },
  "servers": [
    {
      "url": "https://productize.co"
    }
  ],
  "paths": {
    "/api/valuation": {
      "get": {
        "operationId": "valueBusiness",
        "summary": "Estimate what a buyer might pay for a business",
        "description": "Example: https://productize.co/api/valuation?type=agency&revenue=1200000&profit=180000&owner_pay=150000&growth=up&recurring=mid&top_client=mid&founder=22121&format=json. A missing or wrong number also gets status 200, with \"ok\": false and help text.",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": true,
            "description": "The kind of business. A productized service sells a fixed scope for a fixed price.",
            "schema": {
              "type": "string",
              "enum": [
                "agency",
                "productized",
                "consultancy",
                "saas"
              ]
            }
          },
          {
            "name": "revenue",
            "in": "query",
            "required": true,
            "description": "Revenue for the last 12 months, in US dollars.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "profit",
            "in": "query",
            "required": true,
            "description": "Profit before tax for the last 12 months, after the owner's pay. A loss is a negative number.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "owner_pay",
            "in": "query",
            "required": false,
            "description": "What the owner took in salary, bonuses and personal costs in the same 12 months. 0 when not given.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "growth",
            "in": "query",
            "required": false,
            "description": "Revenue in the last 12 months: down (it dropped), flat (flat or up less than 10%), up (up 10% to 30%), fast (up more than 30%).",
            "schema": {
              "type": "string",
              "enum": [
                "down",
                "flat",
                "up",
                "fast"
              ]
            }
          },
          {
            "name": "recurring",
            "in": "query",
            "required": false,
            "description": "Service businesses only. Share of revenue on retainer, subscription or contract: low (under 30%), mid (30% to 60%), high (over 60%).",
            "schema": {
              "type": "string",
              "enum": [
                "low",
                "mid",
                "high"
              ]
            }
          },
          {
            "name": "churn",
            "in": "query",
            "required": false,
            "description": "Software only. Customers lost each month: low (under 2%), mid (2% to 5%), high (over 5%).",
            "schema": {
              "type": "string",
              "enum": [
                "low",
                "mid",
                "high"
              ]
            }
          },
          {
            "name": "top_client",
            "in": "query",
            "required": false,
            "description": "Share of revenue from the biggest client: low (under 15%), mid (15% to 25%), high (over 25%).",
            "schema": {
              "type": "string",
              "enum": [
                "low",
                "mid",
                "high"
              ]
            }
          },
          {
            "name": "founder_dependence",
            "in": "query",
            "required": false,
            "description": "How much the business needs its founder for sales, client contact and decisions: low (it runs without the founder), mid, high (it needs the founder for everything).",
            "schema": {
              "type": "string",
              "enum": [
                "low",
                "mid",
                "high"
              ]
            }
          },
          {
            "name": "founder",
            "in": "query",
            "required": false,
            "description": "The five founder questions on the calculator page, one digit each (0, 1 or 2), for example 22121. Use it in place of founder_dependence.",
            "schema": {
              "type": "string",
              "pattern": "^[012]{5}$"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "json for JSON. Markdown when left out.",
            "schema": {
              "type": "string",
              "enum": [
                "json"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The three cases, or help text when a number is missing or wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "worst_case": {
                      "type": "string",
                      "examples": [
                        "$670K"
                      ]
                    },
                    "base_case": {
                      "type": "string",
                      "examples": [
                        "$790K"
                      ]
                    },
                    "best_case": {
                      "type": "string",
                      "examples": [
                        "$910K"
                      ]
                    },
                    "basis": {
                      "type": "string"
                    },
                    "fixes_available": {
                      "type": "integer"
                    },
                    "fixes_could_add": {
                      "type": "string"
                    },
                    "based_on": {
                      "type": "string"
                    },
                    "assumed": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "currency": {
                      "type": "string",
                      "examples": [
                        "USD"
                      ]
                    },
                    "units": {
                      "type": "string"
                    },
                    "result_page": {
                      "type": "string",
                      "format": "uri"
                    },
                    "calculator": {
                      "type": "string",
                      "format": "uri"
                    },
                    "note": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    },
                    "problems": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "usage": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "ok"
                  ]
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}
