Fee/fine reports (v2.2)

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

Table of contents

Fee/fine reports API

This documents the API calls for loading fee/fine reports

/feefine-reports

POST /feefine-reports/refund

Return data for a refund report

POST /feefine-reports/refund
Body

Media type: application/json

Example:

{
  "startDate": "2021-01-14",
  "endDate": "2021-01-15",
  "feeFineOwners": [
    "da1b013a-0e08-4648-8da8-bd426c0435d0",
    "de65edb3-1d08-47f6-a076-66210223ee38"
  ]
}

Response 200

Body

Media type: application/json

Example:

{
  "reportData": [
    {
      "patronName": "Last, First Middle",
      "patronBarcode": "236964750970123",
      "patronId": "2a424823-588a-45ee-9441-a6384b6614b2",
      "patronGroup": "undergrad",
      "feeFineType": "test-ff-type",
      "billedAmount": "100.00",
      "dateBilled": "12/7/2020 0:13 PM",
      "paidAmount": "70.00",
      "paymentMethod": "test-payment-method",
      "transactionInfo": "test-transaction-info",
      "transferredAmount": "0.00",
      "transferAccount": "",
      "feeFineId": "4f7a5802-fc0d-4122-a3b8-4d9d6f91c922",
      "refundDate": "12/7/2020 0:14 PM",
      "refundAmount": "30.00",
      "refundAction": "Refunded partially",
      "refundReason": "test-refund-reason",
      "staffInfo": "Partial refund - info for staff",
      "itemBarcode": "90000",
      "instance": "A semantic web primer",
      "actionCompletionDate": "",
      "staffMemberName": "",
      "actionTaken": ""
    }
  ]
}

Response 422

Unprocessable entity

Body

Media type: text/plain

Type: any

Example:

Invalid startDate or endDate parameter

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "errors.schema",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "id": "error.schema",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "parameters.schema",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error

POST /feefine-reports/cash-drawer-reconciliation

Return data for a refund cash drawer reconciliation report

POST /feefine-reports/cash-drawer-reconciliation
Body

Media type: application/json

Example:

{
  "createdAt": "7c5abc9f-f3d7-4856-b8d7-6712462ca007",
  "sources": ["Source 1", "Source 2"],
  "startDate": "2020-01-01",
  "endDate": "2020-02-02"
}

Response 200

Body

Media type: application/json

Example:

{
  "reportData": [
    {
      "source": "Foo, Alice",
      "paymentMethod": "Cash",
      "paidAmount": "70.00",
      "feeFineOwner": "Main circ desk",
      "feeFineType": "Lost item fee",
      "paymentDate": "12/10/2020, 2:37 PM",
      "paymentStatus": "Paid partially",
      "transactionInfo": "",
      "additionalStaffInfo": "Patron will pay remaining balance tomorrow",
      "additionalPatronInfo": "",
      "patronId": "2a424823-588a-45ee-9441-a6384b6614b2",
      "feeFineId": "6d8d0c4c-1dbd-47f0-a55f-08b0e97e58e9"
    },
    {
      "source": "Bar, Bob",
      "paymentMethod": "Check",
      "paidAmount": "12.45",
      "feeFineOwner": "Main circ desk",
      "feeFineType": "Overdue fine",
      "paymentDate": "12/10/2020, 3:33 PM",
      "paymentStatus": "Paid fully",
      "transactionInfo": "Check #3112",
      "additionalStaffInfo": "Patron used check from parent",
      "additionalPatronInfo": "You have been assigned locker #234",
      "patronId": "2a424823-588a-45ee-9441-a6384b6614b2",
      "feeFineId": "ef02dd47-6013-4190-b96c-01e8efeb9204"
    }
  ],
  "reportStats": {
    "bySource": [
      {
        "name": "Doe, Jane",
        "totalAmount": "149.64",
        "totalCount": "4"
      },
      {
        "name": "Leary, Joanne",
        "totalAmount": "37.45",
        "totalCount": "2"
      },
      {
        "name": "Mistlebauer, Holly",
        "totalAmount": "75.00",
        "totalCount": "2"
      },
      {
        "name": "Source totals",
        "totalAmount": "262.09",
        "totalCount": "8"
      }
    ],
    "byPaymentMethod": [
      {
        "name": "Cash",
        "totalAmount": "83.32",
        "totalCount": "9"
      },
      {
        "name": "Check",
        "totalAmount": "37.45",
        "totalCount": "9"
      },
      {
        "name": "Credit card",
        "totalAmount": "116.32",
        "totalCount": "9"
      },
      {
        "name": "Department charge",
        "totalAmount": "25.00",
        "totalCount": "9"
      },
      {
        "name": "Payment method totals",
        "totalAmount": "262.09",
        "totalCount": "99"
      }
    ],
    "byFeeFineType": [
      {
        "name": "Locker rental fee",
        "totalAmount": "50.00",
        "totalCount": "9"
      },
      {
        "name": "Lost item fee",
        "totalAmount": "50.00",
        "totalCount": "9"
      },
      {
        "name": "Lost item processing fee",
        "totalAmount": "25.00",
        "totalCount": "9"
      },
      {
        "name": "Overdue fine",
        "totalAmount": "137.09",
        "totalCount": "99"
      },
      {
        "name": "Fee/fine type totals",
        "totalAmount": "262.09",
        "totalCount": "99"
      }
    ],
    "byFeeFineOwner": [
      {
        "name": "Main circ desk",
        "totalAmount": "253.77",
        "totalCount": "9"
      },
      {
        "name": "Science circ desk",
        "totalAmount": "8.32",
        "totalCount": "9"
      },
      {
        "name": "Fee/fine owner totals",
        "totalAmount": "262.09",
        "totalCount": "99"
      }
    ]
  }
}

Response 422

Unprocessable entity

Body

Media type: text/plain

Type: any

Example:

Invalid startDate or endDate parameter

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "errors.schema",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "id": "error.schema",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "parameters.schema",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error

POST /feefine-reports/cash-drawer-reconciliation/sources

Return list of sources for a refund cash drawer reconciliation report

POST /feefine-reports/cash-drawer-reconciliation/sources
Body

Media type: application/json

Example:

{
  "createdAt": "7c5abc9f-f3d7-4856-b8d7-6712462ca007"
}

Response 200

Body

Media type: application/json

Example:

{
  "sources": [
    "Foo, Alice",
    "Bar, Bob"
  ]
}

Response 422

Unprocessable entity

Body

Media type: text/plain

Type: any

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "errors.schema",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "id": "error.schema",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "parameters.schema",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error

POST /feefine-reports/financial-transactions-detail

Return data for a financial transactions detail report

POST /feefine-reports/financial-transactions-detail
Body

Media type: application/json

Example:

{
  "feeFineOwner": "7c5abc9f-f3d7-4856-b8d7-6712462ca007",
  "createdAt": ["4f7a5802-fc0d-4122-a3b8-4d9d6f91c922", "1de41f6a-a597-4781-a96e-90efaf85bd5a"],
  "startDate": "2020-01-01",
  "endDate": "2020-02-02"
}

Response 200

Body

Media type: application/json

Example:

{
  "reportData": [
    {
      "feeFineOwner": "Main circ desk",
      "feeFineType": "Lost item fee",
      "billedAmount": "100.00",
      "dateBilled": "12/6/2020, 1:33 PM",
      "feeFineCreatedAt": "Service Point A",
      "feeFineSource": "Foo, Alice",
      "feeFineId": "6d8d0c4c-1dbd-47f0-a55f-08b0e97e58e9",
      "action": "Payment",
      "actionAmount": "50.00",
      "actionDate": "12/10/2020, 2:37 PM",
      "actionCreatedAt": "Service Point A",
      "actionSource": "Foo, Alice",
      "actionStatus": "Paid partially",
      "actionAdditionalStaffInfo": "Patron used check from parent",
      "actionAdditionalPatronInfo": "You have been assigned locker #234",
      "paymentMethod": "Cash",
      "transactionInfo": "",
      "waiveReason": "",
      "refundReason": "",
      "transferAccount": "",
      "patronId": "2a424823-588a-45ee-9441-a6384b6614b2",
      "patronName": "Bar, Bob",
      "patronBarcode": "12341234",
      "patronGroup": "Faculty",
      "patronEmail": "ff123@cornell.edu",
      "instance": "Bridget Jones :mad about the boy",
      "contributors": "Fielding, Helen",
      "itemBarcode": "108850078",
      "callNumber": "PR6056.I4588 B77 2013 c.1",
      "effectiveLocation": "UC/HP/JRL/Gen",
      "loanDate": "10/10/2020, 10:10 AM",
      "dueDate": "11/10/2020, 11:59 PM",
      "returnDate": "",
      "loanPolicyId": "3b43297a-ec55-4bc9-849f-79601c755912",
      "loanPolicyName": "Faculty-loan-policy",
      "overdueFinePolicyId": "221fa305-2595-4f59-97a1-6f0907a32b92",
      "overdueFinePolicyName": "General-overdue-fine-policy",
      "lostItemPolicyId": "b4989141-18b1-4bb6-ba50-6b7f32b76874",
      "lostItemPolicyName": "General-lost-item-fee-policy",
      "loanId": "07bc223f-3b8a-4558-a51a-6d8625374dc9",
      "holdingsRecordId" : "e3ff6133-b9a2-4d4c-a1c9-dc1867d4df19",
      "instanceId" : "5bf370e0-8cca-4d9c-82e4-5170ab2a0a39",
      "itemId": "dadde30d-5c40-47b6-b70c-5a30cae13b46"
    }
  ],
  "reportTotals": {
    "byFeeFineOwner": [
      {
        "name": "Main circ desk",
        "totalAmount": "253.77",
        "totalCount": "9"
      },
      {
        "name": "Science circ desk",
        "totalAmount": "8.32",
        "totalCount": "9"
      },
      {
        "name": "Fee/fine owner totals",
        "totalAmount": "262.09",
        "totalCount": "99"
      }
    ],
    "byFeeFineType": [
      {
        "name": "Locker rental fee",
        "totalAmount": "50.00",
        "totalCount": "9"
      },
      {
        "name": "Lost item fee",
        "totalAmount": "50.00",
        "totalCount": "9"
      },
      {
        "name": "Lost item processing fee",
        "totalAmount": "25.00",
        "totalCount": "9"
      },
      {
        "name": "Overdue fine",
        "totalAmount": "137.09",
        "totalCount": "99"
      },
      {
        "name": "Fee/fine type totals",
        "totalAmount": "262.09",
        "totalCount": "99"
      }
    ],
    "byAction": [
      {
        "name": "Cancellation",
        "totalAmount": "99.00",
        "totalCount": "99"
      },
      {
        "name": "Payment",
        "totalAmount": "99.00",
        "totalCount": "99"
      },
      {
        "name": "Refund",
        "totalAmount": "99.00",
        "totalCount": "99"
      },
      {
        "name": "Transfer",
        "totalAmount": "99.00",
        "totalCount": "99"
      },
      {
        "name": "Transfer",
        "totalAmount": "99.00",
        "totalCount": "99"
      },
      {
        "name": "Action totals",
        "totalAmount": "999.99",
        "totalCount": "999"
      }
    ],
    "byPaymentMethod": [
      {
        "name": "Cash",
        "totalAmount": "83.32",
        "totalCount": "9"
      },
      {
        "name": "Check",
        "totalAmount": "37.45",
        "totalCount": "9"
      },
      {
        "name": "Credit card",
        "totalAmount": "116.32",
        "totalCount": "9"
      },
      {
        "name": "Department charge",
        "totalAmount": "25.00",
        "totalCount": "9"
      },
      {
        "name": "Payment method totals",
        "totalAmount": "262.09",
        "totalCount": "99"
      }
    ],
    "byWaiveReason": [
      {
        "name": "New patron",
        "totalAmount": "99.00",
        "totalCount": "99"
      },
      {
        "name": "Overcharged",
        "totalAmount": "99.00",
        "totalCount": "99"
      },
      {
        "name": "Special circumstances",
        "totalAmount": "99.00",
        "totalCount": "99"
      },
      {
        "name": "Waive reason totals",
        "totalAmount": "999.99",
        "totalCount": "999"
      }
    ],
    "byRefundReason": [
      {
        "name": "Overcharged",
        "totalAmount": "99.00",
        "totalCount": "99"
      },
      {
        "name": "Special circumstances",
        "totalAmount": "99.00",
        "totalCount": "99"
      },
      {
        "name": "Refund reason totals",
        "totalAmount": "999.99",
        "totalCount": "999"
      }
    ],
    "byTransferAccount": [
      {
        "name": "Bursar",
        "totalAmount": "999.00",
        "totalCount": "999"
      },
      {
        "name": "Transfer account totals",
        "totalAmount": "999.99",
        "totalCount": "999"
      }
    ]
  }
}

Response 422

Unprocessable entity

Body

Media type: text/plain

Type: any

Example:

Invalid startDate or endDate parameter

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "errors.schema",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "id": "error.schema",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "parameters.schema",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error