https://github.com/folio-org/mod-invoice-storage
CRUD APIs used to manage Adjustment Presets for mod-invoice.
Collection of adjustment-preset items.
Get a list of adjustment presets
GET /invoice-storage/adjustment-presets
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.
CQL query
Example:
(username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
description==preset1
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 a list of adjustment-preset items
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A collection of adjustment presets",
"type": "object",
"properties": {
"adjustmentPresets": {
"description": "An array of adjustment preset records",
"id": "adjustmentPresets",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Adjustment Preset",
"properties": {
"id": {
"description": "UUID of this adjustment preset",
"$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}$"
},
"description": {
"description": "Displayed in invoice line as a name for the input",
"type": "string"
},
"exportToAccounting": {
"description": "Whether or not to show this adjustment in batchedVoucherLines",
"type": "boolean",
"default": false
},
"prorate": {
"description": "Displayed in invoice line per adjustment in toggled on in settings",
"type": "string",
"enum": [
"By line",
"By amount",
"By quantity",
"Not prorated"
],
"default": "Not prorated"
},
"relationToTotal": {
"description": "Relationship of this adjustment to the total;In addition to: added to subtotal;Included in: reported as subtotal portion;Separate from:calculated from subtotal",
"type": "string",
"enum": [
"In addition to",
"Included in",
"Separate from"
],
"default": "In addition to"
},
"type": {
"description": "Adjustment type",
"type": "string",
"enum": [
"Percentage",
"Amount"
]
},
"alwaysShow": {
"description": "Flag to toggle to always show this adjustment preset",
"type": "boolean",
"default": false
},
"defaultAmount": {
"description": "Default adjustment value",
"type": "number"
},
"metadata": {
"type": "object",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "metadata.schema",
"title": "Metadata Schema",
"description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
"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"
]
},
"_version": {
"type": "integer",
"description": "Record version for optimistic locking"
}
},
"additionalProperties": false,
"required": [
"description",
"exportToAccounting",
"prorate",
"relationToTotal",
"type",
"alwaysShow"
]
}
},
"totalRecords": {
"description": "Total number of records in the array",
"type": "integer"
}
},
"required": [
"adjustmentPresets",
"totalRecords"
]
}
Example:
{
"adjustmentPresets": [
{
"id": "9d07cef9-9c9a-48f9-ac33-6cff4f23b160",
"description": "Service Fee",
"exportToAccounting": false,
"prorate": "By line",
"relationToTotal": "In addition to",
"type": "Amount",
"alwaysShow": true,
"defaultAmount": 10,
"metadata": {
"createdDate": "2025-10-31T09:21:44.386+0000",
"createdByUserId": "12408630-bce2-5a82-b577-9be500e9b324",
"updatedDate": "2025-10-31T09:21:44.386+0000",
"updatedByUserId": "12408630-bce2-5a82-b577-9be500e9b324"
},
"_version": 1
}
],
"totalRecords": 1
}
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 adjustment-presets -- malformed parameter 'query', syntax error at column 6
Not authorized to perform requested action
Media type: text/plain
Type: any
Example:
unable to list adjustment-presets -- unauthorized
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
internal server error, contact administrator
Add a new adjustment preset
POST /invoice-storage/adjustment-presets
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Adjustment Preset",
"type": "object",
"properties": {
"id": {
"description": "UUID of this adjustment preset",
"$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}$"
},
"description": {
"description": "Displayed in invoice line as a name for the input",
"type": "string"
},
"exportToAccounting": {
"description": "Whether or not to show this adjustment in batchedVoucherLines",
"type": "boolean",
"default": false
},
"prorate": {
"description": "Displayed in invoice line per adjustment in toggled on in settings",
"type": "string",
"enum": [
"By line",
"By amount",
"By quantity",
"Not prorated"
],
"default": "Not prorated"
},
"relationToTotal": {
"description": "Relationship of this adjustment to the total;In addition to: added to subtotal;Included in: reported as subtotal portion;Separate from:calculated from subtotal",
"type": "string",
"enum": [
"In addition to",
"Included in",
"Separate from"
],
"default": "In addition to"
},
"type": {
"description": "Adjustment type",
"type": "string",
"enum": [
"Percentage",
"Amount"
]
},
"alwaysShow": {
"description": "Flag to toggle to always show this adjustment preset",
"type": "boolean",
"default": false
},
"defaultAmount": {
"description": "Default adjustment value",
"type": "number"
},
"metadata": {
"type": "object",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "metadata.schema",
"title": "Metadata Schema",
"description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
"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"
]
},
"_version": {
"type": "integer",
"description": "Record version for optimistic locking"
}
},
"additionalProperties": false,
"required": [
"description",
"exportToAccounting",
"prorate",
"relationToTotal",
"type",
"alwaysShow"
]
}
Example:
{
"id": "9d07cef9-9c9a-48f9-ac33-6cff4f23b160",
"description": "Service Fee",
"exportToAccounting": false,
"prorate": "By line",
"relationToTotal": "In addition to",
"type": "Amount",
"alwaysShow": true,
"defaultAmount": 10,
"metadata": {
"createdDate": "2025-10-31T09:21:44.386+0000",
"createdByUserId": "12408630-bce2-5a82-b577-9be500e9b324",
"updatedDate": "2025-10-31T09:21:44.386+0000",
"updatedByUserId": "12408630-bce2-5a82-b577-9be500e9b324"
},
"_version": 1
}
Adjustment Preset added
URI to the created adjustment-preset item
Media type: application/json
Type: any
Example:
{
"id": "9d07cef9-9c9a-48f9-ac33-6cff4f23b160",
"description": "Service Fee",
"exportToAccounting": false,
"prorate": "By line",
"relationToTotal": "In addition to",
"type": "Amount",
"alwaysShow": true,
"defaultAmount": 10,
"metadata": {
"createdDate": "2025-10-31T09:21:44.386+0000",
"createdByUserId": "12408630-bce2-5a82-b577-9be500e9b324",
"updatedDate": "2025-10-31T09:21:44.386+0000",
"updatedByUserId": "12408630-bce2-5a82-b577-9be500e9b324"
},
"_version": 1
}
Bad Request
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "error.schema",
"description": "An error",
"type": "object",
"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"
]
}
Media type: text/plain
Type: any
Example:
"unable to add adjustment-preset -- malformed JSON at 13:3"
Not found
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "error.schema",
"description": "An error",
"type": "object",
"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"
]
}
Media type: text/plain
Type: any
Example:
unable to create adjustment-presets -- unauthorized
Internal error
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "error.schema",
"description": "An error",
"type": "object",
"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"
]
}
Media type: text/plain
Type: any
Example:
Internal server error, contact administrator
Retrieve adjustment-preset item with given {adjustment-presetId}
GET /invoice-storage/adjustment-presets/{id}
The UUID of the adjustment preset
Returns item with a given ID
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Adjustment Preset",
"type": "object",
"properties": {
"id": {
"description": "UUID of this adjustment preset",
"$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}$"
},
"description": {
"description": "Displayed in invoice line as a name for the input",
"type": "string"
},
"exportToAccounting": {
"description": "Whether or not to show this adjustment in batchedVoucherLines",
"type": "boolean",
"default": false
},
"prorate": {
"description": "Displayed in invoice line per adjustment in toggled on in settings",
"type": "string",
"enum": [
"By line",
"By amount",
"By quantity",
"Not prorated"
],
"default": "Not prorated"
},
"relationToTotal": {
"description": "Relationship of this adjustment to the total;In addition to: added to subtotal;Included in: reported as subtotal portion;Separate from:calculated from subtotal",
"type": "string",
"enum": [
"In addition to",
"Included in",
"Separate from"
],
"default": "In addition to"
},
"type": {
"description": "Adjustment type",
"type": "string",
"enum": [
"Percentage",
"Amount"
]
},
"alwaysShow": {
"description": "Flag to toggle to always show this adjustment preset",
"type": "boolean",
"default": false
},
"defaultAmount": {
"description": "Default adjustment value",
"type": "number"
},
"metadata": {
"type": "object",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "metadata.schema",
"title": "Metadata Schema",
"description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
"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"
]
},
"_version": {
"type": "integer",
"description": "Record version for optimistic locking"
}
},
"additionalProperties": false,
"required": [
"description",
"exportToAccounting",
"prorate",
"relationToTotal",
"type",
"alwaysShow"
]
}
Example:
{
"id": "9d07cef9-9c9a-48f9-ac33-6cff4f23b160",
"description": "Service Fee",
"exportToAccounting": false,
"prorate": "By line",
"relationToTotal": "In addition to",
"type": "Amount",
"alwaysShow": true,
"defaultAmount": 10,
"metadata": {
"createdDate": "2025-10-31T09:21:44.386+0000",
"createdByUserId": "12408630-bce2-5a82-b577-9be500e9b324",
"updatedDate": "2025-10-31T09:21:44.386+0000",
"updatedByUserId": "12408630-bce2-5a82-b577-9be500e9b324"
},
"_version": 1
}
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"adjustment-preset not found"
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
internal server error, contact administrator
Delete adjustment-preset item with given {adjustment-presetId}
DELETE /invoice-storage/adjustment-presets/{id}
The UUID of the adjustment preset
Item deleted successfully
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 delete adjustment-preset -- constraint violation"
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"adjustment-preset not found"
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
Internal server error, contact administrator
Update adjustment-preset item with given {adjustment-presetId}
PUT /invoice-storage/adjustment-presets/{id}
The UUID of the adjustment preset
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Adjustment Preset",
"type": "object",
"properties": {
"id": {
"description": "UUID of this adjustment preset",
"$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}$"
},
"description": {
"description": "Displayed in invoice line as a name for the input",
"type": "string"
},
"exportToAccounting": {
"description": "Whether or not to show this adjustment in batchedVoucherLines",
"type": "boolean",
"default": false
},
"prorate": {
"description": "Displayed in invoice line per adjustment in toggled on in settings",
"type": "string",
"enum": [
"By line",
"By amount",
"By quantity",
"Not prorated"
],
"default": "Not prorated"
},
"relationToTotal": {
"description": "Relationship of this adjustment to the total;In addition to: added to subtotal;Included in: reported as subtotal portion;Separate from:calculated from subtotal",
"type": "string",
"enum": [
"In addition to",
"Included in",
"Separate from"
],
"default": "In addition to"
},
"type": {
"description": "Adjustment type",
"type": "string",
"enum": [
"Percentage",
"Amount"
]
},
"alwaysShow": {
"description": "Flag to toggle to always show this adjustment preset",
"type": "boolean",
"default": false
},
"defaultAmount": {
"description": "Default adjustment value",
"type": "number"
},
"metadata": {
"type": "object",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "metadata.schema",
"title": "Metadata Schema",
"description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
"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"
]
},
"_version": {
"type": "integer",
"description": "Record version for optimistic locking"
}
},
"additionalProperties": false,
"required": [
"description",
"exportToAccounting",
"prorate",
"relationToTotal",
"type",
"alwaysShow"
]
}
Example:
{
"id": "9d07cef9-9c9a-48f9-ac33-6cff4f23b160",
"description": "Service Fee",
"exportToAccounting": false,
"prorate": "By line",
"relationToTotal": "In addition to",
"type": "Amount",
"alwaysShow": true,
"defaultAmount": 10,
"metadata": {
"createdDate": "2025-10-31T09:21:44.386+0000",
"createdByUserId": "12408630-bce2-5a82-b577-9be500e9b324",
"updatedDate": "2025-10-31T09:21:44.386+0000",
"updatedByUserId": "12408630-bce2-5a82-b577-9be500e9b324"
},
"_version": 1
}
Item 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 adjustment-preset -- malformed JSON at 13:4"
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"adjustment-preset not found"
Optimistic locking version conflict
Media type: text/plain
Type: any
Example:
version conflict
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
internal server error, contact administrator