{
 "openapi": "3.1.0",
 "info": {
  "title": "CashForMyNote note & rate calculators API",
  "version": "1.0.0",
  "description": "Read-only, no key, no data stored. Estimates, not offers or appraisals. CashForMyNote.com does not buy notes or make offers. Please credit \"Calculations by CashForMyNote.com\" with a link to the source_url in each response.",
  "termsOfService": "https://cashformynote.com/developers#terms",
  "contact": {
   "url": "https://cashformynote.com/developers"
  }
 },
 "servers": [
  {
   "url": "https://cashformynote.com"
  }
 ],
 "paths": {
  "/api/calc/": {
   "get": {
    "operationId": "list_tools",
    "summary": "List calculators",
    "responses": {
     "200": {
      "description": "Tool list"
     }
    }
   }
  },
  "/api/calc/note_price": {
   "get": {
    "operationId": "note_price",
    "summary": "Mortgage note value calculator",
    "description": "A mortgage note's value is the present value of its remaining monthly payments (plus any balloon) at the yield a buyer requires, and this tool computes that price. It works the same for mortgage notes, land contracts (contracts for deed), owner-financed notes and other real estate notes. Optionally compares the price with the unpaid balance (discount and % of balance). Estimates, not offers or appraisals. CashForMyNote.com does not buy notes or make offers.",
    "parameters": [
     {
      "name": "payment",
      "in": "query",
      "required": false,
      "description": "Monthly payment in USD (principal and interest).",
      "schema": {
       "type": "number",
       "minimum": 0
      }
     },
     {
      "name": "months",
      "in": "query",
      "required": true,
      "description": "Number of monthly payments LEFT (not the original term).",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 1200
      }
     },
     {
      "name": "yield",
      "in": "query",
      "required": true,
      "description": "Target yield the buyer needs, annual % (monthly compounding).",
      "schema": {
       "type": "number",
       "minimum": 0,
       "maximum": 100
      }
     },
     {
      "name": "balloon",
      "in": "query",
      "required": false,
      "description": "Balloon (lump sum) due with the last payment, USD. Default 0.",
      "schema": {
       "type": "number",
       "minimum": 0
      }
     },
     {
      "name": "balance",
      "in": "query",
      "required": false,
      "description": "Unpaid principal balance in USD.",
      "schema": {
       "type": "number",
       "minimum": 0
      }
     },
     {
      "name": "rate",
      "in": "query",
      "required": false,
      "description": "Note interest rate, annual %. With balance, lets the tool compute the payment at full precision instead of taking payment.",
      "schema": {
       "type": "number",
       "minimum": 0,
       "maximum": 100
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Result with attribution",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Envelope"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "429": {
      "description": "Rate limited"
     }
    }
   },
   "post": {
    "operationId": "note_price_post",
    "summary": "Mortgage note value calculator (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "payment": {
          "type": "number",
          "description": "Monthly payment in USD (principal and interest).",
          "minimum": 0
         },
         "months": {
          "type": "integer",
          "description": "Number of monthly payments LEFT (not the original term).",
          "minimum": 1,
          "maximum": 1200
         },
         "yield": {
          "type": "number",
          "description": "Target yield the buyer needs, annual % (monthly compounding).",
          "minimum": 0,
          "maximum": 100
         },
         "balloon": {
          "type": "number",
          "description": "Balloon (lump sum) due with the last payment, USD. Default 0.",
          "minimum": 0
         },
         "balance": {
          "type": "number",
          "description": "Unpaid principal balance in USD.",
          "minimum": 0
         },
         "rate": {
          "type": "number",
          "description": "Note interest rate, annual %. With balance, lets the tool compute the payment at full precision instead of taking payment.",
          "minimum": 0,
          "maximum": 100
         }
        },
        "required": [
         "months",
         "yield"
        ],
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Result with attribution"
     },
     "400": {
      "description": "Invalid input"
     }
    }
   }
  },
  "/api/calc/note_yield": {
   "get": {
    "operationId": "note_yield",
    "summary": "Note yield calculator",
    "description": "A note's yield is the annual return that makes its remaining payments (and any balloon) worth exactly the price paid, and this tool solves for it. It assumes every payment is made on time. Estimates, not offers or appraisals. CashForMyNote.com does not buy notes or make offers.",
    "parameters": [
     {
      "name": "price",
      "in": "query",
      "required": true,
      "description": "Price paid for the note, USD.",
      "schema": {
       "type": "number",
       "minimum": 0.01
      }
     },
     {
      "name": "payment",
      "in": "query",
      "required": true,
      "description": "Monthly payment in USD (principal and interest).",
      "schema": {
       "type": "number",
       "minimum": 0
      }
     },
     {
      "name": "months",
      "in": "query",
      "required": true,
      "description": "Number of monthly payments LEFT (not the original term).",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 1200
      }
     },
     {
      "name": "balloon",
      "in": "query",
      "required": false,
      "description": "Balloon (lump sum) due with the last payment, USD. Default 0.",
      "schema": {
       "type": "number",
       "minimum": 0
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Result with attribution",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Envelope"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "429": {
      "description": "Rate limited"
     }
    }
   },
   "post": {
    "operationId": "note_yield_post",
    "summary": "Note yield calculator (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "price": {
          "type": "number",
          "description": "Price paid for the note, USD.",
          "minimum": 0.01
         },
         "payment": {
          "type": "number",
          "description": "Monthly payment in USD (principal and interest).",
          "minimum": 0
         },
         "months": {
          "type": "integer",
          "description": "Number of monthly payments LEFT (not the original term).",
          "minimum": 1,
          "maximum": 1200
         },
         "balloon": {
          "type": "number",
          "description": "Balloon (lump sum) due with the last payment, USD. Default 0.",
          "minimum": 0
         }
        },
        "required": [
         "price",
         "payment",
         "months"
        ],
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Result with attribution"
     },
     "400": {
      "description": "Invalid input"
     }
    }
   }
  },
  "/api/calc/yield_ladder": {
   "get": {
    "operationId": "yield_ladder",
    "summary": "Note value at several yields",
    "description": "A note's price falls as the yield a buyer requires rises, and this tool prices the same remaining payments at up to 12 yields side by side to show how much. Estimates, not offers or appraisals. CashForMyNote.com does not buy notes or make offers.",
    "parameters": [
     {
      "name": "payment",
      "in": "query",
      "required": false,
      "description": "Monthly payment in USD (principal and interest).",
      "schema": {
       "type": "number",
       "minimum": 0
      }
     },
     {
      "name": "months",
      "in": "query",
      "required": true,
      "description": "Number of monthly payments LEFT (not the original term).",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 1200
      }
     },
     {
      "name": "yields",
      "in": "query",
      "required": true,
      "description": "Yields to test, annual %.",
      "schema": {
       "type": "string",
       "description": "Comma-separated numbers"
      }
     },
     {
      "name": "balloon",
      "in": "query",
      "required": false,
      "description": "Balloon (lump sum) due with the last payment, USD. Default 0.",
      "schema": {
       "type": "number",
       "minimum": 0
      }
     },
     {
      "name": "balance",
      "in": "query",
      "required": false,
      "description": "Unpaid principal balance in USD.",
      "schema": {
       "type": "number",
       "minimum": 0
      }
     },
     {
      "name": "rate",
      "in": "query",
      "required": false,
      "description": "Note interest rate, annual %. With balance, lets the tool compute the payment at full precision instead of taking payment.",
      "schema": {
       "type": "number",
       "minimum": 0,
       "maximum": 100
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Result with attribution",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Envelope"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "429": {
      "description": "Rate limited"
     }
    }
   },
   "post": {
    "operationId": "yield_ladder_post",
    "summary": "Note value at several yields (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "payment": {
          "type": "number",
          "description": "Monthly payment in USD (principal and interest).",
          "minimum": 0
         },
         "months": {
          "type": "integer",
          "description": "Number of monthly payments LEFT (not the original term).",
          "minimum": 1,
          "maximum": 1200
         },
         "yields": {
          "type": "array",
          "items": {
           "type": "number",
           "description": "Yield, annual %."
          },
          "minItems": 1,
          "maxItems": 12,
          "description": "Yields to test, annual %."
         },
         "balloon": {
          "type": "number",
          "description": "Balloon (lump sum) due with the last payment, USD. Default 0.",
          "minimum": 0
         },
         "balance": {
          "type": "number",
          "description": "Unpaid principal balance in USD.",
          "minimum": 0
         },
         "rate": {
          "type": "number",
          "description": "Note interest rate, annual %. With balance, lets the tool compute the payment at full precision instead of taking payment.",
          "minimum": 0,
          "maximum": 100
         }
        },
        "required": [
         "months",
         "yields"
        ],
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Result with attribution"
     },
     "400": {
      "description": "Invalid input"
     }
    }
   }
  },
  "/api/calc/partial_purchase": {
   "get": {
    "operationId": "partial_purchase",
    "summary": "Partial note sale calculator",
    "description": "In a partial note sale the holder sells only the next N payments and the rest revert to the holder, and this tool prices those payments at a target yield. It also shows what the holder keeps and the balance when payments revert. Estimates, not offers or appraisals. CashForMyNote.com does not buy notes or make offers.",
    "parameters": [
     {
      "name": "payment",
      "in": "query",
      "required": false,
      "description": "Monthly payment in USD (principal and interest).",
      "schema": {
       "type": "number",
       "minimum": 0
      }
     },
     {
      "name": "months",
      "in": "query",
      "required": true,
      "description": "Number of monthly payments LEFT (not the original term).",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 1200
      }
     },
     {
      "name": "payments_bought",
      "in": "query",
      "required": true,
      "description": "How many upcoming payments the buyer purchases.",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 1200
      }
     },
     {
      "name": "yield",
      "in": "query",
      "required": true,
      "description": "Target yield the buyer needs, annual % (monthly compounding).",
      "schema": {
       "type": "number",
       "minimum": 0,
       "maximum": 100
      }
     },
     {
      "name": "balloon",
      "in": "query",
      "required": false,
      "description": "Balloon (lump sum) due with the last payment, USD. Default 0.",
      "schema": {
       "type": "number",
       "minimum": 0
      }
     },
     {
      "name": "balance",
      "in": "query",
      "required": false,
      "description": "Unpaid principal balance in USD.",
      "schema": {
       "type": "number",
       "minimum": 0
      }
     },
     {
      "name": "rate",
      "in": "query",
      "required": false,
      "description": "Note interest rate, annual %. With balance, lets the tool compute the payment at full precision instead of taking payment.",
      "schema": {
       "type": "number",
       "minimum": 0,
       "maximum": 100
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Result with attribution",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Envelope"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "429": {
      "description": "Rate limited"
     }
    }
   },
   "post": {
    "operationId": "partial_purchase_post",
    "summary": "Partial note sale calculator (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "payment": {
          "type": "number",
          "description": "Monthly payment in USD (principal and interest).",
          "minimum": 0
         },
         "months": {
          "type": "integer",
          "description": "Number of monthly payments LEFT (not the original term).",
          "minimum": 1,
          "maximum": 1200
         },
         "payments_bought": {
          "type": "integer",
          "description": "How many upcoming payments the buyer purchases.",
          "minimum": 1,
          "maximum": 1200
         },
         "yield": {
          "type": "number",
          "description": "Target yield the buyer needs, annual % (monthly compounding).",
          "minimum": 0,
          "maximum": 100
         },
         "balloon": {
          "type": "number",
          "description": "Balloon (lump sum) due with the last payment, USD. Default 0.",
          "minimum": 0
         },
         "balance": {
          "type": "number",
          "description": "Unpaid principal balance in USD.",
          "minimum": 0
         },
         "rate": {
          "type": "number",
          "description": "Note interest rate, annual %. With balance, lets the tool compute the payment at full precision instead of taking payment.",
          "minimum": 0,
          "maximum": 100
         }
        },
        "required": [
         "months",
         "payments_bought",
         "yield"
        ],
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Result with attribution"
     },
     "400": {
      "description": "Invalid input"
     }
    }
   }
  },
  "/api/calc/balloon_note": {
   "get": {
    "operationId": "balloon_note",
    "summary": "Balloon payment calculator",
    "description": "A balloon payment is the lump sum due when a loan's remaining balance comes due before its monthly payments would pay it off, and this tool computes the monthly payment, the balloon amount and (with a yield) the note's price. Use it for a balloon mortgage or note whose payment is set on a long amortization but whose balance is due early. Estimates, not offers or appraisals. CashForMyNote.com does not buy notes or make offers.",
    "parameters": [
     {
      "name": "balance",
      "in": "query",
      "required": true,
      "description": "Unpaid principal balance in USD.",
      "schema": {
       "type": "number",
       "minimum": 0
      }
     },
     {
      "name": "rate",
      "in": "query",
      "required": true,
      "description": "Note interest rate, annual %, e.g. 7.5.",
      "schema": {
       "type": "number",
       "minimum": 0,
       "maximum": 100
      }
     },
     {
      "name": "amortization_months",
      "in": "query",
      "required": true,
      "description": "Months the payment is calculated over, e.g. 360.",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 1200
      }
     },
     {
      "name": "balloon_month",
      "in": "query",
      "required": true,
      "description": "Month the remaining balance is due, counted from now.",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 1200
      }
     },
     {
      "name": "yield",
      "in": "query",
      "required": false,
      "description": "Target yield the buyer needs, annual % (monthly compounding).",
      "schema": {
       "type": "number",
       "minimum": 0,
       "maximum": 100
      }
     },
     {
      "name": "payment",
      "in": "query",
      "required": false,
      "description": "Actual monthly payment if it differs from the calculated one.",
      "schema": {
       "type": "number",
       "minimum": 0
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Result with attribution",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Envelope"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "429": {
      "description": "Rate limited"
     }
    }
   },
   "post": {
    "operationId": "balloon_note_post",
    "summary": "Balloon payment calculator (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "balance": {
          "type": "number",
          "description": "Unpaid principal balance in USD.",
          "minimum": 0
         },
         "rate": {
          "type": "number",
          "description": "Note interest rate, annual %, e.g. 7.5.",
          "minimum": 0,
          "maximum": 100
         },
         "amortization_months": {
          "type": "integer",
          "description": "Months the payment is calculated over, e.g. 360.",
          "minimum": 1,
          "maximum": 1200
         },
         "balloon_month": {
          "type": "integer",
          "description": "Month the remaining balance is due, counted from now.",
          "minimum": 1,
          "maximum": 1200
         },
         "yield": {
          "type": "number",
          "description": "Target yield the buyer needs, annual % (monthly compounding).",
          "minimum": 0,
          "maximum": 100
         },
         "payment": {
          "type": "number",
          "description": "Actual monthly payment if it differs from the calculated one.",
          "minimum": 0
         }
        },
        "required": [
         "balance",
         "rate",
         "amortization_months",
         "balloon_month"
        ],
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Result with attribution"
     },
     "400": {
      "description": "Invalid input"
     }
    }
   }
  },
  "/api/calc/loan_payment": {
   "get": {
    "operationId": "loan_payment",
    "summary": "Monthly payment calculator",
    "description": "A fixed-rate loan's monthly payment is the level amount that pays off the balance with interest over the number of months, and this tool computes it for a mortgage, land contract or other installment note. Optionally leaves a balloon. Estimates, not offers or appraisals. CashForMyNote.com does not buy notes or make offers.",
    "parameters": [
     {
      "name": "balance",
      "in": "query",
      "required": true,
      "description": "Unpaid principal balance in USD.",
      "schema": {
       "type": "number",
       "minimum": 0
      }
     },
     {
      "name": "rate",
      "in": "query",
      "required": true,
      "description": "Note interest rate, annual %, e.g. 7.5.",
      "schema": {
       "type": "number",
       "minimum": 0,
       "maximum": 100
      }
     },
     {
      "name": "months",
      "in": "query",
      "required": true,
      "description": "Number of monthly payments.",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 1200
      }
     },
     {
      "name": "balloon",
      "in": "query",
      "required": false,
      "description": "Balloon (lump sum) due with the last payment, USD. Default 0.",
      "schema": {
       "type": "number",
       "minimum": 0
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Result with attribution",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Envelope"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "429": {
      "description": "Rate limited"
     }
    }
   },
   "post": {
    "operationId": "loan_payment_post",
    "summary": "Monthly payment calculator (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "balance": {
          "type": "number",
          "description": "Unpaid principal balance in USD.",
          "minimum": 0
         },
         "rate": {
          "type": "number",
          "description": "Note interest rate, annual %, e.g. 7.5.",
          "minimum": 0,
          "maximum": 100
         },
         "months": {
          "type": "integer",
          "description": "Number of monthly payments.",
          "minimum": 1,
          "maximum": 1200
         },
         "balloon": {
          "type": "number",
          "description": "Balloon (lump sum) due with the last payment, USD. Default 0.",
          "minimum": 0
         }
        },
        "required": [
         "balance",
         "rate",
         "months"
        ],
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Result with attribution"
     },
     "400": {
      "description": "Invalid input"
     }
    }
   }
  },
  "/api/calc/remaining_balance": {
   "get": {
    "operationId": "remaining_balance",
    "summary": "Remaining loan balance calculator",
    "description": "The remaining balance is the principal still owed after a number of on-time payments, and this tool computes it from the balance, rate and payment. Estimates, not offers or appraisals. CashForMyNote.com does not buy notes or make offers.",
    "parameters": [
     {
      "name": "balance",
      "in": "query",
      "required": true,
      "description": "Original (or current) balance, USD.",
      "schema": {
       "type": "number",
       "minimum": 0
      }
     },
     {
      "name": "rate",
      "in": "query",
      "required": true,
      "description": "Note interest rate, annual %, e.g. 7.5.",
      "schema": {
       "type": "number",
       "minimum": 0,
       "maximum": 100
      }
     },
     {
      "name": "payment",
      "in": "query",
      "required": true,
      "description": "Monthly payment in USD (principal and interest).",
      "schema": {
       "type": "number",
       "minimum": 0
      }
     },
     {
      "name": "payments_made",
      "in": "query",
      "required": true,
      "description": "Payments made since that balance.",
      "schema": {
       "type": "integer",
       "minimum": 0,
       "maximum": 1200
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Result with attribution",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Envelope"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "429": {
      "description": "Rate limited"
     }
    }
   },
   "post": {
    "operationId": "remaining_balance_post",
    "summary": "Remaining loan balance calculator (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "balance": {
          "type": "number",
          "description": "Original (or current) balance, USD.",
          "minimum": 0
         },
         "rate": {
          "type": "number",
          "description": "Note interest rate, annual %, e.g. 7.5.",
          "minimum": 0,
          "maximum": 100
         },
         "payment": {
          "type": "number",
          "description": "Monthly payment in USD (principal and interest).",
          "minimum": 0
         },
         "payments_made": {
          "type": "integer",
          "description": "Payments made since that balance.",
          "minimum": 0,
          "maximum": 1200
         }
        },
        "required": [
         "balance",
         "rate",
         "payment",
         "payments_made"
        ],
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Result with attribution"
     },
     "400": {
      "description": "Invalid input"
     }
    }
   }
  },
  "/api/calc/amortization_schedule": {
   "get": {
    "operationId": "amortization_schedule",
    "summary": "Amortization schedule calculator",
    "description": "An amortization schedule shows how each monthly payment splits into interest and principal and what balance is left, and this tool lists it month by month (up to 600 rows) with totals. Estimates, not offers or appraisals. CashForMyNote.com does not buy notes or make offers.",
    "parameters": [
     {
      "name": "balance",
      "in": "query",
      "required": true,
      "description": "Unpaid principal balance in USD.",
      "schema": {
       "type": "number",
       "minimum": 0
      }
     },
     {
      "name": "rate",
      "in": "query",
      "required": true,
      "description": "Note interest rate, annual %, e.g. 7.5.",
      "schema": {
       "type": "number",
       "minimum": 0,
       "maximum": 100
      }
     },
     {
      "name": "months",
      "in": "query",
      "required": true,
      "description": "Number of monthly payments.",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 1200
      }
     },
     {
      "name": "payment",
      "in": "query",
      "required": false,
      "description": "Monthly payment if not fully amortizing (the last row then clears the remainder).",
      "schema": {
       "type": "number",
       "minimum": 0
      }
     },
     {
      "name": "start_month",
      "in": "query",
      "required": false,
      "description": "First month to list. Default 1.",
      "schema": {
       "type": "integer",
       "minimum": 1
      }
     },
     {
      "name": "rows",
      "in": "query",
      "required": false,
      "description": "Max rows. Default 600.",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 600
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Result with attribution",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Envelope"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "429": {
      "description": "Rate limited"
     }
    }
   },
   "post": {
    "operationId": "amortization_schedule_post",
    "summary": "Amortization schedule calculator (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "balance": {
          "type": "number",
          "description": "Unpaid principal balance in USD.",
          "minimum": 0
         },
         "rate": {
          "type": "number",
          "description": "Note interest rate, annual %, e.g. 7.5.",
          "minimum": 0,
          "maximum": 100
         },
         "months": {
          "type": "integer",
          "description": "Number of monthly payments.",
          "minimum": 1,
          "maximum": 1200
         },
         "payment": {
          "type": "number",
          "description": "Monthly payment if not fully amortizing (the last row then clears the remainder).",
          "minimum": 0
         },
         "start_month": {
          "type": "integer",
          "description": "First month to list. Default 1.",
          "minimum": 1
         },
         "rows": {
          "type": "integer",
          "description": "Max rows. Default 600.",
          "minimum": 1,
          "maximum": 600
         }
        },
        "required": [
         "balance",
         "rate",
         "months"
        ],
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Result with attribution"
     },
     "400": {
      "description": "Invalid input"
     }
    }
   }
  },
  "/api/calc/note_discount": {
   "get": {
    "operationId": "note_discount",
    "summary": "Note discount calculator",
    "description": "A note's discount is how far its price is below the unpaid balance, and this tool gives it in dollars, as a percent, and in cents per dollar of balance. Estimates, not offers or appraisals. CashForMyNote.com does not buy notes or make offers.",
    "parameters": [
     {
      "name": "price",
      "in": "query",
      "required": true,
      "description": "Price, USD.",
      "schema": {
       "type": "number",
       "minimum": 0
      }
     },
     {
      "name": "balance",
      "in": "query",
      "required": true,
      "description": "Unpaid principal balance in USD.",
      "schema": {
       "type": "number",
       "minimum": 0
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Result with attribution",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Envelope"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "429": {
      "description": "Rate limited"
     }
    }
   },
   "post": {
    "operationId": "note_discount_post",
    "summary": "Note discount calculator (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "price": {
          "type": "number",
          "description": "Price, USD.",
          "minimum": 0
         },
         "balance": {
          "type": "number",
          "description": "Unpaid principal balance in USD.",
          "minimum": 0
         }
        },
        "required": [
         "price",
         "balance"
        ],
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Result with attribution"
     },
     "400": {
      "description": "Invalid input"
     }
    }
   }
  },
  "/api/calc/loan_to_value": {
   "get": {
    "operationId": "loan_to_value",
    "summary": "Loan-to-value (LTV) ratio calculator",
    "description": "The loan-to-value ratio is the loan balance divided by the property's value, shown as a percent, and this tool computes LTV, combined LTV (CLTV) with other liens, and the equity cushion behind a note. Estimates, not offers or appraisals. CashForMyNote.com does not buy notes or make offers.",
    "parameters": [
     {
      "name": "loan",
      "in": "query",
      "required": true,
      "description": "Note balance, USD.",
      "schema": {
       "type": "number",
       "minimum": 0
      }
     },
     {
      "name": "value",
      "in": "query",
      "required": true,
      "description": "Property value, USD.",
      "schema": {
       "type": "number",
       "minimum": 0.01
      }
     },
     {
      "name": "other_liens",
      "in": "query",
      "required": false,
      "description": "Balances of other liens on the property, USD. Default 0.",
      "schema": {
       "type": "number",
       "minimum": 0
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Result with attribution",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Envelope"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "429": {
      "description": "Rate limited"
     }
    }
   },
   "post": {
    "operationId": "loan_to_value_post",
    "summary": "Loan-to-value (LTV) ratio calculator (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "loan": {
          "type": "number",
          "description": "Note balance, USD.",
          "minimum": 0
         },
         "value": {
          "type": "number",
          "description": "Property value, USD.",
          "minimum": 0.01
         },
         "other_liens": {
          "type": "number",
          "description": "Balances of other liens on the property, USD. Default 0.",
          "minimum": 0
         }
        },
        "required": [
         "loan",
         "value"
        ],
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Result with attribution"
     },
     "400": {
      "description": "Invalid input"
     }
    }
   }
  },
  "/api/calc/debt_to_income": {
   "get": {
    "operationId": "debt_to_income",
    "summary": "Debt-to-income (DTI) ratio calculator",
    "description": "The debt-to-income ratio is total monthly debt payments divided by gross monthly income, shown as a percent, and this tool computes it for a borrower (plus the housing-only ratio, if given). Estimates, not offers or appraisals. CashForMyNote.com does not buy notes or make offers.",
    "parameters": [
     {
      "name": "monthly_debts",
      "in": "query",
      "required": true,
      "description": "All monthly debt payments incl. housing, USD.",
      "schema": {
       "type": "number",
       "minimum": 0
      }
     },
     {
      "name": "gross_monthly_income",
      "in": "query",
      "required": true,
      "description": "Gross monthly income, USD.",
      "schema": {
       "type": "number",
       "minimum": 0.01
      }
     },
     {
      "name": "housing_payment",
      "in": "query",
      "required": false,
      "description": "Monthly housing payment, USD (optional).",
      "schema": {
       "type": "number",
       "minimum": 0
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Result with attribution",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Envelope"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "429": {
      "description": "Rate limited"
     }
    }
   },
   "post": {
    "operationId": "debt_to_income_post",
    "summary": "Debt-to-income (DTI) ratio calculator (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "monthly_debts": {
          "type": "number",
          "description": "All monthly debt payments incl. housing, USD.",
          "minimum": 0
         },
         "gross_monthly_income": {
          "type": "number",
          "description": "Gross monthly income, USD.",
          "minimum": 0.01
         },
         "housing_payment": {
          "type": "number",
          "description": "Monthly housing payment, USD (optional).",
          "minimum": 0
         }
        },
        "required": [
         "monthly_debts",
         "gross_monthly_income"
        ],
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Result with attribution"
     },
     "400": {
      "description": "Invalid input"
     }
    }
   }
  },
  "/api/calc/seasoning": {
   "get": {
    "operationId": "seasoning",
    "summary": "Note seasoning calculator",
    "description": "A note's seasoning is how long the borrower has been paying, counted from the first payment due date, and this tool gives the months seasoned and the payments due so far. If given payments made, it shows how many were missed or paid ahead, which helps tell a performing note from a non-performing one. Estimates, not offers or appraisals. CashForMyNote.com does not buy notes or make offers.",
    "parameters": [
     {
      "name": "first_payment_date",
      "in": "query",
      "required": true,
      "description": "YYYY-MM-DD",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "as_of",
      "in": "query",
      "required": true,
      "description": "YYYY-MM-DD",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "payments_made",
      "in": "query",
      "required": false,
      "description": "Payments actually received (optional).",
      "schema": {
       "type": "integer",
       "minimum": 0
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Result with attribution",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Envelope"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "429": {
      "description": "Rate limited"
     }
    }
   },
   "post": {
    "operationId": "seasoning_post",
    "summary": "Note seasoning calculator (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "first_payment_date": {
          "type": "string",
          "description": "YYYY-MM-DD",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
         },
         "as_of": {
          "type": "string",
          "description": "YYYY-MM-DD",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
         },
         "payments_made": {
          "type": "integer",
          "description": "Payments actually received (optional).",
          "minimum": 0
         }
        },
        "required": [
         "first_payment_date",
         "as_of"
        ],
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Result with attribution"
     },
     "400": {
      "description": "Invalid input"
     }
    }
   }
  },
  "/api/calc/market_rates": {
   "get": {
    "operationId": "market_rates",
    "summary": "Current 30-year mortgage rate and 10-year Treasury yield",
    "description": "The current 30-year fixed mortgage rate here is the latest weekly Freddie Mac PMMS average, returned with the latest daily 10-year Treasury yield, each as a single value with its own data date, source and citation. History is not included; use the source links. Estimates, not offers or appraisals. CashForMyNote.com does not buy notes or make offers.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Result with attribution",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Envelope"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "429": {
      "description": "Rate limited"
     }
    }
   },
   "post": {
    "operationId": "market_rates_post",
    "summary": "Current 30-year mortgage rate and 10-year Treasury yield (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {},
        "required": [],
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Result with attribution"
     },
     "400": {
      "description": "Invalid input"
     }
    }
   }
  },
  "/api/calc/rate_vs_market": {
   "get": {
    "operationId": "rate_vs_market",
    "summary": "Note rate vs current mortgage rates",
    "description": "A note whose rate is below current mortgage rates usually sells at a deeper discount, and this tool gives the gap in percentage points between a note's rate and the latest weekly 30-year fixed mortgage average (Freddie Mac PMMS), with that week's date. Estimates, not offers or appraisals. CashForMyNote.com does not buy notes or make offers.",
    "parameters": [
     {
      "name": "note_rate",
      "in": "query",
      "required": true,
      "description": "Note interest rate, annual %, e.g. 7.5.",
      "schema": {
       "type": "number",
       "minimum": 0,
       "maximum": 100
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Result with attribution",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Envelope"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "429": {
      "description": "Rate limited"
     }
    }
   },
   "post": {
    "operationId": "rate_vs_market_post",
    "summary": "Note rate vs current mortgage rates (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "note_rate": {
          "type": "number",
          "description": "Note interest rate, annual %, e.g. 7.5.",
          "minimum": 0,
          "maximum": 100
         }
        },
        "required": [
         "note_rate"
        ],
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Result with attribution"
     },
     "400": {
      "description": "Invalid input"
     }
    }
   }
  },
  "/api/calc/effective_annual_rate": {
   "get": {
    "operationId": "effective_annual_rate",
    "summary": "Effective annual rate calculator",
    "description": "The effective annual rate is what a nominal annual rate compounded monthly actually earns over a year, and this tool converts one into the other. Estimates, not offers or appraisals. CashForMyNote.com does not buy notes or make offers.",
    "parameters": [
     {
      "name": "nominal_rate",
      "in": "query",
      "required": true,
      "description": "Nominal annual %, monthly compounding.",
      "schema": {
       "type": "number",
       "minimum": 0,
       "maximum": 1000
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Result with attribution",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Envelope"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input"
     },
     "429": {
      "description": "Rate limited"
     }
    }
   },
   "post": {
    "operationId": "effective_annual_rate_post",
    "summary": "Effective annual rate calculator (JSON body)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "nominal_rate": {
          "type": "number",
          "description": "Nominal annual %, monthly compounding.",
          "minimum": 0,
          "maximum": 1000
         }
        },
        "required": [
         "nominal_rate"
        ],
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Result with attribution"
     },
     "400": {
      "description": "Invalid input"
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Envelope": {
    "type": "object",
    "properties": {
     "tool": {
      "type": "string"
     },
     "result": {
      "type": "object"
     },
     "attribution": {
      "type": "object",
      "properties": {
       "source": {
        "type": "string"
       },
       "credit": {
        "type": "string"
       },
       "source_url": {
        "type": "string"
       },
       "disclaimer": {
        "type": "string"
       }
      }
     }
    }
   }
  }
 }
}