https://github.com/folio-org/mod-finance-storage
CRUD APIs used to retrieve finance data for a fiscal year
Entity representing a finance-datum
Get finance data for a fiscal year
GET /finance-storage/finance-data
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: for example fiscalYearId
Example:
(username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
["fiscalYearId", "7a4c4d30-3b63-4102-8e2d-3ee5792d7d02", "="]
How to calculate the totalRecords property. "exact" for the correct number, "estimated" for an estimation, "auto" to automatically select "exact" or "estimated", "none" for suppressing the totalRecords property. For details see https://github.com/folio-org/raml-module-builder#estimated-totalrecords
Example:
none
Skip over a number of elements by specifying an offset value for the query
Example:
0
Limit the number of elements returned in the response
Example:
10
Returns item with a given ID
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A collection of fiscal year finance data",
"type": "object",
"properties": {
"fyFinanceData": {
"description": "The list of fiscal year finance data objects contained in this collection",
"type": "array",
"id": "fyFinanceData",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Finance data for a fiscal year",
"javaName": "FyFinanceData",
"properties": {
"fiscalYearId": {
"description": "UUID of the fiscal year",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
},
"fiscalYearCode": {
"description": "The code of the fiscal year",
"type": "string"
},
"fundId": {
"description": "Fund UUID",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
},
"fundCode": {
"description": "A unique code associated with the fund",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "string",
"pattern": "^[^:]+$"
},
"fundName": {
"description": "The name of this fund",
"type": "string"
},
"fundDescription": {
"description": "A description of this fund",
"type": "string"
},
"fundStatus": {
"description": "The current status of this fund",
"type": "string"
},
"fundTags": {
"type": "object",
"description": "Arbitrary tags associated with this fund",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "tags.schema",
"title": "tags",
"properties": {
"tagList": {
"description": "List of tags",
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"fundAcqUnitIds": {
"description": "List of acquisition unit IDs associated with the fund",
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "The UUID format string",
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
}
},
"ledgerId": {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "The UUID format string",
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
},
"ledgerCode": {
"description": "The code for the ledger",
"type": "string"
},
"budgetId": {
"description": "UUID of this budget",
"type": "string"
},
"budgetName": {
"description": "The name of the budget",
"type": "string"
},
"budgetStatus": {
"description": "The status of the budget",
"type": "string"
},
"budgetInitialAllocation": {
"description": "The amount of the first allocation made to this budget",
"type": "number"
},
"budgetCurrentAllocation": {
"description": "The amount currently allocated to this budget",
"type": "number"
},
"budgetAllocationChange": {
"description": "The change in allocation amount for this budget",
"type": "number"
},
"budgetAllowableExpenditure": {
"description": "The expenditure percentage limit for this budget",
"type": "number"
},
"budgetAllowableEncumbrance": {
"description": "The encumbrance percentage limit for this budget",
"type": "number"
},
"budgetAfterAllocation": {
"description": "The amount of the budget after the allocation",
"type": "number"
},
"budgetAcqUnitIds": {
"description": "List of acquisition unit IDs associated with the budget",
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "The UUID format string",
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
}
},
"groupId": {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "The UUID format string",
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
},
"groupCode": {
"description": "The code for the group",
"type": "string"
},
"transactionDescription": {
"description": "A description of this transaction",
"type": "string"
},
"transactionTag": {
"type": "object",
"description": "Arbitrary tags associated with this transaction",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "tags.schema",
"title": "tags",
"properties": {
"tagList": {
"description": "List of tags",
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"isFundChanged": {
"description": "Indicates if the fund has changed",
"type": "boolean"
},
"isBudgetChanged": {
"description": "Indicates if the budget has changed",
"type": "boolean"
}
},
"required": [
"fiscalYearCode",
"fiscalYearId",
"fundId"
]
}
},
"worksheetName": {
"description": "The name of the worksheet from which the data was uploaded",
"type": "string"
},
"updateType": {
"description": "The type of update being performed",
"type": "string",
"enum": [
"Preview",
"Commit"
]
},
"totalRecords": {
"description": "The number of objects contained in this collection",
"type": "integer"
}
},
"additionalProperties": false,
"required": [
"fyFinanceData",
"updateType",
"totalRecords"
]
}
Example:
{
"fyFinanceData": [
{
"fiscalYearId": "123e4567-e89b-12d3-a456-426614174004",
"fiscalYearCode": "FY2023",
"fundId": "123e4567-e89b-12d3-a456-426614174000",
"fundCode": "FND001",
"fundName": "General Fund",
"fundDescription": "This fund is used for general purposes.",
"fundStatus": "Active",
"fundTags": {
"tagList": ["Education", "Research"]
},
"fundAcqUnitIds": ["123e4567-e89b-12d3-a456-426614174006"],
"ledgerId": "123e4567-e89b-12d3-a456-426614174015",
"ledgerCode": "LED001",
"budgetId": "123e4567-e89b-12d3-a456-426614174001",
"budgetName": "Annual Budget",
"budgetStatus": "Active",
"budgetInitialAllocation": 1000000,
"budgetCurrentAllocation": 950000,
"budgetAllowableExpenditure": 80,
"budgetAllowableEncumbrance": 90,
"budgetAcqUnitIds": ["123e4567-e89b-12d3-a456-426614174008"],
"groupId": "123e4567-e89b-12d3-a456-426614174025",
"groupCode": "GRP001",
"isFundChanged": false,
"isBudgetChanged": true
},
{
"fiscalYearId": "123e4567-e89b-12d3-a456-426614174005",
"fiscalYearCode": "FY2023",
"fundId": "123e4567-e89b-12d3-a456-426614174002",
"fundCode": "FND002",
"fundName": "Research Fund",
"fundDescription": "This fund is used for research purposes.",
"fundStatus": "Frozen",
"fundTags": {
"tagList": ["Science", "Innovation"]
},
"fundAcqUnitIds": ["123e4567-e89b-12d3-a456-426614174007"],
"ledgerId": "123e4567-e89b-12d3-a456-426614174016",
"ledgerCode": "LED002",
"budgetId": "123e4567-e89b-12d3-a456-426614174003",
"budgetName": "Research Budget",
"budgetStatus": "Planned",
"budgetInitialAllocation": 500000,
"budgetCurrentAllocation": 450000,
"budgetAllowableExpenditure": 70,
"budgetAllowableEncumbrance": 85,
"budgetAcqUnitIds": ["123e4567-e89b-12d3-a456-426614174009"],
"groupId": "123e4567-e89b-12d3-a456-426614174026",
"groupCode": "GRP002",
"isFundChanged": true,
"isBudgetChanged": true
}
],
"totalRecords": 2
}
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.
Media type: text/plain
Type: any
Example:
"unable to list finance-data -- malformed parameter 'query', syntax error at column 6"
Not authorized to perform requested action
Media type: text/plain
Type: any
Example:
"unable to list finance-data -- unauthorized"
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"finance-datum not found"
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
internal server error, contact administrator
Update finance, budget as a bulk
PUT /finance-storage/finance-data
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A collection of fiscal year finance data",
"type": "object",
"properties": {
"fyFinanceData": {
"description": "The list of fiscal year finance data objects contained in this collection",
"type": "array",
"id": "fyFinanceData",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Finance data for a fiscal year",
"javaName": "FyFinanceData",
"properties": {
"fiscalYearId": {
"description": "UUID of the fiscal year",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
},
"fiscalYearCode": {
"description": "The code of the fiscal year",
"type": "string"
},
"fundId": {
"description": "Fund UUID",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
},
"fundCode": {
"description": "A unique code associated with the fund",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "string",
"pattern": "^[^:]+$"
},
"fundName": {
"description": "The name of this fund",
"type": "string"
},
"fundDescription": {
"description": "A description of this fund",
"type": "string"
},
"fundStatus": {
"description": "The current status of this fund",
"type": "string"
},
"fundTags": {
"type": "object",
"description": "Arbitrary tags associated with this fund",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "tags.schema",
"title": "tags",
"properties": {
"tagList": {
"description": "List of tags",
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"fundAcqUnitIds": {
"description": "List of acquisition unit IDs associated with the fund",
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "The UUID format string",
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
}
},
"ledgerId": {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "The UUID format string",
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
},
"ledgerCode": {
"description": "The code for the ledger",
"type": "string"
},
"budgetId": {
"description": "UUID of this budget",
"type": "string"
},
"budgetName": {
"description": "The name of the budget",
"type": "string"
},
"budgetStatus": {
"description": "The status of the budget",
"type": "string"
},
"budgetInitialAllocation": {
"description": "The amount of the first allocation made to this budget",
"type": "number"
},
"budgetCurrentAllocation": {
"description": "The amount currently allocated to this budget",
"type": "number"
},
"budgetAllocationChange": {
"description": "The change in allocation amount for this budget",
"type": "number"
},
"budgetAllowableExpenditure": {
"description": "The expenditure percentage limit for this budget",
"type": "number"
},
"budgetAllowableEncumbrance": {
"description": "The encumbrance percentage limit for this budget",
"type": "number"
},
"budgetAfterAllocation": {
"description": "The amount of the budget after the allocation",
"type": "number"
},
"budgetAcqUnitIds": {
"description": "List of acquisition unit IDs associated with the budget",
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "The UUID format string",
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
}
},
"groupId": {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "The UUID format string",
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
},
"groupCode": {
"description": "The code for the group",
"type": "string"
},
"transactionDescription": {
"description": "A description of this transaction",
"type": "string"
},
"transactionTag": {
"type": "object",
"description": "Arbitrary tags associated with this transaction",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "tags.schema",
"title": "tags",
"properties": {
"tagList": {
"description": "List of tags",
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"isFundChanged": {
"description": "Indicates if the fund has changed",
"type": "boolean"
},
"isBudgetChanged": {
"description": "Indicates if the budget has changed",
"type": "boolean"
}
},
"required": [
"fiscalYearCode",
"fiscalYearId",
"fundId"
]
}
},
"worksheetName": {
"description": "The name of the worksheet from which the data was uploaded",
"type": "string"
},
"updateType": {
"description": "The type of update being performed",
"type": "string",
"enum": [
"Preview",
"Commit"
]
},
"totalRecords": {
"description": "The number of objects contained in this collection",
"type": "integer"
}
},
"additionalProperties": false,
"required": [
"fyFinanceData",
"updateType",
"totalRecords"
]
}
Example:
{
"fyFinanceData": [
{
"fiscalYearId": "123e4567-e89b-12d3-a456-426614174004",
"fiscalYearCode": "FY2023",
"fundId": "123e4567-e89b-12d3-a456-426614174000",
"fundCode": "FND001",
"fundName": "General Fund",
"fundDescription": "This fund is used for general purposes.",
"fundStatus": "Active",
"fundTags": {
"tagList": ["Education", "Research"]
},
"fundAcqUnitIds": ["123e4567-e89b-12d3-a456-426614174006"],
"ledgerId": "123e4567-e89b-12d3-a456-426614174015",
"ledgerCode": "LED001",
"budgetId": "123e4567-e89b-12d3-a456-426614174001",
"budgetName": "Annual Budget",
"budgetStatus": "Active",
"budgetInitialAllocation": 1000000,
"budgetCurrentAllocation": 950000,
"budgetAllocationChange": -50000,
"budgetAllowableExpenditure": 80,
"budgetAllowableEncumbrance": 90,
"budgetAfterAllocation": 900000,
"budgetAcqUnitIds": ["123e4567-e89b-12d3-a456-426614174008"],
"groupId": "123e4567-e89b-12d3-a456-426614174025",
"groupCode": "GRP001",
"transactionDescription": "End of year adjustment",
"transactionTag": {
"tagList": ["Urgent", "Review"]
}
},
{
"fiscalYearId": "123e4567-e89b-12d3-a456-426614174005",
"fiscalYearCode": "FY2023",
"fundId": "123e4567-e89b-12d3-a456-426614174002",
"fundCode": "FND002",
"fundName": "Research Fund",
"fundDescription": "This fund is used for research purposes.",
"fundStatus": "Frozen",
"fundTags": {
"tagList": ["Science", "Innovation"]
},
"fundAcqUnitIds": ["123e4567-e89b-12d3-a456-426614174007"],
"ledgerId": "123e4567-e89b-12d3-a456-426614174016",
"ledgerCode": "LED002",
"budgetId": "123e4567-e89b-12d3-a456-426614174003",
"budgetName": "Research Budget",
"budgetStatus": "Planned",
"budgetInitialAllocation": 500000,
"budgetCurrentAllocation": 450000,
"budgetAllocationChange": -50000,
"budgetAllowableExpenditure": 70,
"budgetAllowableEncumbrance": 85,
"budgetAfterAllocation": 400000,
"budgetAcqUnitIds": ["123e4567-e89b-12d3-a456-426614174009"],
"groupId": "123e4567-e89b-12d3-a456-426614174026",
"groupCode": "GRP002",
"transactionDescription": "Mid-year adjustment",
"transactionTag": {
"tagList": ["Urgent", "Review"]
}
}
],
"worksheetName": "FY2023_Finance_Data",
"updateType": "Commit",
"totalRecords": 2
}
Items successfully updated
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.
Media type: text/plain
Type: any
Example:
"unable to update items -- malformed JSON at 13:4"
One or more items not found
Media type: text/plain
Type: any
Example:
"One or more items not found"
Optimistic locking version conflict
Media type: text/plain
Type: any
Example:
version conflict
Validation errors
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"
}
]
}
]
}
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
internal server error, contact administrator