{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/blacksky/json-schema/blacksky-estimate-v2-order-response-schema.json",
  "title": "EstimateV2OrderResponse",
  "description": "The cost estimation.\n",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/blacksky-orders-api-openapi.yml#/components/schemas/EstimateV2OrderResponse",
  "required": [
    "errors",
    "results",
    "summary"
  ],
  "type": "object",
  "properties": {
    "summary": {
      "$ref": "#/$defs/EstimationV2Summary"
    },
    "results": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EstimationV2Result"
      }
    },
    "errors": {
      "type": "array",
      "description": "Errors associated with individual geometries, including validation failures due to AOI size or vertex-count limits.\n",
      "items": {
        "$ref": "#/$defs/BatchEndpointErrorDetail"
      }
    }
  },
  "$defs": {
    "BatchEndpointErrorDetail": {
      "required": [
        "details",
        "index",
        "message"
      ],
      "type": "object",
      "properties": {
        "index": {
          "type": "number",
          "description": "The failed geometry index number.\n"
        },
        "message": {
          "type": "string",
          "description": "The error message associated with the failed geometry."
        },
        "details": {
          "type": "string",
          "description": "Error message details."
        }
      },
      "description": "Errors associated with individual geometries returned by batch endpoints, including validation failures due to AOI size or vertex-count limits.\n"
    },
    "EstimateV2OrderPricingUnit": {
      "type": [
        "string",
        "null"
      ],
      "description": "The unit of measurement used to calculate the size.\n",
      "enum": [
        "SQ_KM",
        "SCENE",
        null
      ]
    },
    "EstimationV2Result": {
      "required": [
        "credits",
        "index",
        "size",
        "unit"
      ],
      "type": "object",
      "properties": {
        "index": {
          "type": "number",
          "description": "The geometry index number. Indexing starts from zero.\n",
          "format": "int32"
        },
        "credits": {
          "type": "number",
          "description": "The estimated cost of the geometry, in credits.\n",
          "format": "int32"
        },
        "size": {
          "type": "number",
          "description": "The size of the geometry."
        },
        "unit": {
          "$ref": "#/$defs/EstimateV2OrderPricingUnit"
        }
      },
      "description": "Results for each of the specified geometries.\n"
    },
    "EstimationV2Summary": {
      "required": [
        "totalCredits",
        "totalSize",
        "unit"
      ],
      "type": "object",
      "properties": {
        "totalCredits": {
          "type": "number",
          "description": "The estimate of the order cost, in credits.\n",
          "format": "int32",
          "default": 0
        },
        "totalSize": {
          "type": "number",
          "description": "The size of the order in square kilometers or the number of scenes needed to cover the requested geometry.",
          "default": 0
        },
        "unit": {
          "$ref": "#/$defs/EstimateV2OrderPricingUnit"
        }
      },
      "description": "The overview of the estimation.\n"
    }
  }
}