{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/oracle-retail/json-schema/oracle-retail-order-detail-schema.json",
  "title": "OrderDetail",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/oracle-retail-orders-api-openapi.yml#/components/schemas/OrderDetail",
  "allOf": [
    {
      "$ref": "#/$defs/Order"
    },
    {
      "type": "object",
      "properties": {
        "lines": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/OrderLine"
          }
        }
      }
    }
  ],
  "$defs": {
    "Address": {
      "type": "object",
      "properties": {
        "firstName": {
          "type": "string"
        },
        "lastName": {
          "type": "string"
        },
        "address1": {
          "type": "string"
        },
        "address2": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "state": {
          "type": "string"
        },
        "postalCode": {
          "type": "string"
        },
        "country": {
          "type": "string",
          "maxLength": 3
        },
        "phone": {
          "type": "string"
        },
        "email": {
          "type": "string",
          "format": "email"
        }
      }
    },
    "Order": {
      "type": "object",
      "properties": {
        "orderId": {
          "type": "string"
        },
        "externalOrderId": {
          "type": "string",
          "description": "Order ID from originating channel"
        },
        "status": {
          "type": "string",
          "enum": [
            "CREATED",
            "PAYMENT_PENDING",
            "CONFIRMED",
            "PROCESSING",
            "SHIPPED",
            "DELIVERED",
            "CANCELLED",
            "RETURNED"
          ]
        },
        "channelId": {
          "type": "string"
        },
        "customerId": {
          "type": "string"
        },
        "orderDate": {
          "type": "string",
          "format": "date-time"
        },
        "currencyCode": {
          "type": "string",
          "maxLength": 3
        },
        "subtotal": {
          "type": "number",
          "format": "double"
        },
        "taxTotal": {
          "type": "number",
          "format": "double"
        },
        "shippingTotal": {
          "type": "number",
          "format": "double"
        },
        "discountTotal": {
          "type": "number",
          "format": "double"
        },
        "orderTotal": {
          "type": "number",
          "format": "double"
        },
        "shippingAddress": {
          "$ref": "#/$defs/Address"
        },
        "createDatetime": {
          "type": "string",
          "format": "date-time"
        },
        "lastUpdateDatetime": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "OrderLine": {
      "type": "object",
      "properties": {
        "lineId": {
          "type": "string"
        },
        "itemId": {
          "type": "string"
        },
        "itemDescription": {
          "type": "string"
        },
        "quantity": {
          "type": "integer"
        },
        "unitPrice": {
          "type": "number",
          "format": "double"
        },
        "lineTotal": {
          "type": "number",
          "format": "double"
        },
        "status": {
          "type": "string"
        },
        "fulfillmentType": {
          "type": "string",
          "enum": [
            "SHIP_TO_HOME",
            "SHIP_TO_STORE",
            "PICKUP_IN_STORE",
            "DELIVERY"
          ]
        }
      }
    }
  }
}