{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/lightspeed/main/json-schema/lightspeed-purchase-order-delivery-line-item-collection-response-schema.json",
  "title": "Purchase Order Delivery Line Item Collection Response",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lightspeed-purchase-orders-api-openapi.yml#/components/schemas/PurchaseOrderDeliveryLineItemCollectionResponse",
  "properties": {
    "data": {
      "items": {
        "$ref": "#/$defs/PurchaseOrderDeliveryLineItem"
      },
      "type": "array"
    },
    "version": {
      "$ref": "#/$defs/PurchaseOrderVersion"
    }
  },
  "required": [
    "data",
    "version"
  ],
  "type": "object",
  "$defs": {
    "PurchaseOrderDeliveryLineItem": {
      "properties": {
        "allocations": {
          "items": {
            "$ref": "#/$defs/PurchaseOrderDeliveryLineItemAllocation"
          },
          "type": "array"
        },
        "components": {
          "items": {
            "$ref": "#/$defs/PurchaseOrderDeliveryLineItemComponent"
          },
          "type": "array"
        },
        "cost_price": {
          "type": [
            "string",
            "null"
          ]
        },
        "created_at": {
          "format": "date-time",
          "type": "string"
        },
        "expected_quantity": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "product_id": {
          "type": "string"
        },
        "purchase_order_delivery_id": {
          "type": "string"
        },
        "purchase_order_line_item_id": {
          "type": "string"
        },
        "received_quantity": {
          "type": "string"
        },
        "updated_at": {
          "format": "date-time",
          "type": "string"
        },
        "version": {
          "format": "int64",
          "type": "integer"
        }
      },
      "required": [
        "id",
        "version",
        "purchase_order_delivery_id",
        "purchase_order_line_item_id",
        "product_id",
        "expected_quantity",
        "received_quantity",
        "cost_price",
        "allocations",
        "created_at",
        "updated_at"
      ],
      "title": "Purchase Order Delivery Line Item",
      "type": "object"
    },
    "PurchaseOrderDeliveryLineItemAllocation": {
      "properties": {
        "expected_quantity": {
          "type": "string"
        },
        "outlet_id": {
          "type": "string"
        },
        "received_quantity": {
          "type": "string"
        }
      },
      "required": [
        "outlet_id",
        "expected_quantity",
        "received_quantity"
      ],
      "title": "Purchase Order Delivery Line Item Allocation",
      "type": "object"
    },
    "PurchaseOrderDeliveryLineItemComponent": {
      "properties": {
        "bom_quantity": {
          "type": "string"
        },
        "component_product_id": {
          "type": "string"
        },
        "cost_price": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "component_product_id",
        "bom_quantity",
        "cost_price"
      ],
      "title": "Purchase Order Delivery Line Item Component",
      "type": "object"
    },
    "PurchaseOrderVersion": {
      "properties": {
        "max": {
          "description": "Highest version number in the payload.",
          "format": "int64",
          "type": [
            "integer",
            "null"
          ]
        },
        "min": {
          "description": "Lowest version number in the payload.",
          "format": "int64",
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "required": [
        "min",
        "max"
      ],
      "title": "Purchase Order Version",
      "type": "object"
    }
  }
}