{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/blacksky/json-schema/blacksky-order-v2-response-schema.json",
  "title": "OrderV2Response",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/blacksky-orders-api-openapi.yml#/components/schemas/OrderV2Response",
  "required": [
    "displayName"
  ],
  "type": "object",
  "properties": {
    "displayName": {
      "$ref": "#/$defs/OrderDisplayName"
    },
    "orderDetails": {
      "$ref": "#/$defs/OrderDetailsV2"
    },
    "status": {
      "$ref": "#/$defs/OrderV2Status"
    }
  },
  "allOf": [
    {
      "$ref": "#/$defs/OrderResponseSharedProperties"
    }
  ],
  "$defs": {
    "AccountId": {
      "type": "string",
      "description": "The account ID.",
      "format": "uuid"
    },
    "AcquisitionEnd": {
      "type": "string",
      "description": "The date and time when the sensor finished the acquisition process.\n",
      "format": "date-time"
    },
    "AcquisitionStart": {
      "type": "string",
      "description": "The date and time when the sensor started the acquisition process.\n",
      "format": "date-time"
    },
    "ArchiveOrderDetailsSharedProperties": {
      "required": [
        "aoi"
      ],
      "type": "object",
      "properties": {
        "aoi": {
          "$ref": "#/$defs/OrderingGeometry"
        },
        "imageId": {
          "type": "string",
          "description": "The ID of the image scene.\n",
          "format": "uuid"
        }
      }
    },
    "ArchiveOrderDetailsV2": {
      "type": "object",
      "description": "Catalog order details.\n",
      "allOf": [
        {
          "$ref": "#/$defs/ArchiveOrderDetailsSharedProperties"
        }
      ]
    },
    "Auditor": {
      "type": "object",
      "properties": {
        "id": {
          "oneOf": [
            {
              "type": "string",
              "description": "The ID of the user who performed the action.",
              "format": "uuid"
            },
            {
              "type": "string",
              "description": "A marker that indicates an action was performed automatically. The only allowed value is `system`.",
              "enum": [
                "system"
              ]
            }
          ]
        },
        "type": {
          "type": "string",
          "description": "The type of user who performed the action.",
          "enum": [
            "INTERNAL",
            "ADMIN",
            "API_KEY",
            "USER"
          ]
        }
      },
      "description": "The ID and type of the user who performed the action.\n"
    },
    "OrderDetailsV2": {
      "type": "object",
      "oneOf": [
        {
          "$ref": "#/$defs/TaskingOrderDetailsV2"
        },
        {
          "$ref": "#/$defs/ArchiveOrderDetailsV2"
        }
      ]
    },
    "OrderDisplayName": {
      "maxLength": 200,
      "minLength": 1,
      "type": "string",
      "description": "A human-readable name that describes the order."
    },
    "OrderId": {
      "type": "string",
      "description": "The order ID.",
      "format": "uuid"
    },
    "OrderResponseSharedProperties": {
      "required": [
        "accountId",
        "createdAt",
        "createdBy",
        "id",
        "type",
        "updatedAt",
        "updatedBy",
        "workspaceId"
      ],
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/OrderId"
        },
        "workspaceId": {
          "$ref": "#/$defs/WorkspaceId"
        },
        "accountId": {
          "$ref": "#/$defs/AccountId"
        },
        "type": {
          "$ref": "#/$defs/OrderType"
        },
        "dataProductId": {
          "type": [
            "string",
            "null"
          ],
          "description": "The data product ID.\n",
          "format": "uuid"
        },
        "createdAt": {
          "type": "string",
          "description": "The timestamp when the order was created.\n",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "description": "The timestamp when the order was last updated.\n",
          "format": "date-time"
        },
        "createdBy": {
          "$ref": "#/$defs/Auditor"
        },
        "updatedBy": {
          "$ref": "#/$defs/Auditor"
        },
        "tags": {
          "$ref": "#/$defs/Tags"
        },
        "budgetId": {
          "type": [
            "string",
            "null"
          ],
          "description": "The ID of the budget assigned to the order, if any.\n",
          "format": "uuid"
        }
      }
    },
    "OrderSubStatus": {
      "type": [
        "string",
        "null"
      ],
      "description": "An [additional status](https://docs.up42.com/developers/api-tasking#order-substatuses) for the tasking order.\n",
      "enum": [
        "FEASIBILITY_WAITING_UPLOAD",
        "FEASIBILITY_WAITING_RESPONSE",
        "QUOTATION_WAITING_UPLOAD",
        "QUOTATION_WAITING_RESPONSE",
        "QUOTATION_ACCEPTED",
        "QUOTATION_REJECTED",
        null
      ]
    },
    "OrderType": {
      "type": "string",
      "description": "The order type.",
      "enum": [
        "TASKING",
        "ARCHIVE"
      ]
    },
    "OrderV2Status": {
      "type": "string",
      "description": "The [order status](https://docs.up42.com/developers/api-tasking#order-statuses).\n",
      "enum": [
        "CREATED",
        "BEING_PLACED",
        "PLACED",
        "PLACEMENT_FAILED",
        "BEING_FULFILLED",
        "FULFILLED",
        "FAILED_PERMANENTLY",
        "CANCELED"
      ]
    },
    "OrderingGeometry": {
      "required": [
        "coordinates",
        "type"
      ],
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "The type of geometry.",
          "enum": [
            "Polygon",
            "Point"
          ]
        },
        "coordinates": {
          "description": "The coordinates.",
          "oneOf": [
            {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "minItems": 2,
                  "type": "array",
                  "items": {
                    "type": "number",
                    "format": "double"
                  }
                }
              }
            },
            {
              "type": "array",
              "items": {
                "type": "number",
                "format": "double"
              }
            }
          ]
        },
        "crs": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "description": "The parameter defining the CRS."
            },
            "properties": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "The name of the CRS."
                }
              }
            }
          },
          "description": "The CRS of the order."
        }
      },
      "description": "The geometry in the GeoJSON format.\n"
    },
    "Tag": {
      "maxLength": 180,
      "minLength": 1,
      "type": "string",
      "description": "A tag that consists of letters, numbers, spaces, and special characters (`.`, `-`, `_`, `/`, `:`).\n"
    },
    "Tags": {
      "maxItems": 30,
      "type": "array",
      "description": "A list of tags that categorize the order. A tag can consist of letters, numbers, spaces, and special characters (`.`, `-`, `_`, `/`, `:`).\n",
      "items": {
        "$ref": "#/$defs/Tag"
      }
    },
    "TaskingOrderDetailsSharedProperties": {
      "required": [
        "acquisitionEnd",
        "acquisitionStart",
        "geometry"
      ],
      "type": "object",
      "properties": {
        "acquisitionStart": {
          "$ref": "#/$defs/AcquisitionStart"
        },
        "acquisitionEnd": {
          "$ref": "#/$defs/AcquisitionEnd"
        },
        "geometry": {
          "$ref": "#/$defs/OrderingGeometry"
        },
        "extraDescription": {
          "type": "string",
          "description": "An additional order description.\n"
        },
        "subStatus": {
          "$ref": "#/$defs/OrderSubStatus"
        }
      }
    },
    "TaskingOrderDetailsV2": {
      "type": "object",
      "description": "Tasking order details.\n",
      "allOf": [
        {
          "$ref": "#/$defs/TaskingOrderDetailsSharedProperties"
        }
      ]
    },
    "WorkspaceId": {
      "type": "string",
      "description": "The workspace ID.",
      "format": "uuid"
    }
  }
}