{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/highlevel/main/json-schema/highlevel-estimate-response-dto-schema.json",
  "title": "EstimateResponseDto",
  "x-generated": "2026-09-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/highlevel-invoices-openapi.json#/components/schemas/EstimateResponseDto",
  "type": "object",
  "properties": {
    "altId": {
      "type": "string",
      "description": "Location Id or Agency Id"
    },
    "altType": {
      "type": "string",
      "enum": [
        "location"
      ]
    },
    "_id": {
      "type": "string",
      "description": "Unique identifier"
    },
    "liveMode": {
      "type": "boolean",
      "description": "Indicates if it is in live mode"
    },
    "deleted": {
      "type": "boolean",
      "description": "Indicates if deleted"
    },
    "name": {
      "type": "string",
      "description": "Name"
    },
    "currency": {
      "type": "string",
      "description": "Currency code"
    },
    "businessDetails": {
      "description": "Business details associated with the estimate",
      "allOf": [
        {
          "$ref": "#/$defs/BusinessDetails"
        }
      ]
    },
    "items": {
      "description": "An array of items",
      "type": "array",
      "items": {
        "type": "array"
      }
    },
    "discount": {
      "description": "Discount details for the estimate template",
      "allOf": [
        {
          "$ref": "#/$defs/DiscountDto"
        }
      ]
    },
    "title": {
      "type": "string",
      "description": "Title"
    },
    "estimateNumberPrefix": {
      "type": "string",
      "description": "Estimate number prefix"
    },
    "attachments": {
      "description": "Attachments",
      "type": "array",
      "items": {
        "$ref": "#/$defs/AttachmentsDto"
      }
    },
    "updatedBy": {
      "type": "string",
      "description": "User Id of who last updated"
    },
    "total": {
      "type": "number",
      "description": "Total amount"
    },
    "createdAt": {
      "format": "date-time",
      "type": "string",
      "description": "Timestamp when created"
    },
    "updatedAt": {
      "format": "date-time",
      "type": "string",
      "description": "Timestamp when last updated"
    },
    "__v": {
      "type": "number",
      "description": "Version number"
    },
    "automaticTaxesEnabled": {
      "type": "boolean",
      "description": "Indicates if automatic taxes are enabled for this estimate"
    },
    "termsNotes": {
      "type": "string",
      "description": "Terms and conditions for the estimate, supports HTML markup"
    },
    "companyId": {
      "type": "string",
      "description": "Company identifier associated with the estimate"
    },
    "contactDetails": {
      "description": "Contact details for the estimate",
      "allOf": [
        {
          "$ref": "#/$defs/ContactDetails"
        }
      ]
    },
    "issueDate": {
      "format": "date-time",
      "type": "string",
      "description": "Date when the estimate was issued"
    },
    "expiryDate": {
      "format": "date-time",
      "type": "string",
      "description": "Date when the estimate expires"
    },
    "sentBy": {
      "type": "string",
      "description": "User who sent the estimate"
    },
    "automaticTaxesCalculated": {
      "type": "boolean",
      "description": "Indicates if automatic taxes were calculated"
    },
    "meta": {
      "type": "object",
      "description": "Additional metadata associated with the estimate"
    },
    "estimateActionHistory": {
      "description": "History of actions taken on the estimate",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "sentTo": {
      "description": "Recipient details for the estimate",
      "allOf": [
        {
          "$ref": "#/$defs/SentTo"
        }
      ]
    },
    "frequencySettings": {
      "description": "Frequency settings for recurring estimates",
      "allOf": [
        {
          "$ref": "#/$defs/FrequencySettingsDto"
        }
      ]
    },
    "lastVisitedAt": {
      "format": "date-time",
      "type": "string",
      "description": "Timestamp when the estimate was last visited"
    },
    "totalamountInUSD": {
      "type": "number",
      "description": "Total amount in USD"
    },
    "autoInvoice": {
      "description": "Auto-invoice settings for the estimate",
      "allOf": [
        {
          "$ref": "#/$defs/AutoInvoice"
        }
      ]
    },
    "traceId": {
      "type": "string",
      "description": "Trace ID for logging and debugging"
    }
  },
  "required": [
    "altId",
    "altType",
    "_id",
    "liveMode",
    "deleted",
    "name",
    "currency",
    "businessDetails",
    "items",
    "discount",
    "total",
    "createdAt",
    "updatedAt",
    "__v",
    "automaticTaxesEnabled",
    "companyId",
    "contactDetails",
    "issueDate",
    "expiryDate",
    "automaticTaxesCalculated",
    "meta",
    "estimateActionHistory",
    "sentTo",
    "frequencySettings",
    "lastVisitedAt",
    "totalamountInUSD",
    "traceId"
  ],
  "$defs": {
    "AttachmentsDto": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Id of the file selected"
        },
        "name": {
          "type": "string",
          "description": "Name of the file "
        },
        "url": {
          "type": "string",
          "description": "URL of the file"
        },
        "type": {
          "type": "string",
          "description": "Type of the file"
        },
        "size": {
          "type": "number",
          "description": "Size of the file"
        }
      },
      "required": [
        "id",
        "name",
        "url",
        "type",
        "size"
      ]
    },
    "AutoInvoice": {
      "type": "object",
      "properties": {}
    },
    "BusinessDetails": {
      "type": "object",
      "properties": {}
    },
    "ContactDetails": {
      "type": "object",
      "properties": {}
    },
    "CustomRRuleOptionsDto": {
      "type": "object",
      "properties": {
        "intervalType": {
          "type": "string",
          "enum": [
            "yearly",
            "monthly",
            "weekly",
            "daily",
            "hourly",
            "minutely",
            "secondly"
          ]
        },
        "interval": {
          "type": "number"
        },
        "startDate": {
          "type": "string",
          "description": "Start date in YYYY-MM-DD format"
        },
        "startTime": {
          "type": "string",
          "description": "Start time in HH:mm:ss format"
        },
        "endDate": {
          "type": "string",
          "description": "End date in YYYY-MM-DD format"
        },
        "endTime": {
          "type": "string",
          "description": "End time in HH:mm:ss format"
        },
        "dayOfMonth": {
          "type": "number",
          "description": "-1, 1, 2, 3, ..., 27, 28"
        },
        "dayOfWeek": {
          "type": "string",
          "enum": [
            "mo",
            "tu",
            "we",
            "th",
            "fr",
            "sa",
            "su"
          ]
        },
        "numOfWeek": {
          "type": "number",
          "description": "-1, 1, 2, 3, 4"
        },
        "monthOfYear": {
          "type": "string",
          "enum": [
            "jan",
            "feb",
            "mar",
            "apr",
            "may",
            "jun",
            "jul",
            "aug",
            "sep",
            "oct",
            "nov",
            "dec"
          ]
        },
        "count": {
          "type": "number",
          "description": "Max number of task executions"
        },
        "daysBefore": {
          "type": "number",
          "description": "Execute task number of days before"
        },
        "useStartAsPrimaryUserAccepted": {
          "type": "boolean",
          "description": "Start as primary user accepted date"
        },
        "endType": {
          "type": "string",
          "description": "End type like after, by, count"
        }
      },
      "required": [
        "intervalType",
        "interval",
        "startDate"
      ]
    },
    "DiscountDto": {
      "type": "object",
      "properties": {
        "value": {
          "type": "number",
          "description": "Discount Value",
          "default": 0
        },
        "type": {
          "type": "string",
          "description": "Discount type",
          "enum": [
            "percentage",
            "fixed"
          ],
          "default": "percentage"
        },
        "validOnProductIds": {
          "description": "Product Ids on which discount is applicable",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "type"
      ]
    },
    "FrequencySettingsDto": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "enabled for the frequency settings"
        },
        "schedule": {
          "description": "schedule setting for the estimate",
          "allOf": [
            {
              "$ref": "#/$defs/ScheduleOptionsDto"
            }
          ]
        }
      },
      "required": [
        "enabled",
        "schedule"
      ]
    },
    "ScheduleOptionsDto": {
      "type": "object",
      "properties": {
        "executeAt": {
          "type": "string"
        },
        "rrule": {
          "$ref": "#/$defs/CustomRRuleOptionsDto"
        }
      }
    },
    "SentTo": {
      "type": "object",
      "properties": {}
    }
  }
}