Codat · Schema

Enhanced cash flow transactions

> **Categorization engine** > > The categorization engine uses machine learning and has been fully trained against Plaid and TrueLayer banking data sources. It is not fully trained against the Basiq banking data source. The Enhanced Cash Flow Transactions endpoint provides a fully categorized list of banking transactions for a company. Accounts and transaction data are obtained from the company's banking data sources.

Unified_API

Properties

Name Type Description
reportInfo object
dataSources array
reportItems array
View JSON Schema on GitHub

JSON Schema

codat-enhancedcashflowtransactions-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/EnhancedCashFlowTransactions",
  "title": "Enhanced cash flow transactions",
  "description": "> **Categorization engine**\n>\n> The categorization engine uses machine learning and has been fully trained against Plaid and TrueLayer banking data sources. It is not fully trained against the Basiq banking data source.\n\nThe Enhanced Cash Flow Transactions endpoint provides a fully categorized list of banking transactions for a company. Accounts and transaction data are obtained from the company's banking data sources.",
  "type": "object",
  "properties": {
    "reportInfo": {
      "$ref": "#/components/schemas/EnhancedInvoicesReport/definitions/reportInfo"
    },
    "dataSources": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/EnhancedCashFlowTransactions/definitions/dataSource"
      }
    },
    "reportItems": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/EnhancedCashFlowTransactions/definitions/enhancedCashFlowItem"
      }
    }
  },
  "definitions": {
    "dataSource": {
      "type": "object",
      "properties": {
        "accounts": {
          "description": "An array containing bank account data for each connected banking data source that have the following data types enabled: `banking-accounts`, `banking-transactions`.",
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/EnhancedCashFlowTransactions/definitions/accounts"
          }
        }
      }
    },
    "accounts": {
      "title": "Accounts",
      "type": "object",
      "properties": {
        "sourceRef": {
          "title": "Report source reference",
          "description": "A source reference containing the `sourceType` object \"Banking\".",
          "type": "object",
          "properties": {
            "sourceType": {
              "description": "The data source type.",
              "type": "string"
            }
          },
          "examples": [
            {
              "Example": {
                "value": {
                  "sourceRef": {
                    "sourceType": "Banking"
                  }
                }
              }
            }
          ]
        },
        "platformName": {
          "description": "Name of the banking data source, e.g. \"Plaid\".",
          "type": "string"
        },
        "accountProvider": {
          "description": "The bank or other financial institution providing the account.",
          "type": "string"
        },
        "accountName": {
          "description": "The name of the account according to the provider.",
          "type": "string"
        },
        "accountType": {
          "description": "The type of banking account, e.g. credit or debit.",
          "type": "string"
        },
        "currency": {
          "$ref": "#/components/schemas/SourceAccount/properties/currency",
          "description": "The currency code for the bank account."
        },
        "currentBalance": {
          "description": "The balance of the bank account.",
          "type": "number",
          "format": "decimal"
        }
      }
    },
    "enhancedCashFlowItem": {
      "type": "object",
      "properties": {
        "transactions": {
          "description": "An array of transaction data.",
          "type": "array",
          "items": {
            "title": "Cash flow transaction",
            "type": "object",
            "properties": {
              "id": {
                "description": "The unique identifier of the bank transaction.",
                "type": "string"
              },
              "date": {
                "description": "The date the bank transaction was posted.",
                "$ref": "#/components/schemas/DateTime"
              },
              "description": {
                "description": "The description of the bank transaction.",
                "type": "string"
              },
              "amount": {
                "description": "The bank transaction amount.",
                "type": "number",
                "format": "decimal"
              },
              "currency": {
                "$ref": "#/components/schemas/SourceAccount/properties/currency",
                "description": "The currency code for bank transaction."
              },
              "transactionCategory": {
                "description": "Contains an array of category levels.",
                "$ref": "#/components/schemas/EnhancedCashFlowTransactions/definitions/enhancedCashFlowItem/properties/transactions/items/definitions/transactionCategory"
              },
              "platformName": {
                "description": "Returns the payment processor responsible for the transaction.",
                "type": "string"
              },
              "counterpartyNames": {
                "description": "An array of counterparty names involved in the transaction.",
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "sourceRef": {
                "$ref": "#/components/schemas/EnhancedCashFlowTransactions/definitions/accounts/properties/sourceRef"
              },
              "accountRef": {
                "$ref": "#/components/schemas/EnhancedCashFlowTransactions/definitions/enhancedCashFlowItem/properties/transactions/items/definitions/accountRef"
              },
              "modifiedDate": {
                "description": "The date the bank transaction was last modified.",
                "$ref": "#/components/schemas/DateTime"
              },
              "isRecurring": {
                "description": "Indicates if the transaction is classified as recurring by Codat's categorization engine.",
                "type": "boolean",
                "nullable": true
              }
            },
            "definitions": {
              "accountRef": {
                "title": "Account reference",
                "description": "An account reference containing the account id and name.",
                "type": "object",
                "properties": {
                  "id": {
                    "description": "The id of the account.",
                    "type": "string"
                  },
                  "name": {
                    "description": "The name of the account.",
                    "type": "string"
                  }
                },
                "examples": [
                  {
                    "Example": {
                      "value": {
                        "accountRef": {
                          "id": "4f78a6b0-e9bb-40f2-82fd-f3a2daa1fd0a",
                          "name": "Business Current Account"
                        }
                      }
                    }
                  }
                ]
              },
              "transactionCategory": {
                "title": "Transaction category",
                "type": "object",
                "properties": {
                  "confidence": {
                    "description": "Returns the aggregate confidence of the suggested category for the transaction. The value is between 0 and 100.",
                    "type": "number",
                    "format": "decimal"
                  },
                  "confidences": {
                    "description": "An ordered array of category level confidences where each element is the confidence of the corresponding item in the `levels` array.",
                    "type": "array",
                    "items": {
                      "type": "number",
                      "format": "decimal"
                    }
                  },
                  "levels": {
                    "description": "The suggested category is an ordered array of category levels where each element (or level) is a subcategory of the previous element (or level).",
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "examples": [
                  {
                    "Example": {
                      "value": {
                        "transactionCategory": {
                          "confidence": 92.7,
                          "levels": [
                            "Asset",
                            "Current",
                            "Bank",
                            "BankTransfers",
                            "ShareholderTransfers"
                          ],
                          "confidences": [
                            92.7,
                            95,
                            96,
                            97.5,
                            100
                          ]
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        }
      }
    }
  },
  "examples": [
    {
      "reportInfo": {
        "pageNumber": 1,
        "pageSize": 100,
        "totalResults": 2401,
        "reportName": "Cash Flow transactions report",
        "companyName": "Example Company",
        "generatedDate": "2023-01-25T22:36:05.125Z"
      },
      "dataSources": [
        {
          "accounts": [
            {
              "sourceRef": {
                "sourceType": "Banking"
              },
              "id": "4f78a6b0-e9bb-40f2-82fd-f3a2daa1fd0a",
              "platformName": "Plaid",
              "accountProvider": "Bank of Sandbox",
              "accountName": "Business Current Account",
              "accountType": "Debit",
              "currency": "USD",
              "currentBalance": 1000,
              "identifiers": [
                {
                  "type": "Debit",
                  "subType": "Current",
                  "number": 12345678,
                  "bankCode": 123456,
                  "iban": "US123456789",
                  "bic": "US123456789",
                  "maskedAccountNumber": 1234
                }
              ]
            },
            {
              "sourceRef": {
                "sourceType": "Banking"
              },
              "id": "12345678-1234-1234-1234-123456789012",
              "platformName": "Plaid",
              "accountProvider": "Bank of Sandbox",
              "accountName": "Business Saving Account",
              "accountType": "Debit",
              "currency": "USD",
              "currentBalance": 5321,
              "identifiers": [
                {
                  "type": "Debit",
                  "subType": "Saving",
                  "number": 87654321,
                  "bankCode": 654321,
                  "iban": "US987654321",
                  "bic": "US987654321",
                  "maskedAccountNumber": 4321
                }
              ]
            }
          ]
        }
      ],
      "reportItems": [
        {
          "transactions": [
            {
              "sourceRef": {
                "sourceType": "Banking"
              }
            },
            {
              "accountRef": {
                "id": "4f78a6b0-e9bb-40f2-82fd-f3a2daa1fd0a",
                "name": "Business Current Account"
              },
              "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
              "date": "2023-01-25",
              "description": "Payment to supplier",
              "amount": 100,
              "currency": "USD",
              "transactionCategory": {
                "confidence": 92.7,
                "levels": [
                  "Asset",
                  "Current",
                  "Bank"
                ],
                "confidences": [
                  92.7,
                  95,
                  96
                ]
              },
              "platformName": "Plaid",
              "counterpartyNames": [
                "Counterparty"
              ],
              "modifiedDate": "2023-01-25T22:36:05.125Z"
            },
            {
              "sourceRef": {
                "sourceType": "Banking"
              }
            },
            {
              "accountRef": {
                "id": "12345678-1234-1234-1234-123456789012",
                "name": "Business Saving Account"
              },
              "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
              "date": "2023-01-25",
              "description": "Payment to supplier",
              "amount": 100,
              "currency": "USD",
              "transactionCategory": null,
              "confidence": 92.7,
              "levels": [
                "Expense",
                "Operating"
              ],
              "confidences": [
                92.7,
                95
              ],
              "platformName": "Plaid",
              "counterpartyNames": [],
              "modifiedDate": "2023-01-25T22:36:05.125Z"
            }
          ]
        }
      ]
    }
  ]
}