{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/acronis/main/json-schema/acronis-contract-schema.json",
  "title": "Contract",
  "x-generated": "2026-10-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/acronis-contracts-api-openapi.yml#/components/schemas/Contract",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "BillInAdvance",
    "BillingEntity",
    "BlockHours",
    "BlockHoursNumber",
    "BuildingName",
    "City",
    "ContactEmail",
    "ContractParts",
    "Customer",
    "EndDate",
    "HouseNo",
    "HouseNoAdd",
    "KeepRemainingHours",
    "Name",
    "PaymentIntervalInMonths",
    "ProRated",
    "ReferenceNumber",
    "RenewalThreshold",
    "Retainer",
    "SendInvoiceByEmail",
    "StartDate",
    "StateCountry",
    "Street",
    "Zipcode"
  ],
  "properties": {
    "BillInAdvance": {
      "description": "Defines a billing method for the contract.",
      "type": "boolean"
    },
    "BillingEntity": {
      "description": "Defines a billing entity for the contract billing.",
      "type": "string",
      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
    },
    "BlockHours": {
      "description": "Defines whether support block hours are included (1) into the contract, or not (0).",
      "type": "boolean"
    },
    "BlockHoursNumber": {
      "type": [
        "integer",
        "null"
      ]
    },
    "BuildingName": {
      "description": "Defines customer's address information to be used on the invoice:  building name.",
      "type": "string"
    },
    "City": {
      "description": "Defines customer's address information to be used on the invoice:  city.",
      "type": "string"
    },
    "ContactEmail": {
      "description": "Contact email for the contract.",
      "type": "string"
    },
    "ContractParts": {
      "description": "Contract's parts - list of contract products.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/ContractPart"
      }
    },
    "Customer": {
      "description": "Customer ID.",
      "type": "string",
      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
    },
    "EndDate": {
      "description": "Contract's end date.",
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?$"
    },
    "HouseNo": {
      "description": "Defines customer's address information to be used on the invoice:  street number.",
      "type": "string"
    },
    "HouseNoAdd": {
      "description": "Defines customer's address information to be used on the invoice:  building number.",
      "type": "string"
    },
    "KeepRemainingHours": {
      "description": "Defines a retainer option, remaining (unused) hours are kept for the next billing period (1), or dropped (0).",
      "type": "boolean"
    },
    "Name": {
      "description": "Contract name.",
      "type": "string"
    },
    "PaymentIntervalInMonths": {
      "description": "Defines an invoice interval for the contract.",
      "type": "integer"
    },
    "ProRated": {
      "description": "Defines whether proration for the contract billing is enabled (1), or not (0).",
      "type": "boolean"
    },
    "ReferenceNumber": {
      "description": "Contract's reference number.",
      "type": "string"
    },
    "RenewalThreshold": {
      "type": [
        "integer",
        "null"
      ]
    },
    "Retainer": {
      "description": "Defines whether the contract is a retainer and block hours are billed every month / quarter / half year / year (1), or not (0).",
      "type": "boolean"
    },
    "SendInvoiceByEmail": {
      "description": "Defines a delivery method for generated invoices.",
      "type": "boolean"
    },
    "StartDate": {
      "description": "Contract's start date.",
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?$"
    },
    "StateCountry": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
    },
    "Street": {
      "description": "Defines customer's address information to be used on the invoice:  street.",
      "type": "string"
    },
    "Zipcode": {
      "description": "Defines customer's address information to be used on the invoice:  ZIP or postal code.",
      "type": "string"
    }
  },
  "$defs": {
    "ContractPart": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "APIConnection",
        "ActualQuantity",
        "AutomaticUpdate",
        "Contract",
        "ContractPartType",
        "Description",
        "Discount",
        "DiscountReason",
        "EndDate",
        "Id",
        "IsReadOnly",
        "MachinesCount",
        "MinBillableQuantity",
        "Price",
        "Product",
        "ProductName",
        "Quantity",
        "ServiceLevelAgreement",
        "ServiceObjectGroup",
        "ShowUsersOnInvoice",
        "StartDate",
        "SubscriptionType",
        "TrialPeriod",
        "UserType",
        "VARConnection",
        "VARGroup"
      ],
      "properties": {
        "APIConnection": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "ActualQuantity": {
          "type": "number"
        },
        "AutomaticUpdate": {
          "type": "boolean"
        },
        "Contract": {
          "$ref": "#/$defs/Guid"
        },
        "ContractPartType": {
          "$ref": "#/$defs/Guid"
        },
        "Description": {
          "type": "string"
        },
        "Discount": {
          "type": "number"
        },
        "DiscountReason": {
          "type": "string"
        },
        "EndDate": {
          "$ref": "#/$defs/DatetimeNoTZ"
        },
        "Id": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "IsReadOnly": {
          "type": "boolean"
        },
        "MachinesCount": {
          "type": [
            "integer",
            "null"
          ]
        },
        "MinBillableQuantity": {
          "type": "number"
        },
        "Price": {
          "type": "number"
        },
        "Product": {
          "$ref": "#/$defs/Guid"
        },
        "ProductName": {
          "type": "string"
        },
        "Quantity": {
          "type": "number"
        },
        "ServiceLevelAgreement": {
          "$ref": "#/$defs/Guid"
        },
        "ServiceObjectGroup": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "ShowUsersOnInvoice": {
          "type": "boolean"
        },
        "StartDate": {
          "$ref": "#/$defs/DatetimeNoTZ"
        },
        "SubscriptionType": {
          "$ref": "#/$defs/Guid"
        },
        "TrialPeriod": {
          "type": "integer"
        },
        "UserType": {
          "type": "integer"
        },
        "VARConnection": {
          "$ref": "#/$defs/Guid"
        },
        "VARGroup": {
          "$ref": "#/$defs/Guid"
        }
      }
    },
    "DatetimeNoTZ": {
      "description": "RFC3339-like date and time without timezone.",
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?$"
    },
    "Guid": {
      "type": "string",
      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
    }
  }
}