{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sap-commerce-cloud/json-schema/sap-commerce-cloud-order-history-list-schema.json",
  "title": "OrderHistoryList",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sap-commerce-cloud-orders-api-openapi.yml#/components/schemas/OrderHistoryList",
  "type": "object",
  "properties": {
    "orders": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Order"
      }
    },
    "pagination": {
      "$ref": "#/$defs/Pagination"
    },
    "sorts": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Sort"
      }
    }
  },
  "$defs": {
    "Address": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Address identifier"
        },
        "firstName": {
          "type": "string",
          "description": "First name"
        },
        "lastName": {
          "type": "string",
          "description": "Last name"
        },
        "titleCode": {
          "type": "string",
          "description": "Title code"
        },
        "line1": {
          "type": "string",
          "description": "Address line 1"
        },
        "line2": {
          "type": "string",
          "description": "Address line 2"
        },
        "town": {
          "type": "string",
          "description": "City or town"
        },
        "region": {
          "$ref": "#/$defs/Region"
        },
        "district": {
          "type": "string",
          "description": "District"
        },
        "postalCode": {
          "type": "string",
          "description": "Postal or ZIP code"
        },
        "country": {
          "$ref": "#/$defs/Country"
        },
        "phone": {
          "type": "string",
          "description": "Phone number"
        },
        "email": {
          "type": "string",
          "description": "Email address"
        },
        "defaultAddress": {
          "type": "boolean",
          "description": "Whether this is the default address"
        }
      }
    },
    "Category": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "description": "Category code"
        },
        "name": {
          "type": "string",
          "description": "Category name"
        },
        "url": {
          "type": "string",
          "description": "Category URL"
        },
        "image": {
          "$ref": "#/$defs/Image"
        },
        "subcategories": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Category"
          }
        }
      }
    },
    "Classification": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "description": "Classification code"
        },
        "name": {
          "type": "string",
          "description": "Classification name"
        },
        "features": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "featureValues": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "value": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "Consignment": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "description": "Consignment code"
        },
        "status": {
          "type": "string",
          "description": "Consignment status"
        },
        "statusDisplay": {
          "type": "string",
          "description": "Display-friendly status"
        },
        "trackingID": {
          "type": "string",
          "description": "Shipment tracking ID"
        },
        "entries": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ConsignmentEntry"
          }
        },
        "deliveryPointOfService": {
          "$ref": "#/$defs/PointOfService"
        }
      }
    },
    "ConsignmentEntry": {
      "type": "object",
      "properties": {
        "orderEntry": {
          "$ref": "#/$defs/OrderEntry"
        },
        "quantity": {
          "type": "integer",
          "description": "Shipped quantity"
        },
        "shippedQuantity": {
          "type": "integer",
          "description": "Actual shipped quantity"
        }
      }
    },
    "Country": {
      "type": "object",
      "properties": {
        "isocode": {
          "type": "string",
          "description": "ISO 3166-1 alpha-2 country code"
        },
        "name": {
          "type": "string",
          "description": "Country name"
        }
      }
    },
    "DeliveryMode": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "description": "Delivery mode code"
        },
        "name": {
          "type": "string",
          "description": "Delivery mode name"
        },
        "description": {
          "type": "string",
          "description": "Delivery mode description"
        },
        "deliveryCost": {
          "$ref": "#/$defs/Price"
        }
      }
    },
    "GeoPoint": {
      "type": "object",
      "properties": {
        "latitude": {
          "type": "number",
          "format": "double",
          "description": "Latitude"
        },
        "longitude": {
          "type": "number",
          "format": "double",
          "description": "Longitude"
        }
      }
    },
    "Image": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "description": "Image URL"
        },
        "altText": {
          "type": "string",
          "description": "Alternative text"
        },
        "format": {
          "type": "string",
          "description": "Image format (e.g., thumbnail, product, zoom)"
        },
        "imageType": {
          "type": "string",
          "enum": [
            "PRIMARY",
            "GALLERY"
          ],
          "description": "Image type"
        }
      }
    },
    "OpeningSchedule": {
      "type": "object",
      "properties": {
        "weekDayOpeningList": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "weekDay": {
                "type": "string"
              },
              "openingTime": {
                "type": "object",
                "properties": {
                  "formattedHour": {
                    "type": "string"
                  }
                }
              },
              "closingTime": {
                "type": "object",
                "properties": {
                  "formattedHour": {
                    "type": "string"
                  }
                }
              },
              "closed": {
                "type": "boolean"
              }
            }
          }
        }
      }
    },
    "Order": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "description": "Order code"
        },
        "status": {
          "type": "string",
          "description": "Order status"
        },
        "statusDisplay": {
          "type": "string",
          "description": "Display-friendly order status"
        },
        "created": {
          "type": "string",
          "format": "date-time",
          "description": "Order creation timestamp"
        },
        "totalPrice": {
          "$ref": "#/$defs/Price"
        },
        "totalPriceWithTax": {
          "$ref": "#/$defs/Price"
        },
        "subTotal": {
          "$ref": "#/$defs/Price"
        },
        "deliveryCost": {
          "$ref": "#/$defs/Price"
        },
        "totalTax": {
          "$ref": "#/$defs/Price"
        },
        "totalItems": {
          "type": "integer",
          "description": "Total number of items"
        },
        "entries": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/OrderEntry"
          }
        },
        "deliveryAddress": {
          "$ref": "#/$defs/Address"
        },
        "deliveryMode": {
          "$ref": "#/$defs/DeliveryMode"
        },
        "paymentInfo": {
          "$ref": "#/$defs/PaymentDetails"
        },
        "consignments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Consignment"
          }
        },
        "user": {
          "$ref": "#/$defs/Principal"
        }
      }
    },
    "OrderEntry": {
      "type": "object",
      "properties": {
        "entryNumber": {
          "type": "integer",
          "description": "Entry number (zero-based)"
        },
        "product": {
          "$ref": "#/$defs/Product"
        },
        "quantity": {
          "type": "integer",
          "description": "Quantity"
        },
        "basePrice": {
          "$ref": "#/$defs/Price"
        },
        "totalPrice": {
          "$ref": "#/$defs/Price"
        },
        "updateable": {
          "type": "boolean",
          "description": "Whether the entry can be updated"
        }
      }
    },
    "Pagination": {
      "type": "object",
      "properties": {
        "currentPage": {
          "type": "integer",
          "description": "Current page number"
        },
        "pageSize": {
          "type": "integer",
          "description": "Number of results per page"
        },
        "totalPages": {
          "type": "integer",
          "description": "Total number of pages"
        },
        "totalResults": {
          "type": "integer",
          "description": "Total number of results"
        }
      }
    },
    "PaymentDetails": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Payment details identifier"
        },
        "accountHolderName": {
          "type": "string",
          "description": "Card holder name"
        },
        "cardNumber": {
          "type": "string",
          "description": "Masked card number"
        },
        "cardType": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string",
              "description": "Card type code"
            },
            "name": {
              "type": "string",
              "description": "Card type name"
            }
          }
        },
        "expiryMonth": {
          "type": "string",
          "description": "Card expiry month"
        },
        "expiryYear": {
          "type": "string",
          "description": "Card expiry year"
        },
        "billingAddress": {
          "$ref": "#/$defs/Address"
        },
        "defaultPayment": {
          "type": "boolean",
          "description": "Whether this is the default payment method"
        },
        "saved": {
          "type": "boolean",
          "description": "Whether the payment details are saved"
        }
      }
    },
    "PointOfService": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Store name"
        },
        "displayName": {
          "type": "string",
          "description": "Display name"
        },
        "description": {
          "type": "string",
          "description": "Store description"
        },
        "address": {
          "$ref": "#/$defs/Address"
        },
        "geoPoint": {
          "$ref": "#/$defs/GeoPoint"
        },
        "openingHours": {
          "$ref": "#/$defs/OpeningSchedule"
        },
        "storeImages": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Image"
          }
        },
        "features": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Store features"
        }
      }
    },
    "Price": {
      "type": "object",
      "properties": {
        "currencyIso": {
          "type": "string",
          "description": "ISO 4217 currency code"
        },
        "value": {
          "type": "number",
          "format": "double",
          "description": "Price value"
        },
        "formattedValue": {
          "type": "string",
          "description": "Formatted price string"
        },
        "priceType": {
          "type": "string",
          "enum": [
            "BUY",
            "FROM"
          ],
          "description": "Price type"
        }
      }
    },
    "Principal": {
      "type": "object",
      "properties": {
        "uid": {
          "type": "string",
          "description": "User unique identifier"
        },
        "name": {
          "type": "string",
          "description": "Display name"
        }
      }
    },
    "Product": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "description": "Product code"
        },
        "name": {
          "type": "string",
          "description": "Product name"
        },
        "description": {
          "type": "string",
          "description": "Product description"
        },
        "summary": {
          "type": "string",
          "description": "Short product summary"
        },
        "price": {
          "$ref": "#/$defs/Price"
        },
        "images": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Image"
          },
          "description": "Product images"
        },
        "categories": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Category"
          },
          "description": "Product categories"
        },
        "reviews": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Review"
          },
          "description": "Customer reviews"
        },
        "averageRating": {
          "type": "number",
          "format": "double",
          "description": "Average customer rating"
        },
        "stock": {
          "$ref": "#/$defs/Stock"
        },
        "classifications": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Classification"
          },
          "description": "Product classification attributes"
        },
        "purchasable": {
          "type": "boolean",
          "description": "Whether the product can be purchased"
        },
        "url": {
          "type": "string",
          "description": "Product URL"
        }
      }
    },
    "Region": {
      "type": "object",
      "properties": {
        "isocode": {
          "type": "string",
          "description": "Region ISO code"
        },
        "name": {
          "type": "string",
          "description": "Region name"
        }
      }
    },
    "Review": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Review identifier"
        },
        "headline": {
          "type": "string",
          "description": "Review headline"
        },
        "comment": {
          "type": "string",
          "description": "Review text"
        },
        "rating": {
          "type": "number",
          "format": "double",
          "description": "Rating value"
        },
        "date": {
          "type": "string",
          "format": "date-time",
          "description": "Review date"
        },
        "alias": {
          "type": "string",
          "description": "Reviewer alias"
        },
        "principal": {
          "$ref": "#/$defs/Principal"
        }
      }
    },
    "Sort": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "description": "Sort code"
        },
        "name": {
          "type": "string",
          "description": "Sort display name"
        },
        "selected": {
          "type": "boolean",
          "description": "Whether this sort is selected"
        }
      }
    },
    "Stock": {
      "type": "object",
      "properties": {
        "stockLevelStatus": {
          "type": "string",
          "enum": [
            "inStock",
            "lowStock",
            "outOfStock"
          ],
          "description": "Stock level status"
        },
        "stockLevel": {
          "type": "integer",
          "description": "Actual stock level quantity"
        }
      }
    }
  }
}