mod-finance-storage version v3
https://github.com/folio-org/mod-finance-storage
mod-finance-storage (Funds)
CRUD APIs used to manage funds.
/finance-storage/funds
Collection of fund items.
Get list of funds
Create a new fund item.
get /finance-storage/funds
Get list of funds
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: 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", "="]
- totalRecords: (string - default: auto - pattern: exact|estimated|none|auto)
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
- 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
HTTP status code 200
Returns a list of fund items
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A collection of funds",
"type": "object",
"properties": {
"funds": {
"description": "The list of funds contained in this collection",
"type": "array",
"id": "funds",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A fund to track financial transactions",
"properties": {
"id": {
"description": "UUID of this fund",
"$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}$"
},
"_version": {
"type": "integer",
"description": "Record version for optimistic locking"
},
"allocatedFromIds": {
"description": "All the funds that this fund is allowed to receive money from. This would be 1 fund or none. If this field is blank their is no restriction on allocating to this fund",
"type": "array",
"items": {
"description": "UUID of the fund this fund is allowed to receive money 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}$"
}
},
"allocatedToIds": {
"description": "All the funds that this fund is allowed to send money to. This could be one or many.",
"type": "array",
"items": {
"description": "UUID of the fund this fund is allowed to send money 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}$"
}
},
"code": {
"description": "A unique code associated with the fund",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "string",
"pattern": "^[^:]+$"
},
"description": {
"description": "The description of this fund",
"type": "string"
},
"externalAccountNo": {
"description": "Corresponding account in the financial system. Will be recorded in payment generated as well.",
"type": "string"
},
"fundStatus": {
"description": "The current status of this fund",
"type": "string",
"enum": [
"Active",
"Frozen",
"Inactive"
]
},
"fundTypeId": {
"description": "UUID of the fund type associated with this fund",
"$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}$"
},
"ledgerId": {
"description": "UUID of the financial ledger associated with this fund",
"$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}$"
},
"name": {
"description": "The name of this fund",
"type": "string"
},
"acqUnitIds": {
"description": "acquisition unit ids associated with this 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}$"
}
},
"donorOrganizationIds": {
"description": "donor organization ids associated with this 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}$"
}
},
"restrictByLocations": {
"description": "restrict usage of this fund by locations",
"type": "boolean",
"default": false
},
"locations": {
"description": "Locations associated with this fund",
"type": "array",
"items": {
"type": "object",
"properties": {
"locationId": {
"$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}$"
},
"tenantId": {
"description": "Tenant id of the associated location",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"locationId"
]
}
},
"tags": {
"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
},
"metadata": {
"description": "Metadata about creation and changes to record, provided by the server (client should not provide)",
"type": "object",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "metadata.schema",
"title": "Metadata Schema",
"properties": {
"createdDate": {
"description": "Date and time when the record was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who created the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"createdByUsername": {
"description": "Username of the user who created the record (when available)",
"type": "string"
},
"updatedDate": {
"description": "Date and time when the record was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"updatedByUsername": {
"description": "Username of the user who last updated the record (when available)",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"createdDate"
]
}
},
"additionalProperties": false,
"required": [
"code",
"fundStatus",
"ledgerId",
"name"
]
}
},
"totalRecords": {
"description": "The number of objects contained in this collection",
"type": "integer",
"minimum": 0
}
},
"additionalProperties": false,
"required": [
"funds",
"totalRecords"
]
}
Example:
{
"funds": [
{
"id": "20ad2b8d-84b0-4320-ad83-347c525dc8e1",
"allocatedFromIds": [
"b1f857ba-0e39-4c5b-851a-1b837a56b201",
"1097980d-97c9-4130-b6f0-a11b7804887d"
],
"allocatedToIds": [
"24fa4a94-8aa2-4f69-abeb-f12b67f711e3"
],
"code": "HIST",
"description": "Tracking fund for the History department",
"externalAccountNo": "52186156468152",
"fundStatus": "Active",
"fundTypeId": "c93373df-e7ec-4d31-b200-719736610d89",
"ledgerId": "a3ec5552-c4a4-4a15-a57c-0046db536369",
"name": "History",
"acqUnitIds": [
"1895e539-8dac-441e-b1f5-aab62b3fde60",
"47f504bd-0c1b-498e-a2ae-e2f0a0cea273"
],
"donorOrganizationIds": [
"d926d900-e27d-46d6-bba8-31e9d5c2cf44",
"077274ad-6b4f-4c28-9779-6d381e7a1ca1"
],
"restrictByLocations": true,
"locations": [
{
"locationId": "eb2d063a-5b4c-4cab-8db1-5fc5c5941df6"
},
{
"locationId": "fcd64ce1-6995-48f0-840e-89ffa2288371"
}
],
"tags": {
"tagList": [
"tag"
]
},
"metadata": {
"createdDate": "2020-07-19T10:00:00.000+0000",
"createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
}
}
],
"totalRecords": 1
}
HTTP status code 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 funds -- malformed parameter 'query', syntax error at column 6
HTTP status code 401
Not authorized to perform requested action
Body
Media type: text/plain
Type: any
Example:
unable to list funds -- unauthorized
HTTP status code 422
Validation errors
Body
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"
}
]
}
]
}
HTTP status code 500
Internal server error, e.g. due to misconfiguration
Body
Media type: text/plain
Type: any
Example:
internal server error, contact administrator
post /finance-storage/funds
Create a new fund item.
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A fund to track financial transactions",
"type": "object",
"properties": {
"id": {
"description": "UUID of this fund",
"$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}$"
},
"_version": {
"type": "integer",
"description": "Record version for optimistic locking"
},
"allocatedFromIds": {
"description": "All the funds that this fund is allowed to receive money from. This would be 1 fund or none. If this field is blank their is no restriction on allocating to this fund",
"type": "array",
"items": {
"description": "UUID of the fund this fund is allowed to receive money 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}$"
}
},
"allocatedToIds": {
"description": "All the funds that this fund is allowed to send money to. This could be one or many.",
"type": "array",
"items": {
"description": "UUID of the fund this fund is allowed to send money 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}$"
}
},
"code": {
"description": "A unique code associated with the fund",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "string",
"pattern": "^[^:]+$"
},
"description": {
"description": "The description of this fund",
"type": "string"
},
"externalAccountNo": {
"description": "Corresponding account in the financial system. Will be recorded in payment generated as well.",
"type": "string"
},
"fundStatus": {
"description": "The current status of this fund",
"type": "string",
"enum": [
"Active",
"Frozen",
"Inactive"
]
},
"fundTypeId": {
"description": "UUID of the fund type associated with this fund",
"$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}$"
},
"ledgerId": {
"description": "UUID of the financial ledger associated with this fund",
"$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}$"
},
"name": {
"description": "The name of this fund",
"type": "string"
},
"acqUnitIds": {
"description": "acquisition unit ids associated with this 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}$"
}
},
"donorOrganizationIds": {
"description": "donor organization ids associated with this 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}$"
}
},
"restrictByLocations": {
"description": "restrict usage of this fund by locations",
"type": "boolean",
"default": false
},
"locations": {
"description": "Locations associated with this fund",
"type": "array",
"items": {
"type": "object",
"properties": {
"locationId": {
"$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}$"
},
"tenantId": {
"description": "Tenant id of the associated location",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"locationId"
]
}
},
"tags": {
"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
},
"metadata": {
"description": "Metadata about creation and changes to record, provided by the server (client should not provide)",
"type": "object",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "metadata.schema",
"title": "Metadata Schema",
"properties": {
"createdDate": {
"description": "Date and time when the record was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who created the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"createdByUsername": {
"description": "Username of the user who created the record (when available)",
"type": "string"
},
"updatedDate": {
"description": "Date and time when the record was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"updatedByUsername": {
"description": "Username of the user who last updated the record (when available)",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"createdDate"
]
}
},
"additionalProperties": false,
"required": [
"code",
"fundStatus",
"ledgerId",
"name"
]
}
Example:
{
"id": "6e2fbba3-d557-4480-bca3-b6f5c645de04",
"allocatedFromIds": [
"1a490199-833d-4876-b2ff-2bd61f8324f1",
"d69a001c-ac69-4348-bee1-f9f3ef8a3f32"
],
"allocatedToIds": [
"c08a5b0c-6717-4788-9df5-b0e8338c1172"
],
"code": "HIST",
"description": "Tracking fund for the History department",
"externalAccountNo": "1121112569489",
"fundStatus": "Active",
"fundTypeId": "c93373df-e7ec-4d31-b200-719736610d89",
"ledgerId": "7ebd02c8-2bd4-40ae-b44d-0e76dc197633",
"name": "History",
"acqUnitIds": [
"1895e539-8dac-441e-b1f5-aab62b3fde60",
"47f504bd-0c1b-498e-a2ae-e2f0a0cea273"
],
"donorOrganizationIds": [
"d926d900-e27d-46d6-bba8-31e9d5c2cf44",
"077274ad-6b4f-4c28-9779-6d381e7a1ca1"
],
"restrictByLocations": true,
"locations": [
{
"locationId": "eb2d063a-5b4c-4cab-8db1-5fc5c5941df6"
},
{
"locationId": "fcd64ce1-6995-48f0-840e-89ffa2288371"
}
],
"tags": {
"tagList": [
"tag"
]
},
"metadata": {
"createdDate": "2020-07-19T10:00:00.000+0000",
"createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
}
}
HTTP status code 201
Returns a newly created item, with server-controlled fields like 'id' populated
Headers
- Location: required(string)
URI to the created fund item
Body
Media type: application/json
Type: any
Example:
{
"id": "6e2fbba3-d557-4480-bca3-b6f5c645de04",
"allocatedFromIds": [
"1a490199-833d-4876-b2ff-2bd61f8324f1",
"d69a001c-ac69-4348-bee1-f9f3ef8a3f32"
],
"allocatedToIds": [
"c08a5b0c-6717-4788-9df5-b0e8338c1172"
],
"code": "HIST",
"description": "Tracking fund for the History department",
"externalAccountNo": "1121112569489",
"fundStatus": "Active",
"fundTypeId": "c93373df-e7ec-4d31-b200-719736610d89",
"ledgerId": "7ebd02c8-2bd4-40ae-b44d-0e76dc197633",
"name": "History",
"acqUnitIds": [
"1895e539-8dac-441e-b1f5-aab62b3fde60",
"47f504bd-0c1b-498e-a2ae-e2f0a0cea273"
],
"donorOrganizationIds": [
"d926d900-e27d-46d6-bba8-31e9d5c2cf44",
"077274ad-6b4f-4c28-9779-6d381e7a1ca1"
],
"restrictByLocations": true,
"locations": [
{
"locationId": "eb2d063a-5b4c-4cab-8db1-5fc5c5941df6"
},
{
"locationId": "fcd64ce1-6995-48f0-840e-89ffa2288371"
}
],
"tags": {
"tagList": [
"tag"
]
},
"metadata": {
"createdDate": "2020-07-19T10:00:00.000+0000",
"createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
}
}
HTTP status code 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 fund -- malformed JSON at 13:3"
HTTP status code 401
Not authorized to perform requested action
Body
Media type: text/plain
Type: any
Example:
unable to create funds -- unauthorized
HTTP status code 422
Validation errors
Body
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"
}
]
}
]
}
HTTP status code 500
Internal server error, e.g. due to misconfiguration
Body
Media type: text/plain
Type: any
Example:
Internal server error, contact administrator
Entity representing a fund
Retrieve fund item with given {fundId}
Delete fund item with given {fundId}
Update fund item with given {fundId}
get /finance-storage/funds/{id}
Retrieve fund item with given {fundId}
URI Parameters
- id: required(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}$)
The UUID of a fund
HTTP status code 200
Returns item with a given ID
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A fund to track financial transactions",
"type": "object",
"properties": {
"id": {
"description": "UUID of this fund",
"$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}$"
},
"_version": {
"type": "integer",
"description": "Record version for optimistic locking"
},
"allocatedFromIds": {
"description": "All the funds that this fund is allowed to receive money from. This would be 1 fund or none. If this field is blank their is no restriction on allocating to this fund",
"type": "array",
"items": {
"description": "UUID of the fund this fund is allowed to receive money 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}$"
}
},
"allocatedToIds": {
"description": "All the funds that this fund is allowed to send money to. This could be one or many.",
"type": "array",
"items": {
"description": "UUID of the fund this fund is allowed to send money 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}$"
}
},
"code": {
"description": "A unique code associated with the fund",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "string",
"pattern": "^[^:]+$"
},
"description": {
"description": "The description of this fund",
"type": "string"
},
"externalAccountNo": {
"description": "Corresponding account in the financial system. Will be recorded in payment generated as well.",
"type": "string"
},
"fundStatus": {
"description": "The current status of this fund",
"type": "string",
"enum": [
"Active",
"Frozen",
"Inactive"
]
},
"fundTypeId": {
"description": "UUID of the fund type associated with this fund",
"$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}$"
},
"ledgerId": {
"description": "UUID of the financial ledger associated with this fund",
"$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}$"
},
"name": {
"description": "The name of this fund",
"type": "string"
},
"acqUnitIds": {
"description": "acquisition unit ids associated with this 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}$"
}
},
"donorOrganizationIds": {
"description": "donor organization ids associated with this 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}$"
}
},
"restrictByLocations": {
"description": "restrict usage of this fund by locations",
"type": "boolean",
"default": false
},
"locations": {
"description": "Locations associated with this fund",
"type": "array",
"items": {
"type": "object",
"properties": {
"locationId": {
"$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}$"
},
"tenantId": {
"description": "Tenant id of the associated location",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"locationId"
]
}
},
"tags": {
"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
},
"metadata": {
"description": "Metadata about creation and changes to record, provided by the server (client should not provide)",
"type": "object",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "metadata.schema",
"title": "Metadata Schema",
"properties": {
"createdDate": {
"description": "Date and time when the record was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who created the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"createdByUsername": {
"description": "Username of the user who created the record (when available)",
"type": "string"
},
"updatedDate": {
"description": "Date and time when the record was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"updatedByUsername": {
"description": "Username of the user who last updated the record (when available)",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"createdDate"
]
}
},
"additionalProperties": false,
"required": [
"code",
"fundStatus",
"ledgerId",
"name"
]
}
Example:
{
"id": "6e2fbba3-d557-4480-bca3-b6f5c645de04",
"allocatedFromIds": [
"1a490199-833d-4876-b2ff-2bd61f8324f1",
"d69a001c-ac69-4348-bee1-f9f3ef8a3f32"
],
"allocatedToIds": [
"c08a5b0c-6717-4788-9df5-b0e8338c1172"
],
"code": "HIST",
"description": "Tracking fund for the History department",
"externalAccountNo": "1121112569489",
"fundStatus": "Active",
"fundTypeId": "c93373df-e7ec-4d31-b200-719736610d89",
"ledgerId": "7ebd02c8-2bd4-40ae-b44d-0e76dc197633",
"name": "History",
"acqUnitIds": [
"1895e539-8dac-441e-b1f5-aab62b3fde60",
"47f504bd-0c1b-498e-a2ae-e2f0a0cea273"
],
"donorOrganizationIds": [
"d926d900-e27d-46d6-bba8-31e9d5c2cf44",
"077274ad-6b4f-4c28-9779-6d381e7a1ca1"
],
"restrictByLocations": true,
"locations": [
{
"locationId": "eb2d063a-5b4c-4cab-8db1-5fc5c5941df6"
},
{
"locationId": "fcd64ce1-6995-48f0-840e-89ffa2288371"
}
],
"tags": {
"tagList": [
"tag"
]
},
"metadata": {
"createdDate": "2020-07-19T10:00:00.000+0000",
"createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
}
}
HTTP status code 404
Item with a given ID not found
Body
Media type: text/plain
Type: any
Example:
"fund not found"
HTTP status code 422
Validation errors
Body
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"
}
]
}
]
}
HTTP status code 500
Internal server error, e.g. due to misconfiguration
Body
Media type: text/plain
Type: any
Example:
internal server error, contact administrator
delete /finance-storage/funds/{id}
Delete fund item with given {fundId}
URI Parameters
- id: required(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}$)
The UUID of a fund
HTTP status code 204
Item deleted successfully
HTTP status code 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 fund -- constraint violation"
HTTP status code 404
Item with a given ID not found
Body
Media type: text/plain
Type: any
Example:
"fund not found"
HTTP status code 422
Validation errors
Body
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"
}
]
}
]
}
HTTP status code 500
Internal server error, e.g. due to misconfiguration
Body
Media type: text/plain
Type: any
Example:
Internal server error, contact administrator
put /finance-storage/funds/{id}
Update fund item with given {fundId}
URI Parameters
- id: required(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}$)
The UUID of a fund
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A fund to track financial transactions",
"type": "object",
"properties": {
"id": {
"description": "UUID of this fund",
"$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}$"
},
"_version": {
"type": "integer",
"description": "Record version for optimistic locking"
},
"allocatedFromIds": {
"description": "All the funds that this fund is allowed to receive money from. This would be 1 fund or none. If this field is blank their is no restriction on allocating to this fund",
"type": "array",
"items": {
"description": "UUID of the fund this fund is allowed to receive money 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}$"
}
},
"allocatedToIds": {
"description": "All the funds that this fund is allowed to send money to. This could be one or many.",
"type": "array",
"items": {
"description": "UUID of the fund this fund is allowed to send money 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}$"
}
},
"code": {
"description": "A unique code associated with the fund",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "string",
"pattern": "^[^:]+$"
},
"description": {
"description": "The description of this fund",
"type": "string"
},
"externalAccountNo": {
"description": "Corresponding account in the financial system. Will be recorded in payment generated as well.",
"type": "string"
},
"fundStatus": {
"description": "The current status of this fund",
"type": "string",
"enum": [
"Active",
"Frozen",
"Inactive"
]
},
"fundTypeId": {
"description": "UUID of the fund type associated with this fund",
"$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}$"
},
"ledgerId": {
"description": "UUID of the financial ledger associated with this fund",
"$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}$"
},
"name": {
"description": "The name of this fund",
"type": "string"
},
"acqUnitIds": {
"description": "acquisition unit ids associated with this 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}$"
}
},
"donorOrganizationIds": {
"description": "donor organization ids associated with this 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}$"
}
},
"restrictByLocations": {
"description": "restrict usage of this fund by locations",
"type": "boolean",
"default": false
},
"locations": {
"description": "Locations associated with this fund",
"type": "array",
"items": {
"type": "object",
"properties": {
"locationId": {
"$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}$"
},
"tenantId": {
"description": "Tenant id of the associated location",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"locationId"
]
}
},
"tags": {
"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
},
"metadata": {
"description": "Metadata about creation and changes to record, provided by the server (client should not provide)",
"type": "object",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "metadata.schema",
"title": "Metadata Schema",
"properties": {
"createdDate": {
"description": "Date and time when the record was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who created the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"createdByUsername": {
"description": "Username of the user who created the record (when available)",
"type": "string"
},
"updatedDate": {
"description": "Date and time when the record was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"updatedByUsername": {
"description": "Username of the user who last updated the record (when available)",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"createdDate"
]
}
},
"additionalProperties": false,
"required": [
"code",
"fundStatus",
"ledgerId",
"name"
]
}
Example:
{
"id": "6e2fbba3-d557-4480-bca3-b6f5c645de04",
"allocatedFromIds": [
"1a490199-833d-4876-b2ff-2bd61f8324f1",
"d69a001c-ac69-4348-bee1-f9f3ef8a3f32"
],
"allocatedToIds": [
"c08a5b0c-6717-4788-9df5-b0e8338c1172"
],
"code": "HIST",
"description": "Tracking fund for the History department",
"externalAccountNo": "1121112569489",
"fundStatus": "Active",
"fundTypeId": "c93373df-e7ec-4d31-b200-719736610d89",
"ledgerId": "7ebd02c8-2bd4-40ae-b44d-0e76dc197633",
"name": "History",
"acqUnitIds": [
"1895e539-8dac-441e-b1f5-aab62b3fde60",
"47f504bd-0c1b-498e-a2ae-e2f0a0cea273"
],
"donorOrganizationIds": [
"d926d900-e27d-46d6-bba8-31e9d5c2cf44",
"077274ad-6b4f-4c28-9779-6d381e7a1ca1"
],
"restrictByLocations": true,
"locations": [
{
"locationId": "eb2d063a-5b4c-4cab-8db1-5fc5c5941df6"
},
{
"locationId": "fcd64ce1-6995-48f0-840e-89ffa2288371"
}
],
"tags": {
"tagList": [
"tag"
]
},
"metadata": {
"createdDate": "2020-07-19T10:00:00.000+0000",
"createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
}
}
HTTP status code 204
Item successfully updated
HTTP status code 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 fund -- malformed JSON at 13:4"
HTTP status code 404
Item with a given ID not found
Body
Media type: text/plain
Type: any
Example:
"fund not found"
HTTP status code 409
Optimistic locking version conflict
Body
Media type: text/plain
Type: any
Example:
version conflict
HTTP status code 422
Validation errors
Body
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"
}
]
}
]
}
HTTP status code 500
Internal server error, e.g. due to misconfiguration
Body
Media type: text/plain
Type: any
Example:
internal server error, contact administrator