http://github.com/folio-org/mod-invoice-storage
This documents the API calls that can be made to manage vouchers;This API is intended for internal use only
Get list of vouchers
GET /voucher-storage/vouchers
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
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 voucherStatus
Example:
(username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
voucherStatus=="Paid"
Requested language. Optional. [lang=en]
Returns a list of voucher items
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "collection of vouchers",
"type": "object",
"properties": {
"vouchers": {
"description": "an array of voucher records",
"id": "vouchers",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "voucher",
"properties": {
"id": {
"description": "UUID of this voucher",
"$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}$"
},
"accountingCode": {
"description": "Number that represents the vendor is an external accounting system which may include details like \"Address code\" in it. This is the number as stated on the invoice",
"type": "string"
},
"amount": {
"description": "The amount that is actually paid",
"type": "number"
},
"batchGroupId": {
"description": "UUID of the batch group to use when generating batch vouchers",
"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}$",
"default": "2a2cb998-1437-41d1-88ad-01930aaeadd5"
},
"disbursementNumber": {
"description": "The identifier for the physical transaction corresponding to a payment;Brought in from external source",
"type": "string"
},
"disbursementDate": {
"description": "Date payment was made from financial system",
"type": "string",
"format": "date-time"
},
"disbursementAmount": {
"description": "The amount of the payment made outside of FOLIO",
"type": "number"
},
"invoiceCurrency": {
"description": "The currency in which invoice was originally defined",
"type": "string"
},
"invoiceId": {
"description": "Corresponding invoice Id",
"$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}$"
},
"exchangeRate": {
"description": "Exchange rate used to generate transaction",
"type": "number"
},
"exportToAccounting": {
"description": "Export this payment record to a financial system",
"type": "boolean"
},
"status": {
"description": "Status of the voucher",
"type": "string",
"enum": [
"Awaiting payment",
"Paid"
]
},
"systemCurrency": {
"description": "The currency in which the voucher was paid",
"type": "string"
},
"type": {
"description": "Indicates type of payment to account",
"type": "string",
"enum": [
"Payment",
"Pre-payment",
"Credit",
"Voucher"
]
},
"voucherDate": {
"description": "The date the invoice status changes to approved",
"type": "string",
"format": "date-time"
},
"voucherNumber": {
"description": "Number generated by folio that will eventually identify the payment request sent out to external financial system.",
"type": "string",
"pattern": "^[a-zA-Z0-9]*$"
},
"acqUnitIds": {
"description": "acquisition unit ids associated with this voucher",
"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}$"
}
},
"metadata": {
"type": "object",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/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",
"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",
"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",
"createdByUserId"
]
}
},
"additionalProperties": false,
"required": [
"amount",
"batchGroupId",
"exportToAccounting",
"invoiceCurrency",
"invoiceId",
"type",
"status",
"systemCurrency",
"voucherNumber"
]
}
},
"totalRecords": {
"description": "total number of records in the array",
"type": "integer"
}
},
"required": [
"vouchers",
"totalRecords"
]
}
Example:
{
"vouchers": [
{
"id": "a9b99f8a-7100-47f2-9903-6293d44a9905",
"accountingCode": "0206",
"amount": 23.45,
"batchGroupId": "2a2cb998-1437-41d1-88ad-01930aaeadd5",
"disbursementNumber": "EFT546789",
"disbursementDate": "2019-05-05T00:00:00.000+0000",
"disbursementAmount": 5,
"invoiceCurrency": "EUR",
"invoiceId": "c0d08448-347b-418a-8c2f-5fb50248d67e",
"exchangeRate": 1.12,
"exportToAccounting": false,
"status": "Paid",
"systemCurrency": "USD",
"type": "Pre-payment",
"voucherDate": "2019-05-06T00:00:00.000+0000",
"voucherNumber": "1000",
"acqUnitIds": [
"1895e539-8dac-441e-b1f5-aab62b3fde60",
"47f504bd-0c1b-498e-a2ae-e2f0a0cea273"
],
"metadata": {
"createdDate": "2019-05-06T00:00:00.000+0000",
"createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
}
}
],
"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 vouchers -- malformed parameter 'query', syntax error at column 6
Not authorized to perform requested action
Media type: text/plain
Type: any
Example:
unable to list vouchers -- unauthorized
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
internal server error, contact administrator
Create a new voucher item.
POST /voucher-storage/vouchers
Requested language. Optional. [lang=en]
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "voucher",
"type": "object",
"properties": {
"id": {
"description": "UUID of this voucher",
"$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}$"
},
"accountingCode": {
"description": "Number that represents the vendor is an external accounting system which may include details like \"Address code\" in it. This is the number as stated on the invoice",
"type": "string"
},
"amount": {
"description": "The amount that is actually paid",
"type": "number"
},
"batchGroupId": {
"description": "UUID of the batch group to use when generating batch vouchers",
"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}$",
"default": "2a2cb998-1437-41d1-88ad-01930aaeadd5"
},
"disbursementNumber": {
"description": "The identifier for the physical transaction corresponding to a payment;Brought in from external source",
"type": "string"
},
"disbursementDate": {
"description": "Date payment was made from financial system",
"type": "string",
"format": "date-time"
},
"disbursementAmount": {
"description": "The amount of the payment made outside of FOLIO",
"type": "number"
},
"invoiceCurrency": {
"description": "The currency in which invoice was originally defined",
"type": "string"
},
"invoiceId": {
"description": "Corresponding invoice Id",
"$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}$"
},
"exchangeRate": {
"description": "Exchange rate used to generate transaction",
"type": "number"
},
"exportToAccounting": {
"description": "Export this payment record to a financial system",
"type": "boolean"
},
"status": {
"description": "Status of the voucher",
"type": "string",
"enum": [
"Awaiting payment",
"Paid"
]
},
"systemCurrency": {
"description": "The currency in which the voucher was paid",
"type": "string"
},
"type": {
"description": "Indicates type of payment to account",
"type": "string",
"enum": [
"Payment",
"Pre-payment",
"Credit",
"Voucher"
]
},
"voucherDate": {
"description": "The date the invoice status changes to approved",
"type": "string",
"format": "date-time"
},
"voucherNumber": {
"description": "Number generated by folio that will eventually identify the payment request sent out to external financial system.",
"type": "string",
"pattern": "^[a-zA-Z0-9]*$"
},
"acqUnitIds": {
"description": "acquisition unit ids associated with this voucher",
"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}$"
}
},
"metadata": {
"type": "object",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/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",
"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",
"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",
"createdByUserId"
]
}
},
"additionalProperties": false,
"required": [
"amount",
"batchGroupId",
"exportToAccounting",
"invoiceCurrency",
"invoiceId",
"type",
"status",
"systemCurrency",
"voucherNumber"
]
}
Example:
{
"id": "a9b99f8a-7100-47f2-9903-6293d44a9905",
"accountingCode": "0206",
"amount": 23.45,
"batchGroupId": "2a2cb998-1437-41d1-88ad-01930aaeadd5",
"disbursementNumber": "EFT546789",
"disbursementDate": "2019-05-05T00:00:00.000+0000",
"disbursementAmount": 5,
"exchangeRate": 1.12,
"exportToAccounting": false,
"invoiceCurrency": "EUR",
"invoiceId": "c0d08448-347b-418a-8c2f-5fb50248d67e",
"status": "Awaiting payment",
"systemCurrency": "USD",
"type": "Payment",
"voucherDate": "2019-05-06T00:00:00.000+0000",
"voucherNumber": "1000",
"acqUnitIds": [
"1895e539-8dac-441e-b1f5-aab62b3fde60",
"47f504bd-0c1b-498e-a2ae-e2f0a0cea273"
],
"metadata": {
"createdDate": "2019-05-06T00:00:00.000+0000",
"createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
}
}
Returns a newly created item, with server-controlled fields like 'id' populated
URI to the created voucher item
Media type: application/json
Type: any
Example:
{
"id": "a9b99f8a-7100-47f2-9903-6293d44a9905",
"accountingCode": "0206",
"amount": 23.45,
"batchGroupId": "2a2cb998-1437-41d1-88ad-01930aaeadd5",
"disbursementNumber": "EFT546789",
"disbursementDate": "2019-05-05T00:00:00.000+0000",
"disbursementAmount": 5,
"exchangeRate": 1.12,
"exportToAccounting": false,
"invoiceCurrency": "EUR",
"invoiceId": "c0d08448-347b-418a-8c2f-5fb50248d67e",
"status": "Awaiting payment",
"systemCurrency": "USD",
"type": "Payment",
"voucherDate": "2019-05-06T00:00:00.000+0000",
"voucherNumber": "1000",
"acqUnitIds": [
"1895e539-8dac-441e-b1f5-aab62b3fde60",
"47f504bd-0c1b-498e-a2ae-e2f0a0cea273"
],
"metadata": {
"createdDate": "2019-05-06T00:00:00.000+0000",
"createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
}
}
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 add voucher -- malformed JSON at 13:3"
Not authorized to perform requested action
Media type: text/plain
Type: any
Example:
unable to create vouchers -- unauthorized
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
Internal server error, contact administrator
Retrieve voucher item with given {voucherId}
GET /voucher-storage/vouchers/{id}
The UUID of a voucher
Requested language. Optional. [lang=en]
Returns item with a given ID
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "voucher",
"type": "object",
"properties": {
"id": {
"description": "UUID of this voucher",
"$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}$"
},
"accountingCode": {
"description": "Number that represents the vendor is an external accounting system which may include details like \"Address code\" in it. This is the number as stated on the invoice",
"type": "string"
},
"amount": {
"description": "The amount that is actually paid",
"type": "number"
},
"batchGroupId": {
"description": "UUID of the batch group to use when generating batch vouchers",
"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}$",
"default": "2a2cb998-1437-41d1-88ad-01930aaeadd5"
},
"disbursementNumber": {
"description": "The identifier for the physical transaction corresponding to a payment;Brought in from external source",
"type": "string"
},
"disbursementDate": {
"description": "Date payment was made from financial system",
"type": "string",
"format": "date-time"
},
"disbursementAmount": {
"description": "The amount of the payment made outside of FOLIO",
"type": "number"
},
"invoiceCurrency": {
"description": "The currency in which invoice was originally defined",
"type": "string"
},
"invoiceId": {
"description": "Corresponding invoice Id",
"$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}$"
},
"exchangeRate": {
"description": "Exchange rate used to generate transaction",
"type": "number"
},
"exportToAccounting": {
"description": "Export this payment record to a financial system",
"type": "boolean"
},
"status": {
"description": "Status of the voucher",
"type": "string",
"enum": [
"Awaiting payment",
"Paid"
]
},
"systemCurrency": {
"description": "The currency in which the voucher was paid",
"type": "string"
},
"type": {
"description": "Indicates type of payment to account",
"type": "string",
"enum": [
"Payment",
"Pre-payment",
"Credit",
"Voucher"
]
},
"voucherDate": {
"description": "The date the invoice status changes to approved",
"type": "string",
"format": "date-time"
},
"voucherNumber": {
"description": "Number generated by folio that will eventually identify the payment request sent out to external financial system.",
"type": "string",
"pattern": "^[a-zA-Z0-9]*$"
},
"acqUnitIds": {
"description": "acquisition unit ids associated with this voucher",
"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}$"
}
},
"metadata": {
"type": "object",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/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",
"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",
"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",
"createdByUserId"
]
}
},
"additionalProperties": false,
"required": [
"amount",
"batchGroupId",
"exportToAccounting",
"invoiceCurrency",
"invoiceId",
"type",
"status",
"systemCurrency",
"voucherNumber"
]
}
Example:
{
"id": "a9b99f8a-7100-47f2-9903-6293d44a9905",
"accountingCode": "0206",
"amount": 23.45,
"batchGroupId": "2a2cb998-1437-41d1-88ad-01930aaeadd5",
"disbursementNumber": "EFT546789",
"disbursementDate": "2019-05-05T00:00:00.000+0000",
"disbursementAmount": 5,
"exchangeRate": 1.12,
"exportToAccounting": false,
"invoiceCurrency": "EUR",
"invoiceId": "c0d08448-347b-418a-8c2f-5fb50248d67e",
"status": "Awaiting payment",
"systemCurrency": "USD",
"type": "Payment",
"voucherDate": "2019-05-06T00:00:00.000+0000",
"voucherNumber": "1000",
"acqUnitIds": [
"1895e539-8dac-441e-b1f5-aab62b3fde60",
"47f504bd-0c1b-498e-a2ae-e2f0a0cea273"
],
"metadata": {
"createdDate": "2019-05-06T00:00:00.000+0000",
"createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
}
}
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"voucher not found"
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
internal server error, contact administrator
Delete voucher item with given {voucherId}
DELETE /voucher-storage/vouchers/{id}
The UUID of a voucher
Requested language. Optional. [lang=en]
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 voucher -- constraint violation"
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"voucher not found"
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
Internal server error, contact administrator
Update voucher item with given {voucherId}
PUT /voucher-storage/vouchers/{id}
The UUID of a voucher
Requested language. Optional. [lang=en]
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "voucher",
"type": "object",
"properties": {
"id": {
"description": "UUID of this voucher",
"$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}$"
},
"accountingCode": {
"description": "Number that represents the vendor is an external accounting system which may include details like \"Address code\" in it. This is the number as stated on the invoice",
"type": "string"
},
"amount": {
"description": "The amount that is actually paid",
"type": "number"
},
"batchGroupId": {
"description": "UUID of the batch group to use when generating batch vouchers",
"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}$",
"default": "2a2cb998-1437-41d1-88ad-01930aaeadd5"
},
"disbursementNumber": {
"description": "The identifier for the physical transaction corresponding to a payment;Brought in from external source",
"type": "string"
},
"disbursementDate": {
"description": "Date payment was made from financial system",
"type": "string",
"format": "date-time"
},
"disbursementAmount": {
"description": "The amount of the payment made outside of FOLIO",
"type": "number"
},
"invoiceCurrency": {
"description": "The currency in which invoice was originally defined",
"type": "string"
},
"invoiceId": {
"description": "Corresponding invoice Id",
"$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}$"
},
"exchangeRate": {
"description": "Exchange rate used to generate transaction",
"type": "number"
},
"exportToAccounting": {
"description": "Export this payment record to a financial system",
"type": "boolean"
},
"status": {
"description": "Status of the voucher",
"type": "string",
"enum": [
"Awaiting payment",
"Paid"
]
},
"systemCurrency": {
"description": "The currency in which the voucher was paid",
"type": "string"
},
"type": {
"description": "Indicates type of payment to account",
"type": "string",
"enum": [
"Payment",
"Pre-payment",
"Credit",
"Voucher"
]
},
"voucherDate": {
"description": "The date the invoice status changes to approved",
"type": "string",
"format": "date-time"
},
"voucherNumber": {
"description": "Number generated by folio that will eventually identify the payment request sent out to external financial system.",
"type": "string",
"pattern": "^[a-zA-Z0-9]*$"
},
"acqUnitIds": {
"description": "acquisition unit ids associated with this voucher",
"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}$"
}
},
"metadata": {
"type": "object",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/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",
"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",
"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",
"createdByUserId"
]
}
},
"additionalProperties": false,
"required": [
"amount",
"batchGroupId",
"exportToAccounting",
"invoiceCurrency",
"invoiceId",
"type",
"status",
"systemCurrency",
"voucherNumber"
]
}
Example:
{
"id": "a9b99f8a-7100-47f2-9903-6293d44a9905",
"accountingCode": "0206",
"amount": 23.45,
"batchGroupId": "2a2cb998-1437-41d1-88ad-01930aaeadd5",
"disbursementNumber": "EFT546789",
"disbursementDate": "2019-05-05T00:00:00.000+0000",
"disbursementAmount": 5,
"exchangeRate": 1.12,
"exportToAccounting": false,
"invoiceCurrency": "EUR",
"invoiceId": "c0d08448-347b-418a-8c2f-5fb50248d67e",
"status": "Awaiting payment",
"systemCurrency": "USD",
"type": "Payment",
"voucherDate": "2019-05-06T00:00:00.000+0000",
"voucherNumber": "1000",
"acqUnitIds": [
"1895e539-8dac-441e-b1f5-aab62b3fde60",
"47f504bd-0c1b-498e-a2ae-e2f0a0cea273"
],
"metadata": {
"createdDate": "2019-05-06T00:00:00.000+0000",
"createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
}
}
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 voucher -- malformed JSON at 13:4"
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"voucher not found"
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
internal server error, contact administrator
Get list of voucher lines
GET /voucher-storage/voucher-lines
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
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 externalAccountNumber
Example:
(username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
externalAccountNumber=="567891045"
Requested language. Optional. [lang=en]
Returns a list of voucher-line items
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "collection of voucher lines",
"type": "object",
"properties": {
"voucherLines": {
"description": "an array of voucher line records",
"id": "voucherLines",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "voucher line",
"properties": {
"id": {
"description": "UUID of this voucher line",
"$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": "Total amount of this voucher",
"type": "number"
},
"externalAccountNumber": {
"description": "All distributions that come from funds with the same account number are grouped by voucher line",
"type": "string"
},
"fundDistributions": {
"description": "List of fund distributions",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Invoice/voucher line fund distribution",
"properties": {
"code": {
"description": "The code of the fund associated with this fund distribution",
"type": "string"
},
"encumbrance": {
"description": "UUID of encumbrance record associated with this fund distribution",
"$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}$"
},
"fundId": {
"description": "UUID of the fund associated with this fund distribution",
"$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}$"
},
"invoiceLineId": {
"description": "UUID of the invoice line associated with this fund distribution",
"$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}$"
},
"distributionType": {
"description": "Percentage or amount type of the value property",
"type": "string",
"enum": [
"amount",
"percentage"
],
"default": "percentage"
},
"expenseClassId": {
"description": "UUID of the expense class associated with this fund distribution",
"$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}$"
},
"value": {
"description": "The percentage of the cost to be applied to this fund",
"type": "number"
}
},
"additionalProperties": false,
"required": [
"fundId",
"distributionType",
"value"
]
},
"minItems": 1
},
"sourceIds": {
"description": "UUID of invoice lines. There could be many invoice lines against a single voucher line. These are group on a voucher line based on External account number",
"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}$"
}
},
"subTransactionId": {
"$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}$"
},
"voucherId": {
"$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}$"
},
"metadata": {
"type": "object",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/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",
"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",
"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",
"createdByUserId"
]
}
},
"additionalProperties": false,
"required": [
"amount",
"externalAccountNumber",
"fundDistributions",
"sourceIds",
"voucherId"
]
}
},
"totalRecords": {
"description": "total number of records in the array",
"type": "integer"
}
},
"required": [
"voucherLines",
"totalRecords"
]
}
Example:
{
"voucherLines": [
{
"id": "7a09dfd7-8588-49b5-bd15-5119414ff0b5",
"amount": 23.45,
"externalAccountNumber": "54321098",
"fundDistributions": [
{
"fundId": "63157e96-0693-426d-b0df-948bacdfdb08",
"distributionType": "percentage",
"value": 50,
"code": "EUHIST",
"encumbrance": "5f9bfc74-f6ff-4877-be1f-793f8ce90ade",
"invoiceLineId": "e0d08448-343b-118a-8c2f-4fb50248d672"
}
],
"sourceIds": [
"e0d08448-343b-118a-8c2f-4fb50248d672"
],
"subTransactionId": "7b1f7179-b83f-4eab-a4db-3c600eebe271",
"voucherId": "a9b99f8a-7100-47f2-9903-6293d44a9905"
}
],
"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 voucher-lines -- malformed parameter 'query', syntax error at column 6
Not authorized to perform requested action
Media type: text/plain
Type: any
Example:
unable to list voucher-lines -- unauthorized
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
internal server error, contact administrator
Create a new voucher-line item.
POST /voucher-storage/voucher-lines
Requested language. Optional. [lang=en]
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "voucher line",
"type": "object",
"properties": {
"id": {
"description": "UUID of this voucher line",
"$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": "Total amount of this voucher",
"type": "number"
},
"externalAccountNumber": {
"description": "All distributions that come from funds with the same account number are grouped by voucher line",
"type": "string"
},
"fundDistributions": {
"description": "List of fund distributions",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Invoice/voucher line fund distribution",
"properties": {
"code": {
"description": "The code of the fund associated with this fund distribution",
"type": "string"
},
"encumbrance": {
"description": "UUID of encumbrance record associated with this fund distribution",
"$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}$"
},
"fundId": {
"description": "UUID of the fund associated with this fund distribution",
"$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}$"
},
"invoiceLineId": {
"description": "UUID of the invoice line associated with this fund distribution",
"$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}$"
},
"distributionType": {
"description": "Percentage or amount type of the value property",
"type": "string",
"enum": [
"amount",
"percentage"
],
"default": "percentage"
},
"expenseClassId": {
"description": "UUID of the expense class associated with this fund distribution",
"$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}$"
},
"value": {
"description": "The percentage of the cost to be applied to this fund",
"type": "number"
}
},
"additionalProperties": false,
"required": [
"fundId",
"distributionType",
"value"
]
},
"minItems": 1
},
"sourceIds": {
"description": "UUID of invoice lines. There could be many invoice lines against a single voucher line. These are group on a voucher line based on External account number",
"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}$"
}
},
"subTransactionId": {
"$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}$"
},
"voucherId": {
"$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}$"
},
"metadata": {
"type": "object",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/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",
"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",
"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",
"createdByUserId"
]
}
},
"additionalProperties": false,
"required": [
"amount",
"externalAccountNumber",
"fundDistributions",
"sourceIds",
"voucherId"
]
}
Example:
{
"id": "7a09dfd7-8588-49b5-bd15-5119414ff0b5",
"amount": 23.45,
"externalAccountNumber": "54321098",
"fundDistributions": [
{
"fundId": "1d1574f1-9196-4a57-8d1f-3b2e4309eb81",
"distributionType": "percentage",
"value": 50,
"code": "USHIST",
"encumbrance": "1c8fc9f4-d2cc-4bd1-aa9a-cb02291cbe65",
"invoiceLineId": "e0d08448-343b-118a-8c2f-4fb50248d672"
},
{
"fundId": "63157e96-0693-426d-b0df-948bacdfdb08",
"distributionType": "percentage",
"value": 50,
"code": "EUHIST",
"encumbrance": "5f9bfc74-f6ff-4877-be1f-793f8ce90ade",
"invoiceLineId": "e0d08448-343b-118a-8c2f-4fb50248d672"
}
],
"sourceIds": [
"e0d08448-343b-118a-8c2f-4fb50248d672"
],
"subTransactionId": "7b1f7179-b83f-4eab-a4db-3c600eebe271",
"voucherId": "a9b99f8a-7100-47f2-9903-6293d44a9905",
"metadata": {
"createdDate": "2019-05-06T00:00:00.000+0000",
"createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
}
}
Returns a newly created item, with server-controlled fields like 'id' populated
URI to the created voucher-line item
Media type: application/json
Type: any
Example:
{
"id": "7a09dfd7-8588-49b5-bd15-5119414ff0b5",
"amount": 23.45,
"externalAccountNumber": "54321098",
"fundDistributions": [
{
"fundId": "1d1574f1-9196-4a57-8d1f-3b2e4309eb81",
"distributionType": "percentage",
"value": 50,
"code": "USHIST",
"encumbrance": "1c8fc9f4-d2cc-4bd1-aa9a-cb02291cbe65",
"invoiceLineId": "e0d08448-343b-118a-8c2f-4fb50248d672"
},
{
"fundId": "63157e96-0693-426d-b0df-948bacdfdb08",
"distributionType": "percentage",
"value": 50,
"code": "EUHIST",
"encumbrance": "5f9bfc74-f6ff-4877-be1f-793f8ce90ade",
"invoiceLineId": "e0d08448-343b-118a-8c2f-4fb50248d672"
}
],
"sourceIds": [
"e0d08448-343b-118a-8c2f-4fb50248d672"
],
"subTransactionId": "7b1f7179-b83f-4eab-a4db-3c600eebe271",
"voucherId": "a9b99f8a-7100-47f2-9903-6293d44a9905",
"metadata": {
"createdDate": "2019-05-06T00:00:00.000+0000",
"createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
}
}
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 add voucher-line -- malformed JSON at 13:3"
Not authorized to perform requested action
Media type: text/plain
Type: any
Example:
unable to create voucher-lines -- unauthorized
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
Internal server error, contact administrator
Update voucher-line item with given {voucher-lineId}
PUT /voucher-storage/voucher-lines/{id}
The UUID of an voucher line
Requested language. Optional. [lang=en]
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "voucher line",
"type": "object",
"properties": {
"id": {
"description": "UUID of this voucher line",
"$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": "Total amount of this voucher",
"type": "number"
},
"externalAccountNumber": {
"description": "All distributions that come from funds with the same account number are grouped by voucher line",
"type": "string"
},
"fundDistributions": {
"description": "List of fund distributions",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Invoice/voucher line fund distribution",
"properties": {
"code": {
"description": "The code of the fund associated with this fund distribution",
"type": "string"
},
"encumbrance": {
"description": "UUID of encumbrance record associated with this fund distribution",
"$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}$"
},
"fundId": {
"description": "UUID of the fund associated with this fund distribution",
"$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}$"
},
"invoiceLineId": {
"description": "UUID of the invoice line associated with this fund distribution",
"$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}$"
},
"distributionType": {
"description": "Percentage or amount type of the value property",
"type": "string",
"enum": [
"amount",
"percentage"
],
"default": "percentage"
},
"expenseClassId": {
"description": "UUID of the expense class associated with this fund distribution",
"$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}$"
},
"value": {
"description": "The percentage of the cost to be applied to this fund",
"type": "number"
}
},
"additionalProperties": false,
"required": [
"fundId",
"distributionType",
"value"
]
},
"minItems": 1
},
"sourceIds": {
"description": "UUID of invoice lines. There could be many invoice lines against a single voucher line. These are group on a voucher line based on External account number",
"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}$"
}
},
"subTransactionId": {
"$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}$"
},
"voucherId": {
"$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}$"
},
"metadata": {
"type": "object",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/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",
"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",
"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",
"createdByUserId"
]
}
},
"additionalProperties": false,
"required": [
"amount",
"externalAccountNumber",
"fundDistributions",
"sourceIds",
"voucherId"
]
}
Example:
{
"id": "7a09dfd7-8588-49b5-bd15-5119414ff0b5",
"amount": 23.45,
"externalAccountNumber": "54321098",
"fundDistributions": [
{
"fundId": "1d1574f1-9196-4a57-8d1f-3b2e4309eb81",
"distributionType": "percentage",
"value": 50,
"code": "USHIST",
"encumbrance": "1c8fc9f4-d2cc-4bd1-aa9a-cb02291cbe65",
"invoiceLineId": "e0d08448-343b-118a-8c2f-4fb50248d672"
},
{
"fundId": "63157e96-0693-426d-b0df-948bacdfdb08",
"distributionType": "percentage",
"value": 50,
"code": "EUHIST",
"encumbrance": "5f9bfc74-f6ff-4877-be1f-793f8ce90ade",
"invoiceLineId": "e0d08448-343b-118a-8c2f-4fb50248d672"
}
],
"sourceIds": [
"e0d08448-343b-118a-8c2f-4fb50248d672"
],
"subTransactionId": "7b1f7179-b83f-4eab-a4db-3c600eebe271",
"voucherId": "a9b99f8a-7100-47f2-9903-6293d44a9905",
"metadata": {
"createdDate": "2019-05-06T00:00:00.000+0000",
"createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
}
}
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 voucher-line -- malformed JSON at 13:4"
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"voucher-line not found"
Validation errors
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/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#",
"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": {
"type": "object",
"description": "Error message parameters",
"$schema": "http://json-schema.org/draft-04/schema#",
"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
Retrieve voucher-line item with given {voucher-lineId}
GET /voucher-storage/voucher-lines/{id}
The UUID of an voucher line
Requested language. Optional. [lang=en]
Returns item with a given ID
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "voucher line",
"type": "object",
"properties": {
"id": {
"description": "UUID of this voucher line",
"$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": "Total amount of this voucher",
"type": "number"
},
"externalAccountNumber": {
"description": "All distributions that come from funds with the same account number are grouped by voucher line",
"type": "string"
},
"fundDistributions": {
"description": "List of fund distributions",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Invoice/voucher line fund distribution",
"properties": {
"code": {
"description": "The code of the fund associated with this fund distribution",
"type": "string"
},
"encumbrance": {
"description": "UUID of encumbrance record associated with this fund distribution",
"$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}$"
},
"fundId": {
"description": "UUID of the fund associated with this fund distribution",
"$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}$"
},
"invoiceLineId": {
"description": "UUID of the invoice line associated with this fund distribution",
"$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}$"
},
"distributionType": {
"description": "Percentage or amount type of the value property",
"type": "string",
"enum": [
"amount",
"percentage"
],
"default": "percentage"
},
"expenseClassId": {
"description": "UUID of the expense class associated with this fund distribution",
"$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}$"
},
"value": {
"description": "The percentage of the cost to be applied to this fund",
"type": "number"
}
},
"additionalProperties": false,
"required": [
"fundId",
"distributionType",
"value"
]
},
"minItems": 1
},
"sourceIds": {
"description": "UUID of invoice lines. There could be many invoice lines against a single voucher line. These are group on a voucher line based on External account number",
"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}$"
}
},
"subTransactionId": {
"$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}$"
},
"voucherId": {
"$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}$"
},
"metadata": {
"type": "object",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/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",
"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",
"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",
"createdByUserId"
]
}
},
"additionalProperties": false,
"required": [
"amount",
"externalAccountNumber",
"fundDistributions",
"sourceIds",
"voucherId"
]
}
Example:
{
"id": "7a09dfd7-8588-49b5-bd15-5119414ff0b5",
"amount": 23.45,
"externalAccountNumber": "54321098",
"fundDistributions": [
{
"fundId": "1d1574f1-9196-4a57-8d1f-3b2e4309eb81",
"distributionType": "percentage",
"value": 50,
"code": "USHIST",
"encumbrance": "1c8fc9f4-d2cc-4bd1-aa9a-cb02291cbe65",
"invoiceLineId": "e0d08448-343b-118a-8c2f-4fb50248d672"
},
{
"fundId": "63157e96-0693-426d-b0df-948bacdfdb08",
"distributionType": "percentage",
"value": 50,
"code": "EUHIST",
"encumbrance": "5f9bfc74-f6ff-4877-be1f-793f8ce90ade",
"invoiceLineId": "e0d08448-343b-118a-8c2f-4fb50248d672"
}
],
"sourceIds": [
"e0d08448-343b-118a-8c2f-4fb50248d672"
],
"subTransactionId": "7b1f7179-b83f-4eab-a4db-3c600eebe271",
"voucherId": "a9b99f8a-7100-47f2-9903-6293d44a9905",
"metadata": {
"createdDate": "2019-05-06T00:00:00.000+0000",
"createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
}
}
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"voucher-line not found"
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
internal server error, contact administrator
Delete voucher-line item with given {voucher-lineId}
DELETE /voucher-storage/voucher-lines/{id}
The UUID of an voucher line
Requested language. Optional. [lang=en]
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 voucher-line -- constraint violation"
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"voucher-line not found"
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
Internal server error, contact administrator