foliolib.folio.api.finance.Transaction
- class foliolib.folio.api.finance.Transaction(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)
Bases:
foliolib.folio.FolioApimod-finance (Transactions)
CRUD APIs used to manage transactions.
- Parameters
tenant (str) – Tenant id
okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.
Methods
delete_encumbrance(encumbrancesId)Delete an encumbrance with given transactionId
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)
modify_encumbrance(encumbrancesId, encumbrance)Update a Transaction instance
modify_payment(paymentsId, payment)Update a payment transaction (only allowed to set invoiceCancelled to true)
modify_pendingPayment(pendingPaymentsId, ...)Update a pending payment by transaction
set_allocation(allocation)Create an allocation by transaction
set_credit(credit)Create a credit by transaction
set_encumbrance(encumbrance)Create an encumbrance by transaction
set_payment(payment)Create a payment by transaction
set_pendingPayment(pendingPayment)Create a pending payment by transaction
set_transfer(transfer)Create a transfer by transaction
- delete_encumbrance(encumbrancesId: str)
Delete an encumbrance with given transactionId
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
OkapiFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "A financial transaction", "type": "object", "extends": { "$ref": "../../common/schemas/entity.json" }, "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
OkapiFatalError – 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)
PUT /finance/credits/{creditsId}- Parameters
creditsId (str) –
credit (dict) – See Schema below
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestError – Bad Request
OkapiFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "A financial transaction", "type": "object", "extends": { "$ref": "../../common/schemas/entity.json" }, "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
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", "extends": { "$ref": "../../common/schemas/entity.json" }, "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)
PUT /finance/payments/{paymentsId}- Parameters
paymentsId (str) –
payment (dict) – See Schema below
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestError – Bad Request
OkapiFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "A financial transaction", "type": "object", "extends": { "$ref": "../../common/schemas/entity.json" }, "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
PUT /finance/pending-payments/{pendingPaymentsId}- Parameters
pendingPaymentsId (str) –
pendingPayment (dict) – See Schema below
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestError – Bad Request
OkapiFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "A financial transaction", "type": "object", "extends": { "$ref": "../../common/schemas/entity.json" }, "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
POST /finance/allocations- Parameters
allocation (dict) – See Schema below
- Returns
See Schema below
- Return type
dict
- Raises
OkapiRequestError – Bad Request
OkapiFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "A financial transaction", "type": "object", "extends": { "$ref": "../../common/schemas/entity.json" }, "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_credit(credit: dict)
Create a credit by transaction
POST /finance/credits- Parameters
credit (dict) – See Schema below
- Returns
See Schema below
- Return type
dict
- Raises
OkapiRequestError – Bad Request
OkapiFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "A financial transaction", "type": "object", "extends": { "$ref": "../../common/schemas/entity.json" }, "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
OkapiFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "A financial transaction", "type": "object", "extends": { "$ref": "../../common/schemas/entity.json" }, "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
POST /finance/payments- Parameters
payment (dict) – See Schema below
- Returns
See Schema below
- Return type
dict
- Raises
OkapiRequestError – Bad Request
OkapiFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "A financial transaction", "type": "object", "extends": { "$ref": "../../common/schemas/entity.json" }, "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
POST /finance/pending-payments- Parameters
pendingPayment (dict) – See Schema below
- Returns
See Schema below
- Return type
dict
- Raises
OkapiRequestError – Bad Request
OkapiFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "A financial transaction", "type": "object", "extends": { "$ref": "../../common/schemas/entity.json" }, "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
POST /finance/transfers- Parameters
transfer (dict) – See Schema below
- Returns
See Schema below
- Return type
dict
- Raises
OkapiRequestError – Bad Request
OkapiFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "A financial transaction", "type": "object", "extends": { "$ref": "../../common/schemas/entity.json" }, "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 }