{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/leaseweb/main/json-schema/leaseweb-get-invoices-result-schema.json",
  "title": "getInvoicesResult",
  "x-generated": "2026-10-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/leaseweb-invoice-openapi.yml#/components/schemas/getInvoicesResult",
  "properties": {
    "invoices": {
      "description": "Array of Invoices",
      "items": {
        "$ref": "#/$defs/invoice"
      },
      "type": "array"
    },
    "_metadata": {
      "$ref": "#/$defs/_metadata"
    }
  },
  "type": "object",
  "$defs": {
    "_metadata": {
      "description": "Metadata about the collection",
      "properties": {
        "totalCount": {
          "description": "Total amount of elements in this collection",
          "minimum": 0,
          "type": "integer"
        },
        "offset": {
          "default": 0,
          "description": "The offset used to generate this response",
          "minimum": 0,
          "type": "integer"
        },
        "limit": {
          "default": 5,
          "description": "The limit used to generate this response",
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "limit",
        "offset",
        "totalCount"
      ],
      "title": "metadata",
      "type": "object"
    },
    "invoice": {
      "properties": {
        "id": {
          "description": "The unique id of the invoice",
          "type": "string"
        },
        "date": {
          "description": "The date the invoice was issued (UTC)",
          "type": "string"
        },
        "dueDate": {
          "description": "The date the invoice is due for payment (UTC)",
          "type": "string"
        },
        "taxAmount": {
          "description": "The amount of tax on the invoice",
          "format": "float",
          "type": "number"
        },
        "netAmount": {
          "description": "The total amount without the tax amount included",
          "format": "float",
          "type": "number"
        },
        "total": {
          "description": "The total amount of the invoice",
          "format": "float",
          "type": "number"
        },
        "openAmount": {
          "description": "The open amount of the invoice",
          "format": "float",
          "type": "number"
        },
        "currency": {
          "description": "The currency of the invoice.",
          "enum": [
            "EUR",
            "GBP",
            "USD",
            "SGD",
            "AUD",
            "HKD"
          ],
          "type": "string"
        },
        "isPartialPaymentAllowed": {
          "description": "The invoice can be paid partially",
          "type": "boolean"
        },
        "status": {
          "description": "The status of the invoice.",
          "enum": [
            "OPEN",
            "PAID",
            "OVERDUE",
            "CANCELLED"
          ],
          "type": "string"
        }
      },
      "title": "invoice",
      "type": "object"
    }
  }
}