{
 "openapi": "3.1.0",
 "info": {
  "title": "opportunityzones.help API",
  "version": "1.0.0",
  "description": "Opportunity Zone lookup and calculators. Inputs are query parameters (or a JSON body on POST); the live tool list with input schemas is at /api/oz."
 },
 "servers": [
  {
   "url": "https://www.opportunityzones.help"
  }
 ],
 "paths": {
  "/api/oz/lookup_address": {
   "get": {
    "operationId": "lookup_address",
    "summary": "Is this address in an Opportunity Zone?",
    "description": "Geocodes a US street address (Census Bureau geocoder, falling back to OpenStreetMap; tract assignment by the FCC Census Block API) and returns its 2018 Opportunity Zone status (2010 tract), its status for the 2027 designation round (2020 tract: eligible, nominated or certified, with source), the rural flags, and Census ACS tract statistics.",
    "parameters": [
     {
      "name": "address",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "description": "One-line US address, e.g. '2 Woodward Ave, Detroit, MI 48226'"
      },
      "description": "One-line US address, e.g. '2 Woodward Ave, Detroit, MI 48226'"
     }
    ],
    "responses": {
     "200": {
      "description": "Tool result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tool": {
           "type": "string"
          },
          "inputs": {
           "type": "object"
          },
          "result": {
           "type": "object"
          },
          "disclaimer": {
           "type": "string"
          },
          "financing": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   },
   "post": {
    "operationId": "lookup_address_post",
    "summary": "Is this address in an Opportunity Zone? (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "address": {
          "type": "string",
          "description": "One-line US address, e.g. '2 Woodward Ave, Detroit, MI 48226'"
         }
        },
        "required": [
         "address"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Tool result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tool": {
           "type": "string"
          },
          "inputs": {
           "type": "object"
          },
          "result": {
           "type": "object"
          },
          "disclaimer": {
           "type": "string"
          },
          "financing": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/oz/lookup_coordinates": {
   "get": {
    "operationId": "lookup_coordinates",
    "summary": "Opportunity Zone status for a point",
    "description": "Same as lookup_address for a latitude/longitude point.",
    "parameters": [
     {
      "name": "lat",
      "in": "query",
      "required": true,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "lon",
      "in": "query",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Tool result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tool": {
           "type": "string"
          },
          "inputs": {
           "type": "object"
          },
          "result": {
           "type": "object"
          },
          "disclaimer": {
           "type": "string"
          },
          "financing": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   },
   "post": {
    "operationId": "lookup_coordinates_post",
    "summary": "Opportunity Zone status for a point (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "lat": {
          "type": "number"
         },
         "lon": {
          "type": "number"
         }
        },
        "required": [
         "lat",
         "lon"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Tool result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tool": {
           "type": "string"
          },
          "inputs": {
           "type": "object"
          },
          "result": {
           "type": "object"
          },
          "disclaimer": {
           "type": "string"
          },
          "financing": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/oz/get_tract": {
   "get": {
    "operationId": "get_tract",
    "summary": "One census tract's Opportunity Zone record",
    "description": "Status for an 11-digit census tract GEOID. A 2010 GEOID is checked against the 2018 designations and a 2020 GEOID against the 2027 round; many GEOIDs exist in both vintages. If you already geocoded a property, pass geoid_2010 and geoid_2020 instead of geoid.",
    "parameters": [
     {
      "name": "geoid",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "11-digit tract GEOID (state+county+tract)"
      },
      "description": "11-digit tract GEOID (state+county+tract)"
     },
     {
      "name": "geoid_2010",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "The property's 2010 tract GEOID (for 2018 status)"
      },
      "description": "The property's 2010 tract GEOID (for 2018 status)"
     },
     {
      "name": "geoid_2020",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "The property's 2020 tract GEOID (for 2027 status)"
      },
      "description": "The property's 2020 tract GEOID (for 2027 status)"
     }
    ],
    "responses": {
     "200": {
      "description": "Tool result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tool": {
           "type": "string"
          },
          "inputs": {
           "type": "object"
          },
          "result": {
           "type": "object"
          },
          "disclaimer": {
           "type": "string"
          },
          "financing": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   },
   "post": {
    "operationId": "get_tract_post",
    "summary": "One census tract's Opportunity Zone record (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "geoid": {
          "type": "string",
          "description": "11-digit tract GEOID (state+county+tract)"
         },
         "geoid_2010": {
          "type": "string",
          "description": "The property's 2010 tract GEOID (for 2018 status)"
         },
         "geoid_2020": {
          "type": "string",
          "description": "The property's 2020 tract GEOID (for 2027 status)"
         }
        },
        "required": []
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Tool result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tool": {
           "type": "string"
          },
          "inputs": {
           "type": "object"
          },
          "result": {
           "type": "object"
          },
          "disclaimer": {
           "type": "string"
          },
          "financing": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/oz/get_state": {
   "get": {
    "operationId": "get_state",
    "summary": "Opportunity Zones in a state",
    "description": "Counts of 2018 zones, rural zones, 2027-eligible tracts and their nomination/certification status for one state or territory, with the official source.",
    "parameters": [
     {
      "name": "state",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Two-letter code, FIPS code or name"
      },
      "description": "Two-letter code, FIPS code or name"
     }
    ],
    "responses": {
     "200": {
      "description": "Tool result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tool": {
           "type": "string"
          },
          "inputs": {
           "type": "object"
          },
          "result": {
           "type": "object"
          },
          "disclaimer": {
           "type": "string"
          },
          "financing": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   },
   "post": {
    "operationId": "get_state_post",
    "summary": "Opportunity Zones in a state (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "state": {
          "type": "string",
          "description": "Two-letter code, FIPS code or name"
         }
        },
        "required": [
         "state"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Tool result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tool": {
           "type": "string"
          },
          "inputs": {
           "type": "object"
          },
          "result": {
           "type": "object"
          },
          "disclaimer": {
           "type": "string"
          },
          "financing": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/oz/get_key_dates": {
   "get": {
    "operationId": "get_key_dates",
    "summary": "Opportunity Zone key dates",
    "description": "The program calendar: OZ 1.0 inclusion date, OZ 2.0 start, designation periods, filing dates.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Tool result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tool": {
           "type": "string"
          },
          "inputs": {
           "type": "object"
          },
          "result": {
           "type": "object"
          },
          "disclaimer": {
           "type": "string"
          },
          "financing": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   },
   "post": {
    "operationId": "get_key_dates_post",
    "summary": "Opportunity Zone key dates (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {},
        "required": []
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Tool result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tool": {
           "type": "string"
          },
          "inputs": {
           "type": "object"
          },
          "result": {
           "type": "object"
          },
          "disclaimer": {
           "type": "string"
          },
          "financing": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/oz/calc_180_day_deadline": {
   "get": {
    "operationId": "calc_180_day_deadline",
    "summary": "180-day investment deadline",
    "description": "Last day to invest a gain in a QOF, with every start date the taxpayer may choose (direct, pass-through K-1, section 1231, RIC/REIT dividend, installment) and whether the window reaches OZ 2.0 (Jan 1, 2027).",
    "parameters": [
     {
      "name": "kind",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "sale_date",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "description": "YYYY-MM-DD"
      },
      "description": "YYYY-MM-DD"
     },
     {
      "name": "entity_year_end",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "entity_return_due",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "dividend_date",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Tool result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tool": {
           "type": "string"
          },
          "inputs": {
           "type": "object"
          },
          "result": {
           "type": "object"
          },
          "disclaimer": {
           "type": "string"
          },
          "financing": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   },
   "post": {
    "operationId": "calc_180_day_deadline_post",
    "summary": "180-day investment deadline (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "kind": {
          "type": "string",
          "enum": [
           "direct",
           "passthrough",
           "1231",
           "reit_ric",
           "1256",
           "installment",
           "collectible"
          ]
         },
         "sale_date": {
          "type": "string",
          "description": "YYYY-MM-DD"
         },
         "entity_year_end": {
          "type": "string"
         },
         "entity_return_due": {
          "type": "string"
         },
         "dividend_date": {
          "type": "string"
         }
        },
        "required": [
         "sale_date"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Tool result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tool": {
           "type": "string"
          },
          "inputs": {
           "type": "object"
          },
          "result": {
           "type": "object"
          },
          "disclaimer": {
           "type": "string"
          },
          "financing": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/oz/calc_2026_inclusion": {
   "get": {
    "operationId": "calc_2026_inclusion",
    "summary": "OZ 1.0 Dec 31, 2026 inclusion estimate",
    "description": "Amount of deferred gain included on Dec 31, 2026 for a pre-2027 QOF investment, with the 10%/15% basis step-up where the holding period was met, and an estimated tax at the user's rate.",
    "parameters": [
     {
      "name": "deferred_gain",
      "in": "query",
      "required": true,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "invest_date",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "fmv_12_31_2026",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "rate_pct",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Tool result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tool": {
           "type": "string"
          },
          "inputs": {
           "type": "object"
          },
          "result": {
           "type": "object"
          },
          "disclaimer": {
           "type": "string"
          },
          "financing": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   },
   "post": {
    "operationId": "calc_2026_inclusion_post",
    "summary": "OZ 1.0 Dec 31, 2026 inclusion estimate (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "deferred_gain": {
          "type": "number"
         },
         "invest_date": {
          "type": "string"
         },
         "fmv_12_31_2026": {
          "type": "number"
         },
         "rate_pct": {
          "type": "number"
         }
        },
        "required": [
         "deferred_gain",
         "invest_date"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Tool result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tool": {
           "type": "string"
          },
          "inputs": {
           "type": "object"
          },
          "result": {
           "type": "object"
          },
          "disclaimer": {
           "type": "string"
          },
          "financing": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/oz/calc_oz2_benefit": {
   "get": {
    "operationId": "calc_oz2_benefit",
    "summary": "OZ 2.0 benefit vs paying tax now",
    "description": "Models an OZ 2.0 investment (5-year deferral, 10% or rural 30% step-up, 10-year exclusion capped at year 30) against paying tax now and investing the remainder.",
    "parameters": [
     {
      "name": "gain",
      "in": "query",
      "required": true,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "rate_now_pct",
      "in": "query",
      "required": true,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "rate_later_pct",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "growth_pct",
      "in": "query",
      "required": true,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "hold_years",
      "in": "query",
      "required": true,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "rural",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean"
      }
     },
     {
      "name": "invest_date",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "discount_pct",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Tool result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tool": {
           "type": "string"
          },
          "inputs": {
           "type": "object"
          },
          "result": {
           "type": "object"
          },
          "disclaimer": {
           "type": "string"
          },
          "financing": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   },
   "post": {
    "operationId": "calc_oz2_benefit_post",
    "summary": "OZ 2.0 benefit vs paying tax now (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "gain": {
          "type": "number"
         },
         "rate_now_pct": {
          "type": "number"
         },
         "rate_later_pct": {
          "type": "number"
         },
         "growth_pct": {
          "type": "number"
         },
         "hold_years": {
          "type": "number"
         },
         "rural": {
          "type": "boolean"
         },
         "invest_date": {
          "type": "string"
         },
         "discount_pct": {
          "type": "number"
         }
        },
        "required": [
         "gain",
         "rate_now_pct",
         "growth_pct",
         "hold_years"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Tool result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tool": {
           "type": "string"
          },
          "inputs": {
           "type": "object"
          },
          "result": {
           "type": "object"
          },
          "disclaimer": {
           "type": "string"
          },
          "financing": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/oz/calc_substantial_improvement": {
   "get": {
    "operationId": "calc_substantial_improvement",
    "summary": "Substantial improvement test",
    "description": "How much must be added to a building's basis within 30 months (100%, or 50% in a zone made up entirely of rural areas).",
    "parameters": [
     {
      "name": "purchase_price",
      "in": "query",
      "required": true,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "land_value",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "start_date",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "rural",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean"
      }
     },
     {
      "name": "spent_so_far",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Tool result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tool": {
           "type": "string"
          },
          "inputs": {
           "type": "object"
          },
          "result": {
           "type": "object"
          },
          "disclaimer": {
           "type": "string"
          },
          "financing": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   },
   "post": {
    "operationId": "calc_substantial_improvement_post",
    "summary": "Substantial improvement test (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "purchase_price": {
          "type": "number"
         },
         "land_value": {
          "type": "number"
         },
         "start_date": {
          "type": "string"
         },
         "rural": {
          "type": "boolean"
         },
         "spent_so_far": {
          "type": "number"
         }
        },
        "required": [
         "purchase_price"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Tool result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tool": {
           "type": "string"
          },
          "inputs": {
           "type": "object"
          },
          "result": {
           "type": "object"
          },
          "disclaimer": {
           "type": "string"
          },
          "financing": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/oz/calc_90_percent_test": {
   "get": {
    "operationId": "calc_90_percent_test",
    "summary": "QOF 90% asset test",
    "description": "Averages the two semiannual testing dates and, if the fund falls short, computes the Form 8996 Part IV penalty month by month (pass month-end figures in monthly for an exact figure; otherwise testing-date figures are applied to each half-year and the result is flagged as an approximation) at an underpayment rate the caller supplies.",
    "parameters": [
     {
      "name": "d1_qozp",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "d1_total",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "d2_qozp",
      "in": "query",
      "required": true,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "d2_total",
      "in": "query",
      "required": true,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "single_date",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "description": "true if only the year-end test applies (first year under 6 months); otherwise d1_* are required"
      },
      "description": "true if only the year-end test applies (first year under 6 months); otherwise d1_* are required"
     },
     {
      "name": "underpayment_rate_pct",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number",
       "description": "IRS underpayment rate for the period, percent"
      },
      "description": "IRS underpayment rate for the period, percent"
     },
     {
      "name": "months",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number",
       "description": "Months the entity was a QOF this year, 1-12 (default 12)"
      },
      "description": "Months the entity was a QOF this year, 1-12 (default 12)"
     },
     {
      "name": "monthly",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "Optional month-end figures for Form 8996 Part IV: [{total, qozp, rate_pct}] (JSON-encoded)"
      },
      "description": "Optional month-end figures for Form 8996 Part IV: [{total, qozp, rate_pct}]"
     }
    ],
    "responses": {
     "200": {
      "description": "Tool result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tool": {
           "type": "string"
          },
          "inputs": {
           "type": "object"
          },
          "result": {
           "type": "object"
          },
          "disclaimer": {
           "type": "string"
          },
          "financing": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   },
   "post": {
    "operationId": "calc_90_percent_test_post",
    "summary": "QOF 90% asset test (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "d1_qozp": {
          "type": "number"
         },
         "d1_total": {
          "type": "number"
         },
         "d2_qozp": {
          "type": "number"
         },
         "d2_total": {
          "type": "number"
         },
         "single_date": {
          "type": "boolean",
          "description": "true if only the year-end test applies (first year under 6 months); otherwise d1_* are required"
         },
         "underpayment_rate_pct": {
          "type": "number",
          "description": "IRS underpayment rate for the period, percent"
         },
         "months": {
          "type": "number",
          "description": "Months the entity was a QOF this year, 1-12 (default 12)"
         },
         "monthly": {
          "type": "array",
          "description": "Optional month-end figures for Form 8996 Part IV: [{total, qozp, rate_pct}]",
          "items": {
           "type": "object"
          }
         }
        },
        "required": [
         "d2_qozp",
         "d2_total"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Tool result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tool": {
           "type": "string"
          },
          "inputs": {
           "type": "object"
          },
          "result": {
           "type": "object"
          },
          "disclaimer": {
           "type": "string"
          },
          "financing": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/oz/check_qozb": {
   "get": {
    "operationId": "check_qozb",
    "summary": "Qualified Opportunity Zone Business tests",
    "description": "Checks the 70% tangible property, 50% gross income, 40% intangibles and 5% nonqualified financial property tests and the excluded-business list.",
    "parameters": [
     {
      "name": "tangible_qozbp",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "tangible_total",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "gross_income_zone",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "gross_income_total",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "intangibles_used_in_zone",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "intangibles_total",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "nqfp",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "total_basis",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "sin_business",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Tool result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tool": {
           "type": "string"
          },
          "inputs": {
           "type": "object"
          },
          "result": {
           "type": "object"
          },
          "disclaimer": {
           "type": "string"
          },
          "financing": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   },
   "post": {
    "operationId": "check_qozb_post",
    "summary": "Qualified Opportunity Zone Business tests (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "tangible_qozbp": {
          "type": "number"
         },
         "tangible_total": {
          "type": "number"
         },
         "gross_income_zone": {
          "type": "number"
         },
         "gross_income_total": {
          "type": "number"
         },
         "intangibles_used_in_zone": {
          "type": "number"
         },
         "intangibles_total": {
          "type": "number"
         },
         "nqfp": {
          "type": "number"
         },
         "total_basis": {
          "type": "number"
         },
         "sin_business": {
          "type": "boolean"
         }
        },
        "required": []
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Tool result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tool": {
           "type": "string"
          },
          "inputs": {
           "type": "object"
          },
          "result": {
           "type": "object"
          },
          "disclaimer": {
           "type": "string"
          },
          "financing": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/oz/plan_working_capital": {
   "get": {
    "operationId": "plan_working_capital",
    "summary": "Working capital safe harbor timeline",
    "description": "Spend-by dates for each cash infusion under the 31-month working capital safe harbor, and the 62-month outer limit available to start-up businesses.",
    "parameters": [
     {
      "name": "infusions",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "description": "(JSON-encoded)"
      }
     },
     {
      "name": "startup",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean"
      }
     },
     {
      "name": "disaster",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Tool result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tool": {
           "type": "string"
          },
          "inputs": {
           "type": "object"
          },
          "result": {
           "type": "object"
          },
          "disclaimer": {
           "type": "string"
          },
          "financing": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   },
   "post": {
    "operationId": "plan_working_capital_post",
    "summary": "Working capital safe harbor timeline (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "infusions": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "date": {
             "type": "string"
            },
            "amount": {
             "type": "number"
            }
           }
          }
         },
         "startup": {
          "type": "boolean"
         },
         "disaster": {
          "type": "boolean"
         }
        },
        "required": [
         "infusions"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Tool result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tool": {
           "type": "string"
          },
          "inputs": {
           "type": "object"
          },
          "result": {
           "type": "object"
          },
          "disclaimer": {
           "type": "string"
          },
          "financing": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/oz/get_financing_link": {
   "get": {
    "operationId": "get_financing_link",
    "summary": "Get an Opportunity Zone financing quote",
    "description": "Link where a developer, sponsor or business owner can request debt financing for a project in an Opportunity Zone. Routed to Janover Capital LLC's desk; free, no obligation. Janover arranges loans; it does not sell fund interests.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Tool result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tool": {
           "type": "string"
          },
          "inputs": {
           "type": "object"
          },
          "result": {
           "type": "object"
          },
          "disclaimer": {
           "type": "string"
          },
          "financing": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   },
   "post": {
    "operationId": "get_financing_link_post",
    "summary": "Get an Opportunity Zone financing quote (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {},
        "required": []
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Tool result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tool": {
           "type": "string"
          },
          "inputs": {
           "type": "object"
          },
          "result": {
           "type": "object"
          },
          "disclaimer": {
           "type": "string"
          },
          "financing": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
}