{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cloudovna-eu/json-schema/cloudovna-eu-payment-response-schema.json",
  "title": "PaymentResponse",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cloudovna-eu-openapi.yml#/components/schemas/PaymentResponse",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "type": "string",
      "format": "guid"
    },
    "purpose": {
      "$ref": "#/$defs/BillingPurpose"
    },
    "serviceId": {
      "type": [
        "string",
        "null"
      ],
      "format": "guid"
    },
    "serviceName": {
      "type": [
        "string",
        "null"
      ]
    },
    "services": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PaymentServiceResponse"
      }
    },
    "scheduleId": {
      "type": [
        "string",
        "null"
      ],
      "format": "guid"
    },
    "status": {
      "$ref": "#/$defs/PaymentStatus"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "dueOn": {
      "type": "string",
      "format": "date"
    },
    "periodFrom": {
      "type": "string",
      "format": "date"
    },
    "periodTo": {
      "type": "string",
      "format": "date"
    },
    "subtotal": {
      "type": "number",
      "format": "decimal"
    },
    "vatTotal": {
      "type": "number",
      "format": "decimal"
    },
    "total": {
      "type": "number",
      "format": "decimal"
    },
    "currency": {
      "type": "string"
    },
    "lines": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PaymentLineResponse"
      }
    },
    "onItsWay": {
      "type": "boolean"
    },
    "online": {
      "type": "boolean"
    },
    "paidAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "invoiceId": {
      "type": [
        "string",
        "null"
      ],
      "format": "guid"
    },
    "customerName": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "$defs": {
    "BillingPurpose": {
      "type": "string",
      "description": "",
      "x-enumNames": [
        "Order",
        "Renewal",
        "Change"
      ],
      "enum": [
        "Order",
        "Renewal",
        "Change"
      ]
    },
    "PaymentLineResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "description": {
          "type": "string"
        },
        "quantity": {
          "type": "number",
          "format": "decimal"
        },
        "unitPrice": {
          "type": "number",
          "format": "decimal"
        },
        "serviceId": {
          "type": [
            "string",
            "null"
          ],
          "format": "guid"
        }
      }
    },
    "PaymentServiceResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "format": "guid"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "PaymentStatus": {
      "type": "string",
      "description": "",
      "x-enumNames": [
        "Open",
        "Paid",
        "Cancelled",
        "Scheduled"
      ],
      "enum": [
        "Open",
        "Paid",
        "Cancelled",
        "Scheduled"
      ]
    }
  }
}