Skip to the content.

Table of contents

Cozy Bank doctypes

Cozy can stores and manipulate bank related datas, distributed across several doctypes.

io.cozy.bank.settings

This doctype store informations about Bank application settings. There is only one document, by default:

{
  notifications: {
    amountMax: {
      enable: false,
      value: 30
    }
  }
}

io.cozy.bank.accounts

This doctypes stores informations about a Bank account:

Example

{
  "_id": "2165d9a310deadbeeffc08d54c45102",
  "balance": 1337.73,
  "institutionLabel": "Société Générale (Particuliers)",
  "label": "Livret Dévelop. Durable (x1337)",
  "linxoId": "123456",
  "metadata": {
    "version": 1
  },
  "number": "03791 00048085818",
  "shortLabel": "Livret Dévelop. Durable",
  "type": "Savings",
  "relationships": {
    "connection": {
      "_id": "2165d9a310deadbeeffc08d54c45404",
      "_type": "io.cozy.accounts"
    }
  }
}

io.cozy.bank.accounts.stats

This doctype stores aggregated data about bank accounts:

Relationships

Example

{
  "_id": "f1aacd3254509687c07e48279b42cd50",
  "periodStart": "2019-03-01T00:00:00",
  "periodEnd": "2019-06-30T23:59:59",
  "income": 2345.67,
  "additionalIncome": 123.45,
  "mortgage": 567.89,
  "loans": 678.9,
  "fixedCharges": 234.56,
  "currency": "EUR",
  "relationships": {
    "account": {
      "data": {
        "_id": "f1aacd3254509687c07e48279b42f3de",
        "_type": "io.cozy.bank.accounts"
      }
    }
  }
}

io.cozy.bank.operations

This doctype stors informations about a bank transaction:

For the dates, any string or integer which can be interpreted by new Date(date) is possible but the best the result of Date.toString() -> like ‘Fri Mar 09 2018 19:04:40 GMT+0100 (CET)’ which contains the time zones.

Categories

There are up to four categories that can be assigned to a io.cozy.bank.operations document. But there is only one that a connector have to set when retrieving the transactions from a bank: automaticCategoryId. This property have to be one of the categories ID listed here. If you want to see more human labels, you can check the translations of each label in english or french.

Other category properties are to be set by other sources: the user or Cozy Banks services.

Example

{
  "_id": "f0426fdeadbeef55755ee7f4d6555",
  "account": "15fb6402426bcdeadbeeffd5f4587bb",
  "amount": 10,
  "automaticCategoryId": "400110",
  "currency": "EUR",
  "date": "2017-09-22 00:00:00+01:00",
  "dateOperation": null,
  "label": "M  PIERRE RICHARD",
  "linxoId": "845811337",
  "cozyCategoryId": "400110",
  "cozyCategoryProba": 0.9323,
  "metadata": {
    "dateImport": "2018-03-09T09:23:40.075Z",
    "version": 1
  },
  "originalBankLabel": "VIR RECU    5383518660S DE: M  PIERRE RICHARD J MOTIF: Cascade REF: NOT PROVIDED",
  "type": "transfer"
}

io.cozy.bank.balancehistories

This doctype stores a year of daily balances :

Relationships

Example

{
  "_id": "f1aacd3254509687c07e48279b42cd50",
  "year": 2018,
  "balances": {
    "2018-01-01": 8000,
    "2018-01-02": 8000.42,
    "2018-01-03": 1337
  },
  "metadata": {
    "version": 1
  },
  "relationships": {
    "account": {
      "data": {
        "_id": "f1aacd3254509687c07e48279b42f3de",
        "_type": "io.cozy.bank.accounts"
      }
    }
  }
}

io.cozy.bank.recurrence

Stores a recurrence group information. Those objects are created by the recurrence service that tries to find recurring transactions. Transactions that are found as recurrent have a HasOne relationship to a io.cozy.bank.recurrence object.