{
  "service": "Creditcrest bank statement",
  "standard": "creditcrest/bank-statement",
  "version": "1.1",
  "mediaType": "application/vnd.creditcrest.bank-statement+json",
  "stores": "nothing",
  "what": "One bank statement for every source: the same JSON and the same page whether the data came by open banking, a bank login or the bank’s own file, sealed so a change shows.",
  "sources": {
    "file": "a statement file: a PDF statement; a CSV export; an Excel workbook (.xlsx); an Excel 97–2003 workbook (.xls); an OpenDocument spreadsheet (.ods); a web page saved as a spreadsheet; an Excel 2003 XML spreadsheet; an OFX, QFX or QBO file (Quicken, QuickBooks, MYOB, Xero); a QIF file (Quicken, MYOB); a SWIFT MT940 or MT942 file; an ISO 20022 camt.052, camt.053 or camt.054 file",
    "cdr": "banking data in the Consumer Data Right’s shape (accounts, balances, transactions, customer), as an open-banking provider passes it through, in either spelling",
    "illion": "illion’s raw data file, any of its four published formats",
    "open": "accounts in the standard’s own open input, from a provider of your own"
  },
  "methods": {
    "open banking": "Open banking (the Consumer Data Right), with the account holder’s consent.",
    "bank login": "The bank’s internet banking, with the account holder’s login entered on the provider’s page.",
    "file": "A statement file.",
    "invented": "Invented, to show the standard. Nobody’s data."
  },
  "balanceSources": {
    "printed": "As the bank or its export gave them.",
    "worked": "Worked out from the account’s balance and its transactions; the bank did not give one beside each."
  },
  "seal": "HMAC-SHA256 over the statement’s canonical form, with its SHA-256 beside it. A live key’s statements, for a lender whose records are real, are sealed with Creditcrest’s key; a test key’s, and any made without a key, with the published sandbox key, which proves nothing. Every statement made here is marked source.via \"sent\": made from data sent to Creditcrest, not fetched from the bank by it.",
  "pages": {
    "/bank-statement": "what it is, an example, and one made from your file",
    "/bank-statement/verify": "check one by hand"
  },
  "endpoints": {
    "POST /v1/statement/document": {
      "what": "A bank statement in Creditcrest’s standard, from whatever the data came as: a statement file, banking data in the Consumer Data Right’s shape, illion’s raw data file, or accounts in the standard’s own open input. The same JSON whichever it was, sealed; or the statement as a page with format=html.",
      "body": "the statement file itself as the body (a PDF, a workbook, OFX, QIF, MT940, camt.053 or CSV), a multipart form with the file as \"file\", or JSON: {file: base64, filename?, password?}, {cdr: {accounts, balances, transactions, customer?}, institution?}, {illion: <raw data>}, or {source: {method, provider?}, accounts: [...]}; with reference?, categories? (true unless false) and setting? beside it",
      "query": {
        "format": {
          "what": "json (the default) or html: the statement as its page",
          "takes": [
            "json",
            "html"
          ]
        },
        "setting": {
          "what": "How far a reading may go past the rules: strict is the rules alone; balanced, the default, adds a modelled reading where its category stays at 95% precision or better; broad, at 90%; complete gives every line a category, guessing where nothing read it, and marks each guess. Any case; every answer says which it was read under",
          "takes": [
            "strict",
            "balanced",
            "broad",
            "complete"
          ]
        },
        "categories": {
          "what": "false to leave each line untagged",
          "takes": [
            "true",
            "false"
          ]
        },
        "reference": "your own reference for it, such as the application’s"
      }
    },
    "POST /v1/statement/document/verify": {
      "what": "Whether a statement is as Creditcrest made it: its shape, its fingerprint and its seal, each problem with a code. Free.",
      "body": "the statement as JSON, or {statement}, or its page (text/html)"
    },
    "POST /v1/statement/document/render": {
      "what": "A statement you kept, as its page: drawn again from its JSON, with whether it checks said at the top. Free.",
      "body": "the statement as JSON, or {statement}"
    },
    "GET /v1/statement/document": {
      "what": "What the standard holds, the sources it is made from and how it is sealed."
    },
    "GET /v1/statement/document/schema": {
      "what": "The standard as JSON Schema, for a program that checks what it is given."
    },
    "GET /v1/statement/document/sample": {
      "what": "An invented statement in the standard, sealed with the sandbox key.",
      "query": {
        "example": "which invented statement: strong, steady, borrower, connection, file"
      }
    }
  }
}