mod-finance (v1.1)

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

Table of contents

mod-finance (Transactions)

CRUD APIs used to manage transactions.

/finance

POST /finance/allocations

Create an allocation by transaction

POST /finance/allocations
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A financial transaction",
  "type": "object",
  "extends" : {
    "$ref" : "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of this transaction"
    },
    "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"
    },
    "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",
        "Transfer"
      ],
      "type": "string"
    },
    "metadata": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "required": [
    "amount",
    "currency",
    "fiscalYearId",
    "source",
    "transactionType"
  ],
  "additionalProperties": false
}

Example:

{
  "id": "ee683f15-b1e1-40c8-866d-4e70da03c723",
  "amount": 25,
  "currency": "USD",
  "description": "PO_Line: History of Incas",
  "fiscalYearId": "4438bc3b-4b4a-4e5e-9886-5f69b48a7a32",
  "fromFundId": "27f27438-3197-4281-a353-511829421d6e",
  "paymentEncumbranceId": "80c28fb4-c34e-48d6-b8c2-de6660c3e0aa",
  "source": "Invoice",
  "sourceFiscalYearId": "01705ce5-3c3d-4c30-b23d-a36feec28259",
  "tags": {
    "tagList": [
      "important"
    ]
  },
  "toFundId": "2e51c019-97f3-4523-87e9-59250e3b48bc",
  "transactionType": "Allocation",
  "metadata": {
    "createdDate": "2018-07-19T00:00:00.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1",
    "updatedDate" : "2018-07-19T00:00:00.000+0000",
    "updatedByUserId" : "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

Response 201

Returns processing result of the allocations

Body

Media type: application/json

Type: json

Content:

{
  "$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"
    },
    "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"
    },
    "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",
        "Transfer"
      ],
      "type": "string"
    },
    "metadata": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "required": [
    "amount",
    "currency",
    "fiscalYearId",
    "source",
    "transactionType"
  ],
  "additionalProperties": false
}

Example:

{
  "id": "ee683f15-b1e1-40c8-866d-4e70da03c723",
  "amount": 25,
  "currency": "USD",
  "description": "PO_Line: History of Incas",
  "fiscalYearId": "4438bc3b-4b4a-4e5e-9886-5f69b48a7a32",
  "fromFundId": "27f27438-3197-4281-a353-511829421d6e",
  "paymentEncumbranceId": "80c28fb4-c34e-48d6-b8c2-de6660c3e0aa",
  "source": "Invoice",
  "sourceFiscalYearId": "01705ce5-3c3d-4c30-b23d-a36feec28259",
  "tags": {
    "tagList": [
      "important"
    ]
  },
  "toFundId": "2e51c019-97f3-4523-87e9-59250e3b48bc",
  "transactionType": "Allocation",
  "metadata": {
    "createdDate": "2018-07-19T00:00:00.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1",
    "updatedDate" : "2018-07-19T00:00:00.000+0000",
    "updatedByUserId" : "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

Response 400

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

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

"unable to update allocation -- malformed JSON at 13:4"

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

POST /finance/transfers

Create a transfer by transaction

POST /finance/transfers
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A financial transaction",
  "type": "object",
  "extends" : {
    "$ref" : "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of this transaction"
    },
    "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"
    },
    "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",
        "Transfer"
      ],
      "type": "string"
    },
    "metadata": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "required": [
    "amount",
    "currency",
    "fiscalYearId",
    "source",
    "transactionType"
  ],
  "additionalProperties": false
}

Example:

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

Response 201

Returns processing result of the transfers

Body

Media type: application/json

Type: json

Content:

{
  "$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"
    },
    "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"
    },
    "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",
        "Transfer"
      ],
      "type": "string"
    },
    "metadata": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "required": [
    "amount",
    "currency",
    "fiscalYearId",
    "source",
    "transactionType"
  ],
  "additionalProperties": false
}

Example:

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

Response 400

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

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

"unable to update transfer -- malformed JSON at 13:4"

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

POST /finance/encumbrances

Create an encumbrance by transaction

POST /finance/encumbrances
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A financial transaction",
  "type": "object",
  "extends" : {
    "$ref" : "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of this transaction"
    },
    "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"
    },
    "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",
        "Transfer"
      ],
      "type": "string"
    },
    "metadata": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "required": [
    "amount",
    "currency",
    "fiscalYearId",
    "source",
    "transactionType"
  ],
  "additionalProperties": false
}

Example:

{
  "id": "b7553168-60af-4e6d-bcd3-078199a0b353",
  "amount": 25.17,
  "currency": "USD",
  "description": "PO_Line: History of Incas",
  "encumbrance": {
    "amountExpended": 1567.92,
    "amountAwaitingPayment": 12.50,
    "initialAmountEncumbered": 1720.50,
    "status": "Unreleased",
    "orderType":  "One-Time",
    "subscription": false,
    "reEncumber": false,
    "sourcePurchaseOrderId": "e5ae4afd-3fa9-494e-a972-f541df9b877e",
    "sourcePoLineId": "c5ced39d-672f-3cba-a13a-ceb06a5d4c6b"
  },
  "fiscalYearId": "4438bc3b-4b4a-4e5e-9886-5f69b48a7a32",
  "fromFundId": "27f27438-3197-4281-a353-511829421d6e",
  "paymentEncumbranceId": "80c28fb4-c34e-48d6-b8c2-de6660c3e0aa",
  "source": "Invoice",
  "sourceFiscalYearId": "684b5dc5-92f6-4db7-b996-b549d88f5e4e",
  "sourceInvoiceId": "b360db6c-b825-4d74-ac63-5be506892e2b",
  "sourceInvoiceLineId": "2be1e551-be27-4b03-b770-30e5e8211d19",
  "tags": {
    "tagList": [
      "important"
    ]
  },
  "toFundId": "69640328-788e-43fc-9c3c-af39e243f3b7",
  "transactionType": "Encumbrance",
  "metadata": {
    "createdDate": "2019-10-31T09:21:44.386+0000",
    "createdByUserId": "02408630-bce2-5a82-b577-9be500e9b324",
    "updatedDate": "2019-10-31T09:21:44.386+0000",
    "updatedByUserId": "02408630-bce2-5a82-b577-9be500e9b324"
  }
}

Response 201

Returns processing result of the encumbrances

Body

Media type: application/json

Type: json

Content:

{
  "$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"
    },
    "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"
    },
    "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",
        "Transfer"
      ],
      "type": "string"
    },
    "metadata": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "required": [
    "amount",
    "currency",
    "fiscalYearId",
    "source",
    "transactionType"
  ],
  "additionalProperties": false
}

Example:

{
  "id": "b7553168-60af-4e6d-bcd3-078199a0b353",
  "amount": 25.17,
  "currency": "USD",
  "description": "PO_Line: History of Incas",
  "encumbrance": {
    "amountExpended": 1567.92,
    "amountAwaitingPayment": 12.50,
    "initialAmountEncumbered": 1720.50,
    "status": "Unreleased",
    "orderType":  "One-Time",
    "subscription": false,
    "reEncumber": false,
    "sourcePurchaseOrderId": "e5ae4afd-3fa9-494e-a972-f541df9b877e",
    "sourcePoLineId": "c5ced39d-672f-3cba-a13a-ceb06a5d4c6b"
  },
  "fiscalYearId": "4438bc3b-4b4a-4e5e-9886-5f69b48a7a32",
  "fromFundId": "27f27438-3197-4281-a353-511829421d6e",
  "paymentEncumbranceId": "80c28fb4-c34e-48d6-b8c2-de6660c3e0aa",
  "source": "Invoice",
  "sourceFiscalYearId": "684b5dc5-92f6-4db7-b996-b549d88f5e4e",
  "sourceInvoiceId": "b360db6c-b825-4d74-ac63-5be506892e2b",
  "sourceInvoiceLineId": "2be1e551-be27-4b03-b770-30e5e8211d19",
  "tags": {
    "tagList": [
      "important"
    ]
  },
  "toFundId": "69640328-788e-43fc-9c3c-af39e243f3b7",
  "transactionType": "Encumbrance",
  "metadata": {
    "createdDate": "2019-10-31T09:21:44.386+0000",
    "createdByUserId": "02408630-bce2-5a82-b577-9be500e9b324",
    "updatedDate": "2019-10-31T09:21:44.386+0000",
    "updatedByUserId": "02408630-bce2-5a82-b577-9be500e9b324"
  }
}

Response 400

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

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

"unable to update encumbrance -- malformed JSON at 13:4"

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

PUT /finance/encumbrances/{id}

Update a Transaction instance

PUT /finance/encumbrances/{id}
URI Parameters
  • id: required (string)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A financial transaction",
  "type": "object",
  "extends" : {
    "$ref" : "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of this transaction"
    },
    "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"
    },
    "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",
        "Transfer"
      ],
      "type": "string"
    },
    "metadata": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "required": [
    "amount",
    "currency",
    "fiscalYearId",
    "source",
    "transactionType"
  ],
  "additionalProperties": false
}

POST /finance/payments

Create a payment by transaction

POST /finance/payments
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A financial transaction",
  "type": "object",
  "extends" : {
    "$ref" : "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of this transaction"
    },
    "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"
    },
    "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",
        "Transfer"
      ],
      "type": "string"
    },
    "metadata": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "required": [
    "amount",
    "currency",
    "fiscalYearId",
    "source",
    "transactionType"
  ],
  "additionalProperties": false
}

Example:

{
  "id": "c5732efb-9536-4a49-a22e-1ec6ca8a7922",
  "amount": 25,
  "currency": "USD",
  "description": "PO_Line: History of Incas",
  "fiscalYearId": "684b5dc5-92f6-4db7-b996-b549d88f5e4e",
  "fromFundId": "7fbd5d84-62d1-44c6-9c45-6cb173998bbd",
  "paymentEncumbranceId": "cb0b0c16-59a0-4ece-8e43-8d2310c9883c",
  "source": "Invoice",
  "sourceFiscalYearId": "684b5dc5-92f6-4db7-b996-b549d88f5e4e",
  "sourceInvoiceId": "5925e966-f242-4842-9d5e-b33a651bb390",
  "sourceInvoiceLineId": "ee60ee78-f487-4940-adcf-fa0726989823",
  "transactionType": "Payment",
  "metadata": {
    "createdDate": "2020-01-09T20:53:43.984+0000",
    "createdByUserId": "28d0fb04-d137-11e8-a8d5-f2801f1b9fd1",
    "updatedDate": "2020-01-09T20:53:43.984+0000",
    "updatedByUserId": "28d0fb04-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

Response 201

Returns processing result of the payments

Body

Media type: application/json

Type: json

Content:

{
  "$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"
    },
    "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"
    },
    "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",
        "Transfer"
      ],
      "type": "string"
    },
    "metadata": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "required": [
    "amount",
    "currency",
    "fiscalYearId",
    "source",
    "transactionType"
  ],
  "additionalProperties": false
}

Example:

{
  "id": "c5732efb-9536-4a49-a22e-1ec6ca8a7922",
  "amount": 25,
  "currency": "USD",
  "description": "PO_Line: History of Incas",
  "fiscalYearId": "684b5dc5-92f6-4db7-b996-b549d88f5e4e",
  "fromFundId": "7fbd5d84-62d1-44c6-9c45-6cb173998bbd",
  "paymentEncumbranceId": "cb0b0c16-59a0-4ece-8e43-8d2310c9883c",
  "source": "Invoice",
  "sourceFiscalYearId": "684b5dc5-92f6-4db7-b996-b549d88f5e4e",
  "sourceInvoiceId": "5925e966-f242-4842-9d5e-b33a651bb390",
  "sourceInvoiceLineId": "ee60ee78-f487-4940-adcf-fa0726989823",
  "transactionType": "Payment",
  "metadata": {
    "createdDate": "2020-01-09T20:53:43.984+0000",
    "createdByUserId": "28d0fb04-d137-11e8-a8d5-f2801f1b9fd1",
    "updatedDate": "2020-01-09T20:53:43.984+0000",
    "updatedByUserId": "28d0fb04-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

Response 400

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

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

"unable to update payment -- malformed JSON at 13:4"

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

POST /finance/pending-payments

Create a pending payment by transaction

POST /finance/pending-payments
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A financial transaction",
  "type": "object",
  "extends" : {
    "$ref" : "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of this transaction"
    },
    "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"
    },
    "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",
        "Transfer"
      ],
      "type": "string"
    },
    "metadata": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "required": [
    "amount",
    "currency",
    "fiscalYearId",
    "source",
    "transactionType"
  ],
  "additionalProperties": false
}

Example:

{
  "id": "c5732efb-9536-4a49-a22e-1ec6ca8a7922",
  "amount": 25,
  "awaitingPayment": {
    "encumbranceId": "12ac70a4-5c9d-112f-9acb-852adf67d7e1",
    "releaseEncumbrance": "true"
  },
  "currency": "USD",
  "description": "PO_Line: History of Incas",
  "fiscalYearId": "684b5dc5-92f6-4db7-b996-b549d88f5e4e",
  "fromFundId": "7fbd5d84-62d1-44c6-9c45-6cb173998bbd",
  "source": "Invoice",
  "sourceInvoiceId": "5925e966-f242-4842-9d5e-b33a651bb390",
  "sourceInvoiceLineId": "ee60ee78-f487-4940-adcf-fa0726989823",
  "transactionType": "Pending payment",
  "metadata": {
    "createdDate": "2020-01-09T20:53:43.984+0000",
    "createdByUserId": "28d0fb04-d137-11e8-a8d5-f2801f1b9fd1",
    "updatedDate": "2020-01-09T20:53:43.984+0000",
    "updatedByUserId": "28d0fb04-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

Response 201

Returns processing result of the pending-payments

Body

Media type: application/json

Type: json

Content:

{
  "$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"
    },
    "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"
    },
    "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",
        "Transfer"
      ],
      "type": "string"
    },
    "metadata": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "required": [
    "amount",
    "currency",
    "fiscalYearId",
    "source",
    "transactionType"
  ],
  "additionalProperties": false
}

Example:

{
  "id": "c5732efb-9536-4a49-a22e-1ec6ca8a7922",
  "amount": 25,
  "awaitingPayment": {
    "encumbranceId": "12ac70a4-5c9d-112f-9acb-852adf67d7e1",
    "releaseEncumbrance": "true"
  },
  "currency": "USD",
  "description": "PO_Line: History of Incas",
  "fiscalYearId": "684b5dc5-92f6-4db7-b996-b549d88f5e4e",
  "fromFundId": "7fbd5d84-62d1-44c6-9c45-6cb173998bbd",
  "source": "Invoice",
  "sourceInvoiceId": "5925e966-f242-4842-9d5e-b33a651bb390",
  "sourceInvoiceLineId": "ee60ee78-f487-4940-adcf-fa0726989823",
  "transactionType": "Pending payment",
  "metadata": {
    "createdDate": "2020-01-09T20:53:43.984+0000",
    "createdByUserId": "28d0fb04-d137-11e8-a8d5-f2801f1b9fd1",
    "updatedDate": "2020-01-09T20:53:43.984+0000",
    "updatedByUserId": "28d0fb04-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

Response 400

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

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

"unable to update pending-payment -- malformed JSON at 13:4"

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

POST /finance/credits

Create a credit by transaction

POST /finance/credits
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A financial transaction",
  "type": "object",
  "extends" : {
    "$ref" : "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of this transaction"
    },
    "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"
    },
    "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",
        "Transfer"
      ],
      "type": "string"
    },
    "metadata": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "required": [
    "amount",
    "currency",
    "fiscalYearId",
    "source",
    "transactionType"
  ],
  "additionalProperties": false
}

Example:

{
  "id": "21425789-acdb-44b2-b44f-f2291cc48b42",
  "amount": 25,
  "currency": "USD",
  "description": "PO_Line: History of Incas",
  "fiscalYearId": "684b5dc5-92f6-4db7-b996-b549d88f5e4e",
  "source": "Invoice",
  "sourceFiscalYearId": "684b5dc5-92f6-4db7-b996-b549d88f5e4e",
  "sourceInvoiceId": "041c1fe8-adfa-44eb-b6b3-f85acdd71f81",
  "sourceInvoiceLineId": "ee60ee78-f487-4940-adcf-fa0726989823",
  "toFundId": "7fbd5d84-62d1-44c6-9c45-6cb173998bbd",
  "transactionType": "Credit",
  "metadata": {
    "createdDate": "2020-01-09T20:53:43.984+0000",
    "createdByUserId": "28d0fb04-d137-11e8-a8d5-f2801f1b9fd1",
    "updatedDate": "2020-01-09T20:53:43.984+0000",
    "updatedByUserId": "28d0fb04-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

Response 201

Returns processing result of the credits

Body

Media type: application/json

Type: json

Content:

{
  "$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"
    },
    "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"
    },
    "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",
        "Transfer"
      ],
      "type": "string"
    },
    "metadata": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "required": [
    "amount",
    "currency",
    "fiscalYearId",
    "source",
    "transactionType"
  ],
  "additionalProperties": false
}

Example:

{
  "id": "21425789-acdb-44b2-b44f-f2291cc48b42",
  "amount": 25,
  "currency": "USD",
  "description": "PO_Line: History of Incas",
  "fiscalYearId": "684b5dc5-92f6-4db7-b996-b549d88f5e4e",
  "source": "Invoice",
  "sourceFiscalYearId": "684b5dc5-92f6-4db7-b996-b549d88f5e4e",
  "sourceInvoiceId": "041c1fe8-adfa-44eb-b6b3-f85acdd71f81",
  "sourceInvoiceLineId": "ee60ee78-f487-4940-adcf-fa0726989823",
  "toFundId": "7fbd5d84-62d1-44c6-9c45-6cb173998bbd",
  "transactionType": "Credit",
  "metadata": {
    "createdDate": "2020-01-09T20:53:43.984+0000",
    "createdByUserId": "28d0fb04-d137-11e8-a8d5-f2801f1b9fd1",
    "updatedDate": "2020-01-09T20:53:43.984+0000",
    "updatedByUserId": "28d0fb04-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

Response 400

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

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

"unable to update credit -- malformed JSON at 13:4"

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

GET /finance/transactions

Retrieve a list of transaction items.

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

    A query expressed as a CQL string (see dev.folio.org/reference/glossary#cql) using valid searchable fields. The first example below shows the general form of a full CQL query, but those fields might not be relevant in this context.

    with valid searchable fields: for example currency = USD

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    currency=USD
    
  • offset: (integer - default: 0 - minimum: 0 - maximum: 2147483647)

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

    Example:

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

    Limit the number of elements returned in the response

    Example:

    10
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Returns a list of transaction items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A collection of transactions",
  "type": "object",
  "properties": {
    "transactions": {
      "description": "The list of objects contained in this collection",
      "type": "array",
      "id": "transactions",
      "items": {
        "type": "object",
        "$ref": "transaction.json"
      }
    },
    "totalRecords": {
      "description": "The number of objects in this collection",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "transactions",
    "totalRecords"
  ]
}

Example:

{
  "$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"
  ]
}

Response 400

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

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

unable to list transactions -- malformed parameter 'query', syntax error at column 6

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

"unable to list instances -- unauthorized"

Media type: application/json

Type: any

Example:

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

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

GET /finance/transactions/{id}

Retrieve transaction item with given {transactionId}

GET /finance/transactions/{id}
URI Parameters
  • id: required (string)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Returns item with a given ID

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A financial transaction",
  "type": "object",
  "extends" : {
    "$ref" : "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "$ref": "../../common/schemas/uuid.json",
      "description": "UUID of this transaction"
    },
    "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"
    },
    "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",
        "Transfer"
      ],
      "type": "string"
    },
    "metadata": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "required": [
    "amount",
    "currency",
    "fiscalYearId",
    "source",
    "transactionType"
  ],
  "additionalProperties": false
}

Example:

{
  "$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"
    },
    "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"
    },
    "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",
        "Transfer"
      ],
      "type": "string"
    },
    "metadata": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "required": [
    "amount",
    "currency",
    "fiscalYearId",
    "source",
    "transactionType"
  ],
  "additionalProperties": false
}

Response 401

Not authorized to perform requested action

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

unable to get retrieve transaction -- unauthorized

Response 404

Item with a given ID not found

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

"transaction not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

internal server error, contact administrator