Codat · Schema

Enhanced report

Unified_API

Properties

Name Type Description
reportInfo object
reportItems array An array of report items.
View JSON Schema on GitHub

JSON Schema

codat-enhancedfinancialreport-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/EnhancedFinancialReport",
  "title": "Enhanced report",
  "type": "object",
  "properties": {
    "reportInfo": {
      "$ref": "#/components/schemas/EnhancedFinancialReport/definitions/enhancedReportInfo"
    },
    "reportItems": {
      "type": "array",
      "description": "An array of report items.",
      "items": {
        "title": "Report item",
        "type": "object",
        "properties": {
          "date": {
            "$ref": "#/components/schemas/DateTime",
            "description": "Last date of the period."
          },
          "balance": {
            "type": "number",
            "format": "decimal",
            "description": "Balance of the account as reported on the profit and loss or Balance sheet."
          },
          "accountName": {
            "type": "string",
            "description": "Name of the account."
          },
          "accountId": {
            "type": "string",
            "description": "The unique account ID."
          },
          "accountCategory": {
            "$ref": "#/components/schemas/EnhancedFinancialReport/definitions/enhancedReportAccountCategory"
          }
        }
      }
    }
  },
  "definitions": {
    "enhancedReportAccountCategory": {
      "title": "Account category",
      "descrciption": "An object containing the suggested or confirmed account categories, up to five levels.",
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "description": "Returns a status of \"Suggested\" or \"Confirmed\". If an account has a confirmed category, it will replace any suggested category returned."
        },
        "levels": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/EnhancedFinancialReport/definitions/accountCategoryLevel"
          }
        }
      }
    },
    "accountCategoryLevel": {
      "title": "Account category level",
      "description": "An object containing an ordered list of account category levels.",
      "type": "object",
      "properties": {
        "levelName": {
          "type": "string",
          "description": "Account category name."
        },
        "confidence": {
          "type": "number",
          "format": "decimal",
          "description": "Confidence level of the category. This will only be populated where `status` is `Suggested`."
        }
      }
    },
    "enhancedReportInfo": {
      "type": "object",
      "properties": {
        "currency": {
          "$ref": "#/components/schemas/SourceAccount/properties/currency",
          "description": "Currency of the P&L/Balance sheet."
        },
        "reportName": {
          "type": "string",
          "description": "The name of the report."
        },
        "companyName": {
          "type": "string",
          "description": "Name of the company queried."
        },
        "generatedDate": {
          "$ref": "#/components/schemas/DateTime",
          "description": "Returns the YYYY-MM-DD datetime of report generation."
        }
      }
    }
  },
  "examples": [
    {
      "reportInfo": {
        "reportName": "EnhancedProfitAndLossAccounts",
        "companyName": "ABC LTD",
        "generatedDate": "2022-01-01"
      },
      "reportItems": [
        {
          "date": "2022-01-01",
          "balance": 70,
          "accountName": "Sales UK",
          "accountId": "13931cbf-ea06-4d6e-9538-a8457fa66011",
          "accountCategory": {
            "status": "Suggested",
            "levels": [
              {
                "levelName": "Income",
                "confidence": 0.95
              },
              {
                "levelName": "Revenue",
                "confidence": 0.9
              }
            ]
          }
        },
        {
          "date": "2022-01-01",
          "balance": 30,
          "accountName": "Sales US",
          "accountId": "13931cbf-ea06-4d6e-9538-a8457fa66011",
          "accountCategory": {
            "lastUpdated": "2022-01-02",
            "status": "Suggested",
            "levels": [
              {
                "levelName": "Income",
                "confidence": 0.95
              },
              {
                "levelName": "Revenue",
                "confidence": 0.9
              }
            ]
          }
        },
        {
          "date": "2022-01-01",
          "balance": 70,
          "accountName": "Amazon",
          "accountId": "13931cbf-ea06-4d6e-9538-a8457fa66011",
          "accountCategory": {
            "lastUpdated": "2022-01-02",
            "status": "Suggested",
            "levels": [
              {
                "levelName": "Income",
                "confidence": 0.95
              },
              {
                "levelName": "Revenue",
                "confidence": 0.95
              },
              {
                "levelName": "Online",
                "confidence": 0.8
              }
            ]
          }
        }
      ]
    }
  ]
}