foliolib.folio.api.feesfines.Accounts

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

Bases: foliolib.folio.FolioApi

Accounts 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

checkPay(accountId, checkPay)

Checks if an action is allowed

checkRefund(accountId, checkRefund)

Checks if an action is allowed

checkTransfer(accountId, checkTransfer)

Checks if an action is allowed

checkWaive(accountId, checkWaive)

Checks if an action is allowed

delete_account(accountId)

Delete account item with given {accountId}

get_account(accountId)

Get a single account

get_accounts(**kwargs)

Return a list of accounts

modify_account(accountId, account)

Update account item with given {accountId}

pay(accountId, pay)

Perform action

refund(accountId, refund)

Perform action

set_account(account)

Create an account

set_cancel(accountId, cancel)

Perform action

transfer(accountId, transfer)

Perform action

waive(accountId, waive)

Perform action

checkPay(accountId: str, checkPay: dict)

Checks if an action is allowed

POST /accounts/{accountId}/check-pay

Parameters
  • accountId (str) –

  • checkPay (dict) – See Schema below

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Accounts check request",
  "type": "object",
  "properties": {
    "amount": {
      "type": "string",
      "description": "Action amount to be validated"
    }
  },
  "additionalProperties": false,
  "required": [
    "amount"
  ]
}
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Accounts check response",
  "type": "object",
  "properties": {
    "accountId": {
      "type": "string",
      "description": "ID of users fine/fee account",
      "$ref": "../raml-util/schemas/uuid.schema"
    },
    "amount": {
      "type": "string",
      "description": "Amount that validation was requested for"
    },
    "allowed": {
      "type": "boolean",
      "description": "Flag which indicates if validation is successful"
    },
    "remainingAmount": {
      "type": "string",
      "description": "Amount of fee/fine that will remain if the action is performed"
    },
    "errorMessage": {
      "type": "string",
      "description": "Error message which describes why validation failed"
    }
  },
  "additionalProperties": false,
  "required": [
    "accountId",
    "amount",
    "allowed"
  ]
}
checkRefund(accountId: str, checkRefund: dict)

Checks if an action is allowed

POST /accounts/{accountId}/check-refund

Parameters
  • accountId (str) –

  • checkRefund (dict) – See Schema below

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Accounts check request",
  "type": "object",
  "properties": {
    "amount": {
      "type": "string",
      "description": "Action amount to be validated"
    }
  },
  "additionalProperties": false,
  "required": [
    "amount"
  ]
}
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Accounts check response",
  "type": "object",
  "properties": {
    "accountId": {
      "type": "string",
      "description": "ID of users fine/fee account",
      "$ref": "../raml-util/schemas/uuid.schema"
    },
    "amount": {
      "type": "string",
      "description": "Amount that validation was requested for"
    },
    "allowed": {
      "type": "boolean",
      "description": "Flag which indicates if validation is successful"
    },
    "remainingAmount": {
      "type": "string",
      "description": "Amount of fee/fine that will remain if the action is performed"
    },
    "errorMessage": {
      "type": "string",
      "description": "Error message which describes why validation failed"
    }
  },
  "additionalProperties": false,
  "required": [
    "accountId",
    "amount",
    "allowed"
  ]
}
checkTransfer(accountId: str, checkTransfer: dict)

Checks if an action is allowed

POST /accounts/{accountId}/check-transfer

Parameters
  • accountId (str) –

  • checkTransfer (dict) – See Schema below

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Accounts check request",
  "type": "object",
  "properties": {
    "amount": {
      "type": "string",
      "description": "Action amount to be validated"
    }
  },
  "additionalProperties": false,
  "required": [
    "amount"
  ]
}
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Accounts check response",
  "type": "object",
  "properties": {
    "accountId": {
      "type": "string",
      "description": "ID of users fine/fee account",
      "$ref": "../raml-util/schemas/uuid.schema"
    },
    "amount": {
      "type": "string",
      "description": "Amount that validation was requested for"
    },
    "allowed": {
      "type": "boolean",
      "description": "Flag which indicates if validation is successful"
    },
    "remainingAmount": {
      "type": "string",
      "description": "Amount of fee/fine that will remain if the action is performed"
    },
    "errorMessage": {
      "type": "string",
      "description": "Error message which describes why validation failed"
    }
  },
  "additionalProperties": false,
  "required": [
    "accountId",
    "amount",
    "allowed"
  ]
}
checkWaive(accountId: str, checkWaive: dict)

Checks if an action is allowed

POST /accounts/{accountId}/check-waive

Parameters
  • accountId (str) –

  • checkWaive (dict) – See Schema below

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Accounts check request",
  "type": "object",
  "properties": {
    "amount": {
      "type": "string",
      "description": "Action amount to be validated"
    }
  },
  "additionalProperties": false,
  "required": [
    "amount"
  ]
}
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Accounts check response",
  "type": "object",
  "properties": {
    "accountId": {
      "type": "string",
      "description": "ID of users fine/fee account",
      "$ref": "../raml-util/schemas/uuid.schema"
    },
    "amount": {
      "type": "string",
      "description": "Amount that validation was requested for"
    },
    "allowed": {
      "type": "boolean",
      "description": "Flag which indicates if validation is successful"
    },
    "remainingAmount": {
      "type": "string",
      "description": "Amount of fee/fine that will remain if the action is performed"
    },
    "errorMessage": {
      "type": "string",
      "description": "Error message which describes why validation failed"
    }
  },
  "additionalProperties": false,
  "required": [
    "accountId",
    "amount",
    "allowed"
  ]
}
delete_account(accountId: str)

Delete account item with given {accountId}

DELETE /accounts/{accountId}

Parameters

accountId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

get_account(accountId: str)

Get a single account

GET /accounts/{accountId}

Parameters

accountId (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": "Account schema",
  "description": "User fines/fees account",
  "type": "object",
  "properties": {
    "amount": {
      "description": "Amount of the fine/fee",
      "javaType": "org.folio.rest.domain.MonetaryValue",
      "type": "number"
    },
    "remaining": {
      "description": "Remaining of the fine/fee",
      "javaType": "org.folio.rest.domain.MonetaryValue",
      "type": "number"
    },
    "dateCreated": {
      "description": "Date and time the account of the fine/fee was created",
      "type": "string",
      "format": "date-time"
    },
    "dateUpdated": {
      "description": "Date and time the account of the fine/fee was updated",
      "type": "string",
      "format": "date-time"
    },
    "status": {
      "description": "Overall status of the fee/fine",
      "type": "object",
      "properties": {
        "name": {
          "description": "Name of the status (values used are Open and Closed)",
          "type": "string"
        }
      },
      "required": [
        "name"
      ]
    },
    "paymentStatus": {
      "description": "Overall status of the payment/waive/transfer/refund/cancel",
      "type": "object",
      "properties": {
        "name": {
          "description": "Name of the status",
          "enum": [
            "Outstanding",
            "Paid partially",
            "Paid fully",
            "Waived partially",
            "Waived fully",
            "Transferred partially",
            "Transferred fully",
            "Refunded partially",
            "Refunded fully",
            "Credited fully",
            "Credited partially",
            "Cancelled item returned",
            "Cancelled item renewed",
            "Cancelled item declared lost",
            "Cancelled as error",
            "Suspended claim returned"
          ],
          "type": "string"
        }
      },
      "required": [
        "name"
      ]
    },
    "feeFineType": {
      "description": "Fee/fine that is up to the desecration of the user",
      "type": "string"
    },
    "feeFineOwner": {
      "description": "Owner of the fee/fine defined by the library and is associated with specific fees/fines",
      "type": "string"
    },
    "title": {
      "description": "The title associated with the item",
      "type": "string"
    },
    "callNumber": {
      "description": "Identifier (Call number) assigned to an item",
      "type": "string"
    },
    "barcode": {
      "description": "Text, with input likely validated by the barcode scanner",
      "type": "string"
    },
    "materialType": {
      "description": "Material type what define what type of thing the item is",
      "type": "string"
    },
    "itemStatus": {
      "description": "The status of the item",
      "type": "object",
      "properties": {
        "name": {
          "description": "Name of the item state",
          "type": "string"
        }
      },
      "required": [
        "name"
      ]
    },
    "location": {
      "description": "Effective location is used to know the current home location for the item",
      "type": "string"
    },
    "metadata": {
      "description": "Metadata about creation to user fine/fee account, provided by the server",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    },
    "dueDate": {
      "description": "Date time when the item is due to be returned",
      "type": "string",
      "format": "date-time"
    },
    "returnedDate": {
      "description": "Date time when the item is returned and the loan ends, if the user does not have a loan associated, hyphen (-) is added as default",
      "type": "string",
      "format": "date-time"
    },
    "loanId": {
      "description": "ID of the loan",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "userId": {
      "description": "ID of the user",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "itemId": {
      "description": "ID of the item",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "materialTypeId": {
      "description": "ID of the materialType",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "feeFineId": {
      "description": "ID of the fee/fine",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "ownerId": {
      "description": "ID of the owner",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "id": {
      "description": "User fine/fee account id, UUID",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "holdingsRecordId": {
      "description": "Item field: item.holdingsRecordId",
      "$ref": "raml-util/schemas/uuid.schema",
      "readonly": true
    },
    "instanceId": {
      "description": "Holdings record field: holdingsRecord.instanceId",
      "$ref": "raml-util/schemas/uuid.schema",
      "readonly": true
    },
    "contributors": {
      "type": "array",
      "description": "List of contributors",
      "minItems": 0,
      "items": {
        "javaType": "org.folio.rest.jaxrs.model.ContributorData",
        "properties": {
          "name": {
            "type": "string",
            "description": "Personal name, corporate name, meeting name"
          }
        },
        "additionalProperties": false,
        "required": [
          "name"
        ]
      }
    },
    "loanPolicyId": {
      "description": "Loan policy ID",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "overdueFinePolicyId": {
      "description": "Overdue fine policy ID",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "lostItemFeePolicyId": {
      "description": "Lost item fee policy ID",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "processId": {
      "description": "Randomly generated UUID added to fees/fines created in scope of the same process (e.g. same check-in or same scheduled Lost Item Fee generation job run)",
      "$ref": "raml-util/schemas/uuid.schema"
    }
  },
  "additionalProperties": false,
  "required": [
    "amount",
    "remaining",
    "paymentStatus",
    "userId",
    "feeFineId",
    "ownerId",
    "id"
  ]
}
get_accounts(**kwargs)

Return a list of accounts

GET /accounts

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 accounts",
  "type": "object",
  "properties": {
    "accounts": {
      "description": "List of account items",
      "type": "array",
      "id": "accountsData",
      "items": {
        "type": "object",
        "$ref": "accountdata.json"
      }
    },
    "totalRecords": {
      "type": "integer"
    },
    "resultInfo": {
      "$ref": "raml-util/schemas/resultInfo.schema",
      "readonly": true
    }
  },
  "required": [
    "accounts",
    "totalRecords"
  ]
}
modify_account(accountId: str, account: dict)

Update account item with given {accountId}

PUT /accounts/{accountId}

Parameters
  • accountId (str) –

  • account (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": "Account schema",
  "description": "User fines/fees account",
  "type": "object",
  "properties": {
    "amount": {
      "description": "Amount of the fine/fee",
      "javaType": "org.folio.rest.domain.MonetaryValue",
      "type": "number"
    },
    "remaining": {
      "description": "Remaining of the fine/fee",
      "javaType": "org.folio.rest.domain.MonetaryValue",
      "type": "number"
    },
    "dateCreated": {
      "description": "Date and time the account of the fine/fee was created",
      "type": "string",
      "format": "date-time"
    },
    "dateUpdated": {
      "description": "Date and time the account of the fine/fee was updated",
      "type": "string",
      "format": "date-time"
    },
    "status": {
      "description": "Overall status of the fee/fine",
      "type": "object",
      "properties": {
        "name": {
          "description": "Name of the status (values used are Open and Closed)",
          "type": "string"
        }
      },
      "required": [
        "name"
      ]
    },
    "paymentStatus": {
      "description": "Overall status of the payment/waive/transfer/refund/cancel",
      "type": "object",
      "properties": {
        "name": {
          "description": "Name of the status",
          "enum": [
            "Outstanding",
            "Paid partially",
            "Paid fully",
            "Waived partially",
            "Waived fully",
            "Transferred partially",
            "Transferred fully",
            "Refunded partially",
            "Refunded fully",
            "Credited fully",
            "Credited partially",
            "Cancelled item returned",
            "Cancelled item renewed",
            "Cancelled item declared lost",
            "Cancelled as error",
            "Suspended claim returned"
          ],
          "type": "string"
        }
      },
      "required": [
        "name"
      ]
    },
    "feeFineType": {
      "description": "Fee/fine that is up to the desecration of the user",
      "type": "string"
    },
    "feeFineOwner": {
      "description": "Owner of the fee/fine defined by the library and is associated with specific fees/fines",
      "type": "string"
    },
    "title": {
      "description": "The title associated with the item",
      "type": "string"
    },
    "callNumber": {
      "description": "Identifier (Call number) assigned to an item",
      "type": "string"
    },
    "barcode": {
      "description": "Text, with input likely validated by the barcode scanner",
      "type": "string"
    },
    "materialType": {
      "description": "Material type what define what type of thing the item is",
      "type": "string"
    },
    "itemStatus": {
      "description": "The status of the item",
      "type": "object",
      "properties": {
        "name": {
          "description": "Name of the item state",
          "type": "string"
        }
      },
      "required": [
        "name"
      ]
    },
    "location": {
      "description": "Effective location is used to know the current home location for the item",
      "type": "string"
    },
    "metadata": {
      "description": "Metadata about creation to user fine/fee account, provided by the server",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    },
    "dueDate": {
      "description": "Date time when the item is due to be returned",
      "type": "string",
      "format": "date-time"
    },
    "returnedDate": {
      "description": "Date time when the item is returned and the loan ends, if the user does not have a loan associated, hyphen (-) is added as default",
      "type": "string",
      "format": "date-time"
    },
    "loanId": {
      "description": "ID of the loan",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "userId": {
      "description": "ID of the user",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "itemId": {
      "description": "ID of the item",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "materialTypeId": {
      "description": "ID of the materialType",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "feeFineId": {
      "description": "ID of the fee/fine",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "ownerId": {
      "description": "ID of the owner",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "id": {
      "description": "User fine/fee account id, UUID",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "holdingsRecordId": {
      "description": "Item field: item.holdingsRecordId",
      "$ref": "raml-util/schemas/uuid.schema",
      "readonly": true
    },
    "instanceId": {
      "description": "Holdings record field: holdingsRecord.instanceId",
      "$ref": "raml-util/schemas/uuid.schema",
      "readonly": true
    },
    "contributors": {
      "type": "array",
      "description": "List of contributors",
      "minItems": 0,
      "items": {
        "javaType": "org.folio.rest.jaxrs.model.ContributorData",
        "properties": {
          "name": {
            "type": "string",
            "description": "Personal name, corporate name, meeting name"
          }
        },
        "additionalProperties": false,
        "required": [
          "name"
        ]
      }
    },
    "loanPolicyId": {
      "description": "Loan policy ID",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "overdueFinePolicyId": {
      "description": "Overdue fine policy ID",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "lostItemFeePolicyId": {
      "description": "Lost item fee policy ID",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "processId": {
      "description": "Randomly generated UUID added to fees/fines created in scope of the same process (e.g. same check-in or same scheduled Lost Item Fee generation job run)",
      "$ref": "raml-util/schemas/uuid.schema"
    }
  },
  "additionalProperties": false,
  "required": [
    "amount",
    "remaining",
    "paymentStatus",
    "userId",
    "feeFineId",
    "ownerId",
    "id"
  ]
}
pay(accountId: str, pay: dict)

Perform action

POST /accounts/{accountId}/pay

Parameters
  • accountId (str) –

  • pay (dict) – See Schema below

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

  • OkapiFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Default action request",
  "type": "object",
  "properties": {
    "amount": {
      "type": "string",
      "description": "Action amount"
    },
    "comments": {
      "type": "string",
      "description": "Additional info for staff or patron. Format: [STAFF : staff comment \n PATRON : patron comment]"
    },
    "transactionInfo": {
      "type": "string",
      "description": "Additional transaction information, e.g. check number"
    },
    "notifyPatron": {
      "type": "boolean",
      "description": "Should send patron notification or not"
    },
    "servicePointId": {
      "type": "string",
      "$ref": "../raml-util/schemas/uuid.schema",
      "description": "Unique ID of the service point where the payment was made"
    },
    "userName": {
      "type": "string",
      "description": "Name of the user that was logged in when the action was performed"
    },
    "paymentMethod": {
      "type": "string",
      "description": "Name of the payment method, e.g. `Cash` or `Credit card`"
    }
  },
  "additionalProperties": false,
  "required": [
    "amount",
    "notifyPatron",
    "servicePointId",
    "userName",
    "paymentMethod"
  ]
}
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Action response",
  "type": "object",
  "properties": {
    "accountId": {
      "type": "string",
      "description": "Unique ID of the account",
      "$ref": "../raml-util/schemas/uuid.schema"
    },
    "amount": {
      "type": "string",
      "description": "Action amount"
    },
    "remainingAmount": {
      "type": "string",
      "description": "Remaining fee/fine amount after action"
    },
    "feefineactions": {
      "type": "array",
      "description": "Fee/fine action records created as a result of an action",
      "items": {
        "type": "object",
        "$ref": "../feefineactiondata.json"
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "accountId",
    "amount",
    "remainingAmount"
  ]
}
refund(accountId: str, refund: dict)

Perform action

POST /accounts/{accountId}/refund

Parameters
  • accountId (str) –

  • refund (dict) – See Schema below

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

  • OkapiFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Default action request",
  "type": "object",
  "properties": {
    "amount": {
      "type": "string",
      "description": "Action amount"
    },
    "comments": {
      "type": "string",
      "description": "Additional info for staff or patron. Format: [STAFF : staff comment \n PATRON : patron comment]"
    },
    "transactionInfo": {
      "type": "string",
      "description": "Additional transaction information, e.g. check number"
    },
    "notifyPatron": {
      "type": "boolean",
      "description": "Should send patron notification or not"
    },
    "servicePointId": {
      "type": "string",
      "$ref": "../raml-util/schemas/uuid.schema",
      "description": "Unique ID of the service point where the payment was made"
    },
    "userName": {
      "type": "string",
      "description": "Name of the user that was logged in when the action was performed"
    },
    "paymentMethod": {
      "type": "string",
      "description": "Name of the payment method, e.g. `Cash` or `Credit card`"
    }
  },
  "additionalProperties": false,
  "required": [
    "amount",
    "notifyPatron",
    "servicePointId",
    "userName",
    "paymentMethod"
  ]
}
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Action response",
  "type": "object",
  "properties": {
    "accountId": {
      "type": "string",
      "description": "Unique ID of the account",
      "$ref": "../raml-util/schemas/uuid.schema"
    },
    "amount": {
      "type": "string",
      "description": "Action amount"
    },
    "remainingAmount": {
      "type": "string",
      "description": "Remaining fee/fine amount after action"
    },
    "feefineactions": {
      "type": "array",
      "description": "Fee/fine action records created as a result of an action",
      "items": {
        "type": "object",
        "$ref": "../feefineactiondata.json"
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "accountId",
    "amount",
    "remainingAmount"
  ]
}
set_account(account: dict)

Create an account

POST /accounts

Parameters

account (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Headers

  • Location - URI to the created account item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Account schema",
  "description": "User fines/fees account",
  "type": "object",
  "properties": {
    "amount": {
      "description": "Amount of the fine/fee",
      "javaType": "org.folio.rest.domain.MonetaryValue",
      "type": "number"
    },
    "remaining": {
      "description": "Remaining of the fine/fee",
      "javaType": "org.folio.rest.domain.MonetaryValue",
      "type": "number"
    },
    "dateCreated": {
      "description": "Date and time the account of the fine/fee was created",
      "type": "string",
      "format": "date-time"
    },
    "dateUpdated": {
      "description": "Date and time the account of the fine/fee was updated",
      "type": "string",
      "format": "date-time"
    },
    "status": {
      "description": "Overall status of the fee/fine",
      "type": "object",
      "properties": {
        "name": {
          "description": "Name of the status (values used are Open and Closed)",
          "type": "string"
        }
      },
      "required": [
        "name"
      ]
    },
    "paymentStatus": {
      "description": "Overall status of the payment/waive/transfer/refund/cancel",
      "type": "object",
      "properties": {
        "name": {
          "description": "Name of the status",
          "enum": [
            "Outstanding",
            "Paid partially",
            "Paid fully",
            "Waived partially",
            "Waived fully",
            "Transferred partially",
            "Transferred fully",
            "Refunded partially",
            "Refunded fully",
            "Credited fully",
            "Credited partially",
            "Cancelled item returned",
            "Cancelled item renewed",
            "Cancelled item declared lost",
            "Cancelled as error",
            "Suspended claim returned"
          ],
          "type": "string"
        }
      },
      "required": [
        "name"
      ]
    },
    "feeFineType": {
      "description": "Fee/fine that is up to the desecration of the user",
      "type": "string"
    },
    "feeFineOwner": {
      "description": "Owner of the fee/fine defined by the library and is associated with specific fees/fines",
      "type": "string"
    },
    "title": {
      "description": "The title associated with the item",
      "type": "string"
    },
    "callNumber": {
      "description": "Identifier (Call number) assigned to an item",
      "type": "string"
    },
    "barcode": {
      "description": "Text, with input likely validated by the barcode scanner",
      "type": "string"
    },
    "materialType": {
      "description": "Material type what define what type of thing the item is",
      "type": "string"
    },
    "itemStatus": {
      "description": "The status of the item",
      "type": "object",
      "properties": {
        "name": {
          "description": "Name of the item state",
          "type": "string"
        }
      },
      "required": [
        "name"
      ]
    },
    "location": {
      "description": "Effective location is used to know the current home location for the item",
      "type": "string"
    },
    "metadata": {
      "description": "Metadata about creation to user fine/fee account, provided by the server",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    },
    "dueDate": {
      "description": "Date time when the item is due to be returned",
      "type": "string",
      "format": "date-time"
    },
    "returnedDate": {
      "description": "Date time when the item is returned and the loan ends, if the user does not have a loan associated, hyphen (-) is added as default",
      "type": "string",
      "format": "date-time"
    },
    "loanId": {
      "description": "ID of the loan",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "userId": {
      "description": "ID of the user",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "itemId": {
      "description": "ID of the item",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "materialTypeId": {
      "description": "ID of the materialType",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "feeFineId": {
      "description": "ID of the fee/fine",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "ownerId": {
      "description": "ID of the owner",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "id": {
      "description": "User fine/fee account id, UUID",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "holdingsRecordId": {
      "description": "Item field: item.holdingsRecordId",
      "$ref": "raml-util/schemas/uuid.schema",
      "readonly": true
    },
    "instanceId": {
      "description": "Holdings record field: holdingsRecord.instanceId",
      "$ref": "raml-util/schemas/uuid.schema",
      "readonly": true
    },
    "contributors": {
      "type": "array",
      "description": "List of contributors",
      "minItems": 0,
      "items": {
        "javaType": "org.folio.rest.jaxrs.model.ContributorData",
        "properties": {
          "name": {
            "type": "string",
            "description": "Personal name, corporate name, meeting name"
          }
        },
        "additionalProperties": false,
        "required": [
          "name"
        ]
      }
    },
    "loanPolicyId": {
      "description": "Loan policy ID",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "overdueFinePolicyId": {
      "description": "Overdue fine policy ID",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "lostItemFeePolicyId": {
      "description": "Lost item fee policy ID",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "processId": {
      "description": "Randomly generated UUID added to fees/fines created in scope of the same process (e.g. same check-in or same scheduled Lost Item Fee generation job run)",
      "$ref": "raml-util/schemas/uuid.schema"
    }
  },
  "additionalProperties": false,
  "required": [
    "amount",
    "remaining",
    "paymentStatus",
    "userId",
    "feeFineId",
    "ownerId",
    "id"
  ]
}
set_cancel(accountId: str, cancel: dict)

Perform action

POST /accounts/{accountId}/cancel

Parameters
  • accountId (str) –

  • cancel (dict) – See Schema below

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

  • OkapiFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Cancel action request",
  "type": "object",
  "properties": {
    "comments": {
      "type": "string",
      "description": "Additional info for staff or patron. Format: [STAFF : staff comment \n PATRON : patron comment]"
    },
    "notifyPatron": {
      "type": "boolean",
      "description": "Should send patron notification or not"
    },
    "servicePointId": {
      "type": "string",
      "$ref": "../raml-util/schemas/uuid.schema",
      "description": "Unique ID of the service point where the payment was made"
    },
    "userName": {
      "type": "string",
      "description": "Name of the user that was logged in when the action was performed"
    },
    "cancellationReason": {
      "type": "string",
      "description": "Reason for cancellation",
      "default": "Cancelled as error"
    }
  },
  "additionalProperties": false,
  "required": [
    "notifyPatron",
    "servicePointId",
    "userName"
  ]
}
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Action response",
  "type": "object",
  "properties": {
    "accountId": {
      "type": "string",
      "description": "Unique ID of the account",
      "$ref": "../raml-util/schemas/uuid.schema"
    },
    "amount": {
      "type": "string",
      "description": "Action amount"
    },
    "remainingAmount": {
      "type": "string",
      "description": "Remaining fee/fine amount after action"
    },
    "feefineactions": {
      "type": "array",
      "description": "Fee/fine action records created as a result of an action",
      "items": {
        "type": "object",
        "$ref": "../feefineactiondata.json"
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "accountId",
    "amount",
    "remainingAmount"
  ]
}
transfer(accountId: str, transfer: dict)

Perform action

POST /accounts/{accountId}/transfer

Parameters
  • accountId (str) –

  • transfer (dict) – See Schema below

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

  • OkapiFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Default action request",
  "type": "object",
  "properties": {
    "amount": {
      "type": "string",
      "description": "Action amount"
    },
    "comments": {
      "type": "string",
      "description": "Additional info for staff or patron. Format: [STAFF : staff comment \n PATRON : patron comment]"
    },
    "transactionInfo": {
      "type": "string",
      "description": "Additional transaction information, e.g. check number"
    },
    "notifyPatron": {
      "type": "boolean",
      "description": "Should send patron notification or not"
    },
    "servicePointId": {
      "type": "string",
      "$ref": "../raml-util/schemas/uuid.schema",
      "description": "Unique ID of the service point where the payment was made"
    },
    "userName": {
      "type": "string",
      "description": "Name of the user that was logged in when the action was performed"
    },
    "paymentMethod": {
      "type": "string",
      "description": "Name of the payment method, e.g. `Cash` or `Credit card`"
    }
  },
  "additionalProperties": false,
  "required": [
    "amount",
    "notifyPatron",
    "servicePointId",
    "userName",
    "paymentMethod"
  ]
}
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Action response",
  "type": "object",
  "properties": {
    "accountId": {
      "type": "string",
      "description": "Unique ID of the account",
      "$ref": "../raml-util/schemas/uuid.schema"
    },
    "amount": {
      "type": "string",
      "description": "Action amount"
    },
    "remainingAmount": {
      "type": "string",
      "description": "Remaining fee/fine amount after action"
    },
    "feefineactions": {
      "type": "array",
      "description": "Fee/fine action records created as a result of an action",
      "items": {
        "type": "object",
        "$ref": "../feefineactiondata.json"
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "accountId",
    "amount",
    "remainingAmount"
  ]
}
waive(accountId: str, waive: dict)

Perform action

POST /accounts/{accountId}/waive

Parameters
  • accountId (str) –

  • waive (dict) – See Schema below

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

  • OkapiFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Default action request",
  "type": "object",
  "properties": {
    "amount": {
      "type": "string",
      "description": "Action amount"
    },
    "comments": {
      "type": "string",
      "description": "Additional info for staff or patron. Format: [STAFF : staff comment \n PATRON : patron comment]"
    },
    "transactionInfo": {
      "type": "string",
      "description": "Additional transaction information, e.g. check number"
    },
    "notifyPatron": {
      "type": "boolean",
      "description": "Should send patron notification or not"
    },
    "servicePointId": {
      "type": "string",
      "$ref": "../raml-util/schemas/uuid.schema",
      "description": "Unique ID of the service point where the payment was made"
    },
    "userName": {
      "type": "string",
      "description": "Name of the user that was logged in when the action was performed"
    },
    "paymentMethod": {
      "type": "string",
      "description": "Name of the payment method, e.g. `Cash` or `Credit card`"
    }
  },
  "additionalProperties": false,
  "required": [
    "amount",
    "notifyPatron",
    "servicePointId",
    "userName",
    "paymentMethod"
  ]
}
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Action response",
  "type": "object",
  "properties": {
    "accountId": {
      "type": "string",
      "description": "Unique ID of the account",
      "$ref": "../raml-util/schemas/uuid.schema"
    },
    "amount": {
      "type": "string",
      "description": "Action amount"
    },
    "remainingAmount": {
      "type": "string",
      "description": "Remaining fee/fine amount after action"
    },
    "feefineactions": {
      "type": "array",
      "description": "Fee/fine action records created as a result of an action",
      "items": {
        "type": "object",
        "$ref": "../feefineactiondata.json"
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "accountId",
    "amount",
    "remainingAmount"
  ]
}