https://github.com/folio-org/mod-finance
This documents the API calls that can be made to create Transaction summaries for Orders and Invoices
Create a new order transaction summary
Create a new order transaction summary, for an order with number of transactions(encumbrances)
POST /finance/order-transaction-summaries
Requested language. Optional. [lang=en]
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Order transactions summary",
"type": "object",
"properties": {
"id": {
"description": "UUID of this summary",
"$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}$"
},
"numTransactions": {
"description": "Total number of transactions (encumbrances) expected for this order. Negative value indicates that all transactions have been processed",
"type": "integer"
}
},
"additionalProperties": false,
"required": [
"id",
"numTransactions"
]
}
Example:
{
"id": "f2715f25-8504-4698-afd0-3025aa779ac6",
"numTransactions": 1
}
Returns processing result of the order-transaction-summaries
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Order transactions summary",
"type": "object",
"properties": {
"id": {
"description": "UUID of this summary",
"$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}$"
},
"numTransactions": {
"description": "Total number of transactions (encumbrances) expected for this order. Negative value indicates that all transactions have been processed",
"type": "integer"
}
},
"additionalProperties": false,
"required": [
"id",
"numTransactions"
]
}
Example:
{
"id": "f2715f25-8504-4698-afd0-3025aa779ac6",
"numTransactions": 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: application/json
Type: any
Example:
{
"errors": [
{
"message": "may not be null",
"type": "1",
"code": "-1",
"parameters": [
{
"key": "moduleTo",
"value": "null"
}
]
}
]
}
Media type: text/plain
Type: any
Example:
"unable to update order-transaction-summary -- malformed JSON at 13:4"
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: application/json
Type: any
Example:
{
"errors": [
{
"message": "may not be null",
"type": "1",
"code": "-1",
"parameters": [
{
"key": "moduleTo",
"value": "null"
}
]
}
]
}
Media type: text/plain
Type: any
Example:
internal server error, contact administrator
Updated order transaction summary, for an order with number of transactions(encumbrances)
PUT /finance/order-transaction-summaries/{id}
Requested language. Optional. [lang=en]
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Order transactions summary",
"type": "object",
"properties": {
"id": {
"description": "UUID of this summary",
"$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}$"
},
"numTransactions": {
"description": "Total number of transactions (encumbrances) expected for this order. Negative value indicates that all transactions have been processed",
"type": "integer"
}
},
"additionalProperties": false,
"required": [
"id",
"numTransactions"
]
}
Example:
{
"id": "f2715f25-8504-4698-afd0-3025aa779ac6",
"numTransactions": 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 order-transaction-summary -- malformed JSON at 13:4"
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"order-transaction-summary 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
Create a new invoice transaction summary
Create a new invoice transaction summary, for an order with number of transactions(encumbrances) and number of payment credits
POST /finance/invoice-transaction-summaries
Requested language. Optional. [lang=en]
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Invoice transactions Summary",
"type": "object",
"properties": {
"id": {
"description": "UUID of this summary",
"$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}$"
},
"numPendingPayments": {
"description": "Total number of pending payments(transactions) expected for this invoice. Negative value indicates that all transactions have been processed",
"type": "integer"
},
"numPaymentsCredits": {
"description": "Total number of payments/credits(transactions) expected for this invoice. Negative value indicates that all transactions have been processed",
"type": "integer"
}
},
"additionalProperties": false,
"required": [
"id",
"numPendingPayments",
"numPaymentsCredits"
]
}
Example:
{
"id": "ff5bf77f-8e30-459b-bc98-ddcbd764e3f0",
"numPendingPayments": -10,
"numPaymentsCredits": 10
}
Returns processing result of the invoice-transaction-summaries
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Invoice transactions Summary",
"type": "object",
"properties": {
"id": {
"description": "UUID of this summary",
"$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}$"
},
"numPendingPayments": {
"description": "Total number of pending payments(transactions) expected for this invoice. Negative value indicates that all transactions have been processed",
"type": "integer"
},
"numPaymentsCredits": {
"description": "Total number of payments/credits(transactions) expected for this invoice. Negative value indicates that all transactions have been processed",
"type": "integer"
}
},
"additionalProperties": false,
"required": [
"id",
"numPendingPayments",
"numPaymentsCredits"
]
}
Example:
{
"id": "ff5bf77f-8e30-459b-bc98-ddcbd764e3f0",
"numPendingPayments": -10,
"numPaymentsCredits": 10
}
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: application/json
Type: any
Example:
{
"errors": [
{
"message": "may not be null",
"type": "1",
"code": "-1",
"parameters": [
{
"key": "moduleTo",
"value": "null"
}
]
}
]
}
Media type: text/plain
Type: any
Example:
"unable to update invoice-transaction-summary -- malformed JSON at 13:4"
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: application/json
Type: any
Example:
{
"errors": [
{
"message": "may not be null",
"type": "1",
"code": "-1",
"parameters": [
{
"key": "moduleTo",
"value": "null"
}
]
}
]
}
Media type: text/plain
Type: any
Example:
internal server error, contact administrator
Updated invoice transaction summary, for an invoice with number of pending payments and number of payment/credits
PUT /finance/invoice-transaction-summaries/{id}
Requested language. Optional. [lang=en]
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Invoice transactions Summary",
"type": "object",
"properties": {
"id": {
"description": "UUID of this summary",
"$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}$"
},
"numPendingPayments": {
"description": "Total number of pending payments(transactions) expected for this invoice. Negative value indicates that all transactions have been processed",
"type": "integer"
},
"numPaymentsCredits": {
"description": "Total number of payments/credits(transactions) expected for this invoice. Negative value indicates that all transactions have been processed",
"type": "integer"
}
},
"additionalProperties": false,
"required": [
"id",
"numPendingPayments",
"numPaymentsCredits"
]
}
Example:
{
"id": "ff5bf77f-8e30-459b-bc98-ddcbd764e3f0",
"numPendingPayments": -10,
"numPaymentsCredits": 10
}
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 invoice-transaction-summary -- malformed JSON at 13:4"
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"invoice-transaction-summary 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