{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cloudovna-eu/json-schema/cloudovna-eu-invoice-response-schema.json",
  "title": "InvoiceResponse",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cloudovna-eu-openapi.yml#/components/schemas/InvoiceResponse",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "type": "string",
      "format": "guid"
    },
    "purpose": {
      "nullable": true,
      "oneOf": [
        {
          "$ref": "#/$defs/BillingPurpose"
        }
      ]
    },
    "serviceId": {
      "type": [
        "string",
        "null"
      ],
      "format": "guid"
    },
    "serviceName": {
      "type": [
        "string",
        "null"
      ]
    },
    "number": {
      "type": "string"
    },
    "issuedOn": {
      "type": "string",
      "format": "date"
    },
    "dueOn": {
      "type": "string",
      "format": "date"
    },
    "periodFrom": {
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "periodTo": {
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "status": {
      "$ref": "#/$defs/InvoiceStatus"
    },
    "subtotal": {
      "type": "number",
      "format": "decimal"
    },
    "vatTotal": {
      "type": "number",
      "format": "decimal"
    },
    "total": {
      "type": "number",
      "format": "decimal"
    },
    "currency": {
      "type": "string"
    },
    "lines": {
      "type": "integer",
      "format": "int32"
    },
    "customerName": {
      "type": "string"
    },
    "customerEmail": {
      "type": [
        "string",
        "null"
      ]
    },
    "pdfGeneratedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  },
  "$defs": {
    "BillingPurpose": {
      "type": "string",
      "description": "",
      "x-enumNames": [
        "Order",
        "Renewal",
        "Change"
      ],
      "enum": [
        "Order",
        "Renewal",
        "Change"
      ]
    },
    "InvoiceStatus": {
      "type": "string",
      "description": "",
      "x-enumNames": [
        "Issued",
        "Paid",
        "Cancelled"
      ],
      "enum": [
        "Issued",
        "Paid",
        "Cancelled"
      ]
    }
  }
}