{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "#/components/schemas/BankAccounts",
"title": "Accounting: Bank accounts",
"x-internal": true,
"allOf": [
{
"type": "object",
"properties": {
"results": {
"type": "array",
"items": {
"title": "Accounting: Bank account",
"description": "> **Accessing Bank Accounts through Banking API**\n> \n> This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. \n> \n> To view bank account data through the Banking API, please refer to the new [Banking: Account](https://docs.codat.io/bank-feeds-api#/schemas/Account) data type.\n\n## Overview\n\nA list of bank accounts associated with a company and a specific data connection.\n\nBank accounts data includes:\n* The name and ID of the account in the accounting software.\n* The currency and balance of the account.\n* The sort code and account number.",
"type": "object",
"allOf": [
{
"properties": {
"id": {
"type": "string",
"description": "Identifier for the account, unique for the company in the accounting software."
}
}
},
{
"$ref": "#/components/schemas/BankAccounts/allOf/0/properties/results/items/definitions/bankAccountPrototype"
},
{
"properties": {
"metadata": {
"title": "Metadata",
"type": "object",
"x-internal": true,
"properties": {
"isDeleted": {
"type": "boolean",
"description": "Indicates whether the record has been deleted in the third-party system this record originated from.",
"nullable": true
}
}
},
"supplementalData": {
"title": "Supplemental data",
"type": "object",
"x-internal": true,
"description": "Supplemental data is additional data you can include in our standard data types. \n\nIt is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data.",
"properties": {
"content": {
"type": "object",
"additionalProperties": {
"type": "object",
"additionalProperties": true
},
"nullable": true
}
}
}
}
},
{
"title": "Modified dates",
"x-internal": true,
"allOf": [
{
"title": "ModifiedDate",
"x-internal": true,
"type": "object",
"properties": {
"modifiedDate": {
"allOf": [
{
"$ref": "#/components/schemas/DateTime"
},
{
"description": "The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat\u2019s data cache.\n\nUse it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today.\n\nThis date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)).\n\nIn Codat's data model, dates and times are represented using the <a class=\"external\" href=\"https://en.wikipedia.org/wiki/ISO_8601\" target=\"_blank\">ISO 8601 standard</a>."
}
]
}
}
},
{
"title": "Source Modified Date",
"x-internal": true,
"type": "object",
"nullable": true,
"properties": {
"sourceModifiedDate": {
"allOf": [
{
"$ref": "#/components/schemas/DateTime"
},
{
"description": "The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. \n\nIt is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when:\n - Pulling attachments\n - The accounting software does not provide modification dates for a data type\n - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred\n - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records\n\nIn Codat's data model, dates and times are represented using the <a class=\"external\" href=\"https://en.wikipedia.org/wiki/ISO_8601\" target=\"_blank\">ISO 8601 standard</a>."
}
]
}
}
}
]
}
],
"definitions": {
"bankAccountPrototype": {
"title": "Bank account prototype",
"type": "object",
"properties": {
"accountName": {
"type": "string",
"nullable": true,
"description": "Name of the bank account in the accounting software."
},
"accountType": {
"title": "Bank Account Type",
"x-internal": true,
"enum": [
"Unknown",
"Credit",
"Debit"
],
"type": "string",
"description": "The type of transactions and balances on the account. \nFor Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. \nFor Debit accounts, positive balances are assets, and positive transactions **increase** assets."
},
"nominalCode": {
"type": "string",
"nullable": true,
"description": "Code used to identify each nominal account for a business."
},
"sortCode": {
"type": "string",
"nullable": true,
"description": "Sort code for the bank account.\n\nXero integrations\nThe sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated."
},
"accountNumber": {
"type": "string",
"nullable": true,
"description": "Account number for the bank account.\n\nXero integrations\nOnly a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated.\n\nFreeAgent integrations\nFor Credit accounts, only the last four digits are required. For other types, the field is optional."
},
"iBan": {
"type": "string",
"nullable": true,
"description": "International bank account number of the account. Often used when making or receiving international payments."
},
"currency": {
"$ref": "#/components/schemas/SourceAccount/properties/currency",
"description": "Base currency of the bank account."
},
"balance": {
"type": "number",
"format": "decimal",
"nullable": true,
"description": "Balance of the bank account."
},
"institution": {
"type": "string",
"nullable": true,
"description": "The institution of the bank account."
},
"availableBalance": {
"type": "number",
"format": "decimal",
"nullable": true,
"description": "Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example."
},
"overdraftLimit": {
"type": "number",
"format": "decimal",
"nullable": true,
"description": "Pre-arranged overdraft limit of the account.\n\nThe value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`."
},
"status": {
"$ref": "#/components/schemas/BankAccounts/allOf/0/properties/results/items/definitions/bankAccountStatus"
}
}
},
"bankAccountCreateResponse": {
"title": "Create bank account response",
"allOf": [
{
"properties": {
"data": {
"allOf": [
{
"$ref": "#/components/schemas/BankAccounts/allOf/0/properties/results/items"
},
{
"deprecated": true
}
]
}
}
},
{
"$ref": "#/components/schemas/PushOperation"
}
]
},
"bankAccountRef": {
"title": "Bank account reference",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Bank account 'id' for the account transaction."
},
"name": {
"type": "string",
"description": "bank account 'name' for the account transaction."
}
},
"description": "Links to the Account transactions data type."
},
"bankAccounts": {
"title": "Accounting: Bank accounts",
"allOf": [
{
"type": "object",
"properties": {
"results": {
"type": "array",
"items": {
"$ref": "#/components/schemas/BankAccounts/allOf/0/properties/results/items"
}
}
}
},
{
"$ref": "#/components/schemas/Companies/allOf/1"
}
]
},
"bankAccountStatus": {
"title": "Account status",
"enum": [
"Unknown",
"Active",
"Archived",
"Pending"
],
"type": "string",
"description": "Status of the bank account.",
"example": "Active"
}
}
}
}
}
},
{
"$ref": "#/components/schemas/Companies/allOf/1"
}
]
}