mod-finance-storage (v4)

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

Table of contents

mod-finance-storage (Transactions)

CRUD APIs used to manage transactions.

/finance-storage/transactions

Entity representing a transaction

GET /finance-storage/transactions

Get list of transactions

GET /finance-storage/transactions
Query Parameters
  • query: (string)

    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 code

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    ["code", "MEDGRANT", "="]
    
  • totalRecords: (string - default: auto - pattern: exact|estimated|none|auto)

    How to calculate the totalRecords property. "exact" for the correct number, "estimated" for an estimation, "auto" to automatically select "exact" or "estimated", "none" for suppressing the totalRecords property. For details see https://github.com/folio-org/raml-module-builder#estimated-totalrecords

    Example:

    none
  • offset: (integer - default: 0 - minimum: 0 - maximum: 2147483647)

    Skip over a number of elements by specifying an offset value for the query

    Example:

    0
  • limit: (integer - default: 10 - minimum: 0 - maximum: 2147483647)

    Limit the number of elements returned in the response

    Example:

    10

Response 200

Returns item with a given ID

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A collection of transactions",
  "type": "object",
  "properties": {
    "transactions": {
      "description": "The list of objects contained in this collection",
      "type": "array",
      "id": "transactions",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "A financial transaction",
        "javaName": "transaction",
        "properties": {
          "id": {
            "description": "UUID of this transaction",
            "$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}$"
          },
          "_version": {
            "type": "integer",
            "description": "Record version for optimistic locking"
          },
          "amount": {
            "description": "The amount of this transaction. For encumbrances: This is initialAmountEncumbered - (amountAwaitingPayment + amountExpended)",
            "type": "number"
          },
          "awaitingPayment": {
            "description": "Pending payment sub-object - holds awaiting payment-specific information not applicable to other transaction types",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "object",
            "properties": {
              "encumbranceId": {
                "description": "UUID of the encumbrance to updated",
                "$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}$"
              },
              "releaseEncumbrance": {
                "description": "Whether or not remaining encumbered money should be released",
                "type": "boolean",
                "default": false
              }
            },
            "additionalProperties": false
          },
          "currency": {
            "description": "Currency code for this transaction - from the system currency",
            "type": "string"
          },
          "description": {
            "description": "Description of this transaction",
            "type": "string"
          },
          "encumbrance": {
            "description": "Encumbrance sub-object - holds encumbrance-specific information not applicable to other transaction types",
            "type": "object",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "properties": {
              "amountAwaitingPayment": {
                "default": 0,
                "description": "Deprecated! Going to be removed in next release. The amount of awaiting for payment",
                "type": "number"
              },
              "amountCredited": {
                "default": 0,
                "description": "The amount currently credited to this encumbrance",
                "type": "number"
              },
              "amountExpended": {
                "default": 0,
                "description": "The amount currently expended by this encumbrance",
                "type": "number"
              },
              "initialAmountEncumbered": {
                "default": 0,
                "description": "The initial amount of this encumbrance. Shouldn't change once create",
                "type": "number"
              },
              "status": {
                "default": "Unreleased",
                "description": "The status of this encumbrance",
                "type": "string",
                "enum": [
                  "Released",
                  "Unreleased",
                  "Pending"
                ]
              },
              "orderType": {
                "description": "Taken from the purchase order",
                "type": "string",
                "enum": [
                  "One-Time",
                  "Ongoing"
                ]
              },
              "orderStatus": {
                "description": "Taken from the purchase order",
                "type": "string",
                "default": "Open",
                "enum": [
                  "Pending",
                  "Open",
                  "Closed"
                ]
              },
              "subscription": {
                "description": "Taken from the purchase Order,for fiscal year rollover",
                "type": "boolean"
              },
              "reEncumber": {
                "description": "Taken from the purchase Order,for fiscal year rollover",
                "type": "boolean"
              },
              "sourcePurchaseOrderId": {
                "description": "UUID of the purchase order associated with this encumbrance",
                "$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}$"
              },
              "sourcePoLineId": {
                "description": "UUID of the poLine associated with this encumbrance",
                "$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}$"
              }
            },
            "additionalProperties": false,
            "required": [
              "initialAmountEncumbered",
              "status",
              "orderType",
              "subscription",
              "reEncumber",
              "sourcePurchaseOrderId",
              "sourcePoLineId"
            ]
          },
          "expenseClassId": {
            "description": "UUID of the associated expense class",
            "type": "string",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "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}$"
          },
          "fiscalYearId": {
            "description": "UUID of the fiscal year that the transaction is taking place in",
            "$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}$"
          },
          "fromFundId": {
            "description": "UUID of the fund money is moving from",
            "$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}$"
          },
          "invoiceCancelled": {
            "description": "Indicates that related invoice was cancelled",
            "type": "boolean"
          },
          "paymentEncumbranceId": {
            "description": "UUID of the encumbrance associated with this payment/credit taking place.",
            "$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}$"
          },
          "source": {
            "description": "The readable identifier of the record that resulted in the creation of this transaction",
            "type": "string",
            "enum": [
              "User",
              "PoLine",
              "Invoice"
            ]
          },
          "sourceFiscalYearId": {
            "description": "UUID of the fiscal year that triggered the creation of this transaction (Used during fiscal year rollover)",
            "$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}$"
          },
          "sourceInvoiceId": {
            "description": "UUID of the Invoice that triggered the creation of this transaction",
            "$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}$"
          },
          "sourceInvoiceLineId": {
            "description": "UUID of the Invoice Line that triggered the creation of this transaction",
            "$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}$"
          },
          "tags": {
            "description": "Arbitrary tags associated with this transaction",
            "type": "object",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "tags.schema",
            "title": "tags",
            "properties": {
              "tagList": {
                "description": "List of tags",
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "additionalProperties": false
          },
          "toFundId": {
            "description": "UUID of the fund money is moving to",
            "$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}$"
          },
          "transactionType": {
            "description": "This describes the type of transaction",
            "enum": [
              "Allocation",
              "Credit",
              "Encumbrance",
              "Payment",
              "Pending payment",
              "Rollover transfer",
              "Transfer"
            ],
            "type": "string"
          },
          "voidedAmount": {
            "description": "Voided amount, not to be counted in budget totals",
            "type": "number"
          },
          "metadata": {
            "readonly": true,
            "type": "object",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "metadata.schema",
            "title": "Metadata Schema",
            "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
            "properties": {
              "createdDate": {
                "description": "Date and time when the record was created",
                "type": "string",
                "format": "date-time"
              },
              "createdByUserId": {
                "description": "ID of the user who created the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "createdByUsername": {
                "description": "Username of the user who created the record (when available)",
                "type": "string"
              },
              "updatedDate": {
                "description": "Date and time when the record was last updated",
                "type": "string",
                "format": "date-time"
              },
              "updatedByUserId": {
                "description": "ID of the user who last updated the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "updatedByUsername": {
                "description": "Username of the user who last updated the record (when available)",
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "createdDate"
            ]
          }
        },
        "required": [
          "amount",
          "currency",
          "fiscalYearId",
          "source",
          "transactionType"
        ],
        "additionalProperties": false
      }
    },
    "totalRecords": {
      "description": "The number of objects in this collection",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "transactions",
    "totalRecords"
  ]
}

Example:

{
  "transactions": [
    {
      "id": "12ac70a4-5c9d-112f-9acb-852adf67d7e1",
      "amount": 140.80,
      "currency": "USD",
      "description": "PO_Line: History of Incas",
      "encumbrance": {
        "amountExpended": 1567.92,
        "amountAwaitingPayment": 12.50,
        "initialAmountEncumbered": 1720.50,
        "status": "Unreleased",
        "orderType":  "One-Time",
        "orderStatus":  "Open",
        "subscription": false,
        "reEncumber": false,
        "sourcePurchaseOrderId": "e5ae4afd-3fa9-494e-a972-f541df9b877e",
        "sourcePoLineId": "c5ced39d-672f-3cba-a13a-ceb06a5d4c6b"
      },
      "fiscalYearId": "4438bc3b-4b4a-4e5e-9886-5f69b48a7a32",
      "fromFundId": "27f27438-3197-4281-a353-511829421d6e",
      "invoiceCancelled": false,
      "paymentEncumbranceId": "80c28fb4-c34e-48d6-b8c2-de6660c3e0aa",
      "source": "Invoice",
      "sourceFiscalYearId": "01705ce5-3c3d-4c30-b23d-a36feec28259",
      "sourceInvoiceId": "b360db6c-b825-4d74-ac63-5be506892e2b",
      "tags": {
        "tagList": [
          "important"
        ]
      },
      "toFundId": "2e51c019-97f3-4523-87e9-59250e3b48bc",
      "transactionType": "Encumbrance",
      "voidedAmount" : 15,
      "metadata": {
        "createdDate": "2018-07-19T00:00:00.000+0000",
        "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
      }
    },
    {
      "id": "a4780d61-e9c7-4206-b203-a8b22a6d5c38",
      "amount": 25,
      "currency": "USD",
      "description": "PO_Line: History of Incas",
      "fiscalYearId": "684b5dc5-92f6-4db7-b996-b549d88f5e4e",
      "fromFundId": "7fbd5d84-62d1-44c6-9c45-6cb173998bbd",
      "paymentEncumbranceId": "80c28fb4-c34e-48d6-b8c2-de6660c3e0aa",
      "source": "Invoice",
      "sourceFiscalYearId": "684b5dc5-92f6-4db7-b996-b549d88f5e4e",
      "sourceInvoiceId": "041c1fe8-adfa-44eb-b6b3-f85acdd71f81",
      "sourceInvoiceLineId": "2be1e551-be27-4b03-b770-30e5e8211d19",
      "tags": {
        "tagList": [
          "important"
        ]
      },
      "toFundId": "69640328-788e-43fc-9c3c-af39e243f3b7",
      "transactionType": "Payment",
      "voidedAmount" : 0
    }
  ],
  "totalRecords": 2
}

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 list transactions -- malformed parameter 'query', syntax error at column 6"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

"unable to list transactions -- unauthorized"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"transaction not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

GET /finance-storage/transactions/{id}

Retrieve transaction item with given {transactionId}

GET /finance-storage/transactions/{id}
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 transaction

Response 200

Returns item with a given ID

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A financial transaction",
  "type": "object",
  "javaName": "transaction",
  "properties": {
    "id": {
      "description": "UUID of this transaction",
      "$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}$"
    },
    "_version": {
      "type": "integer",
      "description": "Record version for optimistic locking"
    },
    "amount": {
      "description": "The amount of this transaction. For encumbrances: This is initialAmountEncumbered - (amountAwaitingPayment + amountExpended)",
      "type": "number"
    },
    "awaitingPayment": {
      "description": "Pending payment sub-object - holds awaiting payment-specific information not applicable to other transaction types",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "object",
      "properties": {
        "encumbranceId": {
          "description": "UUID of the encumbrance to updated",
          "$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}$"
        },
        "releaseEncumbrance": {
          "description": "Whether or not remaining encumbered money should be released",
          "type": "boolean",
          "default": false
        }
      },
      "additionalProperties": false
    },
    "currency": {
      "description": "Currency code for this transaction - from the system currency",
      "type": "string"
    },
    "description": {
      "description": "Description of this transaction",
      "type": "string"
    },
    "encumbrance": {
      "description": "Encumbrance sub-object - holds encumbrance-specific information not applicable to other transaction types",
      "type": "object",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "properties": {
        "amountAwaitingPayment": {
          "default": 0,
          "description": "Deprecated! Going to be removed in next release. The amount of awaiting for payment",
          "type": "number"
        },
        "amountCredited": {
          "default": 0,
          "description": "The amount currently credited to this encumbrance",
          "type": "number"
        },
        "amountExpended": {
          "default": 0,
          "description": "The amount currently expended by this encumbrance",
          "type": "number"
        },
        "initialAmountEncumbered": {
          "default": 0,
          "description": "The initial amount of this encumbrance. Shouldn't change once create",
          "type": "number"
        },
        "status": {
          "default": "Unreleased",
          "description": "The status of this encumbrance",
          "type": "string",
          "enum": [
            "Released",
            "Unreleased",
            "Pending"
          ]
        },
        "orderType": {
          "description": "Taken from the purchase order",
          "type": "string",
          "enum": [
            "One-Time",
            "Ongoing"
          ]
        },
        "orderStatus": {
          "description": "Taken from the purchase order",
          "type": "string",
          "default": "Open",
          "enum": [
            "Pending",
            "Open",
            "Closed"
          ]
        },
        "subscription": {
          "description": "Taken from the purchase Order,for fiscal year rollover",
          "type": "boolean"
        },
        "reEncumber": {
          "description": "Taken from the purchase Order,for fiscal year rollover",
          "type": "boolean"
        },
        "sourcePurchaseOrderId": {
          "description": "UUID of the purchase order associated with this encumbrance",
          "$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}$"
        },
        "sourcePoLineId": {
          "description": "UUID of the poLine associated with this encumbrance",
          "$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}$"
        }
      },
      "additionalProperties": false,
      "required": [
        "initialAmountEncumbered",
        "status",
        "orderType",
        "subscription",
        "reEncumber",
        "sourcePurchaseOrderId",
        "sourcePoLineId"
      ]
    },
    "expenseClassId": {
      "description": "UUID of the associated expense class",
      "type": "string",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "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}$"
    },
    "fiscalYearId": {
      "description": "UUID of the fiscal year that the transaction is taking place in",
      "$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}$"
    },
    "fromFundId": {
      "description": "UUID of the fund money is moving from",
      "$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}$"
    },
    "invoiceCancelled": {
      "description": "Indicates that related invoice was cancelled",
      "type": "boolean"
    },
    "paymentEncumbranceId": {
      "description": "UUID of the encumbrance associated with this payment/credit taking place.",
      "$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}$"
    },
    "source": {
      "description": "The readable identifier of the record that resulted in the creation of this transaction",
      "type": "string",
      "enum": [
        "User",
        "PoLine",
        "Invoice"
      ]
    },
    "sourceFiscalYearId": {
      "description": "UUID of the fiscal year that triggered the creation of this transaction (Used during fiscal year rollover)",
      "$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}$"
    },
    "sourceInvoiceId": {
      "description": "UUID of the Invoice that triggered the creation of this transaction",
      "$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}$"
    },
    "sourceInvoiceLineId": {
      "description": "UUID of the Invoice Line that triggered the creation of this transaction",
      "$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}$"
    },
    "tags": {
      "description": "Arbitrary tags associated with this transaction",
      "type": "object",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "id": "tags.schema",
      "title": "tags",
      "properties": {
        "tagList": {
          "description": "List of tags",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "toFundId": {
      "description": "UUID of the fund money is moving to",
      "$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}$"
    },
    "transactionType": {
      "description": "This describes the type of transaction",
      "enum": [
        "Allocation",
        "Credit",
        "Encumbrance",
        "Payment",
        "Pending payment",
        "Rollover transfer",
        "Transfer"
      ],
      "type": "string"
    },
    "voidedAmount": {
      "description": "Voided amount, not to be counted in budget totals",
      "type": "number"
    },
    "metadata": {
      "readonly": true,
      "type": "object",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "id": "metadata.schema",
      "title": "Metadata Schema",
      "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
      "properties": {
        "createdDate": {
          "description": "Date and time when the record was created",
          "type": "string",
          "format": "date-time"
        },
        "createdByUserId": {
          "description": "ID of the user who created the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "updatedDate": {
          "description": "Date and time when the record was last updated",
          "type": "string",
          "format": "date-time"
        },
        "updatedByUserId": {
          "description": "ID of the user who last updated the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    }
  },
  "required": [
    "amount",
    "currency",
    "fiscalYearId",
    "source",
    "transactionType"
  ],
  "additionalProperties": false
}

Example:

{
  "id": "12ac70a4-5c9d-112f-9acb-852adf67d7e1",
  "amount": 25,
  "currency": "USD",
  "description": "PO_Line: History of Incas",
  "fiscalYearId": "4438bc3b-4b4a-4e5e-9886-5f69b48a7a32",
  "fromFundId": "27f27438-3197-4281-a353-511829421d6e",
  "invoiceCancelled": false,
  "paymentEncumbranceId": "80c28fb4-c34e-48d6-b8c2-de6660c3e0aa",
  "source": "Invoice",
  "sourceFiscalYearId": "01705ce5-3c3d-4c30-b23d-a36feec28259",
  "sourceInvoiceId": "b360db6c-b825-4d74-ac63-5be506892e2b",
  "sourceInvoiceLineId": "2be1e551-be27-4b03-b770-30e5e8211d19",
  "tags": {
    "tagList": [
      "important"
    ]
  },
  "toFundId": "2e51c019-97f3-4523-87e9-59250e3b48bc",
  "transactionType": "Payment",
  "voidedAmount" : 15,
  "metadata": {
    "createdDate": "2018-07-19T00:00:00.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

Response 401

Not authorized to perform requested action

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 get retrieve transaction -- unauthorized

Response 404

Item with a given ID not found

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:

"transaction not found"

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

POST /finance-storage/transactions/batch-all-or-nothing

Process actions on transactions in a single all-or-nothing operation

POST /finance-storage/transactions/batch-all-or-nothing
Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Batch processing of transactions",
  "type": "object",
  "properties": {
    "transactionsToCreate": {
      "description": "Transactions to create (they must include the id)",
      "type": "array",
      "items": {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "A financial transaction",
        "type": "object",
        "javaName": "transaction",
        "properties": {
          "id": {
            "description": "UUID of this transaction",
            "$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}$"
          },
          "_version": {
            "type": "integer",
            "description": "Record version for optimistic locking"
          },
          "amount": {
            "description": "The amount of this transaction. For encumbrances: This is initialAmountEncumbered - (amountAwaitingPayment + amountExpended)",
            "type": "number"
          },
          "awaitingPayment": {
            "description": "Pending payment sub-object - holds awaiting payment-specific information not applicable to other transaction types",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "object",
            "properties": {
              "encumbranceId": {
                "description": "UUID of the encumbrance to updated",
                "$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}$"
              },
              "releaseEncumbrance": {
                "description": "Whether or not remaining encumbered money should be released",
                "type": "boolean",
                "default": false
              }
            },
            "additionalProperties": false
          },
          "currency": {
            "description": "Currency code for this transaction - from the system currency",
            "type": "string"
          },
          "description": {
            "description": "Description of this transaction",
            "type": "string"
          },
          "encumbrance": {
            "description": "Encumbrance sub-object - holds encumbrance-specific information not applicable to other transaction types",
            "type": "object",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "properties": {
              "amountAwaitingPayment": {
                "default": 0,
                "description": "Deprecated! Going to be removed in next release. The amount of awaiting for payment",
                "type": "number"
              },
              "amountCredited": {
                "default": 0,
                "description": "The amount currently credited to this encumbrance",
                "type": "number"
              },
              "amountExpended": {
                "default": 0,
                "description": "The amount currently expended by this encumbrance",
                "type": "number"
              },
              "initialAmountEncumbered": {
                "default": 0,
                "description": "The initial amount of this encumbrance. Shouldn't change once create",
                "type": "number"
              },
              "status": {
                "default": "Unreleased",
                "description": "The status of this encumbrance",
                "type": "string",
                "enum": [
                  "Released",
                  "Unreleased",
                  "Pending"
                ]
              },
              "orderType": {
                "description": "Taken from the purchase order",
                "type": "string",
                "enum": [
                  "One-Time",
                  "Ongoing"
                ]
              },
              "orderStatus": {
                "description": "Taken from the purchase order",
                "type": "string",
                "default": "Open",
                "enum": [
                  "Pending",
                  "Open",
                  "Closed"
                ]
              },
              "subscription": {
                "description": "Taken from the purchase Order,for fiscal year rollover",
                "type": "boolean"
              },
              "reEncumber": {
                "description": "Taken from the purchase Order,for fiscal year rollover",
                "type": "boolean"
              },
              "sourcePurchaseOrderId": {
                "description": "UUID of the purchase order associated with this encumbrance",
                "$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}$"
              },
              "sourcePoLineId": {
                "description": "UUID of the poLine associated with this encumbrance",
                "$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}$"
              }
            },
            "additionalProperties": false,
            "required": [
              "initialAmountEncumbered",
              "status",
              "orderType",
              "subscription",
              "reEncumber",
              "sourcePurchaseOrderId",
              "sourcePoLineId"
            ]
          },
          "expenseClassId": {
            "description": "UUID of the associated expense class",
            "type": "string",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "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}$"
          },
          "fiscalYearId": {
            "description": "UUID of the fiscal year that the transaction is taking place in",
            "$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}$"
          },
          "fromFundId": {
            "description": "UUID of the fund money is moving from",
            "$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}$"
          },
          "invoiceCancelled": {
            "description": "Indicates that related invoice was cancelled",
            "type": "boolean"
          },
          "paymentEncumbranceId": {
            "description": "UUID of the encumbrance associated with this payment/credit taking place.",
            "$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}$"
          },
          "source": {
            "description": "The readable identifier of the record that resulted in the creation of this transaction",
            "type": "string",
            "enum": [
              "User",
              "PoLine",
              "Invoice"
            ]
          },
          "sourceFiscalYearId": {
            "description": "UUID of the fiscal year that triggered the creation of this transaction (Used during fiscal year rollover)",
            "$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}$"
          },
          "sourceInvoiceId": {
            "description": "UUID of the Invoice that triggered the creation of this transaction",
            "$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}$"
          },
          "sourceInvoiceLineId": {
            "description": "UUID of the Invoice Line that triggered the creation of this transaction",
            "$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}$"
          },
          "tags": {
            "description": "Arbitrary tags associated with this transaction",
            "type": "object",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "tags.schema",
            "title": "tags",
            "properties": {
              "tagList": {
                "description": "List of tags",
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "additionalProperties": false
          },
          "toFundId": {
            "description": "UUID of the fund money is moving to",
            "$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}$"
          },
          "transactionType": {
            "description": "This describes the type of transaction",
            "enum": [
              "Allocation",
              "Credit",
              "Encumbrance",
              "Payment",
              "Pending payment",
              "Rollover transfer",
              "Transfer"
            ],
            "type": "string"
          },
          "voidedAmount": {
            "description": "Voided amount, not to be counted in budget totals",
            "type": "number"
          },
          "metadata": {
            "readonly": true,
            "type": "object",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "metadata.schema",
            "title": "Metadata Schema",
            "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
            "properties": {
              "createdDate": {
                "description": "Date and time when the record was created",
                "type": "string",
                "format": "date-time"
              },
              "createdByUserId": {
                "description": "ID of the user who created the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "createdByUsername": {
                "description": "Username of the user who created the record (when available)",
                "type": "string"
              },
              "updatedDate": {
                "description": "Date and time when the record was last updated",
                "type": "string",
                "format": "date-time"
              },
              "updatedByUserId": {
                "description": "ID of the user who last updated the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "updatedByUsername": {
                "description": "Username of the user who last updated the record (when available)",
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "createdDate"
            ]
          }
        },
        "required": [
          "amount",
          "currency",
          "fiscalYearId",
          "source",
          "transactionType"
        ],
        "additionalProperties": false
      }
    },
    "transactionsToUpdate": {
      "description": "Transactions to update",
      "type": "array",
      "items": {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "A financial transaction",
        "type": "object",
        "javaName": "transaction",
        "properties": {
          "id": {
            "description": "UUID of this transaction",
            "$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}$"
          },
          "_version": {
            "type": "integer",
            "description": "Record version for optimistic locking"
          },
          "amount": {
            "description": "The amount of this transaction. For encumbrances: This is initialAmountEncumbered - (amountAwaitingPayment + amountExpended)",
            "type": "number"
          },
          "awaitingPayment": {
            "description": "Pending payment sub-object - holds awaiting payment-specific information not applicable to other transaction types",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "object",
            "properties": {
              "encumbranceId": {
                "description": "UUID of the encumbrance to updated",
                "$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}$"
              },
              "releaseEncumbrance": {
                "description": "Whether or not remaining encumbered money should be released",
                "type": "boolean",
                "default": false
              }
            },
            "additionalProperties": false
          },
          "currency": {
            "description": "Currency code for this transaction - from the system currency",
            "type": "string"
          },
          "description": {
            "description": "Description of this transaction",
            "type": "string"
          },
          "encumbrance": {
            "description": "Encumbrance sub-object - holds encumbrance-specific information not applicable to other transaction types",
            "type": "object",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "properties": {
              "amountAwaitingPayment": {
                "default": 0,
                "description": "Deprecated! Going to be removed in next release. The amount of awaiting for payment",
                "type": "number"
              },
              "amountCredited": {
                "default": 0,
                "description": "The amount currently credited to this encumbrance",
                "type": "number"
              },
              "amountExpended": {
                "default": 0,
                "description": "The amount currently expended by this encumbrance",
                "type": "number"
              },
              "initialAmountEncumbered": {
                "default": 0,
                "description": "The initial amount of this encumbrance. Shouldn't change once create",
                "type": "number"
              },
              "status": {
                "default": "Unreleased",
                "description": "The status of this encumbrance",
                "type": "string",
                "enum": [
                  "Released",
                  "Unreleased",
                  "Pending"
                ]
              },
              "orderType": {
                "description": "Taken from the purchase order",
                "type": "string",
                "enum": [
                  "One-Time",
                  "Ongoing"
                ]
              },
              "orderStatus": {
                "description": "Taken from the purchase order",
                "type": "string",
                "default": "Open",
                "enum": [
                  "Pending",
                  "Open",
                  "Closed"
                ]
              },
              "subscription": {
                "description": "Taken from the purchase Order,for fiscal year rollover",
                "type": "boolean"
              },
              "reEncumber": {
                "description": "Taken from the purchase Order,for fiscal year rollover",
                "type": "boolean"
              },
              "sourcePurchaseOrderId": {
                "description": "UUID of the purchase order associated with this encumbrance",
                "$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}$"
              },
              "sourcePoLineId": {
                "description": "UUID of the poLine associated with this encumbrance",
                "$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}$"
              }
            },
            "additionalProperties": false,
            "required": [
              "initialAmountEncumbered",
              "status",
              "orderType",
              "subscription",
              "reEncumber",
              "sourcePurchaseOrderId",
              "sourcePoLineId"
            ]
          },
          "expenseClassId": {
            "description": "UUID of the associated expense class",
            "type": "string",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "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}$"
          },
          "fiscalYearId": {
            "description": "UUID of the fiscal year that the transaction is taking place in",
            "$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}$"
          },
          "fromFundId": {
            "description": "UUID of the fund money is moving from",
            "$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}$"
          },
          "invoiceCancelled": {
            "description": "Indicates that related invoice was cancelled",
            "type": "boolean"
          },
          "paymentEncumbranceId": {
            "description": "UUID of the encumbrance associated with this payment/credit taking place.",
            "$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}$"
          },
          "source": {
            "description": "The readable identifier of the record that resulted in the creation of this transaction",
            "type": "string",
            "enum": [
              "User",
              "PoLine",
              "Invoice"
            ]
          },
          "sourceFiscalYearId": {
            "description": "UUID of the fiscal year that triggered the creation of this transaction (Used during fiscal year rollover)",
            "$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}$"
          },
          "sourceInvoiceId": {
            "description": "UUID of the Invoice that triggered the creation of this transaction",
            "$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}$"
          },
          "sourceInvoiceLineId": {
            "description": "UUID of the Invoice Line that triggered the creation of this transaction",
            "$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}$"
          },
          "tags": {
            "description": "Arbitrary tags associated with this transaction",
            "type": "object",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "tags.schema",
            "title": "tags",
            "properties": {
              "tagList": {
                "description": "List of tags",
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "additionalProperties": false
          },
          "toFundId": {
            "description": "UUID of the fund money is moving to",
            "$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}$"
          },
          "transactionType": {
            "description": "This describes the type of transaction",
            "enum": [
              "Allocation",
              "Credit",
              "Encumbrance",
              "Payment",
              "Pending payment",
              "Rollover transfer",
              "Transfer"
            ],
            "type": "string"
          },
          "voidedAmount": {
            "description": "Voided amount, not to be counted in budget totals",
            "type": "number"
          },
          "metadata": {
            "readonly": true,
            "type": "object",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "metadata.schema",
            "title": "Metadata Schema",
            "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
            "properties": {
              "createdDate": {
                "description": "Date and time when the record was created",
                "type": "string",
                "format": "date-time"
              },
              "createdByUserId": {
                "description": "ID of the user who created the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "createdByUsername": {
                "description": "Username of the user who created the record (when available)",
                "type": "string"
              },
              "updatedDate": {
                "description": "Date and time when the record was last updated",
                "type": "string",
                "format": "date-time"
              },
              "updatedByUserId": {
                "description": "ID of the user who last updated the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "updatedByUsername": {
                "description": "Username of the user who last updated the record (when available)",
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "createdDate"
            ]
          }
        },
        "required": [
          "amount",
          "currency",
          "fiscalYearId",
          "source",
          "transactionType"
        ],
        "additionalProperties": false
      }
    },
    "idsOfTransactionsToDelete": {
      "description": "Ids of transactions to delete",
      "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}$"
      }
    },
    "transactionPatches": {
      "description": "Transaction patches (incomplete transactions that must include the id)",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "$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}$"
          }
        },
        "additionalProperties": true,
        "required": [
          "id"
        ]
      }
    }
  },
  "additionalProperties": false
}

Example:

{
  "transactionsToCreate": [
    {
      "id": "c5732efb-9536-4a49-a22e-1ec6ca8a7922",
      "amount": 25,
      "awaitingPayment": {
        "encumbranceId": "12ac70a4-5c9d-112f-9acb-852adf67d7e1",
        "releaseEncumbrance": true
      },
      "currency": "USD",
      "description": "PO_Line: History of Incas",
      "fiscalYearId": "684b5dc5-92f6-4db7-b996-b549d88f5e4e",
      "fromFundId": "7fbd5d84-62d1-44c6-9c45-6cb173998bbd",
      "invoiceCancelled": false,
      "source": "Invoice",
      "sourceInvoiceId": "5925e966-f242-4842-9d5e-b33a651bb390",
      "sourceInvoiceLineId": "ee60ee78-f487-4940-adcf-fa0726989823",
      "transactionType": "Pending payment"
    }
  ],
  "transactionsToUpdate": [
    {
      "id": "b7553168-60af-4e6d-bcd3-078199a0b353",
      "amount": 25.17,
      "currency": "USD",
      "description": "PO_Line: History of Incas",
      "encumbrance": {
        "amountExpended": 1567.92,
        "amountAwaitingPayment": 12.50,
        "initialAmountEncumbered": 1720.50,
        "status": "Unreleased",
        "orderType":  "One-Time",
        "orderStatus":  "Open",
        "subscription": false,
        "reEncumber": false,
        "sourcePurchaseOrderId": "e5ae4afd-3fa9-494e-a972-f541df9b877e",
        "sourcePoLineId": "c5ced39d-672f-3cba-a13a-ceb06a5d4c6b"
      },
      "fiscalYearId": "4438bc3b-4b4a-4e5e-9886-5f69b48a7a32",
      "fromFundId": "27f27438-3197-4281-a353-511829421d6e",
      "paymentEncumbranceId": "80c28fb4-c34e-48d6-b8c2-de6660c3e0aa",
      "source": "Invoice",
      "sourceFiscalYearId": "684b5dc5-92f6-4db7-b996-b549d88f5e4e",
      "sourceInvoiceId": "b360db6c-b825-4d74-ac63-5be506892e2b",
      "sourceInvoiceLineId": "2be1e551-be27-4b03-b770-30e5e8211d19",
      "toFundId": "69640328-788e-43fc-9c3c-af39e243f3b7",
      "transactionType": "Encumbrance",
      "metadata": {
        "createdDate": "2019-10-31T09:21:44.386+0000",
        "createdByUserId": "02408630-bce2-5a82-b577-9be500e9b324",
        "updatedDate": "2019-10-31T09:21:44.386+0000",
        "updatedByUserId": "02408630-bce2-5a82-b577-9be500e9b324"
      }
    }
  ],
  "idsOfTransactionsToDelete": [
    "a00f6f26-a3ea-4f85-9ae2-34770f602249",
    "ecc8583e-6601-4983-a7d8-978850680b0d"
  ],
  "transactionPatches": [
    {
      "id": "570b95a8-ebe1-41f9-a96d-87a863606f82",
      "encumbrance": {
        "orderStatus": "Closed"
      }
    },
    {
      "id": "8ed20ba2-b2f8-4851-b6d0-b3cdef27cdd6",
      "encumbrance": {
        "orderStatus": "Closed"
      }
    }
  ]
}

Response 204

Transactions processed successfully

Response 400

Bad request, for instance with the syntax. Details of the error 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"
        }
      ]
    }
  ]
}

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "errors.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#",
        "id": "error.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": {
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "parameters.schema",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "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

Body

Media type: application/json

Type: any

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}