{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/Order",
  "title": "Order",
  "type": "object",
  "description": "A purchase order",
  "properties": {
    "order_group_id": {
      "type": "integer",
      "format": "int64",
      "description": "Unique order group identifier"
    },
    "customer_id": {
      "type": "string",
      "description": "Customer identifier"
    },
    "customer_name": {
      "type": "string",
      "description": "Customer name"
    },
    "status": {
      "type": "string",
      "description": "Current order status"
    },
    "total": {
      "type": "number",
      "description": "Order total amount"
    },
    "currency": {
      "type": "string",
      "description": "Currency code"
    },
    "created": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp when the order was created"
    },
    "modified": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp when the order was last modified"
    },
    "order_forms": {
      "type": "array",
      "description": "Order forms containing line items",
      "items": {
        "type": "object",
        "properties": {
          "line_items": {
            "type": "array",
            "description": "Line items in the order form",
            "items": {
              "type": "object",
              "properties": {
                "catalog_entry_id": {
                  "type": "string",
                  "description": "Catalog entry code"
                },
                "display_name": {
                  "type": "string",
                  "description": "Display name of the item"
                },
                "quantity": {
                  "type": "number",
                  "description": "Quantity ordered"
                },
                "placed_price": {
                  "type": "number",
                  "description": "Price at time of purchase"
                }
              }
            }
          }
        }
      }
    }
  }
}