{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/atlar/json-schema/atlar-account-reporting-summary-schema.json",
  "title": "AccountReportingSummary",
  "description": "A summary of account reporting data for a specific reporting period, e.g. a booked date.\n",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/atlar-accounts-api-openapi.yml#/components/schemas/AccountReportingSummary",
  "type": "object",
  "properties": {
    "id": {
      "$ref": "#/$defs/ResourceID",
      "readOnly": true
    },
    "organizationId": {
      "$ref": "#/$defs/OrganizationID",
      "readOnly": true
    },
    "accountId": {
      "$ref": "#/$defs/ResourceID",
      "readOnly": true
    },
    "type": {
      "type": "string",
      "enum": [
        "BOOKED"
      ],
      "readOnly": true
    },
    "date": {
      "description": "Booked date.",
      "$ref": "#/$defs/Date",
      "readOnly": true
    },
    "transactionsControlData": {
      "allOf": [
        {
          "$ref": "#/$defs/SummaryTransactionsControlData"
        }
      ],
      "readOnly": true
    },
    "version": {
      "$ref": "#/$defs/ResourceVersion",
      "readOnly": true
    },
    "etag": {
      "x-atlar-fields-enum-skip": true,
      "$ref": "#/$defs/ETag",
      "readOnly": true
    }
  },
  "required": [
    "id",
    "organizationId",
    "accountId",
    "type",
    "date",
    "version",
    "etag"
  ],
  "$defs": {
    "Amount": {
      "type": "object",
      "properties": {
        "currency": {
          "$ref": "#/$defs/CurrencyCode"
        },
        "stringValue": {
          "description": "A string representation of the amount value. This will be\na decimal number if the currency has decimals. The number\nis not formatted for display purposes (e.g. with locale\nspecific thousand separator) and always contains the dot\n`.` character as decimal separator.",
          "type": "string"
        },
        "value": {
          "description": "The amount value as an integer (int64) represented in\ncurrency minor units (e.g. 15.02 EUR is represented as the\nvalue 1502).",
          "type": "integer",
          "format": "int64"
        }
      },
      "required": [
        "currency",
        "stringValue",
        "value"
      ]
    },
    "ControlData": {
      "type": "object",
      "properties": {
        "sum": {
          "$ref": "#/$defs/Amount"
        },
        "count": {
          "type": "integer",
          "format": "int64"
        }
      },
      "required": [
        "sum",
        "count"
      ]
    },
    "CurrencyCode": {
      "type": "string",
      "description": "Three-letter ISO 4217 currency code.",
      "minLength": 3,
      "maxLength": 3,
      "pattern": "^[A-Z]{3,3}$"
    },
    "Date": {
      "type": "string",
      "format": "date",
      "description": "`full-date` notation as defined by [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), for example, `2017-07-21`."
    },
    "ETag": {
      "type": "string",
      "description": "[ETag](https://en.wikipedia.org/wiki/HTTP_ETag) based on the\nresource version. This can be passed along in `If-Match` HTTP\nheader when updating a resource to perform a conditional\nupdate.",
      "pattern": "^version:\\d{1,4}$",
      "readOnly": true
    },
    "OrganizationID": {
      "type": "string",
      "description": "Unique resource identifier for an Organization."
    },
    "ResourceID": {
      "type": "string",
      "description": "Unique resource identifier.",
      "minLength": 32,
      "maxLength": 64
    },
    "ResourceVersion": {
      "type": "integer",
      "description": "Resource version. Starts at value `1` when the resource is\ncreated and increases by one for each successive update.",
      "minimum": 1,
      "readOnly": true
    },
    "SummaryTransactionsControlData": {
      "description": "Control data for all the transactions for the `date` which this summary spans.\n\nTransactions control data is only included in the response if the requesting principal have authorization scopes `transactions:read`.\n",
      "type": "object",
      "properties": {
        "total": {
          "description": "Total count and sum of absolute amounts of all transactions.",
          "$ref": "#/$defs/ControlData"
        },
        "net": {
          "description": "Total count and net amount of all transactions.",
          "$ref": "#/$defs/ControlData"
        }
      },
      "required": [
        "total",
        "net"
      ]
    }
  }
}