Finance Transaction Summaries (v1.1)

https://github.com/folio-org/mod-finance

Table of contents

Transaction Summaries API

This documents the API calls that can be made to create Transaction summaries for Orders and Invoices

Create a transaction allocation

Create a new order transaction summary

POST /finance/order-transaction-summaries

Create a new order transaction summary, for an order with number of transactions(encumbrances)

POST /finance/order-transaction-summaries
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": "Order transactions summary",
  "type": "object",
  "extends" : {
    "$ref" : "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "description": "UUID of this summary",
      "$ref": "../../common/schemas/uuid.json"
    },
    "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
}

Response 201

Returns processing result of the order-transaction-summaries

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Order transactions summary",
  "type": "object",
  "extends" : {
    "$ref" : "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "description": "UUID of this summary",
      "$ref": "../../common/schemas/uuid.json"
    },
    "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
}

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: 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"

Response 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",
        "$ref": "error.schema"
      }
    },
    "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"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

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

PUT /finance/order-transaction-summaries/{id}

Updated order transaction summary, for an order with number of transactions(encumbrances)

PUT /finance/order-transaction-summaries/{id}
URI Parameters
  • id: required (string)
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": "Order transactions summary",
  "type": "object",
  "extends" : {
    "$ref" : "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "description": "UUID of this summary",
      "$ref": "../../common/schemas/uuid.json"
    },
    "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
}

Response 204

Item successfully updated

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to update order-transaction-summary -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"order-transaction-summary not found"

Response 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",
        "$ref": "error.schema"
      }
    },
    "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"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

Create a transaction allocation

Create a new invoice transaction summary

POST /finance/invoice-transaction-summaries

Create a new invoice transaction summary, for an order with number of transactions(encumbrances) and number of payment credits

POST /finance/invoice-transaction-summaries
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": "Invoice transactions Summary",
  "type": "object",
  "extends" : {
    "$ref" : "../../common/schemas/entity.json"
  },
  "properties": {
    "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
}

Response 201

Returns processing result of the invoice-transaction-summaries

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Invoice transactions Summary",
  "type": "object",
  "extends" : {
    "$ref" : "../../common/schemas/entity.json"
  },
  "properties": {
    "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
}

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: 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"

Response 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",
        "$ref": "error.schema"
      }
    },
    "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"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

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