{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/digi-key/main/json-schema/digi-key-order-response-schema.json",
  "title": "OrderResponse",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/digi-key-orderhistory-api-openapi.yml#/components/schemas/OrderResponse",
  "type": "object",
  "properties": {
    "TotalOrders": {
      "format": "int32",
      "type": "integer"
    },
    "Orders": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Order"
      }
    }
  },
  "additionalProperties": false,
  "$defs": {
    "Address": {
      "type": "object",
      "properties": {
        "FirstName": {
          "description": "First name on address",
          "type": "string"
        },
        "LastName": {
          "description": "Last name on address",
          "type": "string"
        },
        "CompanyName": {
          "description": "Company name on address",
          "type": "string"
        },
        "AddressLine1": {
          "description": "First address line",
          "type": "string"
        },
        "AddressLine2": {
          "description": "Second address line",
          "type": "string"
        },
        "AddressLine3": {
          "description": "Third address line",
          "type": "string"
        },
        "City": {
          "description": "City on address",
          "type": "string"
        },
        "State": {
          "description": "State code on address",
          "type": "string"
        },
        "County": {
          "description": "County on address",
          "type": "string"
        },
        "ZipCode": {
          "description": "Zip code on address",
          "type": "string"
        },
        "IsoCode": {
          "description": "Country on address",
          "type": "string"
        },
        "Phone": {
          "description": "Phone number on address",
          "type": "string"
        },
        "InvoiceId": {
          "format": "int32",
          "description": "Invoice ID of order",
          "type": "integer"
        }
      },
      "additionalProperties": false
    },
    "Contact": {
      "description": "The contact information for a given customer",
      "type": "object",
      "properties": {
        "FirstName": {
          "description": "The first name of the customer",
          "type": "string"
        },
        "LastName": {
          "description": "The last name of the customer",
          "type": "string"
        },
        "Email": {
          "description": "The email address of the customer",
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ItemShipInfo": {
      "type": "object",
      "properties": {
        "QuantityShipped": {
          "format": "int32",
          "description": "Quantity of item shipped",
          "type": "integer"
        },
        "InvoiceId": {
          "format": "int32",
          "description": "Invoice ID of given item",
          "type": "integer"
        },
        "ShippedDate": {
          "format": "date-time",
          "description": "Date shipped",
          "type": "string"
        },
        "TrackingNumber": {
          "description": "Tracking number of the shipment",
          "type": "string"
        },
        "ExpectedDeliveryDate": {
          "description": "Expected date item to be delivered by",
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "LineItem": {
      "description": "LineItem for a given Sales Order",
      "type": "object",
      "properties": {
        "SalesOrderId": {
          "format": "int32",
          "description": "Sales order ID for given line item",
          "type": "integer"
        },
        "DetailId": {
          "format": "int32",
          "description": "DK detail ID for given line item",
          "type": "integer"
        },
        "TotalPrice": {
          "format": "double",
          "description": "Total price of all details, Shipping Charges, Sales Tax, Tariffs, GST, HST",
          "type": "number"
        },
        "PurchaseOrder": {
          "description": "Customer purchase order",
          "type": "string"
        },
        "CustomerReference": {
          "description": "Customer part number for reference",
          "type": "string"
        },
        "CountryOfOrigin": {
          "description": "Country of origin",
          "type": "string"
        },
        "DigiKeyProductNumber": {
          "description": "DigiKey product number for given line item",
          "type": "string"
        },
        "ManufacturerProductNumber": {
          "description": "Manufacturer part number for given line item",
          "type": "string"
        },
        "Description": {
          "description": "Description of part for given line item",
          "type": "string"
        },
        "PackType": {
          "description": "PackType of given line item",
          "enum": [
            "TapeReel",
            "CutTape",
            "Bulk",
            "TapeBox",
            "Tube",
            "Tray",
            "Box",
            "Bag",
            "Spools",
            "DigiReel",
            "Strip",
            "Bottle",
            "Canister",
            "Book",
            "Dispenser",
            "Sheet",
            "Pail",
            "Can",
            "Case",
            "RetailPkg",
            "DigiSpool",
            "ElectronicDelivery",
            "None"
          ],
          "type": "string"
        },
        "QuantityInitialRequested": {
          "format": "int32",
          "description": "The total initial quantity requested on the order.",
          "type": "integer",
          "readOnly": true
        },
        "QuantityOrdered": {
          "format": "int32",
          "description": "The accepted Quantity of the order. QuantityOrdered will be the same as QuantityInitialRequested at order entry. If changes are made to quantity it will be reflected in QuantityOrdered",
          "type": "integer"
        },
        "QuantityShipped": {
          "format": "int32",
          "description": "The sum quantity shipped",
          "type": "integer"
        },
        "QuantityReserved": {
          "format": "int32",
          "description": "The Quantity reserved and not shipped.",
          "type": "integer"
        },
        "QuantityBackOrder": {
          "format": "int32",
          "description": "Quantity on backorder",
          "type": "integer"
        },
        "UnitPrice": {
          "format": "double",
          "description": "Unit price of product",
          "type": "number"
        },
        "PoLineItemNumber": {
          "description": "Line item number provided on purchase order",
          "type": "string"
        },
        "ItemShipments": {
          "description": "List of item shipments for given lineitem",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ItemShipInfo"
          }
        },
        "Schedules": {
          "description": "List of schedules for given line item",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Schedule"
          }
        }
      },
      "additionalProperties": false
    },
    "Order": {
      "type": "object",
      "properties": {
        "OrderNumber": {
          "format": "int64",
          "description": "OrderNumber of the order",
          "type": "integer"
        },
        "CustomerId": {
          "format": "int32",
          "description": "CustomerID of the order",
          "type": "integer"
        },
        "DateEntered": {
          "format": "date-time",
          "description": "Date the order was entered",
          "type": "string"
        },
        "Currency": {
          "description": "Currency used to pay for order",
          "type": "string"
        },
        "PONumber": {
          "description": "Purchase order number of the order",
          "type": "string"
        },
        "EntireOrderStatus": {
          "$ref": "#/$defs/OrderStatusInfo"
        },
        "SalesOrders": {
          "description": "List of the salesOrders",
          "type": "array",
          "items": {
            "$ref": "#/$defs/SalesOrder"
          }
        }
      },
      "additionalProperties": false
    },
    "OrderStatusInfo": {
      "type": "object",
      "properties": {
        "OrderStatus": {
          "description": "Status of order",
          "enum": [
            "Unknown",
            "Received",
            "Processing",
            "ProcessingPartialShipment",
            "ProcessingAwaitingBackorders",
            "ProcessingShipBackorder",
            "ProcessingScheduledShipmentsMultipleRelease",
            "ProcessingScheduledShipmentSingleRelease",
            "ProcessingScheduledShipmentMsc",
            "ProcessingDkAnd3rdParty",
            "ProcessingMultiple3rdParty",
            "Shipped",
            "Delivered",
            "GenericDelay",
            "Canceled",
            "Proforma",
            "ActionRequiredWireTransfer"
          ],
          "type": "string"
        },
        "ShortDescription": {
          "description": "Short description of order status",
          "type": "string"
        },
        "LongDescription": {
          "description": "Longer description of order status",
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "SalesOrder": {
      "description": "DTO for a Sales Order",
      "type": "object",
      "properties": {
        "CustomerId": {
          "format": "int32",
          "description": "Customer ID for the sales order",
          "type": "integer"
        },
        "Contact": {
          "$ref": "#/$defs/Contact"
        },
        "SalesOrderId": {
          "format": "int32",
          "description": "Sales order ID for the sales order",
          "type": "integer"
        },
        "Status": {
          "$ref": "#/$defs/SalesOrderStatusInfo"
        },
        "PurchaseOrder": {
          "description": "Purchase order number of the sales order",
          "type": "string"
        },
        "TotalPrice": {
          "format": "double",
          "description": "Total price of all details, Shipping Charges, Sales Tax, Tariffs, GST, HST",
          "type": "number"
        },
        "DateEntered": {
          "format": "date-time",
          "description": "Date the sales order was entered",
          "type": "string"
        },
        "OrderNumber": {
          "format": "int64",
          "description": "Order number of the sales order",
          "type": "integer"
        },
        "ShipMethod": {
          "description": "Method used to ship items in sales order",
          "type": "string"
        },
        "Currency": {
          "description": "Currency used to place sales order",
          "type": "string"
        },
        "ShippingAddress": {
          "$ref": "#/$defs/Address"
        },
        "LineItems": {
          "description": "List of line items for a sales order",
          "type": "array",
          "items": {
            "$ref": "#/$defs/LineItem"
          }
        }
      },
      "additionalProperties": false
    },
    "SalesOrderStatusInfo": {
      "type": "object",
      "properties": {
        "SalesOrderStatus": {
          "description": "Status of order",
          "enum": [
            "Unknown",
            "Received",
            "Processing",
            "Processing3rdParty",
            "ProcessingPartialShipment",
            "ProcessingAwaitingBackorders",
            "ProcessingShipBackorder",
            "ProcessingScheduledShipmentMultipleRelease",
            "ProcessingScheduledShipmentSingleRelease",
            "ProcessingScheduledShipmentMsc",
            "Shipped",
            "Delivered",
            "GenericDelay",
            "Canceled",
            "Proforma",
            "ActionRequiredWireTransfer"
          ],
          "type": "string"
        },
        "ShortDescription": {
          "description": "Short description of order status",
          "type": "string"
        },
        "LongDescription": {
          "description": "Longer description of order status",
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "Schedule": {
      "type": "object",
      "properties": {
        "QuantityScheduled": {
          "format": "int32",
          "description": "Quantity scheduled to be shipped",
          "type": "integer"
        },
        "ScheduledDate": {
          "format": "date-time",
          "description": "Date the shipment is scheduled to be delivered to the customer",
          "type": "string"
        },
        "DigiKeyReleaseDate": {
          "format": "date-time",
          "description": "Date the shipment is scheduled to depart DigiKey’s facility",
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  }
}