foliolib.folio.api.ordersStorage.PoLine

class foliolib.folio.api.ordersStorage.PoLine(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)

Bases: foliolib.folio.FolioApi

PO Line

This module implements the CRUD interface. This API is intended for internal use only. Please use the /orders/order-lines API provided by mod-orders instead.

Parameters
  • tenant (str) – Tenant id

  • okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.

Methods

delete_poLine(poLinesId)

Delete poLine item with given {poLineId}

get_poLine(poLinesId)

Retrieve poLine item with given {poLineId}

get_poLines(**kwargs)

Get list of po lines

modify_poLine(poLinesId, poLine)

Update poLine item with given {poLineId}

set_poLine(poLine)

Create a new poLine item.

delete_poLine(poLinesId: str)

Delete poLine item with given {poLineId}

DELETE /orders-storage/po-lines/{poLinesId}

Parameters

poLinesId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

get_poLine(poLinesId: str)

Retrieve poLine item with given {poLineId}

GET /orders-storage/po-lines/{poLinesId}

Parameters

poLinesId (str) –

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "purchase order line",
  "type": "object",
  "javaName": "PoLine",
  "properties": {
    "id": {
      "description": "UUID identifying this purchase order line",
      "$ref": "../../common/schemas/uuid.json"
    },
    "edition": {
      "description": "edition of the material",
      "type": "string"
    },
    "checkinItems": {
      "description": "if true this will toggle the Check-in workflow for details associated with this PO line",
      "type": "boolean",
      "default": false
    },
    "agreementId": {
      "description": "UUID of the agreement this purchase order line is related to",
      "$ref": "../../common/schemas/uuid.json"
    },
    "acquisitionMethod": {
      "description": "UUID of the acquisition method for this purchase order line",
      "type": "string",
      "$ref": "../../common/schemas/uuid.json"
    },
    "automaticExport": {
      "description": "if true then line will be marked as available to export in the EDIFACT format or other format",
      "type": "boolean",
      "default": false
    },
    "alerts": {
      "description": "an array of alert record IDs",
      "id": "alerts",
      "type": "array",
      "items": {
        "description": "UUID of an alert record",
        "$ref": "../../common/schemas/uuid.json"
      }
    },
    "cancellationRestriction": {
      "description": "whether or not there are cancellation restrictions for this purchase order line",
      "type": "boolean"
    },
    "cancellationRestrictionNote": {
      "description": "free-form notes related to cancellation restrictions",
      "type": "string"
    },
    "claims": {
      "description": "list of claims",
      "id": "claims",
      "type": "array",
      "items": {
        "description": "claim record",
        "type": "object",
        "$ref": "claim.json"
      }
    },
    "collection": {
      "description": "whether or not this purchase order line is for a collection",
      "type": "boolean",
      "default": false
    },
    "contributors": {
      "description": "list of contributors to the material",
      "id": "contributors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "contributor.json"
      }
    },
    "cost": {
      "description": "cost record",
      "type": "object",
      "$ref": "cost.json"
    },
    "description": {
      "description": "description of the material",
      "type": "string"
    },
    "details": {
      "description": "details record",
      "type": "object",
      "$ref": "details.json"
    },
    "donor": {
      "description": "the donor contributing to this purchase order line",
      "type": "string"
    },
    "eresource": {
      "description": "eresource record",
      "type": "object",
      "$ref": "eresource.json"
    },
    "fundDistribution": {
      "description": "Fund distribution records for this purchase order line",
      "id": "fundDistribution",
      "type": "array",
      "items": {
        "description": "fund distribution record",
        "type": "object",
        "$ref": "fund_distribution.json"
      }
    },
    "instanceId": {
      "description": "UUID of the instance record this purchase order line is related to",
      "$ref": "../../common/schemas/uuid.json"
    },
    "isPackage": {
      "description": "Indicates that this POL is for a package",
      "type": "boolean",
      "default": false
    },
    "locations": {
      "description": "Location records for this purchase order line",
      "id": "locations",
      "type": "array",
      "items": {
        "description": "location record",
        "type": "object",
        "$ref": "location.json"
      }
    },
    "lastEDIExportDate": {
      "description": "The last date when line was exported in the EDIFACT file",
      "type": "string",
      "format": "date-time"
    },
    "orderFormat": {
      "description": "The purchase order line format",
      "type": "object",
      "$ref": "order_format.json"
    },
    "packagePoLineId": {
      "description": "UUID referencing the poLine that represents the package that this POLs title belongs to",
      "$ref": "../../common/schemas/uuid.json"
    },
    "paymentStatus": {
      "description": "The purchase order line payment status",
      "type": "string",
      "$ref": "payment_status.json"
    },
    "physical": {
      "description": "UUID of the physical (details) record",
      "type": "object",
      "$ref": "physical.json"
    },
    "poLineDescription": {
      "description": "purchase order line description",
      "type": "string"
    },
    "poLineNumber": {
      "description": "A human readable number assigned to this PO line",
      "type": "string",
      "pattern": "^[a-zA-Z0-9]{1,22}-[0-9]{1,3}$"
    },
    "publicationDate": {
      "description": "date (year) of the material's publication",
      "type": "string"
    },
    "publisher": {
      "description": "publisher of the material",
      "type": "string"
    },
    "purchaseOrderId": {
      "description": "UUID of the purchase order",
      "$ref": "../../common/schemas/uuid.json"
    },
    "receiptDate": {
      "description": "date the purchase order line was received",
      "type": [
        "null",
        "string"
      ],
      "format": "date-time"
    },
    "receiptStatus": {
      "description": "The purchase order line receipt status",
      "type": "object",
      "$ref": "receipt_status.json"
    },
    "renewalNote": {
      "description": "Renewal note for this purchase order line",
      "type": "string"
    },
    "reportingCodes": {
      "description": "a list of reporting codes associated with this purchase order line",
      "id": "reportingCodes",
      "type": "array",
      "items": {
        "description": "UUID of the reporting code",
        "$ref": "../../common/schemas/uuid.json"
      }
    },
    "requester": {
      "description": "who requested this purchase order line",
      "type": "string"
    },
    "rush": {
      "description": "whether or not this is a rush order",
      "type": "boolean",
      "default": false
    },
    "selector": {
      "description": "who selected this material",
      "type": "string"
    },
    "source": {
      "description": "the source of this purchase order line",
      "type": "object",
      "$ref": "source.json"
    },
    "tags": {
      "description": "arbitrary tags associated with this purchase order line",
      "id": "tags",
      "type": "object",
      "$ref": "../../../raml-util/schemas/tags.schema"
    },
    "titleOrPackage": {
      "description": "title of the material",
      "type": "string"
    },
    "vendorDetail": {
      "description": "Vendor detail record",
      "type": "object",
      "$ref": "vendor_detail.json"
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "orderFormat",
    "source",
    "purchaseOrderId",
    "titleOrPackage"
  ]
}
get_poLines(**kwargs)

Get list of po lines

GET /orders-storage/po-lines

Parameters

**kwargs (properties) – Keyword Arguments

Keyword Arguments
  • query (str) –

    A query expressed as a CQL string (see [dev.folio.org/reference/glossary#cql](https://dev.folio.org/reference/glossary#cql)) using valid searchable fields. The first example below shows the general form of a full CQL query, but those fields might not be relevant in this context.

    with valid searchable fields: for example code

    Example

    • (username==”ab*” or personal.firstName==”ab*” or personal.lastName==”ab*”) and active==”true” sortby personal.lastName personal.firstName barcode

    • [“code”, “MEDGRANT”, “=”]

  • totalRecords (str) –

    (default=auto) How to calculate the totalRecords property. “exact” for the correct number, “estimated” for an estimation, “auto” to automatically select “exact” or “estimated”, “none” for suppressing the totalRecords property. For details see https://github.com/folio-org/raml-module-builder#estimated-totalrecords

    Example

    • none

  • offset (int) –

    (default=0) Skip over a number of elements by specifying an offset value for the query

    Example

    • 0

  • limit (int) –

    (default=10) Limit the number of elements returned in the response

    Example

    • 10

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "collection of purchase order line records",
  "type": "object",
  "properties": {
    "poLines": {
      "description": "collection of purchase order line records",
      "type": "array",
      "id": "poLines",
      "items": {
        "type": "object",
        "$ref": "po_line.json"
      }
    },
    "totalRecords": {
      "description": "The number of objects contained in this collection",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "poLines",
    "totalRecords"
  ]
}
modify_poLine(poLinesId: str, poLine: dict)

Update poLine item with given {poLineId}

PUT /orders-storage/po-lines/{poLinesId}

Parameters
  • poLinesId (str) –

  • poLine (dict) – See Schema below

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiRequestConflict – Conflict

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "purchase order line",
  "type": "object",
  "javaName": "PoLine",
  "properties": {
    "id": {
      "description": "UUID identifying this purchase order line",
      "$ref": "../../common/schemas/uuid.json"
    },
    "edition": {
      "description": "edition of the material",
      "type": "string"
    },
    "checkinItems": {
      "description": "if true this will toggle the Check-in workflow for details associated with this PO line",
      "type": "boolean",
      "default": false
    },
    "agreementId": {
      "description": "UUID of the agreement this purchase order line is related to",
      "$ref": "../../common/schemas/uuid.json"
    },
    "acquisitionMethod": {
      "description": "UUID of the acquisition method for this purchase order line",
      "type": "string",
      "$ref": "../../common/schemas/uuid.json"
    },
    "automaticExport": {
      "description": "if true then line will be marked as available to export in the EDIFACT format or other format",
      "type": "boolean",
      "default": false
    },
    "alerts": {
      "description": "an array of alert record IDs",
      "id": "alerts",
      "type": "array",
      "items": {
        "description": "UUID of an alert record",
        "$ref": "../../common/schemas/uuid.json"
      }
    },
    "cancellationRestriction": {
      "description": "whether or not there are cancellation restrictions for this purchase order line",
      "type": "boolean"
    },
    "cancellationRestrictionNote": {
      "description": "free-form notes related to cancellation restrictions",
      "type": "string"
    },
    "claims": {
      "description": "list of claims",
      "id": "claims",
      "type": "array",
      "items": {
        "description": "claim record",
        "type": "object",
        "$ref": "claim.json"
      }
    },
    "collection": {
      "description": "whether or not this purchase order line is for a collection",
      "type": "boolean",
      "default": false
    },
    "contributors": {
      "description": "list of contributors to the material",
      "id": "contributors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "contributor.json"
      }
    },
    "cost": {
      "description": "cost record",
      "type": "object",
      "$ref": "cost.json"
    },
    "description": {
      "description": "description of the material",
      "type": "string"
    },
    "details": {
      "description": "details record",
      "type": "object",
      "$ref": "details.json"
    },
    "donor": {
      "description": "the donor contributing to this purchase order line",
      "type": "string"
    },
    "eresource": {
      "description": "eresource record",
      "type": "object",
      "$ref": "eresource.json"
    },
    "fundDistribution": {
      "description": "Fund distribution records for this purchase order line",
      "id": "fundDistribution",
      "type": "array",
      "items": {
        "description": "fund distribution record",
        "type": "object",
        "$ref": "fund_distribution.json"
      }
    },
    "instanceId": {
      "description": "UUID of the instance record this purchase order line is related to",
      "$ref": "../../common/schemas/uuid.json"
    },
    "isPackage": {
      "description": "Indicates that this POL is for a package",
      "type": "boolean",
      "default": false
    },
    "locations": {
      "description": "Location records for this purchase order line",
      "id": "locations",
      "type": "array",
      "items": {
        "description": "location record",
        "type": "object",
        "$ref": "location.json"
      }
    },
    "lastEDIExportDate": {
      "description": "The last date when line was exported in the EDIFACT file",
      "type": "string",
      "format": "date-time"
    },
    "orderFormat": {
      "description": "The purchase order line format",
      "type": "object",
      "$ref": "order_format.json"
    },
    "packagePoLineId": {
      "description": "UUID referencing the poLine that represents the package that this POLs title belongs to",
      "$ref": "../../common/schemas/uuid.json"
    },
    "paymentStatus": {
      "description": "The purchase order line payment status",
      "type": "string",
      "$ref": "payment_status.json"
    },
    "physical": {
      "description": "UUID of the physical (details) record",
      "type": "object",
      "$ref": "physical.json"
    },
    "poLineDescription": {
      "description": "purchase order line description",
      "type": "string"
    },
    "poLineNumber": {
      "description": "A human readable number assigned to this PO line",
      "type": "string",
      "pattern": "^[a-zA-Z0-9]{1,22}-[0-9]{1,3}$"
    },
    "publicationDate": {
      "description": "date (year) of the material's publication",
      "type": "string"
    },
    "publisher": {
      "description": "publisher of the material",
      "type": "string"
    },
    "purchaseOrderId": {
      "description": "UUID of the purchase order",
      "$ref": "../../common/schemas/uuid.json"
    },
    "receiptDate": {
      "description": "date the purchase order line was received",
      "type": [
        "null",
        "string"
      ],
      "format": "date-time"
    },
    "receiptStatus": {
      "description": "The purchase order line receipt status",
      "type": "object",
      "$ref": "receipt_status.json"
    },
    "renewalNote": {
      "description": "Renewal note for this purchase order line",
      "type": "string"
    },
    "reportingCodes": {
      "description": "a list of reporting codes associated with this purchase order line",
      "id": "reportingCodes",
      "type": "array",
      "items": {
        "description": "UUID of the reporting code",
        "$ref": "../../common/schemas/uuid.json"
      }
    },
    "requester": {
      "description": "who requested this purchase order line",
      "type": "string"
    },
    "rush": {
      "description": "whether or not this is a rush order",
      "type": "boolean",
      "default": false
    },
    "selector": {
      "description": "who selected this material",
      "type": "string"
    },
    "source": {
      "description": "the source of this purchase order line",
      "type": "object",
      "$ref": "source.json"
    },
    "tags": {
      "description": "arbitrary tags associated with this purchase order line",
      "id": "tags",
      "type": "object",
      "$ref": "../../../raml-util/schemas/tags.schema"
    },
    "titleOrPackage": {
      "description": "title of the material",
      "type": "string"
    },
    "vendorDetail": {
      "description": "Vendor detail record",
      "type": "object",
      "$ref": "vendor_detail.json"
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "orderFormat",
    "source",
    "purchaseOrderId",
    "titleOrPackage"
  ]
}
set_poLine(poLine: dict)

Create a new poLine item.

POST /orders-storage/po-lines

Parameters

poLine (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

Headers

  • Location - URI to the created poLine item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "purchase order line",
  "type": "object",
  "javaName": "PoLine",
  "properties": {
    "id": {
      "description": "UUID identifying this purchase order line",
      "$ref": "../../common/schemas/uuid.json"
    },
    "edition": {
      "description": "edition of the material",
      "type": "string"
    },
    "checkinItems": {
      "description": "if true this will toggle the Check-in workflow for details associated with this PO line",
      "type": "boolean",
      "default": false
    },
    "agreementId": {
      "description": "UUID of the agreement this purchase order line is related to",
      "$ref": "../../common/schemas/uuid.json"
    },
    "acquisitionMethod": {
      "description": "UUID of the acquisition method for this purchase order line",
      "type": "string",
      "$ref": "../../common/schemas/uuid.json"
    },
    "automaticExport": {
      "description": "if true then line will be marked as available to export in the EDIFACT format or other format",
      "type": "boolean",
      "default": false
    },
    "alerts": {
      "description": "an array of alert record IDs",
      "id": "alerts",
      "type": "array",
      "items": {
        "description": "UUID of an alert record",
        "$ref": "../../common/schemas/uuid.json"
      }
    },
    "cancellationRestriction": {
      "description": "whether or not there are cancellation restrictions for this purchase order line",
      "type": "boolean"
    },
    "cancellationRestrictionNote": {
      "description": "free-form notes related to cancellation restrictions",
      "type": "string"
    },
    "claims": {
      "description": "list of claims",
      "id": "claims",
      "type": "array",
      "items": {
        "description": "claim record",
        "type": "object",
        "$ref": "claim.json"
      }
    },
    "collection": {
      "description": "whether or not this purchase order line is for a collection",
      "type": "boolean",
      "default": false
    },
    "contributors": {
      "description": "list of contributors to the material",
      "id": "contributors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "contributor.json"
      }
    },
    "cost": {
      "description": "cost record",
      "type": "object",
      "$ref": "cost.json"
    },
    "description": {
      "description": "description of the material",
      "type": "string"
    },
    "details": {
      "description": "details record",
      "type": "object",
      "$ref": "details.json"
    },
    "donor": {
      "description": "the donor contributing to this purchase order line",
      "type": "string"
    },
    "eresource": {
      "description": "eresource record",
      "type": "object",
      "$ref": "eresource.json"
    },
    "fundDistribution": {
      "description": "Fund distribution records for this purchase order line",
      "id": "fundDistribution",
      "type": "array",
      "items": {
        "description": "fund distribution record",
        "type": "object",
        "$ref": "fund_distribution.json"
      }
    },
    "instanceId": {
      "description": "UUID of the instance record this purchase order line is related to",
      "$ref": "../../common/schemas/uuid.json"
    },
    "isPackage": {
      "description": "Indicates that this POL is for a package",
      "type": "boolean",
      "default": false
    },
    "locations": {
      "description": "Location records for this purchase order line",
      "id": "locations",
      "type": "array",
      "items": {
        "description": "location record",
        "type": "object",
        "$ref": "location.json"
      }
    },
    "lastEDIExportDate": {
      "description": "The last date when line was exported in the EDIFACT file",
      "type": "string",
      "format": "date-time"
    },
    "orderFormat": {
      "description": "The purchase order line format",
      "type": "object",
      "$ref": "order_format.json"
    },
    "packagePoLineId": {
      "description": "UUID referencing the poLine that represents the package that this POLs title belongs to",
      "$ref": "../../common/schemas/uuid.json"
    },
    "paymentStatus": {
      "description": "The purchase order line payment status",
      "type": "string",
      "$ref": "payment_status.json"
    },
    "physical": {
      "description": "UUID of the physical (details) record",
      "type": "object",
      "$ref": "physical.json"
    },
    "poLineDescription": {
      "description": "purchase order line description",
      "type": "string"
    },
    "poLineNumber": {
      "description": "A human readable number assigned to this PO line",
      "type": "string",
      "pattern": "^[a-zA-Z0-9]{1,22}-[0-9]{1,3}$"
    },
    "publicationDate": {
      "description": "date (year) of the material's publication",
      "type": "string"
    },
    "publisher": {
      "description": "publisher of the material",
      "type": "string"
    },
    "purchaseOrderId": {
      "description": "UUID of the purchase order",
      "$ref": "../../common/schemas/uuid.json"
    },
    "receiptDate": {
      "description": "date the purchase order line was received",
      "type": [
        "null",
        "string"
      ],
      "format": "date-time"
    },
    "receiptStatus": {
      "description": "The purchase order line receipt status",
      "type": "object",
      "$ref": "receipt_status.json"
    },
    "renewalNote": {
      "description": "Renewal note for this purchase order line",
      "type": "string"
    },
    "reportingCodes": {
      "description": "a list of reporting codes associated with this purchase order line",
      "id": "reportingCodes",
      "type": "array",
      "items": {
        "description": "UUID of the reporting code",
        "$ref": "../../common/schemas/uuid.json"
      }
    },
    "requester": {
      "description": "who requested this purchase order line",
      "type": "string"
    },
    "rush": {
      "description": "whether or not this is a rush order",
      "type": "boolean",
      "default": false
    },
    "selector": {
      "description": "who selected this material",
      "type": "string"
    },
    "source": {
      "description": "the source of this purchase order line",
      "type": "object",
      "$ref": "source.json"
    },
    "tags": {
      "description": "arbitrary tags associated with this purchase order line",
      "id": "tags",
      "type": "object",
      "$ref": "../../../raml-util/schemas/tags.schema"
    },
    "titleOrPackage": {
      "description": "title of the material",
      "type": "string"
    },
    "vendorDetail": {
      "description": "Vendor detail record",
      "type": "object",
      "$ref": "vendor_detail.json"
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "orderFormat",
    "source",
    "purchaseOrderId",
    "titleOrPackage"
  ]
}