{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/verkanto-eu/json-schema/verkanto-eu-api-invoice-request-schema.json",
  "title": "ApiInvoiceRequest",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/verkanto-eu-openapi.yml#/components/schemas/ApiInvoiceRequest",
  "type": "object",
  "properties": {
    "client": {
      "$ref": "#/$defs/Buyer"
    },
    "issueDate": {
      "type": "string",
      "format": "date"
    },
    "dueDate": {
      "type": "string",
      "format": "date"
    },
    "digitalService": {
      "type": "boolean"
    },
    "items": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Item"
      },
      "maxItems": 200,
      "minItems": 1
    },
    "number": {},
    "seller": {}
  },
  "required": [
    "client",
    "items"
  ],
  "$defs": {
    "Buyer": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "maxLength": 255,
          "minLength": 0
        },
        "email": {
          "type": "string",
          "format": "email",
          "maxLength": 255,
          "minLength": 0
        },
        "company": {
          "type": "string",
          "maxLength": 255,
          "minLength": 0
        },
        "address": {
          "type": "string",
          "maxLength": 10000,
          "minLength": 0
        },
        "vatId": {
          "type": "string",
          "maxLength": 50,
          "minLength": 0
        },
        "countryCode": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[A-Za-z]{2}$"
        }
      },
      "required": [
        "countryCode",
        "name"
      ]
    },
    "Item": {
      "type": "object",
      "properties": {
        "description": {
          "type": "string",
          "maxLength": 500,
          "minLength": 0
        },
        "qty": {
          "type": "number",
          "minimum": 0
        },
        "unitPrice": {
          "type": "number",
          "minimum": 0
        }
      },
      "required": [
        "description",
        "qty",
        "unitPrice"
      ]
    }
  }
}