foliolib.folio.api.finance.Transaction

class foliolib.folio.api.finance.Transaction(tenant: str)

Bases: foliolib.folio.FolioApi

mod-finance (Transactions)

CRUD APIs used to manage transactions.

Base class of the Folio API

Parameters

tenant (str) – Tenant id

Methods

delete_encumbrance(encumbrancesId)

Delete an encumbrance with given transactionId; DEPRECATED - use <tt>batch-all-or-nothing</tt> instead

get_transaction(transactionsId)

Retrieve transaction item with given {transactionId}

get_transactions(**kwargs)

Retrieve a list of transaction items.

modify_credit(creditsId, credit)

Update a credit transaction (only allowed to set invoiceCancelled to true); DEPRECATED - use <tt>batch-all-or-nothing</tt> instead

modify_encumbrance(encumbrancesId, encumbrance)

Update a Transaction instance; DEPRECATED - use <tt>batch-all-or-nothing</tt> instead

modify_payment(paymentsId, payment)

Update a payment transaction (only allowed to set invoiceCancelled to true); DEPRECATED - use <tt>batch-all-or-nothing</tt> instead

modify_pendingPayment(pendingPaymentsId, ...)

Update a pending payment by transaction; DEPRECATED - use <tt>batch-all-or-nothing</tt> instead

set_allocation(allocation)

Create an allocation by transaction; DEPRECATED - use <tt>batch-all-or-nothing</tt> instead

set_batchAllOrNothing(batchAllOrNothing)

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

set_credit(credit)

Create a credit by transaction; DEPRECATED - use <tt>batch-all-or-nothing</tt> instead

set_encumbrance(encumbrance)

Create an encumbrance by transaction

set_payment(payment)

Create a payment by transaction; DEPRECATED - use <tt>batch-all-or-nothing</tt> instead

set_pendingPayment(pendingPayment)

Create a pending payment by transaction; DEPRECATED - use <tt>batch-all-or-nothing</tt> instead

set_transfer(transfer)

Create a transfer by transaction; DEPRECATED - use <tt>batch-all-or-nothing</tt> instead

delete_encumbrance(encumbrancesId: str)

Delete an encumbrance with given transactionId; DEPRECATED - use <tt>batch-all-or-nothing</tt> instead

DELETE /finance/encumbrances/{encumbrancesId}

Parameters

encumbrancesId (str) –

Raises

OkapiRequestUnprocessableEntity – Unprocessable Entity

get_transaction(transactionsId: str)

Retrieve transaction item with given {transactionId}

GET /finance/transactions/{transactionsId}

Parameters

transactionsId (str) –

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestUnauthorized – Authentication is required

  • OkapiRequestNotFound – Not Found

  • OkapiRequestFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A financial transaction",
  "type": "object",
  "javaName": "transaction",
  "properties": {
    "id": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of this transaction"
    },
    "_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",
      "$ref": "awaiting_payment.json"
    },
    "currency": {
      "description": "Currency code for this transaction - from the system currency",
      "type": "string"
    },
    "description": {
      "description": "Description of this transaction",
      "type": "string"
    },
    "encumbrance": {
      "$ref": "encumbrance.json",
      "description": "Encumbrance sub-object - holds encumbrance-specific information not applicable to other transaction types",
      "type": "object"
    },
    "expenseClassId": {
      "description": "UUID of the associated expense class",
      "type": "string",
      "$ref": "../../common/schemas/uuid.json"
    },
    "fiscalYearId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fiscal year that the transaction is taking place in"
    },
    "fromFundId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fund money is moving from"
    },
    "invoiceCancelled": {
      "description": "Indicates that related invoice was cancelled",
      "type": "boolean"
    },
    "paymentEncumbranceId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the encumbrance associated with this payment/credit taking place."
    },
    "source": {
      "description": "The readable identifier of the record that resulted in the creation of this transaction",
      "type": "string",
      "enum": [
        "User",
        "PoLine",
        "Invoice"
      ]
    },
    "sourceFiscalYearId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fiscal year that triggered the creation of this transaction (Used during fiscal year rollover)"
    },
    "sourceInvoiceId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the Invoice that triggered the creation of this transaction"
    },
    "sourceInvoiceLineId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the Invoice Line that triggered the creation of this transaction"
    },
    "tags": {
      "$ref": "../../../raml-util/schemas/tags.schema",
      "description": "Arbitrary tags associated with this transaction",
      "type": "object"
    },
    "toFundId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fund money is moving to"
    },
    "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": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "required": [
    "amount",
    "currency",
    "fiscalYearId",
    "source",
    "transactionType"
  ],
  "additionalProperties": false
}
get_transactions(**kwargs)

Retrieve a list of transaction items.

GET /finance/transactions

Parameters

**kwargs (properties) – Keyword Arguments

Keyword Arguments
  • query (str) –

    A query expressed as a CQL string (see [dev.folio.org/reference/glossary#cql](https://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 currency = USD

    Example

    • (username==”ab*” or personal.firstName==”ab*” or personal.lastName==”ab*”) and active==”true” sortby personal.lastName personal.firstName barcode

    • currency=USD

  • totalRecords (str) –

    (default=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 (int) –

    (default=0) Skip over a number of elements by specifying an offset value for the query

    Example

    • 0

  • limit (int) –

    (default=10) Limit the number of elements returned in the response

    Example

    • 10

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestFatalError – Server Error

  • OkapiRequestUnauthorized – Authentication is required

Schema

{
  "$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",
        "$ref": "transaction.json"
      }
    },
    "totalRecords": {
      "description": "The number of objects in this collection",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "transactions",
    "totalRecords"
  ]
}
modify_credit(creditsId: str, credit: dict)

Update a credit transaction (only allowed to set invoiceCancelled to true); DEPRECATED - use <tt>batch-all-or-nothing</tt> instead

PUT /finance/credits/{creditsId}

Parameters
  • creditsId (str) –

  • credit (dict) – See Schema below

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiRequestFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A financial transaction",
  "type": "object",
  "javaName": "transaction",
  "properties": {
    "id": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of this transaction"
    },
    "_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",
      "$ref": "awaiting_payment.json"
    },
    "currency": {
      "description": "Currency code for this transaction - from the system currency",
      "type": "string"
    },
    "description": {
      "description": "Description of this transaction",
      "type": "string"
    },
    "encumbrance": {
      "$ref": "encumbrance.json",
      "description": "Encumbrance sub-object - holds encumbrance-specific information not applicable to other transaction types",
      "type": "object"
    },
    "expenseClassId": {
      "description": "UUID of the associated expense class",
      "type": "string",
      "$ref": "../../common/schemas/uuid.json"
    },
    "fiscalYearId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fiscal year that the transaction is taking place in"
    },
    "fromFundId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fund money is moving from"
    },
    "invoiceCancelled": {
      "description": "Indicates that related invoice was cancelled",
      "type": "boolean"
    },
    "paymentEncumbranceId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the encumbrance associated with this payment/credit taking place."
    },
    "source": {
      "description": "The readable identifier of the record that resulted in the creation of this transaction",
      "type": "string",
      "enum": [
        "User",
        "PoLine",
        "Invoice"
      ]
    },
    "sourceFiscalYearId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fiscal year that triggered the creation of this transaction (Used during fiscal year rollover)"
    },
    "sourceInvoiceId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the Invoice that triggered the creation of this transaction"
    },
    "sourceInvoiceLineId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the Invoice Line that triggered the creation of this transaction"
    },
    "tags": {
      "$ref": "../../../raml-util/schemas/tags.schema",
      "description": "Arbitrary tags associated with this transaction",
      "type": "object"
    },
    "toFundId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fund money is moving to"
    },
    "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": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "required": [
    "amount",
    "currency",
    "fiscalYearId",
    "source",
    "transactionType"
  ],
  "additionalProperties": false
}
modify_encumbrance(encumbrancesId: str, encumbrance: dict)

Update a Transaction instance; DEPRECATED - use <tt>batch-all-or-nothing</tt> instead

PUT /finance/encumbrances/{encumbrancesId}

Parameters
  • encumbrancesId (str) –

  • encumbrance (dict) – See Schema below

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A financial transaction",
  "type": "object",
  "javaName": "transaction",
  "properties": {
    "id": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of this transaction"
    },
    "_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",
      "$ref": "awaiting_payment.json"
    },
    "currency": {
      "description": "Currency code for this transaction - from the system currency",
      "type": "string"
    },
    "description": {
      "description": "Description of this transaction",
      "type": "string"
    },
    "encumbrance": {
      "$ref": "encumbrance.json",
      "description": "Encumbrance sub-object - holds encumbrance-specific information not applicable to other transaction types",
      "type": "object"
    },
    "expenseClassId": {
      "description": "UUID of the associated expense class",
      "type": "string",
      "$ref": "../../common/schemas/uuid.json"
    },
    "fiscalYearId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fiscal year that the transaction is taking place in"
    },
    "fromFundId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fund money is moving from"
    },
    "invoiceCancelled": {
      "description": "Indicates that related invoice was cancelled",
      "type": "boolean"
    },
    "paymentEncumbranceId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the encumbrance associated with this payment/credit taking place."
    },
    "source": {
      "description": "The readable identifier of the record that resulted in the creation of this transaction",
      "type": "string",
      "enum": [
        "User",
        "PoLine",
        "Invoice"
      ]
    },
    "sourceFiscalYearId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fiscal year that triggered the creation of this transaction (Used during fiscal year rollover)"
    },
    "sourceInvoiceId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the Invoice that triggered the creation of this transaction"
    },
    "sourceInvoiceLineId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the Invoice Line that triggered the creation of this transaction"
    },
    "tags": {
      "$ref": "../../../raml-util/schemas/tags.schema",
      "description": "Arbitrary tags associated with this transaction",
      "type": "object"
    },
    "toFundId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fund money is moving to"
    },
    "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": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "required": [
    "amount",
    "currency",
    "fiscalYearId",
    "source",
    "transactionType"
  ],
  "additionalProperties": false
}
modify_payment(paymentsId: str, payment: dict)

Update a payment transaction (only allowed to set invoiceCancelled to true); DEPRECATED - use <tt>batch-all-or-nothing</tt> instead

PUT /finance/payments/{paymentsId}

Parameters
  • paymentsId (str) –

  • payment (dict) – See Schema below

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiRequestFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A financial transaction",
  "type": "object",
  "javaName": "transaction",
  "properties": {
    "id": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of this transaction"
    },
    "_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",
      "$ref": "awaiting_payment.json"
    },
    "currency": {
      "description": "Currency code for this transaction - from the system currency",
      "type": "string"
    },
    "description": {
      "description": "Description of this transaction",
      "type": "string"
    },
    "encumbrance": {
      "$ref": "encumbrance.json",
      "description": "Encumbrance sub-object - holds encumbrance-specific information not applicable to other transaction types",
      "type": "object"
    },
    "expenseClassId": {
      "description": "UUID of the associated expense class",
      "type": "string",
      "$ref": "../../common/schemas/uuid.json"
    },
    "fiscalYearId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fiscal year that the transaction is taking place in"
    },
    "fromFundId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fund money is moving from"
    },
    "invoiceCancelled": {
      "description": "Indicates that related invoice was cancelled",
      "type": "boolean"
    },
    "paymentEncumbranceId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the encumbrance associated with this payment/credit taking place."
    },
    "source": {
      "description": "The readable identifier of the record that resulted in the creation of this transaction",
      "type": "string",
      "enum": [
        "User",
        "PoLine",
        "Invoice"
      ]
    },
    "sourceFiscalYearId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fiscal year that triggered the creation of this transaction (Used during fiscal year rollover)"
    },
    "sourceInvoiceId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the Invoice that triggered the creation of this transaction"
    },
    "sourceInvoiceLineId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the Invoice Line that triggered the creation of this transaction"
    },
    "tags": {
      "$ref": "../../../raml-util/schemas/tags.schema",
      "description": "Arbitrary tags associated with this transaction",
      "type": "object"
    },
    "toFundId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fund money is moving to"
    },
    "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": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "required": [
    "amount",
    "currency",
    "fiscalYearId",
    "source",
    "transactionType"
  ],
  "additionalProperties": false
}
modify_pendingPayment(pendingPaymentsId: str, pendingPayment: dict)

Update a pending payment by transaction; DEPRECATED - use <tt>batch-all-or-nothing</tt> instead

PUT /finance/pending-payments/{pendingPaymentsId}

Parameters
  • pendingPaymentsId (str) –

  • pendingPayment (dict) – See Schema below

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiRequestFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A financial transaction",
  "type": "object",
  "javaName": "transaction",
  "properties": {
    "id": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of this transaction"
    },
    "_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",
      "$ref": "awaiting_payment.json"
    },
    "currency": {
      "description": "Currency code for this transaction - from the system currency",
      "type": "string"
    },
    "description": {
      "description": "Description of this transaction",
      "type": "string"
    },
    "encumbrance": {
      "$ref": "encumbrance.json",
      "description": "Encumbrance sub-object - holds encumbrance-specific information not applicable to other transaction types",
      "type": "object"
    },
    "expenseClassId": {
      "description": "UUID of the associated expense class",
      "type": "string",
      "$ref": "../../common/schemas/uuid.json"
    },
    "fiscalYearId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fiscal year that the transaction is taking place in"
    },
    "fromFundId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fund money is moving from"
    },
    "invoiceCancelled": {
      "description": "Indicates that related invoice was cancelled",
      "type": "boolean"
    },
    "paymentEncumbranceId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the encumbrance associated with this payment/credit taking place."
    },
    "source": {
      "description": "The readable identifier of the record that resulted in the creation of this transaction",
      "type": "string",
      "enum": [
        "User",
        "PoLine",
        "Invoice"
      ]
    },
    "sourceFiscalYearId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fiscal year that triggered the creation of this transaction (Used during fiscal year rollover)"
    },
    "sourceInvoiceId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the Invoice that triggered the creation of this transaction"
    },
    "sourceInvoiceLineId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the Invoice Line that triggered the creation of this transaction"
    },
    "tags": {
      "$ref": "../../../raml-util/schemas/tags.schema",
      "description": "Arbitrary tags associated with this transaction",
      "type": "object"
    },
    "toFundId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fund money is moving to"
    },
    "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": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "required": [
    "amount",
    "currency",
    "fiscalYearId",
    "source",
    "transactionType"
  ],
  "additionalProperties": false
}
set_allocation(allocation: dict)

Create an allocation by transaction; DEPRECATED - use <tt>batch-all-or-nothing</tt> instead

POST /finance/allocations

Parameters

allocation (dict) – See Schema below

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A financial transaction",
  "type": "object",
  "javaName": "transaction",
  "properties": {
    "id": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of this transaction"
    },
    "_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",
      "$ref": "awaiting_payment.json"
    },
    "currency": {
      "description": "Currency code for this transaction - from the system currency",
      "type": "string"
    },
    "description": {
      "description": "Description of this transaction",
      "type": "string"
    },
    "encumbrance": {
      "$ref": "encumbrance.json",
      "description": "Encumbrance sub-object - holds encumbrance-specific information not applicable to other transaction types",
      "type": "object"
    },
    "expenseClassId": {
      "description": "UUID of the associated expense class",
      "type": "string",
      "$ref": "../../common/schemas/uuid.json"
    },
    "fiscalYearId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fiscal year that the transaction is taking place in"
    },
    "fromFundId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fund money is moving from"
    },
    "invoiceCancelled": {
      "description": "Indicates that related invoice was cancelled",
      "type": "boolean"
    },
    "paymentEncumbranceId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the encumbrance associated with this payment/credit taking place."
    },
    "source": {
      "description": "The readable identifier of the record that resulted in the creation of this transaction",
      "type": "string",
      "enum": [
        "User",
        "PoLine",
        "Invoice"
      ]
    },
    "sourceFiscalYearId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fiscal year that triggered the creation of this transaction (Used during fiscal year rollover)"
    },
    "sourceInvoiceId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the Invoice that triggered the creation of this transaction"
    },
    "sourceInvoiceLineId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the Invoice Line that triggered the creation of this transaction"
    },
    "tags": {
      "$ref": "../../../raml-util/schemas/tags.schema",
      "description": "Arbitrary tags associated with this transaction",
      "type": "object"
    },
    "toFundId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fund money is moving to"
    },
    "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": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "required": [
    "amount",
    "currency",
    "fiscalYearId",
    "source",
    "transactionType"
  ],
  "additionalProperties": false
}
set_batchAllOrNothing(batchAllOrNothing: dict)

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

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

Parameters

batchAllOrNothing (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Schema

{
  "$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": {
        "$ref": "transaction.json"
      }
    },
    "transactionsToUpdate": {
      "description": "Transactions to update",
      "type": "array",
      "items": {
        "$ref": "transaction.json"
      }
    },
    "idsOfTransactionsToDelete": {
      "description": "Ids of transactions to delete",
      "type": "array",
      "items": {
        "$ref": "../../common/schemas/uuid.json"
      }
    },
    "transactionPatches": {
      "description": "Transaction patches (incomplete transactions that must include the id)",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "description": "UUID of the transaction to patch",
            "$ref": "../../common/schemas/uuid.json"
          }
        },
        "additionalProperties": true,
        "required": [
          "id"
        ]
      }
    }
  },
  "additionalProperties": false
}
set_credit(credit: dict)

Create a credit by transaction; DEPRECATED - use <tt>batch-all-or-nothing</tt> instead

POST /finance/credits

Parameters

credit (dict) – See Schema below

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A financial transaction",
  "type": "object",
  "javaName": "transaction",
  "properties": {
    "id": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of this transaction"
    },
    "_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",
      "$ref": "awaiting_payment.json"
    },
    "currency": {
      "description": "Currency code for this transaction - from the system currency",
      "type": "string"
    },
    "description": {
      "description": "Description of this transaction",
      "type": "string"
    },
    "encumbrance": {
      "$ref": "encumbrance.json",
      "description": "Encumbrance sub-object - holds encumbrance-specific information not applicable to other transaction types",
      "type": "object"
    },
    "expenseClassId": {
      "description": "UUID of the associated expense class",
      "type": "string",
      "$ref": "../../common/schemas/uuid.json"
    },
    "fiscalYearId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fiscal year that the transaction is taking place in"
    },
    "fromFundId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fund money is moving from"
    },
    "invoiceCancelled": {
      "description": "Indicates that related invoice was cancelled",
      "type": "boolean"
    },
    "paymentEncumbranceId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the encumbrance associated with this payment/credit taking place."
    },
    "source": {
      "description": "The readable identifier of the record that resulted in the creation of this transaction",
      "type": "string",
      "enum": [
        "User",
        "PoLine",
        "Invoice"
      ]
    },
    "sourceFiscalYearId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fiscal year that triggered the creation of this transaction (Used during fiscal year rollover)"
    },
    "sourceInvoiceId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the Invoice that triggered the creation of this transaction"
    },
    "sourceInvoiceLineId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the Invoice Line that triggered the creation of this transaction"
    },
    "tags": {
      "$ref": "../../../raml-util/schemas/tags.schema",
      "description": "Arbitrary tags associated with this transaction",
      "type": "object"
    },
    "toFundId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fund money is moving to"
    },
    "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": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "required": [
    "amount",
    "currency",
    "fiscalYearId",
    "source",
    "transactionType"
  ],
  "additionalProperties": false
}
set_encumbrance(encumbrance: dict)

Create an encumbrance by transaction

POST /finance/encumbrances

Parameters

encumbrance (dict) – See Schema below

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A financial transaction",
  "type": "object",
  "javaName": "transaction",
  "properties": {
    "id": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of this transaction"
    },
    "_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",
      "$ref": "awaiting_payment.json"
    },
    "currency": {
      "description": "Currency code for this transaction - from the system currency",
      "type": "string"
    },
    "description": {
      "description": "Description of this transaction",
      "type": "string"
    },
    "encumbrance": {
      "$ref": "encumbrance.json",
      "description": "Encumbrance sub-object - holds encumbrance-specific information not applicable to other transaction types",
      "type": "object"
    },
    "expenseClassId": {
      "description": "UUID of the associated expense class",
      "type": "string",
      "$ref": "../../common/schemas/uuid.json"
    },
    "fiscalYearId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fiscal year that the transaction is taking place in"
    },
    "fromFundId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fund money is moving from"
    },
    "invoiceCancelled": {
      "description": "Indicates that related invoice was cancelled",
      "type": "boolean"
    },
    "paymentEncumbranceId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the encumbrance associated with this payment/credit taking place."
    },
    "source": {
      "description": "The readable identifier of the record that resulted in the creation of this transaction",
      "type": "string",
      "enum": [
        "User",
        "PoLine",
        "Invoice"
      ]
    },
    "sourceFiscalYearId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fiscal year that triggered the creation of this transaction (Used during fiscal year rollover)"
    },
    "sourceInvoiceId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the Invoice that triggered the creation of this transaction"
    },
    "sourceInvoiceLineId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the Invoice Line that triggered the creation of this transaction"
    },
    "tags": {
      "$ref": "../../../raml-util/schemas/tags.schema",
      "description": "Arbitrary tags associated with this transaction",
      "type": "object"
    },
    "toFundId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fund money is moving to"
    },
    "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": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "required": [
    "amount",
    "currency",
    "fiscalYearId",
    "source",
    "transactionType"
  ],
  "additionalProperties": false
}
set_payment(payment: dict)

Create a payment by transaction; DEPRECATED - use <tt>batch-all-or-nothing</tt> instead

POST /finance/payments

Parameters

payment (dict) – See Schema below

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A financial transaction",
  "type": "object",
  "javaName": "transaction",
  "properties": {
    "id": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of this transaction"
    },
    "_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",
      "$ref": "awaiting_payment.json"
    },
    "currency": {
      "description": "Currency code for this transaction - from the system currency",
      "type": "string"
    },
    "description": {
      "description": "Description of this transaction",
      "type": "string"
    },
    "encumbrance": {
      "$ref": "encumbrance.json",
      "description": "Encumbrance sub-object - holds encumbrance-specific information not applicable to other transaction types",
      "type": "object"
    },
    "expenseClassId": {
      "description": "UUID of the associated expense class",
      "type": "string",
      "$ref": "../../common/schemas/uuid.json"
    },
    "fiscalYearId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fiscal year that the transaction is taking place in"
    },
    "fromFundId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fund money is moving from"
    },
    "invoiceCancelled": {
      "description": "Indicates that related invoice was cancelled",
      "type": "boolean"
    },
    "paymentEncumbranceId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the encumbrance associated with this payment/credit taking place."
    },
    "source": {
      "description": "The readable identifier of the record that resulted in the creation of this transaction",
      "type": "string",
      "enum": [
        "User",
        "PoLine",
        "Invoice"
      ]
    },
    "sourceFiscalYearId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fiscal year that triggered the creation of this transaction (Used during fiscal year rollover)"
    },
    "sourceInvoiceId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the Invoice that triggered the creation of this transaction"
    },
    "sourceInvoiceLineId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the Invoice Line that triggered the creation of this transaction"
    },
    "tags": {
      "$ref": "../../../raml-util/schemas/tags.schema",
      "description": "Arbitrary tags associated with this transaction",
      "type": "object"
    },
    "toFundId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fund money is moving to"
    },
    "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": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "required": [
    "amount",
    "currency",
    "fiscalYearId",
    "source",
    "transactionType"
  ],
  "additionalProperties": false
}
set_pendingPayment(pendingPayment: dict)

Create a pending payment by transaction; DEPRECATED - use <tt>batch-all-or-nothing</tt> instead

POST /finance/pending-payments

Parameters

pendingPayment (dict) – See Schema below

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A financial transaction",
  "type": "object",
  "javaName": "transaction",
  "properties": {
    "id": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of this transaction"
    },
    "_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",
      "$ref": "awaiting_payment.json"
    },
    "currency": {
      "description": "Currency code for this transaction - from the system currency",
      "type": "string"
    },
    "description": {
      "description": "Description of this transaction",
      "type": "string"
    },
    "encumbrance": {
      "$ref": "encumbrance.json",
      "description": "Encumbrance sub-object - holds encumbrance-specific information not applicable to other transaction types",
      "type": "object"
    },
    "expenseClassId": {
      "description": "UUID of the associated expense class",
      "type": "string",
      "$ref": "../../common/schemas/uuid.json"
    },
    "fiscalYearId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fiscal year that the transaction is taking place in"
    },
    "fromFundId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fund money is moving from"
    },
    "invoiceCancelled": {
      "description": "Indicates that related invoice was cancelled",
      "type": "boolean"
    },
    "paymentEncumbranceId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the encumbrance associated with this payment/credit taking place."
    },
    "source": {
      "description": "The readable identifier of the record that resulted in the creation of this transaction",
      "type": "string",
      "enum": [
        "User",
        "PoLine",
        "Invoice"
      ]
    },
    "sourceFiscalYearId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fiscal year that triggered the creation of this transaction (Used during fiscal year rollover)"
    },
    "sourceInvoiceId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the Invoice that triggered the creation of this transaction"
    },
    "sourceInvoiceLineId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the Invoice Line that triggered the creation of this transaction"
    },
    "tags": {
      "$ref": "../../../raml-util/schemas/tags.schema",
      "description": "Arbitrary tags associated with this transaction",
      "type": "object"
    },
    "toFundId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fund money is moving to"
    },
    "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": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "required": [
    "amount",
    "currency",
    "fiscalYearId",
    "source",
    "transactionType"
  ],
  "additionalProperties": false
}
set_transfer(transfer: dict)

Create a transfer by transaction; DEPRECATED - use <tt>batch-all-or-nothing</tt> instead

POST /finance/transfers

Parameters

transfer (dict) – See Schema below

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A financial transaction",
  "type": "object",
  "javaName": "transaction",
  "properties": {
    "id": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of this transaction"
    },
    "_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",
      "$ref": "awaiting_payment.json"
    },
    "currency": {
      "description": "Currency code for this transaction - from the system currency",
      "type": "string"
    },
    "description": {
      "description": "Description of this transaction",
      "type": "string"
    },
    "encumbrance": {
      "$ref": "encumbrance.json",
      "description": "Encumbrance sub-object - holds encumbrance-specific information not applicable to other transaction types",
      "type": "object"
    },
    "expenseClassId": {
      "description": "UUID of the associated expense class",
      "type": "string",
      "$ref": "../../common/schemas/uuid.json"
    },
    "fiscalYearId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fiscal year that the transaction is taking place in"
    },
    "fromFundId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fund money is moving from"
    },
    "invoiceCancelled": {
      "description": "Indicates that related invoice was cancelled",
      "type": "boolean"
    },
    "paymentEncumbranceId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the encumbrance associated with this payment/credit taking place."
    },
    "source": {
      "description": "The readable identifier of the record that resulted in the creation of this transaction",
      "type": "string",
      "enum": [
        "User",
        "PoLine",
        "Invoice"
      ]
    },
    "sourceFiscalYearId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fiscal year that triggered the creation of this transaction (Used during fiscal year rollover)"
    },
    "sourceInvoiceId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the Invoice that triggered the creation of this transaction"
    },
    "sourceInvoiceLineId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the Invoice Line that triggered the creation of this transaction"
    },
    "tags": {
      "$ref": "../../../raml-util/schemas/tags.schema",
      "description": "Arbitrary tags associated with this transaction",
      "type": "object"
    },
    "toFundId": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of the fund money is moving to"
    },
    "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": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "required": [
    "amount",
    "currency",
    "fiscalYearId",
    "source",
    "transactionType"
  ],
  "additionalProperties": false
}