Batch Vouchers CRUD API version v2.0
http://github.com/folio-org/mod-invoice-storage
Batch Vouchers CRUD API
API used to manage batch vouchers.
/batch-voucher-storage/batch-vouchers
Create a batch voucher
Process batch-vouchers.
post /batch-voucher-storage/batch-vouchers
Process batch-vouchers.
Query Parameters
- lang: (string - default: en - pattern: [a-zA-Z]{2})
Requested language. Optional. [lang=en]
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "top-level batch voucher, i.e. a collection of batched vouchers",
"type": "object",
"properties": {
"id": {
"description": "UUID of batch 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}$"
},
"batchGroup": {
"description": "The human-readable name of the batch group used when generating this batch voucher",
"type": "string"
},
"batchedVouchers": {
"description": "an array of batched voucher records",
"id": "batchVouchers",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A single voucher which is part of a batch voucher",
"properties": {
"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"
},
"batchedVoucherLines": {
"description": "an array of batched voucher line records",
"id": "batchedVoucherLines",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "One line of a batched voucher",
"properties": {
"amount": {
"description": "Total amount of this voucher",
"type": "number"
},
"fundCodes": {
"description": "an array of fund codes",
"id": "fundCodes",
"type": "array",
"items": {
"type": "string"
}
},
"externalAccountNumber": {
"description": "All distributions that come from funds with the same account number are grouped by voucher line",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"amount",
"externalAccountNumber",
"fundCodes"
]
}
},
"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"
},
"enclosureNeeded": {
"description": "Indicates that an enclosure is needed",
"type": "boolean",
"default": false
},
"exchangeRate": {
"description": "Exchange rate used to generate transaction",
"type": "number"
},
"folioInvoiceNo": {
"description": "Represents associated invoice number",
"type": "string"
},
"invoiceCurrency": {
"description": "The currency in which invoice was originally defined",
"type": "string"
},
"invoiceNote": {
"description": "Free-form notes from the invoice",
"type": "string"
},
"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"
]
},
"vendorInvoiceNo": {
"description": "Corresponding invoice's vendorInvoiceNo",
"type": "string"
},
"vendorName": {
"description": "The name of the vendor",
"type": "string"
},
"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]*$"
}
},
"additionalProperties": false,
"required": [
"accountingCode",
"amount",
"batchedVoucherLines",
"folioInvoiceNo",
"invoiceCurrency",
"status",
"systemCurrency",
"type",
"vendorInvoiceNo",
"vendorName",
"voucherDate",
"voucherNumber"
]
}
},
"created": {
"description": "When this batch voucher was created",
"type": "string",
"format": "date-time"
},
"start": {
"description": "This export is for all vouchers between start and end",
"type": "string",
"format": "date-time"
},
"end": {
"description": "This export is for all vouchers between start and end",
"type": "string",
"format": "date-time"
},
"totalRecords": {
"description": "total number of records in the array",
"type": "integer"
}
},
"required": [
"batchGroup",
"batchedVouchers",
"created",
"start",
"end",
"totalRecords"
]
}
Example:
{
"id": "35657479-83b9-4760-9c39-b58dcd02ee27",
"batchGroup": "Amherst College (AC)",
"start": "2019-12-06T00:00:00.000+0000",
"end": "2019-12-07T00:00:00.000+0000",
"created": "2019-12-07T00:01:04.000+0000",
"batchedVouchers": [
{
"accountingCode": "0206",
"amount": 23.45,
"disbursementNumber": "EFT546789",
"disbursementDate": "2019-12-06T00:01:04.000+0000",
"disbursementAmount": 23.45,
"enclosureNeeded": false,
"exchangeRate": 1,
"folioInvoiceNo": "123invoicenumber45",
"invoiceCurrency": "USD",
"invoiceNote": "Process immediately",
"status": "Paid",
"systemCurrency": "USD",
"type": "Voucher",
"voucherDate": "2019-12-06T00:00:00.000+0000",
"voucherNumber": "1023",
"vendorName": "GOBI",
"vendorInvoiceNo": "YK75851",
"batchVoucherLines": [
{
"amount": 23.45,
"externalAccountNumber": "54321098",
"fundCodes": [
"HIST",
"LATHIST",
"CANHIST"
]
}
]
}
],
"totalRecords": 1
}
HTTP status code 201
Returns processing result of the batch-vouchers
Headers
- Location: required(string)
URI to the created batch-voucher item
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "top-level batch voucher, i.e. a collection of batched vouchers",
"type": "object",
"properties": {
"id": {
"description": "UUID of batch 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}$"
},
"batchGroup": {
"description": "The human-readable name of the batch group used when generating this batch voucher",
"type": "string"
},
"batchedVouchers": {
"description": "an array of batched voucher records",
"id": "batchVouchers",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A single voucher which is part of a batch voucher",
"properties": {
"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"
},
"batchedVoucherLines": {
"description": "an array of batched voucher line records",
"id": "batchedVoucherLines",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "One line of a batched voucher",
"properties": {
"amount": {
"description": "Total amount of this voucher",
"type": "number"
},
"fundCodes": {
"description": "an array of fund codes",
"id": "fundCodes",
"type": "array",
"items": {
"type": "string"
}
},
"externalAccountNumber": {
"description": "All distributions that come from funds with the same account number are grouped by voucher line",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"amount",
"externalAccountNumber",
"fundCodes"
]
}
},
"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"
},
"enclosureNeeded": {
"description": "Indicates that an enclosure is needed",
"type": "boolean",
"default": false
},
"exchangeRate": {
"description": "Exchange rate used to generate transaction",
"type": "number"
},
"folioInvoiceNo": {
"description": "Represents associated invoice number",
"type": "string"
},
"invoiceCurrency": {
"description": "The currency in which invoice was originally defined",
"type": "string"
},
"invoiceNote": {
"description": "Free-form notes from the invoice",
"type": "string"
},
"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"
]
},
"vendorInvoiceNo": {
"description": "Corresponding invoice's vendorInvoiceNo",
"type": "string"
},
"vendorName": {
"description": "The name of the vendor",
"type": "string"
},
"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]*$"
}
},
"additionalProperties": false,
"required": [
"accountingCode",
"amount",
"batchedVoucherLines",
"folioInvoiceNo",
"invoiceCurrency",
"status",
"systemCurrency",
"type",
"vendorInvoiceNo",
"vendorName",
"voucherDate",
"voucherNumber"
]
}
},
"created": {
"description": "When this batch voucher was created",
"type": "string",
"format": "date-time"
},
"start": {
"description": "This export is for all vouchers between start and end",
"type": "string",
"format": "date-time"
},
"end": {
"description": "This export is for all vouchers between start and end",
"type": "string",
"format": "date-time"
},
"totalRecords": {
"description": "total number of records in the array",
"type": "integer"
}
},
"required": [
"batchGroup",
"batchedVouchers",
"created",
"start",
"end",
"totalRecords"
]
}
Example:
{
"id": "35657479-83b9-4760-9c39-b58dcd02ee27",
"batchGroup": "Amherst College (AC)",
"start": "2019-12-06T00:00:00.000+0000",
"end": "2019-12-07T00:00:00.000+0000",
"created": "2019-12-07T00:01:04.000+0000",
"batchedVouchers": [
{
"accountingCode": "0206",
"amount": 23.45,
"disbursementNumber": "EFT546789",
"disbursementDate": "2019-12-06T00:01:04.000+0000",
"disbursementAmount": 23.45,
"enclosureNeeded": false,
"exchangeRate": 1,
"folioInvoiceNo": "123invoicenumber45",
"invoiceCurrency": "USD",
"invoiceNote": "Process immediately",
"status": "Paid",
"systemCurrency": "USD",
"type": "Voucher",
"voucherDate": "2019-12-06T00:00:00.000+0000",
"voucherNumber": "1023",
"vendorName": "GOBI",
"vendorInvoiceNo": "YK75851",
"batchVoucherLines": [
{
"amount": 23.45,
"externalAccountNumber": "54321098",
"fundCodes": [
"HIST",
"LATHIST",
"CANHIST"
]
}
]
}
],
"totalRecords": 1
}
HTTP status code 400
Bad request
Body
Media type: text/plain
Type: any
Example:
"unable to process batch-voucher -- constraint violation"
HTTP status code 404
Item with a given ID not found
Body
Media type: text/plain
Type: any
Example:
"batch-voucher not found"
HTTP status code 422
Validation errors
Body
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"
}
]
}
]
}
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
Get and Delete a specific batch voucher. Update operation is not allowed
Retrieve batch-voucher item with given {batch-voucherId}
Delete batch-voucher item with given {batch-voucherId}
get /batch-voucher-storage/batch-vouchers/{id}
Retrieve batch-voucher item with given {batch-voucherId}
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 batch voucher
Query Parameters
- lang: (string - default: en - pattern: [a-zA-Z]{2})
Requested language. Optional. [lang=en]
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": "top-level batch voucher, i.e. a collection of batched vouchers",
"type": "object",
"properties": {
"id": {
"description": "UUID of batch 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}$"
},
"batchGroup": {
"description": "The human-readable name of the batch group used when generating this batch voucher",
"type": "string"
},
"batchedVouchers": {
"description": "an array of batched voucher records",
"id": "batchVouchers",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A single voucher which is part of a batch voucher",
"properties": {
"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"
},
"batchedVoucherLines": {
"description": "an array of batched voucher line records",
"id": "batchedVoucherLines",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "One line of a batched voucher",
"properties": {
"amount": {
"description": "Total amount of this voucher",
"type": "number"
},
"fundCodes": {
"description": "an array of fund codes",
"id": "fundCodes",
"type": "array",
"items": {
"type": "string"
}
},
"externalAccountNumber": {
"description": "All distributions that come from funds with the same account number are grouped by voucher line",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"amount",
"externalAccountNumber",
"fundCodes"
]
}
},
"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"
},
"enclosureNeeded": {
"description": "Indicates that an enclosure is needed",
"type": "boolean",
"default": false
},
"exchangeRate": {
"description": "Exchange rate used to generate transaction",
"type": "number"
},
"folioInvoiceNo": {
"description": "Represents associated invoice number",
"type": "string"
},
"invoiceCurrency": {
"description": "The currency in which invoice was originally defined",
"type": "string"
},
"invoiceNote": {
"description": "Free-form notes from the invoice",
"type": "string"
},
"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"
]
},
"vendorInvoiceNo": {
"description": "Corresponding invoice's vendorInvoiceNo",
"type": "string"
},
"vendorName": {
"description": "The name of the vendor",
"type": "string"
},
"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]*$"
}
},
"additionalProperties": false,
"required": [
"accountingCode",
"amount",
"batchedVoucherLines",
"folioInvoiceNo",
"invoiceCurrency",
"status",
"systemCurrency",
"type",
"vendorInvoiceNo",
"vendorName",
"voucherDate",
"voucherNumber"
]
}
},
"created": {
"description": "When this batch voucher was created",
"type": "string",
"format": "date-time"
},
"start": {
"description": "This export is for all vouchers between start and end",
"type": "string",
"format": "date-time"
},
"end": {
"description": "This export is for all vouchers between start and end",
"type": "string",
"format": "date-time"
},
"totalRecords": {
"description": "total number of records in the array",
"type": "integer"
}
},
"required": [
"batchGroup",
"batchedVouchers",
"created",
"start",
"end",
"totalRecords"
]
}
Example:
{
"id": "35657479-83b9-4760-9c39-b58dcd02ee27",
"batchGroup": "Amherst College (AC)",
"start": "2019-12-06T00:00:00.000+0000",
"end": "2019-12-07T00:00:00.000+0000",
"created": "2019-12-07T00:01:04.000+0000",
"batchedVouchers": [
{
"accountingCode": "0206",
"amount": 23.45,
"disbursementNumber": "EFT546789",
"disbursementDate": "2019-12-06T00:01:04.000+0000",
"disbursementAmount": 23.45,
"enclosureNeeded": false,
"exchangeRate": 1,
"folioInvoiceNo": "123invoicenumber45",
"invoiceCurrency": "USD",
"invoiceNote": "Process immediately",
"status": "Paid",
"systemCurrency": "USD",
"type": "Voucher",
"voucherDate": "2019-12-06T00:00:00.000+0000",
"voucherNumber": "1023",
"vendorName": "GOBI",
"vendorInvoiceNo": "YK75851",
"batchVoucherLines": [
{
"amount": 23.45,
"externalAccountNumber": "54321098",
"fundCodes": [
"HIST",
"LATHIST",
"CANHIST"
]
}
]
}
],
"totalRecords": 1
}
HTTP status code 400
Bad request
Body
Media type: text/plain
Type: any
Example:
"unable to process batch-voucher -- constraint violation"
HTTP status code 404
Item with a given ID not found
Body
Media type: text/plain
Type: any
Example:
"batch-voucher not found"
HTTP status code 422
Validation errors
Body
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"
}
]
}
]
}
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 /batch-voucher-storage/batch-vouchers/{id}
Delete batch-voucher item with given {batch-voucherId}
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 batch voucher
Query Parameters
- lang: (string - default: en - pattern: [a-zA-Z]{2})
Requested language. Optional. [lang=en]
HTTP status code 204
Item deleted successfully
HTTP status code 400
Bad request
Body
Media type: text/plain
Type: any
Example:
"unable to process batch-voucher -- constraint violation"
HTTP status code 404
Item with a given ID not found
Body
Media type: text/plain
Type: any
Example:
"batch-voucher not found"
HTTP status code 422
Validation errors
Body
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"
}
]
}
]
}
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