{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/fis/main/json-schema/fis-get-estimate-response-dto-schema.json",
  "title": "GetEstimateResponseDto",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fis-estimate-api-openapi.yml#/components/schemas/GetEstimateResponseDto",
  "type": "object",
  "properties": {
    "count": {
      "type": "number",
      "readOnly": true,
      "format": "integer"
    },
    "meta": {
      "$ref": "#/$defs/BasicStartEndDateReportMetaData"
    },
    "pagination": {
      "$ref": "#/$defs/PaginationMetaData"
    },
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/GetEstimateData"
      }
    }
  },
  "required": [
    "count",
    "meta",
    "pagination",
    "data"
  ],
  "$defs": {
    "AccountRef": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "id"
      ]
    },
    "BaseAddress": {
      "type": "object",
      "properties": {
        "line1": {
          "type": "string"
        },
        "line2": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "region": {
          "type": "string"
        },
        "country": {
          "type": "string"
        },
        "postalCode": {
          "type": "string"
        }
      }
    },
    "BasicStartEndDateReportMetaData": {
      "type": "object",
      "properties": {
        "reportId": {
          "readOnly": true,
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "serviceName": {
          "type": "string",
          "readOnly": true,
          "enum": [
            "freshbooks",
            "quickbooks",
            "quickbooksDesktop",
            "xero",
            "oracleNetsuite",
            "sageBusinessCloud",
            "sageIntacct",
            "dynamicsBusinessCentral",
            "dynamics365Finance",
            "wave",
            "myob",
            "zohoBooks",
            "byod"
          ]
        },
        "businessName": {
          "type": "string",
          "readOnly": true
        },
        "createdAt": {
          "type": "string",
          "readOnly": true,
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time",
          "readOnly": false
        },
        "startDate": {
          "type": "string",
          "readOnly": true,
          "format": "date-time"
        },
        "endDate": {
          "type": "string",
          "readOnly": true,
          "format": "date-time"
        }
      },
      "required": [
        "reportId",
        "serviceName",
        "businessName",
        "createdAt",
        "updatedAt",
        "startDate",
        "endDate"
      ]
    },
    "CurrencyRef": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "symbol": {
          "type": "string"
        }
      },
      "required": [
        "id"
      ]
    },
    "CustomerRef": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "id"
      ]
    },
    "EstimateLineItems": {
      "type": "object",
      "properties": {
        "description": {
          "type": "string"
        },
        "unitAmount": {
          "type": "number",
          "format": "float"
        },
        "quantity": {
          "type": "number",
          "format": "float"
        },
        "discountAmount": {
          "type": "number",
          "format": "float"
        },
        "taxAmount": {
          "type": "number",
          "format": "float"
        },
        "taxRateRef": {
          "$ref": "#/$defs/TaxRateRef"
        },
        "inventoryRef": {
          "$ref": "#/$defs/InventoryRef"
        },
        "discountPercentage": {
          "type": "number",
          "format": "float"
        },
        "id": {
          "type": "string"
        },
        "accountRef": {
          "$ref": "#/$defs/AccountRef"
        },
        "subTotal": {
          "type": "number",
          "format": "float",
          "deprecated": true
        },
        "totalAmount": {
          "type": "number",
          "format": "float",
          "deprecated": true
        },
        "trackingCategoryRef": {
          "deprecated": true,
          "allOf": [
            {
              "$ref": "#/$defs/TrackingCategoryRef"
            }
          ]
        }
      }
    },
    "GetEstimateData": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "customerRef": {
          "$ref": "#/$defs/CustomerRef"
        },
        "postedDate": {
          "format": "date-time",
          "type": "string"
        },
        "dueDate": {
          "format": "date-time",
          "type": "string"
        },
        "acceptedDate": {
          "format": "date-time",
          "type": "string"
        },
        "expiryDate": {
          "format": "date-time",
          "type": "string"
        },
        "currencyRef": {
          "$ref": "#/$defs/CurrencyRef"
        },
        "currencyRate": {
          "type": "number",
          "format": "float"
        },
        "lines": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EstimateLineItems"
          }
        },
        "totalDiscount": {
          "type": "number",
          "format": "float"
        },
        "discountPercentage": {
          "type": "number",
          "format": "float"
        },
        "subTotal": {
          "type": "number",
          "format": "float"
        },
        "taxAmount": {
          "type": "number",
          "format": "float"
        },
        "totalAmount": {
          "type": "number",
          "format": "float"
        },
        "status": {
          "type": "string",
          "enum": [
            "open",
            "closed",
            "void",
            "unknown",
            "draft"
          ]
        },
        "memo": {
          "type": "string"
        },
        "shippingAddress": {
          "$ref": "#/$defs/BaseAddress"
        },
        "sourceModifiedDate": {
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "id",
        "postedDate",
        "totalAmount",
        "status"
      ]
    },
    "InventoryRef": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "id"
      ]
    },
    "PaginationMetaData": {
      "type": "object",
      "properties": {
        "offset": {
          "type": "number",
          "readOnly": true
        },
        "limit": {
          "type": "number",
          "readOnly": true
        },
        "count": {
          "type": "number",
          "readOnly": true
        }
      },
      "required": [
        "offset",
        "limit",
        "count"
      ]
    },
    "TaxRateRef": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "effectiveTaxRate": {
          "type": "number",
          "format": "float"
        }
      },
      "required": [
        "id"
      ]
    },
    "TrackingCategoryRef": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "readOnly": false
        },
        "name": {
          "type": "string",
          "readOnly": false
        },
        "option": {
          "type": "string",
          "readOnly": false
        },
        "optionId": {
          "type": "string",
          "readOnly": false
        }
      },
      "required": [
        "id"
      ]
    }
  }
}