foliolib.folio.api.feesfines.Payments

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

Bases: foliolib.folio.FolioApi

Payments 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_payment(paymentId)

Delete payment item with given {paymentId}

get_payment(paymentId)

Get a single payment

get_payments(**kwargs)

Return a list of payments

modify_payment(paymentId, payment)

Update payment item with given {paymentId}

set_payment(payment)

Create a payment

delete_payment(paymentId: str)

Delete payment item with given {paymentId}

DELETE /payments/{paymentId}

Parameters

paymentId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

get_payment(paymentId: str)

Get a single payment

GET /payments/{paymentId}

Parameters

paymentId (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": "CRUD Payments Methods Settings schema",
  "description": "CRUD Fee/Fine Payment Methods Settings",
  "type": "object",
  "properties": {
    "nameMethod": {
      "description": "Payment method name",
      "type": "string"
    },
    "allowedRefundMethod": {
      "description": "A flag to determine if refund method is allowed default at 'Yes'",
      "type": "boolean"
    },
    "metadata": {
      "description": "Metadata about creation to payment method, provided by the server",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    },
    "ownerId": {
      "description": "ID of the owner",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "id": {
      "description": "Payment method id, UUID",
      "$ref": "raml-util/schemas/uuid.schema"
    }
  },
  "additionalProperties": false,
  "required": [
    "nameMethod"
  ]
}
get_payments(**kwargs)

Return a list of payments

GET /payments

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 payments",
  "type": "object",
  "properties": {
    "payments": {
      "description": "List of payment items",
      "type": "array",
      "id": "paymentsData",
      "items": {
        "type": "object",
        "$ref": "paymentdata.json"
      }
    },
    "totalRecords": {
      "type": "integer"
    },
    "resultInfo": {
      "$ref": "raml-util/schemas/resultInfo.schema",
      "readonly": true
    }
  },
  "required": [
    "payments",
    "totalRecords"
  ]
}
modify_payment(paymentId: str, payment: dict)

Update payment item with given {paymentId}

PUT /payments/{paymentId}

Parameters
  • paymentId (str) –

  • payment (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": "CRUD Payments Methods Settings schema",
  "description": "CRUD Fee/Fine Payment Methods Settings",
  "type": "object",
  "properties": {
    "nameMethod": {
      "description": "Payment method name",
      "type": "string"
    },
    "allowedRefundMethod": {
      "description": "A flag to determine if refund method is allowed default at 'Yes'",
      "type": "boolean"
    },
    "metadata": {
      "description": "Metadata about creation to payment method, provided by the server",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    },
    "ownerId": {
      "description": "ID of the owner",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "id": {
      "description": "Payment method id, UUID",
      "$ref": "raml-util/schemas/uuid.schema"
    }
  },
  "additionalProperties": false,
  "required": [
    "nameMethod"
  ]
}
set_payment(payment: dict)

Create a payment

POST /payments

Parameters

payment (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Headers

  • Location - URI to the created payment item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "CRUD Payments Methods Settings schema",
  "description": "CRUD Fee/Fine Payment Methods Settings",
  "type": "object",
  "properties": {
    "nameMethod": {
      "description": "Payment method name",
      "type": "string"
    },
    "allowedRefundMethod": {
      "description": "A flag to determine if refund method is allowed default at 'Yes'",
      "type": "boolean"
    },
    "metadata": {
      "description": "Metadata about creation to payment method, provided by the server",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    },
    "ownerId": {
      "description": "ID of the owner",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "id": {
      "description": "Payment method id, UUID",
      "$ref": "raml-util/schemas/uuid.schema"
    }
  },
  "additionalProperties": false,
  "required": [
    "nameMethod"
  ]
}