Feefines (v1)

http://github.com/org/folio/mod-feesfines

Table of contents

Feefines API

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

/feefines

Collection of feefine items.

GET /feefines

Return a list of feefines

GET /feefines
Query Parameters
  • query: (string)

    A query expressed as a CQL string (see 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: (string)

    Order by field: field A, field B

  • order: (one of desc, asc - default: desc)

    Order

  • offset: (integer - default: 0 - minimum: 0 - maximum: 2147483647)

    Skip over a number of elements by specifying an offset value for the query

    Example:

    0
  • limit: (integer - default: 10 - minimum: 0 - maximum: 2147483647)

    Limit the number of elements returned in the response

    Example:

    10
  • facets: (array of string)

    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

  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Returns a list of feefine items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "feefines": {
      "type": "array",
      "id": "feefinesData",
      "items": {
        "type": "object",
        "$ref": "feefinedata.json"
      }
    },
    "totalRecords": {
      "type": "integer"
     },
    "resultInfo":{
      "$ref": "raml-util/schemas/resultInfo.schema",
      "readonly":true
    }

  },
  "required": [
    "feefines",
    "totalRecords"
  ]
}

Example:

{
  "feefines":[
    {
      "feeFineType":"overdue",
      "id":"39a14e03-c372-4659-860b-5423c970633e",
      "defaultAmount":100,
      "ownerId":"03ece16e-3fc6-4390-8511-ca7a7882c5c6"
    }
  ],
  "totalRecords":1
}

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

unable to list feefines -- malformed parameter 'query', syntax error at column 6

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to list feefines -- unauthorized

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

POST /feefines

Create a feefine

POST /feefines
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type: json

Content:

{
  "$schema" : "http://json-schema.org/draft-04/schema#",
  "title": "Fee/Fine Schema",
  "type": "object",
  "properties": {
    "feeFineType": {
      "type": "string"
    },
    "defaultAmount": {
      "type": "number"
    },
    "ownerId": {
      "type": "string"
    },
    "metadata" : {
      "type" : "object",
      "$ref" : "raml-util/schemas/metadata.schema"
    },
    "id": {
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "feeFineType",
    "ownerId"
   ]
}

Example:

{
  "feeFineType": "overdue",
  "id": "39a14e03-c372-4659-860b-5423c970633e",
  "defaultAmount": 100,
  "ownerId": "03ece16e-3fc6-4390-8511-ca7a7882c5c6"
}

Response 201

Returns a newly created item, with server-controlled fields like 'id' populated

Headers
  • Location: required (string)

    URI to the created feefine item

Body

Media type: application/json

Type: any

Example:

{
  "feeFineType": "overdue",
  "id": "39a14e03-c372-4659-860b-5423c970633e",
  "defaultAmount": 100,
  "ownerId": "03ece16e-3fc6-4390-8511-ca7a7882c5c6"
}

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to add feefine -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create feefines -- unauthorized

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

GET /feefines/{feefineId}

Get a single feefine

GET /feefines/{feefineId}
URI Parameters
  • feefineId: required (string)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Returns item with a given ID

Body

Media type: application/json

Type: json

Content:

{
  "$schema" : "http://json-schema.org/draft-04/schema#",
  "title": "Fee/Fine Schema",
  "type": "object",
  "properties": {
    "feeFineType": {
      "type": "string"
    },
    "defaultAmount": {
      "type": "number"
    },
    "ownerId": {
      "type": "string"
    },
    "metadata" : {
      "type" : "object",
      "$ref" : "raml-util/schemas/metadata.schema"
    },
    "id": {
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "feeFineType",
    "ownerId"
   ]
}

Example:

{
  "feeFineType": "overdue",
  "id": "39a14e03-c372-4659-860b-5423c970633e",
  "defaultAmount": 100,
  "ownerId": "03ece16e-3fc6-4390-8511-ca7a7882c5c6"
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"feefine not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

DELETE /feefines/{feefineId}

Delete feefine item with given {feefineId}

DELETE /feefines/{feefineId}
URI Parameters
  • feefineId: required (string)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 204

Item deleted successfully

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to delete feefine -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"feefine not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

PUT /feefines/{feefineId}

Update feefine item with given {feefineId}

PUT /feefines/{feefineId}
URI Parameters
  • feefineId: required (string)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type: json

Content:

{
  "$schema" : "http://json-schema.org/draft-04/schema#",
  "title": "Fee/Fine Schema",
  "type": "object",
  "properties": {
    "feeFineType": {
      "type": "string"
    },
    "defaultAmount": {
      "type": "number"
    },
    "ownerId": {
      "type": "string"
    },
    "metadata" : {
      "type" : "object",
      "$ref" : "raml-util/schemas/metadata.schema"
    },
    "id": {
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "feeFineType",
    "ownerId"
   ]
}

Example:

{
  "feeFineType": "overdue",
  "id": "39a14e03-c372-4659-860b-5423c970633e",
  "defaultAmount": 100,
  "ownerId": "03ece16e-3fc6-4390-8511-ca7a7882c5c6"
}

Response 204

Item successfully updated

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to update feefine -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"feefine not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator