Transfers (v1)

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

Table of contents

Transfers API

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

/transfers

Collection of transfer items.

GET /transfers

Return a list of transfers

GET /transfers
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 transfer items

Body

Media type: application/json

Type: json

Content:

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

Example:

{
  "transfers" : [ {
    "accountName": "Payroll",
    "allowedRefundMethod": true,
    "typeUser": "Student",
    "metadata": {
      "createdDate": "2018-04-16T14:22:07Z",
      "createdByUserId": "1ad737b0-d847-11e6-bf26-cec0c932ce01",
      "createdByUsername": "diku_admin",
      "updatedDate": "2018-04-16T14:22:07Z"
    },
    "groupId": "1e20449e-e469-4c4d-9d9f-9c87a1c969d3",
    "id": "0bab56e5-1ab6-4ac2-afdf-8b2df0434371"
  }, {
    "accountName": "State Tax Office",
    "allowedRefundMethod": true,
    "typeUser": "Resident",
    "metadata": {
      "createdDate": "2018-04-16T14:22:07Z",
      "createdByUserId": "1ad737b0-d847-11e6-bf26-cec0c932ce01",
      "createdByUsername": "diku_admin",
      "updatedDate": "2018-04-16T14:22:07Z"
    },
    "groupId": "d71d5a16-822c-49de-bfa8-bc0adeda996f",
    "id": "0bab56e5-1ab6-4ac2-afdf-8b2df0434372"
  } ],
  "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 transfers -- 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 transfers -- 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 /transfers

Create a transfer

POST /transfers
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": "Transfers Schema",
  "type": "object",
  "properties": {
    "accountName": {
      "type": "string"
    },
    "allowedRefundMethod": {
      "type": "boolean"
    },
    "typeUser": {
      "type": "string"
    },
    "metadata": {
      "type": "object",
      "$ref" : "raml-util/schemas/metadata.schema"
    },
    "groupId": {
      "type": "string"
    },
    "id": {
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "id"
   ]
}

Example:

{
  "accountName": "Payroll",
  "allowedRefundMethod": true,
  "typeUser": "Student",
  "metadata": {
    "createdDate": "2018-04-16T14:22:07Z",
    "createdByUserId": "1ad737b0-d847-11e6-bf26-cec0c932ce01",
    "createdByUsername": "diku_admin",
    "updatedDate": "2018-04-16T14:22:07Z"
  },
  "groupId": "1e20449e-e469-4c4d-9d9f-9c87a1c969d3",
  "id": "0bab56e5-1ab6-4ac2-afdf-8b2df0434371"
}

Response 201

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

Headers
  • Location: required (string)

    URI to the created transfer item

Body

Media type: application/json

Type: any

Example:

{
  "accountName": "Payroll",
  "allowedRefundMethod": true,
  "typeUser": "Student",
  "metadata": {
    "createdDate": "2018-04-16T14:22:07Z",
    "createdByUserId": "1ad737b0-d847-11e6-bf26-cec0c932ce01",
    "createdByUsername": "diku_admin",
    "updatedDate": "2018-04-16T14:22:07Z"
  },
  "groupId": "1e20449e-e469-4c4d-9d9f-9c87a1c969d3",
  "id": "0bab56e5-1ab6-4ac2-afdf-8b2df0434371"
}

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

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create transfers -- 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 /transfers/{transferId}

Get a single transfer

GET /transfers/{transferId}
URI Parameters
  • transferId: 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": "Transfers Schema",
  "type": "object",
  "properties": {
    "accountName": {
      "type": "string"
    },
    "allowedRefundMethod": {
      "type": "boolean"
    },
    "typeUser": {
      "type": "string"
    },
    "metadata": {
      "type": "object",
      "$ref" : "raml-util/schemas/metadata.schema"
    },
    "groupId": {
      "type": "string"
    },
    "id": {
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "id"
   ]
}

Example:

{
  "accountName": "Payroll",
  "allowedRefundMethod": true,
  "typeUser": "Student",
  "metadata": {
    "createdDate": "2018-04-16T14:22:07Z",
    "createdByUserId": "1ad737b0-d847-11e6-bf26-cec0c932ce01",
    "createdByUsername": "diku_admin",
    "updatedDate": "2018-04-16T14:22:07Z"
  },
  "groupId": "1e20449e-e469-4c4d-9d9f-9c87a1c969d3",
  "id": "0bab56e5-1ab6-4ac2-afdf-8b2df0434371"
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"transfer 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 /transfers/{transferId}

Delete transfer item with given {transferId}

DELETE /transfers/{transferId}
URI Parameters
  • transferId: 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 transfer -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"transfer 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 /transfers/{transferId}

Update transfer item with given {transferId}

PUT /transfers/{transferId}
URI Parameters
  • transferId: 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": "Transfers Schema",
  "type": "object",
  "properties": {
    "accountName": {
      "type": "string"
    },
    "allowedRefundMethod": {
      "type": "boolean"
    },
    "typeUser": {
      "type": "string"
    },
    "metadata": {
      "type": "object",
      "$ref" : "raml-util/schemas/metadata.schema"
    },
    "groupId": {
      "type": "string"
    },
    "id": {
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "id"
   ]
}

Example:

{
  "accountName": "Payroll",
  "allowedRefundMethod": true,
  "typeUser": "Student",
  "metadata": {
    "createdDate": "2018-04-16T14:22:07Z",
    "createdByUserId": "1ad737b0-d847-11e6-bf26-cec0c932ce01",
    "createdByUsername": "diku_admin",
    "updatedDate": "2018-04-16T14:22:07Z"
  },
  "groupId": "1e20449e-e469-4c4d-9d9f-9c87a1c969d3",
  "id": "0bab56e5-1ab6-4ac2-afdf-8b2df0434371"
}

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

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

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