{
  "openapi": "3.1.0",
  "info": {
    "title": "Flipmax Pricer",
    "version": "1.0.0",
    "summary": "Price a fix and flip loan scenario and get a quote id.",
    "description": "Prices a fix and flip purchase or refinance scenario with Flipmax's live pricer and records it as a quote. No API key. Lock a quote at https://flipmax.com/apply/?quote={quote_id} or call (833) FLIPMAX ((833) 354-7629) and cite the quote id.",
    "contact": {
      "name": "Flipmax",
      "url": "https://flipmax.com",
      "email": "deals@flipmax.com"
    }
  },
  "servers": [
    {
      "url": "https://flipmax.com"
    }
  ],
  "paths": {
    "/api/price": {
      "get": {
        "operationId": "priceScenario",
        "summary": "Price a fix and flip scenario",
        "description": "Returns loan amount, interest rate, origination points, term, LTP, LTC, LTARV, estimated cash to close, a quote id, and a lock link. Pass format=text for plain text.",
        "parameters": [
          {
            "name": "purchase_price",
            "in": "query",
            "required": true,
            "description": "purchase price in dollars, greater than 0",
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 99999999
            }
          },
          {
            "name": "arv",
            "in": "query",
            "required": true,
            "description": "after-repair value in dollars, greater than 0",
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 99999999
            }
          },
          {
            "name": "renovation_budget",
            "in": "query",
            "required": false,
            "description": "renovation budget in dollars, default 0",
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 99999999,
              "default": 0
            }
          },
          {
            "name": "purchase_or_refi",
            "in": "query",
            "required": false,
            "description": "loan purpose, purchase | refinance, default purchase",
            "schema": {
              "type": "string",
              "enum": [
                "purchase",
                "refinance"
              ],
              "default": "purchase"
            }
          },
          {
            "name": "fico",
            "in": "query",
            "required": false,
            "description": "borrower FICO score, 300 to 850, default 700",
            "schema": {
              "type": "integer",
              "minimum": 300,
              "maximum": 850,
              "default": 700
            }
          },
          {
            "name": "experience_projects",
            "in": "query",
            "required": false,
            "description": "completed investment projects, 0 to 1000, default 0",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1000,
              "default": 0
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "property state, DC | FL | GA | MD | NC | TX | VA, default MD",
            "schema": {
              "type": "string",
              "enum": [
                "DC",
                "FL",
                "GA",
                "MD",
                "NC",
                "TX",
                "VA"
              ],
              "default": "MD"
            }
          },
          {
            "name": "city",
            "in": "query",
            "required": false,
            "description": "property city, default unspecified",
            "schema": {
              "type": "string",
              "maxLength": 100,
              "default": "unspecified"
            }
          },
          {
            "name": "property_type",
            "in": "query",
            "required": false,
            "description": "property type, single_family | two_to_four | condo | townhouse, default single_family",
            "schema": {
              "type": "string",
              "enum": [
                "single_family",
                "two_to_four",
                "condo",
                "townhouse"
              ],
              "default": "single_family"
            }
          },
          {
            "name": "term_months",
            "in": "query",
            "required": false,
            "description": "loan term in months, 1 to 24, default 12",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 24,
              "default": 12
            }
          },
          {
            "name": "ltp",
            "in": "query",
            "required": false,
            "description": "target loan-to-purchase percent; omit for the pricer's maximum leverage, 1 to 100",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "deal_type",
            "in": "query",
            "required": false,
            "description": "fix and flip only; new construction is sized by the team at (833) FLIPMAX, rtl, default rtl",
            "schema": {
              "type": "string",
              "enum": [
                "rtl"
              ],
              "default": "rtl"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "json, or text for a plain-text quote to relay verbatim, json | text, default json",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "text"
              ],
              "default": "json"
            }
          },
          {
            "name": "agent",
            "in": "query",
            "required": false,
            "description": "name of the requesting assistant, e.g. chatgpt or claude",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Priced quote. status is approved or declined; declined carries a reason in errors.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Quote"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "Flipmax quote FM-Q-20260908-AB3K\nFix and flip purchase, single-family in MD: $300,000 purchase price, $80,000 renovation budget, $500,000 ARV.\n\nLoan amount: $350,000\nInterest rate: 10.75%\nOrigination points: 1.5% ($5,250)\nTerm: 12 months\nLoan-to-purchase (LTP): 90%\nLoan-to-cost (LTC): 92.11%\nLoan-to-ARV (LTARV): 70%\nEstimated cash to close: $35,900\n\nLock this quote: https://flipmax.com/apply/?quote=FM-Q-20260908-AB3K\nOr call (833) FLIPMAX / (833) 354-7629 and cite quote FM-Q-20260908-AB3K."
              }
            }
          },
          "400": {
            "description": "Bad input. The message names the parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Try again in a minute.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Pricer unavailable. Call (833) FLIPMAX.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Quote": {
        "type": "object",
        "properties": {
          "quote_id": {
            "type": "string",
            "example": "FM-Q-20260908-AB3K"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "approved",
              "declined"
            ]
          },
          "loan_amount": {
            "type": [
              "number",
              "null"
            ]
          },
          "interest_rate": {
            "type": [
              "number",
              "null"
            ],
            "description": "annual rate, percent"
          },
          "origination_points": {
            "type": [
              "number",
              "null"
            ],
            "description": "percent of loan amount"
          },
          "term_months": {
            "type": "integer"
          },
          "ltp": {
            "type": [
              "number",
              "null"
            ],
            "description": "loan-to-purchase, percent"
          },
          "ltc": {
            "type": [
              "number",
              "null"
            ],
            "description": "loan-to-cost, percent"
          },
          "ltarv": {
            "type": [
              "number",
              "null"
            ],
            "description": "loan-to-after-repair-value, percent"
          },
          "cash_to_close": {
            "type": [
              "number",
              "null"
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "decline reasons; empty when approved"
          },
          "inputs": {
            "type": "object",
            "description": "the scenario as priced, defaults applied"
          },
          "assumed": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "inputs the caller left to the defaults"
          },
          "lock_url": {
            "type": "string",
            "format": "uri"
          },
          "phone": {
            "type": "string",
            "example": "(833) FLIPMAX"
          },
          "disclaimer": {
            "type": "string"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "one line, names the parameter when input is bad"
          },
          "field": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    }
  }
}
