{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "$id": "https://raw.githubusercontent.com/api-evangelist/folio/main/json-schema/folio-ebsconet-order-line-schema.json",
  "title": "ebsconet_order_line",
  "description": "Ebsconet order line integration schema",
  "x-generated": "2026-10-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/folio-mod-ebsconet-openapi.yml#/components/schemas/ebsconet_order_line",
  "id": "ebsconet_order_line",
  "type": "object",
  "properties": {
    "cancellationRestriction": {
      "type": "boolean",
      "description": "Whether or not there are cancellation restrictions for this purchase order line",
      "readOnly": false
    },
    "cancellationRestrictionNote": {
      "type": "string",
      "description": "Free-form notes related to cancellation restrictions",
      "readOnly": false
    },
    "currency": {
      "type": "string",
      "description": "An ISO currency code",
      "readOnly": false
    },
    "fundCode": {
      "type": "string",
      "description": "Fund distribution code",
      "readOnly": false
    },
    "poLineNumber": {
      "$ref": "#/$defs/order_line_number",
      "description": "A human readable number assigned to this PO line",
      "readOnly": true
    },
    "publisherName": {
      "type": "string",
      "description": "Publisher of the material",
      "readOnly": false
    },
    "internalNote": {
      "type": "string",
      "description": "Renewal note for this purchase order line"
    },
    "quantity": {
      "type": "integer",
      "description": "Quantity of physical items or resources of 'Other' order format in this purchase order line",
      "readOnly": false
    },
    "subscriptionFromDate": {
      "type": [
        "string",
        "null"
      ],
      "description": "the start date of the subscription",
      "format": "date-time",
      "readOnly": false
    },
    "subscriptionToDate": {
      "type": [
        "string",
        "null"
      ],
      "description": "the end date of the subscription",
      "format": "date-time",
      "readOnly": false
    },
    "unitPrice": {
      "type": "number",
      "description": "The per-item list price for physical or resources of 'Other' order format",
      "readOnly": false
    },
    "vendor": {
      "type": "string",
      "description": "Vendor code",
      "maxLength": 55,
      "pattern": "[\\S ]+",
      "readOnly": true
    },
    "vendorAccountNumber": {
      "type": "string",
      "description": "Account number on the vendor's end associated with this purchase order line",
      "readOnly": false
    },
    "vendorReferenceNumbers": {
      "type": "array",
      "description": "Reference number items array",
      "items": {
        "$ref": "#/$defs/reference_number_item"
      }
    },
    "workflowStatus": {
      "$ref": "#/$defs/workflow_status",
      "description": "the workflow status for the purchase order",
      "readOnly": true
    },
    "type": {
      "type": "string",
      "description": "Set to non-renewal to cancel the purchase order line",
      "readOnly": true,
      "pattern": "^([Rr][Ee][Nn][Ee][Ww][Aa][Ll]|[Nn][Oo][Nn][-][Rr][Ee][Nn][Ee][Ww][Aa][Ll])$"
    },
    "customerNote": {
      "type": "string",
      "description": "customerNote on the ebsconet's end can be associated with this purchase order line",
      "readOnly": false
    }
  },
  "required": [
    "currency",
    "poLineNumber"
  ],
  "$defs": {
    "order_line_number": {
      "id": "po_line_number",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "description": "A human readable number, assigned to this product order line",
      "type": "string",
      "pattern": "^[a-zA-Z0-9]{1,22}-[0-9]{1,3}$"
    },
    "reference_number_item": {
      "id": "reference_number_item",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "description": "Reference number item",
      "type": "object",
      "properties": {
        "refNumber": {
          "description": "a reference number for this purchase order line",
          "type": "string"
        },
        "refNumberType": {
          "description": "the reference number type",
          "type": "string",
          "enum": [
            "Vendor continuation reference number",
            "Vendor order reference number",
            "Vendor subscription reference number",
            "Vendor internal number",
            "Vendor title number"
          ]
        }
      },
      "additionalProperties": false
    },
    "workflow_status": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "description": "Composite workflow status",
      "type": "string",
      "enum": [
        "Pending",
        "Open",
        "Closed"
      ],
      "default": "Pending"
    }
  }
}