Cozy can stores and manipulate bank related datas, distributed across several doctypes.
This doctype store informations about Bank application settings. There is only one document, by default:
{
notifications: {
amountMax: {
enable: false,
value: 30
}
}
}
This doctypes stores informations about a Bank account:
label
: {string} - The bank account label (e.g. John Doe Bank Account)institutionLabel
: {string} - The financial institution name the bank account belongs tobalance
: {number} - The current account balancetype
: {string} - The account type in the list['none', 'bank', 'cash', 'asset', 'credit card', 'liability']
number
: {string} - The bank account number in its institutioniban
: {string} - The bank account international identifierserviceID
: {number} - In case of external service used to import transactions, this key can stores the service's account ID; can beundefined
is the account isn't managed by any external servicevendorId
: {string} - Id of the bank account on the vendor sideloan
: {Object} - Specific properties for loan accounts. Will be undefined for all other account typescontactName
: {string} - The name of the contact in the credit institutiontotalAmount
: {number} - The total amount of the loanavailableAmount
: {number} - The currently available amountusedAmount
: {number} - The amount already usedsubscriptionDate
: {date} - The date on which the loan has been subscribedmaturityDate
: {date} - The end date of the loannextPaymentAmount
: {number} - The amount of the next paymentnextPaymentDate
: {date} - The date of the next paymentrate
: {number} - The loan rate (between 0 and 100)nbPaymentsLeft
: {number} - The number of remaining paymentsnbPaymentsDone
: {number} - The number of payments madenbPaymentsTotal
: {number} - The total number of paymentslastPaymentAmount
: {number} - The amount of the last paymentlastPaymentDate
: {date} - The date of the last paymentaccountLabel
: {string} - The loan account labelinsuranceLabel
: {string} - The insurance labelduration
: {number} - The loan duration in months
relationships
: {Object} - Relationships to other documentsconnection
: {HasOne<io.cozy.accounts>
} The account used to retrieve this document. This is used by Harvest to be able to edit anio.cozy.bank.accounts
through the "Configuration" tab of anio.cozy.accounts
.checkingsAccount
: {HasOne<io.cozy.bank.accounts>
} - In case of a credit card account, links to the bankaccount on which all the transactions will be debited at the end of the monthowners
: {HasMany<io.cozy.contacts>
} - List of owners for this account
{
"_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"
}
}
}
This doctype stores aggregated data about bank accounts:
periodStart
: {date} - The start of the reference periodperiodEnd
: {date} - The end of the reference periodincome
: {number} - The average income on the reference periodadditionalIncome
: {number} - The average additional income on the reference periodmortgage
: {number} - The average mortgage expense on the reference periodloans
: {number} - The average total loans expense on the reference periodfixedCharges
: {number} - The average fixed charges on the reference periodcurrency
: {string} - A 3 uppercased chars defining the currecny used for the transaction as stated in ISO4217
account
: {object} - The associated account
{
"_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"
}
}
}
}
This doctype stors informations about a bank transaction:
label
: {string} - The label describing the transactiontype
: {string} - A type in the list :['none', 'credit card', 'cash', 'check', 'transfer', 'internal transfer', 'debit card', 'deposit', 'financial fee', 'direct debit']
date
: {date} - The date the transaction is emitteddateOperation
: {date} - The date the transaction is registered in the accountdateImport
: {date} - The date the transaction is imported (can differ of the date of creation of the document as the import can be done by an external service)amount
: {number} - The amount of the transactioncurrency
: {string} - A 3 uppercased chars defining the currecny used for the transaction as stated in ISO4217automaticCategoryId
: {string} - A category that apply to the transaction and is automatically calculated. This property should be hydrated by the connector. See the « categories » section below to know more about categoriesmanualCategoryId
: {string} - A category that apply to the transaction and is manually selected by the usercozyCategoryId
: {string} - A category found by CozycozyCategoryProba
: {number} - The probability of Cozy categorylocalCategoryId
: {string} - A category found by Cozy, based on the user recategorization habitslocalCategoryProba
: {number} - The probability of local categoryaccount
: {identifier} - The related account id the transaction belongs tobills
: {array[<io.cozy.bills._id>]} - List of bills id.reimbursements
: {array[<io.cozy.bills._id>]} - List of bills id.creditOperations
: {array[<io.cozy.bank.operations._id>]} - List of credit operations iddebitOperations
: {array[<io.cozy.bank.operations._id>]} - List of debit operations idparent
: {_id} - In case of a split transaction, the one refers the global transaction the split one belongs tovendorId
: {string} - Id of the transaction on the vendor sidevendorAccountId
: {string} - Id of the transaction's account on the vendor side
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.
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.
{
"_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"
}
This doctype stores a year of daily balances :
year
: {number} - The year of the balancesbalances
: {object} - A day (YYYY-MM-DD format) / balance (number) map
account
: {object} - The associated account
{
"_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"
}
}
}
}
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.
manualLabel
: {string} - The year of the balancesautomaticLabel
: {string} - A day (YYYY-MM-DD format) / balance (number) mapamounts
: {Array} - Amounts that can be matched to the recurrence (come from the transactions)categoryIds
: {Array} - Category ids of the transactions that have been linkedstatus
: {Enum<"ongoing","finished">} - A recurrence can be stated as "finished" if transactions should not longer match it. For example if a telco contract has finished.stats
: {Object} - Statistics used during matchingstats.deltas.median
: Median time distance in days between operations. For example, for a monthly recurrence, this should be 30.