foliolib.folio.api.ordersStorage.OrderInvoiceRelns

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

Bases: foliolib.folio.FolioApi

Order relationship

CRUD APIs used to manage relationship between order and invoice.

Parameters
  • tenant (str) – Tenant id

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

Methods

delete_orderInvoiceReln(orderInvoiceRelnsId)

Delete orderInvoiceReln item with given {orderInvoiceRelnId}

get_orderInvoiceReln(orderInvoiceRelnsId)

Retrieve orderInvoiceReln item with given {orderInvoiceRelnId}

get_orderInvoiceRelns(**kwargs)

Get list of relationships

modify_orderInvoiceReln(orderInvoiceRelnsId, ...)

Update orderInvoiceReln item with given {orderInvoiceRelnId}

set_orderInvoiceReln(orderInvoiceReln)

Create a new orderInvoiceReln item.

delete_orderInvoiceReln(orderInvoiceRelnsId: str)

Delete orderInvoiceReln item with given {orderInvoiceRelnId}

DELETE /orders-storage/order-invoice-relns/{orderInvoiceRelnsId}

Parameters

orderInvoiceRelnsId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

get_orderInvoiceReln(orderInvoiceRelnsId: str)

Retrieve orderInvoiceReln item with given {orderInvoiceRelnId}

GET /orders-storage/order-invoice-relns/{orderInvoiceRelnsId}

Parameters

orderInvoiceRelnsId (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": "Relationship between order and invoice",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this relationship record",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "purchaseOrderId": {
      "description": "Purchase order id",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "invoiceId": {
      "description": "Invoice id",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    }
  },
  "additionalProperties": false,
  "required": [
    "purchaseOrderId",
    "invoiceId"
  ]
}
get_orderInvoiceRelns(**kwargs)

Get list of relationships

GET /orders-storage/order-invoice-relns

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 purchaseOrderId

    Example

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

    • [“purchaseOrderId”, “55b97a4a-6601-4488-84e1-8b0d47a3f523”]

  • 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 relationship between invoice and order",
  "type": "object",
  "properties": {
    "orderInvoiceRelationships": {
      "description": "Collection of relationship",
      "type": "array",
      "id": "order_invoice_relationship",
      "items": {
        "type": "object",
        "$ref": "order_invoice_relationship.json"
      }
    },
    "totalRecords": {
      "description": "The number of objects contained in this collection",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "orderInvoiceRelationships",
    "totalRecords"
  ]
}
modify_orderInvoiceReln(orderInvoiceRelnsId: str, orderInvoiceReln: dict)

Update orderInvoiceReln item with given {orderInvoiceRelnId}

PUT /orders-storage/order-invoice-relns/{orderInvoiceRelnsId}

Parameters
  • orderInvoiceRelnsId (str) –

  • orderInvoiceReln (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": "Relationship between order and invoice",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this relationship record",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "purchaseOrderId": {
      "description": "Purchase order id",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "invoiceId": {
      "description": "Invoice id",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    }
  },
  "additionalProperties": false,
  "required": [
    "purchaseOrderId",
    "invoiceId"
  ]
}
set_orderInvoiceReln(orderInvoiceReln: dict)

Create a new orderInvoiceReln item.

POST /orders-storage/order-invoice-relns

Parameters

orderInvoiceReln (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

Headers

  • Location - URI to the created orderInvoiceReln item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Relationship between order and invoice",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this relationship record",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "purchaseOrderId": {
      "description": "Purchase order id",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "invoiceId": {
      "description": "Invoice id",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    }
  },
  "additionalProperties": false,
  "required": [
    "purchaseOrderId",
    "invoiceId"
  ]
}