{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "OrderItemRead",
  "type": "object",
  "properties": {
    "PO": {
      "type": "array",
      "items": {
        "type": "integer",
        "title": "PO"
      }
    },
    "PO_line_num": {
      "type": "integer",
      "maximum": 2147483647,
      "minimum": -2147483648
    },
    "account": {
      "$ref": "#/components/schemas/AccountRead"
    },
    "accountCode": {
      "type": "string",
      "maxLength": 100
    },
    "active": {
      "type": "boolean"
    },
    "approved_currency_rate": {
      "type": "string",
      "format": "decimal",
      "pattern": "^-?\\d{0,9}(?:\\.\\d{0,6})?$",
      "nullable": true
    },
    "approved_datetime": {
      "type": "string",
      "format": "date-time",
      "nullable": true
    },
    "approved_price": {
      "type": "string",
      "format": "decimal",
      "pattern": "^-?\\d{0,13}(?:\\.\\d{0,8})?$",
      "nullable": true
    },
    "approved_quantity": {
      "type": "number",
      "format": "double"
    },
    "approved_shipping_amount": {
      "type": "string",
      "format": "decimal",
      "pattern": "^-?\\d{0,13}(?:\\.\\d{0,8})?$",
      "nullable": true
    },
    "approved_tax_amount": {
      "type": "string",
      "format": "decimal",
      "pattern": "^-?\\d{0,13}(?:\\.\\d{0,8})?$",
      "nullable": true
    },
    "attachments": {
      "type": "string"
    },
    "catalog_item": {
      "allOf": [
        {
          "$ref": "#/components/schemas/CatalogItemRead"
        }
      ],
      "nullable": true,
      "type": "object"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "currency": {
      "$ref": "#/components/schemas/CurrencySummary"
    },
    "dateInvoiced": {
      "type": "string",
      "format": "date-time",
      "nullable": true
    },
    "external_id": {
      "type": "string",
      "description": "External id of the order item",
      "maxLength": 100
    },
    "hot": {
      "type": "boolean"
    },
    "id": {
      "type": "integer",
      "readOnly": true
    },
    "inventoryItem": {
      "type": "integer",
      "nullable": true
    },
    "is_active": {
      "type": "boolean"
    },
    "item_attachments": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Attachment"
      }
    },
    "last_changed_by": {
      "type": "integer",
      "nullable": true,
      "title": "Last changed by user"
    },
    "last_modified": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "lineComment": {
      "type": "string",
      "nullable": true
    },
    "name": {
      "type": "string",
      "maxLength": 255
    },
    "num": {
      "type": "string",
      "maxLength": 50
    },
    "orderNum": {
      "type": "integer",
      "nullable": true
    },
    "order_number": {
      "type": "integer",
      "readOnly": true,
      "nullable": true
    },
    "po_note": {
      "type": "string",
      "title": "Comment"
    },
    "po_version": {
      "type": "integer",
      "maximum": 2147483647,
      "minimum": -2147483648
    },
    "pref_vendor": {
      "$ref": "#/components/schemas/VendorRead"
    },
    "price": {
      "type": "string",
      "format": "decimal",
      "pattern": "^-?\\d{0,13}(?:\\.\\d{0,8})?$"
    },
    "purchase_order": {
      "type": "integer",
      "title": "Procurify PO Number",
      "nullable": true
    },
    "purchaser": {
      "$ref": "#/components/schemas/UserSummary"
    },
    "quantity": {
      "type": "number",
      "format": "double"
    },
    "receivedFailQty": {
      "type": "number",
      "format": "double"
    },
    "receivedPassQty": {
      "type": "number",
      "format": "double"
    },
    "shipping_amount": {
      "type": "string",
      "format": "decimal",
      "pattern": "^-?\\d{0,13}(?:\\.\\d{0,8})?$",
      "nullable": true
    },
    "sku": {
      "type": "string",
      "maxLength": 100
    },
    "status": {
      "nullable": true,
      "minimum": -2147483648,
      "maximum": 2147483647,
      "oneOf": [
        {
          "$ref": "#/components/schemas/OrderItemStatusEnum"
        },
        {
          "$ref": "#/components/schemas/NullEnum"
        }
      ],
      "type": "integer"
    },
    "tax_amount": {
      "type": "string",
      "format": "decimal",
      "pattern": "^-?\\d{0,13}(?:\\.\\d{0,8})?$",
      "nullable": true
    },
    "total_cost": {
      "type": "string",
      "format": "decimal",
      "pattern": "^-?\\d{0,16}(?:\\.\\d{0,2})?$"
    },
    "unit": {
      "type": "string",
      "maxLength": 30
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "vendor": {
      "type": "string",
      "readOnly": true
    },
    "receive_method": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ReceiveMethodEnum"
        }
      ],
      "minimum": 0,
      "maximum": 65535
    },
    "type": {
      "allOf": [
        {
          "$ref": "#/components/schemas/OrderItemTypeEnum"
        }
      ],
      "minimum": 0,
      "maximum": 65535
    },
    "blanket": {
      "allOf": [
        {
          "$ref": "#/components/schemas/BlanketOrderItemRead"
        }
      ],
      "readOnly": true
    },
    "comments": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Comment"
      },
      "readOnly": true
    },
    "confirmation_status": {
      "type": "integer",
      "nullable": true,
      "readOnly": true
    },
    "confirmation_status_description": {
      "type": "string",
      "nullable": true,
      "readOnly": true
    },
    "cost_details": {
      "allOf": [
        {
          "$ref": "#/components/schemas/CostDetails"
        }
      ],
      "nullable": true,
      "readOnly": true,
      "type": "object"
    },
    "custom_fields": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/CustomFieldValueRead"
      },
      "readOnly": true
    },
    "date_required": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "fully_received_actual_receive_date": {
      "type": "string",
      "format": "date",
      "readOnly": true
    },
    "has_sibling_items": {
      "type": "boolean",
      "readOnly": true
    },
    "line_comment": {
      "type": "string",
      "readOnly": true
    },
    "logs": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/MasterLogger"
      },
      "readOnly": true
    },
    "order_description": {
      "type": "string",
      "readOnly": true
    },
    "order_status": {
      "type": "integer",
      "readOnly": true
    },
    "order_uuid": {
      "type": "string",
      "format": "uuid",
      "readOnly": true
    },
    "punchout_supplier_icon": {
      "type": "string",
      "readOnly": true,
      "nullable": true
    },
    "punchout_supplier_name": {
      "type": "string",
      "readOnly": true,
      "nullable": true
    },
    "punchout_system": {
      "type": "integer",
      "nullable": true,
      "readOnly": true
    },
    "punchout_vendor_reference": {
      "type": "integer",
      "nullable": true,
      "readOnly": true
    },
    "punchout_supplier_can_update_quantity": {
      "type": "boolean",
      "readOnly": true
    },
    "purchase_order_number": {
      "type": "string",
      "readOnly": true
    },
    "purchase_order_uuid": {
      "type": "string",
      "format": "uuid",
      "readOnly": true
    },
    "purchased_currency_rate": {
      "type": "string",
      "format": "decimal",
      "pattern": "^-?\\d{0,9}(?:\\.\\d{0,6})?$",
      "readOnly": true,
      "default": "0.000000"
    },
    "recurrence": {
      "allOf": [
        {
          "$ref": "#/components/schemas/RecurringOrderItem"
        }
      ],
      "nullable": true,
      "type": "object"
    },
    "requester": {
      "allOf": [
        {
          "$ref": "#/components/schemas/SimpleUserSummary"
        }
      ],
      "readOnly": true
    },
    "spend_allocation": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/AllocationRead"
      },
      "readOnly": true
    },
    "submitted_date": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "taxes": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Adjustment"
      },
      "nullable": true
    }
  },
  "required": [
    "account",
    "approved_datetime",
    "approved_quantity",
    "catalog_item",
    "currency",
    "item_attachments",
    "name",
    "num",
    "pref_vendor",
    "price",
    "purchaser",
    "quantity",
    "receivedFailQty",
    "receivedPassQty",
    "recurrence",
    "unit"
  ]
}