foliolib.folio.api.feesfines.Refunds

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

Bases: foliolib.folio.FolioApi

Refunds API

This documents the API calls that can be made to query and manage feefine of the system

Parameters
  • tenant (str) – Tenant id

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

Methods

delete_refund(refundId)

Delete refund item with given {refundId}

get_refund(refundId)

Get a single refund

get_refunds(**kwargs)

Return a list of refunds

modify_refund(refundId, refund)

Update refund item with given {refundId}

set_refund(refund)

Create a refund

delete_refund(refundId: str)

Delete refund item with given {refundId}

DELETE /refunds/{refundId}

Parameters

refundId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

get_refund(refundId: str)

Get a single refund

GET /refunds/{refundId}

Parameters

refundId (str) –

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Refund Reasons schema",
  "description": "CRUD Fee/Fine Refund Reasons",
  "type": "object",
  "properties": {
    "nameReason": {
      "description": "Refund reason is required field",
      "type": "string"
    },
    "description": {
      "description": "Refund reason description",
      "type": "string"
    },
    "metadata": {
      "description": "Metadata about creation to refund reason, provided by the server",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    },
    "accountId": {
      "description": "ID of the User fine/fee account",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "id": {
      "description": "Refund reason id, UUID",
      "$ref": "raml-util/schemas/uuid.schema"
    }
  },
  "additionalProperties": false,
  "required": [
    "nameReason"
  ]
}
get_refunds(**kwargs)

Return a list of refunds

GET /refunds

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

    Example

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

    • active=true

  • orderBy (str) – Order by field: field A, field B

  • order (str (desc|asc) – ): (default=desc) Order

  • 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

  • facets (list) – facets to return in the collection result set, can be suffixed by a count of facet values to return, for example, patronGroup:10 default to top 5 facet values

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 refunds",
  "type": "object",
  "properties": {
    "refunds": {
      "description": "List of refund items",
      "type": "array",
      "id": "refundsData",
      "items": {
        "type": "object",
        "$ref": "refunddata.json"
      }
    },
    "totalRecords": {
      "type": "integer"
    },
    "resultInfo": {
      "$ref": "raml-util/schemas/resultInfo.schema",
      "readonly": true
    }
  },
  "required": [
    "refunds",
    "totalRecords"
  ]
}
modify_refund(refundId: str, refund: dict)

Update refund item with given {refundId}

PUT /refunds/{refundId}

Parameters
  • refundId (str) –

  • refund (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#",
  "title": "Refund Reasons schema",
  "description": "CRUD Fee/Fine Refund Reasons",
  "type": "object",
  "properties": {
    "nameReason": {
      "description": "Refund reason is required field",
      "type": "string"
    },
    "description": {
      "description": "Refund reason description",
      "type": "string"
    },
    "metadata": {
      "description": "Metadata about creation to refund reason, provided by the server",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    },
    "accountId": {
      "description": "ID of the User fine/fee account",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "id": {
      "description": "Refund reason id, UUID",
      "$ref": "raml-util/schemas/uuid.schema"
    }
  },
  "additionalProperties": false,
  "required": [
    "nameReason"
  ]
}
set_refund(refund: dict)

Create a refund

POST /refunds

Parameters

refund (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Headers

  • Location - URI to the created refund item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Refund Reasons schema",
  "description": "CRUD Fee/Fine Refund Reasons",
  "type": "object",
  "properties": {
    "nameReason": {
      "description": "Refund reason is required field",
      "type": "string"
    },
    "description": {
      "description": "Refund reason description",
      "type": "string"
    },
    "metadata": {
      "description": "Metadata about creation to refund reason, provided by the server",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    },
    "accountId": {
      "description": "ID of the User fine/fee account",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "id": {
      "description": "Refund reason id, UUID",
      "$ref": "raml-util/schemas/uuid.schema"
    }
  },
  "additionalProperties": false,
  "required": [
    "nameReason"
  ]
}