Waives (v1)

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

Table of contents

Waives API

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

/waives

Collection of waive items.

GET /waives

Return a list of waive

GET /waives
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 waive items

Body

Media type: application/json

Type: json

Content:

{
  "$schema":"http://json-schema.org/draft-04/schema#",
  "type":"object",
  "properties":{
    "waiver":{
      "type":"array",
      "id":"waivesData",
      "items":{
        "type":"object",
        "$ref":"waivedata.json"
      }
    },
    "totalRecords":{
      "type":"integer"
    },
    "resultInfo":{
      "$ref":"raml-util/schemas/resultInfo.schema",
      "readonly":true
    }
  },
  "required":[
    "waiver",
    "totalRecords"
  ]
}

Example:

{
  "waiver" : [ {
    "nameReason": "First time offender",
    "description": "Penalty abatement",
    "metadata": {
      "createdDate": "2018-03-19T14:22:07Z",
      "createdByUserId": "1ad737b0-d847-11e6-bf26-cec0c932ce02",
      "createdByUsername": "Doe",
      "updatedDate": "2018-03-19T14:22:07Z"
    },
    "accountId": "0bab56e5-1ab6-4ac2-afdf-8b2df0434373",
    "id": "0bab56e5-1ab6-4ac2-afdf-8b2df0434371"
  }, {
    "nameReason": "Special Circumstances",
    "description": "Financial problems",
    "metadata": {
      "createdDate": "2018-03-19T14:22:07Z",
      "createdByUserId": "1ad737b0-d847-11e6-bf26-cec0c932ce02",
      "createdByUsername": "Doe",
      "updatedDate": "2018-03-19T14:22:07Z"
    },
    "accountId": "0bab56e5-1ab6-4ac2-afdf-8b2df0434364",
    "id": "0bab56e5-1ab6-4ac2-afdf-8b2df0434374"
  } ],
  "totalRecords" : 2
}

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 waives -- 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 waives -- 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 /waives

Create a waive

POST /waives
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": "Waives Schema",
  "type": "object",
  "properties": {
    "nameReason": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "metadata": {
      "type": "object",
      "$ref" : "raml-util/schemas/metadata.schema"
    },
    "accountId": {
      "type": "string"
    },
    "id": {
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "id"
   ]
}

Example:

{
  "nameReason": "First time offender",
  "description": "Penalty abatement",
  "metadata": {
    "createdDate": "2018-03-19T14:22:07Z",
    "createdByUserId": "1ad737b0-d847-11e6-bf26-cec0c932ce02",
    "createdByUsername": "Doe",
    "updatedDate": "2018-03-19T14:22:07Z"
  },
  "accountId": "cfebe06e-d4f8-4d4e-8f5c-4d70595d74f8",
  "id": "0bab56e5-1ab6-4ac2-afdf-8b2df0434379"
}

Response 201

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

Headers
  • Location: required (string)

    URI to the created waive item

Body

Media type: application/json

Type: any

Example:

{
  "nameReason": "First time offender",
  "description": "Penalty abatement",
  "metadata": {
    "createdDate": "2018-03-19T14:22:07Z",
    "createdByUserId": "1ad737b0-d847-11e6-bf26-cec0c932ce02",
    "createdByUsername": "Doe",
    "updatedDate": "2018-03-19T14:22:07Z"
  },
  "accountId": "cfebe06e-d4f8-4d4e-8f5c-4d70595d74f8",
  "id": "0bab56e5-1ab6-4ac2-afdf-8b2df0434379"
}

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 waive -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create waives -- 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 /waives/{waiveId}

Get a single waive

GET /waives/{waiveId}
URI Parameters
  • waiveId: 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": "Waives Schema",
  "type": "object",
  "properties": {
    "nameReason": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "metadata": {
      "type": "object",
      "$ref" : "raml-util/schemas/metadata.schema"
    },
    "accountId": {
      "type": "string"
    },
    "id": {
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "id"
   ]
}

Example:

{
  "nameReason": "First time offender",
  "description": "Penalty abatement",
  "metadata": {
    "createdDate": "2018-03-19T14:22:07Z",
    "createdByUserId": "1ad737b0-d847-11e6-bf26-cec0c932ce02",
    "createdByUsername": "Doe",
    "updatedDate": "2018-03-19T14:22:07Z"
  },
  "accountId": "cfebe06e-d4f8-4d4e-8f5c-4d70595d74f8",
  "id": "0bab56e5-1ab6-4ac2-afdf-8b2df0434379"
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"waive 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 /waives/{waiveId}

Delete waive item with given {waiveId}

DELETE /waives/{waiveId}
URI Parameters
  • waiveId: 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 waive -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"waive 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 /waives/{waiveId}

Update waive item with given {waiveId}

PUT /waives/{waiveId}
URI Parameters
  • waiveId: 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": "Waives Schema",
  "type": "object",
  "properties": {
    "nameReason": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "metadata": {
      "type": "object",
      "$ref" : "raml-util/schemas/metadata.schema"
    },
    "accountId": {
      "type": "string"
    },
    "id": {
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "id"
   ]
}

Example:

{
  "nameReason": "First time offender",
  "description": "Penalty abatement",
  "metadata": {
    "createdDate": "2018-03-19T14:22:07Z",
    "createdByUserId": "1ad737b0-d847-11e6-bf26-cec0c932ce02",
    "createdByUsername": "Doe",
    "updatedDate": "2018-03-19T14:22:07Z"
  },
  "accountId": "cfebe06e-d4f8-4d4e-8f5c-4d70595d74f8",
  "id": "0bab56e5-1ab6-4ac2-afdf-8b2df0434379"
}

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 waive -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"waive 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