{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/evidujzdarma-cz/json-schema/evidujzdarma-cz-sales-request-schema.json",
  "title": "SalesRequest",
  "x-generated": "2026-11-07",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/evidujzdarma-cz-openapi.json#/components/schemas/SalesRequest",
  "type": "object",
  "properties": {
    "sales": {
      "minItems": 1,
      "maxItems": 100,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "externalRef": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "unitId": {
            "type": "string",
            "format": "uuid"
          },
          "soldAt": {
            "type": "string",
            "format": "date-time"
          },
          "sequence": {
            "type": "string",
            "minLength": 1,
            "maxLength": 25
          },
          "lines": {
            "minItems": 1,
            "maxItems": 300,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "qty": {
                  "type": "number"
                },
                "unitPrice": {
                  "type": "integer",
                  "minimum": -10000000000,
                  "maximum": 10000000000
                },
                "vatRate": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 30
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "goods",
                    "credit_topup"
                  ]
                }
              },
              "required": [
                "name",
                "qty",
                "unitPrice",
                "vatRate"
              ]
            }
          },
          "payments": {
            "minItems": 1,
            "maxItems": 5,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "method": {
                  "type": "string",
                  "enum": [
                    "cash",
                    "card",
                    "qr",
                    "transfer",
                    "meal_voucher",
                    "credit",
                    "gift_voucher",
                    "voucher"
                  ]
                },
                "amount": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "method",
                "amount"
              ]
            }
          },
          "tip": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "discount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "refundOf": {},
          "approval": {}
        },
        "required": [
          "id",
          "unitId",
          "soldAt",
          "lines",
          "payments"
        ]
      }
    }
  },
  "required": [
    "sales"
  ]
}