https://github.com/folio-org/mod-finance-storage
Read API used to manage transaction totals.
Entity representing a transaction-total
Get list of transaction totals
GET /finance-storage/transaction-totalsA 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 code
Example:
(username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
["code", "MEDGRANT", "="]
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:
noneSkip over a number of elements by specifying an offset value for the query
Example:
0Limit the number of elements returned in the response
Example:
10Returns item with a given ID
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A collection of transaction totals",
"type": "object",
"properties": {
"transactionTotals": {
"description": "The list of objects contained in this collection",
"type": "array",
"id": "transactionTotals",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A financial transaction total",
"javaName": "transactionTotal",
"properties": {
"fiscalYearId": {
"description": "UUID of the fiscal year that the transaction is taking place in",
"$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}$"
},
"transactionType": {
"description": "This describes the type of transaction",
"enum": [
"Allocation",
"Credit",
"Encumbrance",
"Payment",
"Pending payment",
"Rollover transfer",
"Transfer"
],
"type": "string"
},
"fromFundId": {
"description": "UUID of the fund money is moving from",
"$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}$"
},
"toFundId": {
"description": "UUID of the fund money is moving to",
"$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}$"
},
"amount": {
"description": "The amount of this transaction",
"type": "number"
}
},
"required": [
"fiscalYearId",
"transactionType",
"fromFundId",
"toFundId",
"amount"
],
"additionalProperties": true
}
},
"totalRecords": {
"description": "The number of objects in this collection",
"type": "integer"
}
},
"additionalProperties": false,
"required": [
"transactionTotals",
"totalRecords"
]
}Example:
{
"transactionTotals": [
{
"fiscalYearId": "4438bc3b-4b4a-4e5e-9886-5f69b48a7a32",
"transactionType": "Allocation",
"currency": "USD",
"fromFundId": "27f27438-3197-4281-a353-511829421d6e",
"toFundId": "2e51c019-97f3-4523-87e9-59250e3b48bc",
"amount": 50000
},
{
"fiscalYearId": "684b5dc5-92f6-4db7-b996-b549d88f5e4e",
"transactionType": "Transfer",
"currency": "USD",
"fromFundId": "7fbd5d84-62d1-44c6-9c45-6cb173998bbd",
"toFundId": "69640328-788e-43fc-9c3c-af39e243f3b7",
"amount": 1000
}
],
"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 transaction-totals -- malformed parameter 'query', syntax error at column 6"
Not authorized to perform requested action
Media type: text/plain
Type: any
Example:
"unable to list transaction-totals -- unauthorized"
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"transaction-total not found"
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
internal server error, contact administratorGet transaction totals in batch
POST /finance-storage/transaction-totals/batchMedia type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A transaction total batch request",
"type": "object",
"javaName": "transactionTotalBatch",
"properties": {
"fiscalYearId": {
"description": "UUID of the fiscal year that the transaction is taking place in",
"$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}$"
},
"transactionTypes": {
"type": "array",
"description": "Types of transactions to include in the filter",
"items": {
"description": "This describes the type of transaction",
"enum": [
"Allocation",
"Credit",
"Encumbrance",
"Payment",
"Pending payment",
"Rollover transfer",
"Transfer"
],
"type": "string"
}
},
"fromFundIds": {
"type": "array",
"description": "UUIDs of the fund money is moving from (use only one of fromFundIds or toFundIds to filter)",
"items": {
"description": "UUID of the fund money is moving from",
"$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}$"
}
},
"toFundIds": {
"type": "array",
"description": "UUID of the fund money is moving to (use only one of fromFundIds or toFundIds to filter)",
"items": {
"description": "UUID of the fund money is moving to",
"$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}$"
}
}
},
"required": [
"fiscalYearId",
"transactionTypes"
],
"additionalProperties": false
}Returns matching group-fund-fiscal-year records
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A collection of transaction totals",
"type": "object",
"properties": {
"transactionTotals": {
"description": "The list of objects contained in this collection",
"type": "array",
"id": "transactionTotals",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A financial transaction total",
"javaName": "transactionTotal",
"properties": {
"fiscalYearId": {
"description": "UUID of the fiscal year that the transaction is taking place in",
"$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}$"
},
"transactionType": {
"description": "This describes the type of transaction",
"enum": [
"Allocation",
"Credit",
"Encumbrance",
"Payment",
"Pending payment",
"Rollover transfer",
"Transfer"
],
"type": "string"
},
"fromFundId": {
"description": "UUID of the fund money is moving from",
"$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}$"
},
"toFundId": {
"description": "UUID of the fund money is moving to",
"$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}$"
},
"amount": {
"description": "The amount of this transaction",
"type": "number"
}
},
"required": [
"fiscalYearId",
"transactionType",
"fromFundId",
"toFundId",
"amount"
],
"additionalProperties": true
}
},
"totalRecords": {
"description": "The number of objects in this collection",
"type": "integer"
}
},
"additionalProperties": false,
"required": [
"transactionTotals",
"totalRecords"
]
}Bad request
Media type: text/plain
Type: any
Example:
Bad requestMedia 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"
}
}
}Unprocessable entity
Media type: text/plain
Type: any
Example:
Unprocessable entityMedia 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
Media type: text/plain
Type: any
Example:
Internal server error, contact administratorMedia 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"
}
}
}