{
  "service": "Creditcrest Score",
  "version": "2.0.0",
  "stores": "nothing",
  "says": "Creditcrest Score compares an applicant with the lender’s borrowers who repaid. It is not a credit decision, it declines nobody, and until it is validated on the lender’s own outcomes it is uncalibrated.",
  "scales": {
    "elo": "Against the lender’s model borrower: a rating where the model borrower started at 1500 and moves with the lender’s outcomes.",
    "plain": "A plain score from 0 to 1200, each measure read against fixed scales and compared with nobody."
  },
  "keeps": "Nothing. A lender that keeps its own records sends the model borrower and a loan’s rating history in, and keeps what comes back. A lender hosted on Creditcrest has them kept in its own records: GET /v1/l.",
  "endpoints": {
    "POST /v1/score": {
      "what": "Score an applicant against the lender’s model borrower, or on the plain scale out of 1200. The answer carries the first entry of the rating history, to keep.",
      "body": "{ statement (CSV text) | application (reading, assessment, history, answers…), amount, termMonths, frequency, scale: elo | plain, model? (the model borrower, as /v1/score/model-borrower returned it), lender?, reference? (the application’s), loan? }"
    },
    "POST /v1/score/model-borrower": {
      "what": "Count completed and written-off loans in the lender’s model borrower, up to 25 a call: its rating moves with each, and repaid loans join its profile. Send it back each time; each loan counts once.",
      "body": "{ model? | lender, loans: [{ loan, application?, outcome: completed | written off, on, good: repaid and never over 7 days past due, rated: the history’s first entry (scale, rating, measures) }] }"
    },
    "POST /v1/score/history": {
      "what": "Bring a loan’s rating history up to a day from its ledger: every repayment, dishonour, cleared arrears, early payout, completion or write-off since, each once. Hardship never lowers it.",
      "body": "{ history: [the entries so far, first to last], terms, events (the ledger’s events), through: YYYY-MM-DD, graceDays?, model? }"
    },
    "POST /v1/score/benchmark": {
      "what": "Build a model borrower’s profile from closed loans in one go.",
      "body": "{ loans: [{ measures, outcome: good|bad|neither, closedOn }], from?, to? }"
    },
    "POST /v1/score/validate": {
      "what": "How well the score separates good and bad loans: AUC, Gini, KS and the bad rate by band.",
      "body": "{ loans: [{ rating, outcome }] }"
    },
    "POST /v1/score/update": {
      "what": "Move a rating by repayment results: each instalment is a match.",
      "body": "{ rating, results: [{ result: on time|late|missed|plan kept }], baseRate? }"
    }
  }
}