Actual cost fee/fine API (v0.3)

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

Table of contents

Actual Cost Fee Fine API

This documents the Actual Cost Fee Fine API

/actual-cost-fee-fine

POST /actual-cost-fee-fine/cancel

Cancel actual cost record

POST /actual-cost-fee-fine/cancel
Body

Media type: application/json

Example:

{
  "actualCostRecordId": "1dcfc936-9402-45f2-b681-bd18d8601f6d",
  "additionalInfoForStaff": "Additional information for staff",
  "additionalInfoForPatron": "Additional information for a patron"
}

Response 201

Body

Media type: application/json

Example:

{
  "id": "89105c06-dbdb-4aa0-9695-d4d19c733270",
  "lossType": "Aged to lost",
  "lossDate": "2022-01-01T22:25:37.000+00:00",
  "expirationDate": "2022-02-01T23:59:59.000+00:00",
  "user": {
    "id": "88805c06-dbdb-4aa0-9695-d4d19c733221",
    "barcode": "777",
    "firstName": "John",
    "lastName": "Doe",
    "middleName": "Robert",
    "patronGroupId": "4bb563d9-3f9d-4e1e-8d1d-04e75666d68f",
    "patronGroup": "librarian"
  },
  "loan": {
    "id": "65de6432-be11-48ba-9686-a65101634040"
  },
  "item": {
    "id": "b7bee7e9-f41d-4136-b7eb-af00c2f6d274",
    "barcode": "123456",
    "materialTypeId": "57a578ab-4dde-4f75-909c-edc74772d09b",
    "materialType": "book",
    "permanentLocationId": "9da9dcdd-474f-4e16-bb83-21e64e5eb288",
    "permanentLocation": "Main library",
    "effectiveLocationId": "5513cf26-a45c-482e-a25a-3ce5c32e619c",
    "effectiveLocation": "Annex",
    "loanTypeId": "e1e17294-dd52-44ae-8a94-b96aa08ef3b5",
    "loanType": "Can circulate",
    "holdingsRecordId": "68190dd4-9a88-4dbe-af1a-9048be222ac8",
    "effectiveCallNumberComponents": {
      "callNumber": "TX809.M17J66",
      "prefix": "f",
      "suffix": "1993"
    },
    "volume": "v. 2",
    "enumeration": "v.73:no.1-6",
    "chronology": "1985:July-Dec.",
    "copyNumber": "c.1"
  },
  "instance": {
    "id": "9dfe10e5-6db9-4f80-b574-7edc0f960288",
    "title": "Nod",
    "identifiers": [
      {
        "value": "9781466636897",
        "identifierType": "ISBN",
        "identifierTypeId": "8261054f-be78-422d-bd51-4ed9f33c3422"
      }
    ],
    "contributors": [
      {
        "name": "Schmitz, Bettina"
      }
    ]
  },
  "feeFine": {
    "accountId": "306339a5-539b-4652-be7c-ab041a286c8c",
    "billedAmount": 9.99,
    "ownerId": "a2e1729a-2593-4a2a-8069-2fee39d9ae31",
    "owner": "Default owner",
    "typeId": "92ef9706-f1af-430d-9edd-78035689efa2",
    "type": "Overdue fine"
  },
  "status": "Billed",
  "additionalInfoForStaff": "Additional information for staff",
  "additionalInfoForPatron": "Additional information for a patron",
  "metadata": {
    "createdDate": "2022-09-19T14:09:41.284+00:00",
    "createdByUserId": "5bcadcf1-2608-4cd3-b4e2-947ffe58d15f",
    "updatedDate": "2022-09-19T14:09:41.284+00:00",
    "updatedByUserId": "5bcadcf1-2608-4cd3-b4e2-947ffe58d15f"
  }
}

Response 422

Unprocessable entity

Body

Media type: text/plain

Type: any

Example:

Invalid request

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 /actual-cost-fee-fine/bill

Bill actual cost record

POST /actual-cost-fee-fine/bill
Body

Media type: application/json

Example:

{
  "actualCostRecordId": "1dcfc936-9402-45f2-b681-bd18d8601f6d",
  "amount": 9.99,
  "servicePointId": "b5fe7a1a-edc3-4b34-b6a2-38969cac253b",
  "additionalInfoForStaff": "Additional information for staff",
  "additionalInfoForPatron": "Additional information for a patron"
}

Response 201

Body

Media type: application/json

Example:

{
  "id": "89105c06-dbdb-4aa0-9695-d4d19c733270",
  "lossType": "Aged to lost",
  "lossDate": "2022-01-01T22:25:37.000+00:00",
  "expirationDate": "2022-02-01T23:59:59.000+00:00",
  "user": {
    "id": "88805c06-dbdb-4aa0-9695-d4d19c733221",
    "barcode": "777",
    "firstName": "John",
    "lastName": "Doe",
    "middleName": "Robert",
    "patronGroupId": "4bb563d9-3f9d-4e1e-8d1d-04e75666d68f",
    "patronGroup": "librarian"
  },
  "loan": {
    "id": "65de6432-be11-48ba-9686-a65101634040"
  },
  "item": {
    "id": "b7bee7e9-f41d-4136-b7eb-af00c2f6d274",
    "barcode": "123456",
    "materialTypeId": "57a578ab-4dde-4f75-909c-edc74772d09b",
    "materialType": "book",
    "permanentLocationId": "9da9dcdd-474f-4e16-bb83-21e64e5eb288",
    "permanentLocation": "Main library",
    "effectiveLocationId": "5513cf26-a45c-482e-a25a-3ce5c32e619c",
    "effectiveLocation": "Annex",
    "loanTypeId": "e1e17294-dd52-44ae-8a94-b96aa08ef3b5",
    "loanType": "Can circulate",
    "holdingsRecordId": "68190dd4-9a88-4dbe-af1a-9048be222ac8",
    "effectiveCallNumberComponents": {
      "callNumber": "TX809.M17J66",
      "prefix": "f",
      "suffix": "1993"
    },
    "volume": "v. 2",
    "enumeration": "v.73:no.1-6",
    "chronology": "1985:July-Dec.",
    "copyNumber": "c.1"
  },
  "instance": {
    "id": "9dfe10e5-6db9-4f80-b574-7edc0f960288",
    "title": "Nod",
    "identifiers": [
      {
        "value": "9781466636897",
        "identifierType": "ISBN",
        "identifierTypeId": "8261054f-be78-422d-bd51-4ed9f33c3422"
      }
    ],
    "contributors": [
      {
        "name": "Schmitz, Bettina"
      }
    ]
  },
  "feeFine": {
    "accountId": "306339a5-539b-4652-be7c-ab041a286c8c",
    "billedAmount": 9.99,
    "ownerId": "a2e1729a-2593-4a2a-8069-2fee39d9ae31",
    "owner": "Default owner",
    "typeId": "92ef9706-f1af-430d-9edd-78035689efa2",
    "type": "Overdue fine"
  },
  "status": "Billed",
  "additionalInfoForStaff": "Additional information for staff",
  "additionalInfoForPatron": "Additional information for a patron",
  "metadata": {
    "createdDate": "2022-09-19T14:09:41.284+00:00",
    "createdByUserId": "5bcadcf1-2608-4cd3-b4e2-947ffe58d15f",
    "updatedDate": "2022-09-19T14:09:41.284+00:00",
    "updatedByUserId": "5bcadcf1-2608-4cd3-b4e2-947ffe58d15f"
  }
}

Response 422

Unprocessable entity

Body

Media type: text/plain

Type: any

Example:

Invalid request

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