Voucher (v2.3)

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

Table of contents

Voucher API

This documents the API calls that can be made to manage vouchers

/voucher

GET /voucher/vouchers

Retrieve a list of voucher items.

GET /voucher/vouchers
Query Parameters
  • 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
  • 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.

    using CQL (indexes for voucher)

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    voucherNumber=="1000"
    
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Returns a list of voucher items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "collection of vouchers",
  "type": "object",
  "properties": {
    "vouchers": {
      "description": "an array of voucher records",
      "id": "vouchers",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "voucher",
        "properties": {
          "id": {
            "description": "UUID of this voucher",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "accountingCode": {
            "description": "Number that represents the vendor is an external accounting system which may include details like \"Address code\" in it. This is the number as stated on the invoice",
            "type": "string"
          },
          "amount": {
            "description": "The amount that is actually paid",
            "type": "number"
          },
          "batchGroupId": {
            "description": "UUID of the batch group to use when generating batch vouchers",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
            "default": "2a2cb998-1437-41d1-88ad-01930aaeadd5"
          },
          "disbursementNumber": {
            "description": "The identifier for the physical transaction corresponding to a payment;Brought in from external source",
            "type": "string"
          },
          "disbursementDate": {
            "description": "Date payment was made from financial system",
            "type": "string",
            "format": "date-time"
          },
          "disbursementAmount": {
            "description": "The amount of the payment made outside of FOLIO",
            "type": "number"
          },
          "invoiceCurrency": {
            "description": "The currency in which invoice was originally defined",
            "type": "string"
          },
          "invoiceId": {
            "description": "Corresponding invoice Id",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "exchangeRate": {
            "description": "Exchange rate used to generate transaction",
            "type": "number"
          },
          "exportToAccounting": {
            "description": "Export this payment record to a financial system",
            "type": "boolean"
          },
          "status": {
            "description": "Status of the voucher",
            "type": "string",
            "enum": [
              "Awaiting payment",
              "Paid"
            ]
          },
          "systemCurrency": {
            "description": "The currency in which the voucher was paid",
            "type": "string"
          },
          "type": {
            "description": "Indicates type of payment to account",
            "type": "string",
            "enum": [
              "Payment",
              "Pre-payment",
              "Credit",
              "Voucher"
            ]
          },
          "voucherDate": {
            "description": "The date the invoice status changes to approved",
            "type": "string",
            "format": "date-time"
          },
          "voucherNumber": {
            "description": "Number generated by folio that will eventually identify the payment request sent out to external financial system.",
            "type": "string",
            "pattern": "^[a-zA-Z0-9]*$"
          },
          "acqUnitIds": {
            "description": "acquisition unit ids associated with this voucher",
            "type": "array",
            "items": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "description": "The UUID format string",
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
            }
          },
          "metadata": {
            "type": "object",
            "readonly": true,
            "$schema": "http://json-schema.org/draft-04/schema#",
            "title": "Metadata Schema",
            "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
            "properties": {
              "createdDate": {
                "description": "Date and time when the record was created",
                "type": "string",
                "format": "date-time"
              },
              "createdByUserId": {
                "description": "ID of the user who created the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "createdByUsername": {
                "description": "Username of the user who created the record (when available)",
                "type": "string"
              },
              "updatedDate": {
                "description": "Date and time when the record was last updated",
                "type": "string",
                "format": "date-time"
              },
              "updatedByUserId": {
                "description": "ID of the user who last updated the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "updatedByUsername": {
                "description": "Username of the user who last updated the record (when available)",
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "createdDate"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "amount",
          "batchGroupId",
          "exportToAccounting",
          "invoiceCurrency",
          "invoiceId",
          "type",
          "status",
          "systemCurrency",
          "voucherNumber"
        ]
      }
    },
    "totalRecords": {
      "description": "total number of records in the array",
      "type": "integer"
    }
  },
  "required": [
    "vouchers",
    "totalRecords"
  ]
}

Example:

{
  "vouchers": [
    {
      "id": "a9b99f8a-7100-47f2-9903-6293d44a9905",
      "accountingCode": "0206",
      "amount": 23.45,
      "batchGroupId": "2a2cb998-1437-41d1-88ad-01930aaeadd5",
      "disbursementNumber": "EFT546789",
      "disbursementDate": "2019-05-05T00:00:00.000+0000",
      "disbursementAmount": 5,
      "invoiceCurrency": "EUR",
      "invoiceId": "c0d08448-347b-418a-8c2f-5fb50248d67e",
      "exchangeRate": 1.12,
      "exportToAccounting": false,
      "status": "Paid",
      "systemCurrency": "USD",
      "type": "Pre-payment",
      "voucherDate": "2019-05-06T00:00:00.000+0000",
      "voucherNumber": "1000",
      "acqUnitIds": [
        "1895e539-8dac-441e-b1f5-aab62b3fde60",
        "47f504bd-0c1b-498e-a2ae-e2f0a0cea273"
      ],
      "metadata": {
         "createdDate": "2019-05-06T00:00:00.000+0000",
         "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
      }
    }
  ],
  "totalRecords": 1
}

Response 400

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

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

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

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",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "type": "object",
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error, 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 /voucher/vouchers/{id}

Return a voucher with given {id}

GET /voucher/vouchers/{id}
URI Parameters
  • id: required (string - pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$)

    The UUID of an voucher

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": "voucher",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this voucher",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "accountingCode": {
      "description": "Number that represents the vendor is an external accounting system which may include details like \"Address code\" in it. This is the number as stated on the invoice",
      "type": "string"
    },
    "amount": {
      "description": "The amount that is actually paid",
      "type": "number"
    },
    "batchGroupId": {
      "description": "UUID of the batch group to use when generating batch vouchers",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
      "default": "2a2cb998-1437-41d1-88ad-01930aaeadd5"
    },
    "disbursementNumber": {
      "description": "The identifier for the physical transaction corresponding to a payment;Brought in from external source",
      "type": "string"
    },
    "disbursementDate": {
      "description": "Date payment was made from financial system",
      "type": "string",
      "format": "date-time"
    },
    "disbursementAmount": {
      "description": "The amount of the payment made outside of FOLIO",
      "type": "number"
    },
    "invoiceCurrency": {
      "description": "The currency in which invoice was originally defined",
      "type": "string"
    },
    "invoiceId": {
      "description": "Corresponding invoice Id",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "exchangeRate": {
      "description": "Exchange rate used to generate transaction",
      "type": "number"
    },
    "exportToAccounting": {
      "description": "Export this payment record to a financial system",
      "type": "boolean"
    },
    "status": {
      "description": "Status of the voucher",
      "type": "string",
      "enum": [
        "Awaiting payment",
        "Paid"
      ]
    },
    "systemCurrency": {
      "description": "The currency in which the voucher was paid",
      "type": "string"
    },
    "type": {
      "description": "Indicates type of payment to account",
      "type": "string",
      "enum": [
        "Payment",
        "Pre-payment",
        "Credit",
        "Voucher"
      ]
    },
    "voucherDate": {
      "description": "The date the invoice status changes to approved",
      "type": "string",
      "format": "date-time"
    },
    "voucherNumber": {
      "description": "Number generated by folio that will eventually identify the payment request sent out to external financial system.",
      "type": "string",
      "pattern": "^[a-zA-Z0-9]*$"
    },
    "acqUnitIds": {
      "description": "acquisition unit ids associated with this voucher",
      "type": "array",
      "items": {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "The UUID format string",
        "type": "string",
        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
      }
    },
    "metadata": {
      "type": "object",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "title": "Metadata Schema",
      "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
      "properties": {
        "createdDate": {
          "description": "Date and time when the record was created",
          "type": "string",
          "format": "date-time"
        },
        "createdByUserId": {
          "description": "ID of the user who created the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "updatedDate": {
          "description": "Date and time when the record was last updated",
          "type": "string",
          "format": "date-time"
        },
        "updatedByUserId": {
          "description": "ID of the user who last updated the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "amount",
    "batchGroupId",
    "exportToAccounting",
    "invoiceCurrency",
    "invoiceId",
    "type",
    "status",
    "systemCurrency",
    "voucherNumber"
  ]
}

Example:

{
  "id": "a9b99f8a-7100-47f2-9903-6293d44a9905",
  "accountingCode": "0206",
  "amount": 23.45,
  "batchGroupId": "2a2cb998-1437-41d1-88ad-01930aaeadd5",
  "disbursementNumber": "EFT546789",
  "disbursementDate": "2019-05-05T00:00:00.000+0000",
  "disbursementAmount": 5,
  "exchangeRate": 1.12,
  "exportToAccounting": false,
  "invoiceCurrency": "EUR",
  "invoiceId": "c0d08448-347b-418a-8c2f-5fb50248d67e",
  "status": "Awaiting payment",
  "systemCurrency": "USD",
  "type": "Payment",
  "voucherDate": "2019-05-06T00:00:00.000+0000",
  "voucherNumber": "1000",
  "acqUnitIds": [
    "1895e539-8dac-441e-b1f5-aab62b3fde60",
    "47f504bd-0c1b-498e-a2ae-e2f0a0cea273"
  ],
  "metadata": {
    "createdDate": "2019-05-06T00:00:00.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

Response 401

Not authorized to perform requested action

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

unable to get retrieve voucher -- 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:

"voucher 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

PUT /voucher/vouchers/{id}

Update a voucher with given {Id}

PUT /voucher/vouchers/{id}
URI Parameters
  • id: required (string - pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$)

    The UUID of an voucher

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": "voucher",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this voucher",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "accountingCode": {
      "description": "Number that represents the vendor is an external accounting system which may include details like \"Address code\" in it. This is the number as stated on the invoice",
      "type": "string"
    },
    "amount": {
      "description": "The amount that is actually paid",
      "type": "number"
    },
    "batchGroupId": {
      "description": "UUID of the batch group to use when generating batch vouchers",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
      "default": "2a2cb998-1437-41d1-88ad-01930aaeadd5"
    },
    "disbursementNumber": {
      "description": "The identifier for the physical transaction corresponding to a payment;Brought in from external source",
      "type": "string"
    },
    "disbursementDate": {
      "description": "Date payment was made from financial system",
      "type": "string",
      "format": "date-time"
    },
    "disbursementAmount": {
      "description": "The amount of the payment made outside of FOLIO",
      "type": "number"
    },
    "invoiceCurrency": {
      "description": "The currency in which invoice was originally defined",
      "type": "string"
    },
    "invoiceId": {
      "description": "Corresponding invoice Id",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "exchangeRate": {
      "description": "Exchange rate used to generate transaction",
      "type": "number"
    },
    "exportToAccounting": {
      "description": "Export this payment record to a financial system",
      "type": "boolean"
    },
    "status": {
      "description": "Status of the voucher",
      "type": "string",
      "enum": [
        "Awaiting payment",
        "Paid"
      ]
    },
    "systemCurrency": {
      "description": "The currency in which the voucher was paid",
      "type": "string"
    },
    "type": {
      "description": "Indicates type of payment to account",
      "type": "string",
      "enum": [
        "Payment",
        "Pre-payment",
        "Credit",
        "Voucher"
      ]
    },
    "voucherDate": {
      "description": "The date the invoice status changes to approved",
      "type": "string",
      "format": "date-time"
    },
    "voucherNumber": {
      "description": "Number generated by folio that will eventually identify the payment request sent out to external financial system.",
      "type": "string",
      "pattern": "^[a-zA-Z0-9]*$"
    },
    "acqUnitIds": {
      "description": "acquisition unit ids associated with this voucher",
      "type": "array",
      "items": {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "The UUID format string",
        "type": "string",
        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
      }
    },
    "metadata": {
      "type": "object",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "title": "Metadata Schema",
      "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
      "properties": {
        "createdDate": {
          "description": "Date and time when the record was created",
          "type": "string",
          "format": "date-time"
        },
        "createdByUserId": {
          "description": "ID of the user who created the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "updatedDate": {
          "description": "Date and time when the record was last updated",
          "type": "string",
          "format": "date-time"
        },
        "updatedByUserId": {
          "description": "ID of the user who last updated the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "amount",
    "batchGroupId",
    "exportToAccounting",
    "invoiceCurrency",
    "invoiceId",
    "type",
    "status",
    "systemCurrency",
    "voucherNumber"
  ]
}

Example:

{
  "id": "a9b99f8a-7100-47f2-9903-6293d44a9905",
  "accountingCode": "0206",
  "amount": 23.45,
  "batchGroupId": "2a2cb998-1437-41d1-88ad-01930aaeadd5",
  "disbursementNumber": "EFT546789",
  "disbursementDate": "2019-05-05T00:00:00.000+0000",
  "disbursementAmount": 5,
  "exchangeRate": 1.12,
  "exportToAccounting": false,
  "invoiceCurrency": "EUR",
  "invoiceId": "c0d08448-347b-418a-8c2f-5fb50248d67e",
  "status": "Awaiting payment",
  "systemCurrency": "USD",
  "type": "Payment",
  "voucherDate": "2019-05-06T00:00:00.000+0000",
  "voucherNumber": "1000",
  "acqUnitIds": [
    "1895e539-8dac-441e-b1f5-aab62b3fde60",
    "47f504bd-0c1b-498e-a2ae-e2f0a0cea273"
  ],
  "metadata": {
    "createdDate": "2019-05-06T00:00:00.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

Response 204

Voucher successfully updated

Response 400

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

Body

Media type: text/plain

Type: any

Example:

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

Media type: application/json

Type: any

Example:

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

Response 404

Voucher with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"Voucher not found"

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: text/plain

Type: any

Example:

internal server error, contact administrator

Media type: application/json

Type: any

Example:

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

GET /voucher/voucher-lines

Retrieve a list of voucher lines.

GET /voucher/voucher-lines
Query Parameters
  • 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
  • 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.

    using CQL (indexes for voucher line)

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    amount>=="10"
    
  • 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": "collection of voucher lines",
  "type": "object",
  "properties": {
    "voucherLines": {
      "description": "an array of voucher line records",
      "id": "voucherLines",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "voucher line",
        "properties": {
          "id": {
            "description": "UUID of this voucher line",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "amount": {
            "description": "Total amount of this voucher",
            "type": "number"
          },
          "externalAccountNumber": {
            "description": "All distributions that come from funds with the same account number are grouped by voucher line",
            "type": "string"
          },
          "fundDistributions": {
            "description": "List of fund distributions",
            "type": "array",
            "items": {
              "type": "object",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "description": "Invoice/voucher line fund distribution",
              "properties": {
                "code": {
                  "description": "The code of the fund associated with this fund distribution",
                  "type": "string"
                },
                "encumbrance": {
                  "description": "UUID of encumbrance record associated with this fund distribution",
                  "$schema": "http://json-schema.org/draft-04/schema#",
                  "type": "string",
                  "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                },
                "fundId": {
                  "description": "UUID of the fund associated with this fund distribution",
                  "$schema": "http://json-schema.org/draft-04/schema#",
                  "type": "string",
                  "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                },
                "invoiceLineId": {
                  "description": "UUID of the invoice line associated with this fund distribution",
                  "$schema": "http://json-schema.org/draft-04/schema#",
                  "type": "string",
                  "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                },
                "distributionType": {
                  "description": "Percentage or amount type of the value property",
                  "type": "string",
                  "enum": [
                    "amount",
                    "percentage"
                  ],
                  "default": "percentage"
                },
                "expenseClassId": {
                  "description": "UUID of the expense class associated with this fund distribution",
                  "$schema": "http://json-schema.org/draft-04/schema#",
                  "type": "string",
                  "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                },
                "value": {
                  "description": "The percentage of the cost to be applied to this fund",
                  "type": "number"
                }
              },
              "additionalProperties": false,
              "required": [
                "fundId",
                "distributionType",
                "value"
              ]
            },
            "minItems": 1
          },
          "sourceIds": {
            "description": "UUID of invoice lines. There could be many invoice lines against a single voucher line. These are group on a voucher line based on External account number",
            "type": "array",
            "items": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "description": "The UUID format string",
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
            }
          },
          "subTransactionId": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "description": "The UUID format string",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "voucherId": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "description": "The UUID format string",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "metadata": {
            "type": "object",
            "readonly": true,
            "$schema": "http://json-schema.org/draft-04/schema#",
            "title": "Metadata Schema",
            "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
            "properties": {
              "createdDate": {
                "description": "Date and time when the record was created",
                "type": "string",
                "format": "date-time"
              },
              "createdByUserId": {
                "description": "ID of the user who created the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "createdByUsername": {
                "description": "Username of the user who created the record (when available)",
                "type": "string"
              },
              "updatedDate": {
                "description": "Date and time when the record was last updated",
                "type": "string",
                "format": "date-time"
              },
              "updatedByUserId": {
                "description": "ID of the user who last updated the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "updatedByUsername": {
                "description": "Username of the user who last updated the record (when available)",
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "createdDate"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "amount",
          "externalAccountNumber",
          "fundDistributions",
          "sourceIds",
          "voucherId"
        ]
      }
    },
    "totalRecords": {
      "description": "total number of records in the array",
      "type": "integer"
    }
  },
  "required": [
    "voucherLines",
    "totalRecords"
  ]
}

Example:

{
  "voucherLines": [
    {
      "id": "7a09dfd7-8588-49b5-bd15-5119414ff0b5",
      "amount": 23.45,
      "externalAccountNumber": "54321098",
      "fundDistributions": [
        {
          "fundId": "63157e96-0693-426d-b0df-948bacdfdb08",
          "distributionType": "percentage",
          "value": 50,
          "code": "EUHIST",
          "encumbrance": "5f9bfc74-f6ff-4877-be1f-793f8ce90ade",
          "invoiceLineId": "e0d08448-343b-118a-8c2f-4fb50248d672"
        }
      ],
      "sourceIds": [
        "e0d08448-343b-118a-8c2f-4fb50248d672"
      ],
      "subTransactionId": "7b1f7179-b83f-4eab-a4db-3c600eebe271",
      "voucherId": "a9b99f8a-7100-47f2-9903-6293d44a9905"
    }
  ],
  "totalRecords": 1
}

Response 400

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

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

"unable to list voucher-lines -- malformed parameter 'query', syntax error at column 6"

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 list voucher-lines -- 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:

"voucher-line not found"

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "type": "object",
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error, 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 /voucher/voucher-lines/{id}

Return an voucher line with given {id}

GET /voucher/voucher-lines/{id}
URI Parameters
  • id: required (string - pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$)

    The UUID of a voucher line

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

    Requested language. Optional. [lang=en]

Response 200

Returns a list of voucher-line items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "voucher line",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this voucher line",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "amount": {
      "description": "Total amount of this voucher",
      "type": "number"
    },
    "externalAccountNumber": {
      "description": "All distributions that come from funds with the same account number are grouped by voucher line",
      "type": "string"
    },
    "fundDistributions": {
      "description": "List of fund distributions",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Invoice/voucher line fund distribution",
        "properties": {
          "code": {
            "description": "The code of the fund associated with this fund distribution",
            "type": "string"
          },
          "encumbrance": {
            "description": "UUID of encumbrance record associated with this fund distribution",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "fundId": {
            "description": "UUID of the fund associated with this fund distribution",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "invoiceLineId": {
            "description": "UUID of the invoice line associated with this fund distribution",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "distributionType": {
            "description": "Percentage or amount type of the value property",
            "type": "string",
            "enum": [
              "amount",
              "percentage"
            ],
            "default": "percentage"
          },
          "expenseClassId": {
            "description": "UUID of the expense class associated with this fund distribution",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "value": {
            "description": "The percentage of the cost to be applied to this fund",
            "type": "number"
          }
        },
        "additionalProperties": false,
        "required": [
          "fundId",
          "distributionType",
          "value"
        ]
      },
      "minItems": 1
    },
    "sourceIds": {
      "description": "UUID of invoice lines. There could be many invoice lines against a single voucher line. These are group on a voucher line based on External account number",
      "type": "array",
      "items": {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "The UUID format string",
        "type": "string",
        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
      }
    },
    "subTransactionId": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "description": "The UUID format string",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "voucherId": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "description": "The UUID format string",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "metadata": {
      "type": "object",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "title": "Metadata Schema",
      "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
      "properties": {
        "createdDate": {
          "description": "Date and time when the record was created",
          "type": "string",
          "format": "date-time"
        },
        "createdByUserId": {
          "description": "ID of the user who created the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "updatedDate": {
          "description": "Date and time when the record was last updated",
          "type": "string",
          "format": "date-time"
        },
        "updatedByUserId": {
          "description": "ID of the user who last updated the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "amount",
    "externalAccountNumber",
    "fundDistributions",
    "sourceIds",
    "voucherId"
  ]
}

Example:

{
  "id": "7a09dfd7-8588-49b5-bd15-5119414ff0b5",
  "amount": 23.45,
  "externalAccountNumber": "54321098",
  "fundDistributions": [
    {
      "fundId": "1d1574f1-9196-4a57-8d1f-3b2e4309eb81",
      "distributionType": "percentage",
      "value": 50,
      "code": "USHIST",
      "encumbrance": "1c8fc9f4-d2cc-4bd1-aa9a-cb02291cbe65",
      "invoiceLineId": "e0d08448-343b-118a-8c2f-4fb50248d672"
    },
    {
      "fundId": "63157e96-0693-426d-b0df-948bacdfdb08",
      "distributionType": "percentage",
      "value": 50,
      "code": "EUHIST",
      "encumbrance": "5f9bfc74-f6ff-4877-be1f-793f8ce90ade",
      "invoiceLineId": "e0d08448-343b-118a-8c2f-4fb50248d672"
    }
  ],
  "sourceIds": [
    "e0d08448-343b-118a-8c2f-4fb50248d672"
  ],
  "subTransactionId": "7b1f7179-b83f-4eab-a4db-3c600eebe271",
  "voucherId": "a9b99f8a-7100-47f2-9903-6293d44a9905",
  "metadata": {
    "createdDate": "2019-05-06T00:00:00.000+0000",
    "createdByUserId": "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 list voucher-lines -- malformed parameter 'query', syntax error at column 6

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",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "type": "object",
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error, 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 /voucher/voucher-lines/{id}

Update a voucher line with given {id}

PUT /voucher/voucher-lines/{id}
URI Parameters
  • id: required (string - pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$)

    The UUID of a voucher line

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": "voucher line",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this voucher line",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "amount": {
      "description": "Total amount of this voucher",
      "type": "number"
    },
    "externalAccountNumber": {
      "description": "All distributions that come from funds with the same account number are grouped by voucher line",
      "type": "string"
    },
    "fundDistributions": {
      "description": "List of fund distributions",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Invoice/voucher line fund distribution",
        "properties": {
          "code": {
            "description": "The code of the fund associated with this fund distribution",
            "type": "string"
          },
          "encumbrance": {
            "description": "UUID of encumbrance record associated with this fund distribution",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "fundId": {
            "description": "UUID of the fund associated with this fund distribution",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "invoiceLineId": {
            "description": "UUID of the invoice line associated with this fund distribution",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "distributionType": {
            "description": "Percentage or amount type of the value property",
            "type": "string",
            "enum": [
              "amount",
              "percentage"
            ],
            "default": "percentage"
          },
          "expenseClassId": {
            "description": "UUID of the expense class associated with this fund distribution",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "value": {
            "description": "The percentage of the cost to be applied to this fund",
            "type": "number"
          }
        },
        "additionalProperties": false,
        "required": [
          "fundId",
          "distributionType",
          "value"
        ]
      },
      "minItems": 1
    },
    "sourceIds": {
      "description": "UUID of invoice lines. There could be many invoice lines against a single voucher line. These are group on a voucher line based on External account number",
      "type": "array",
      "items": {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "The UUID format string",
        "type": "string",
        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
      }
    },
    "subTransactionId": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "description": "The UUID format string",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "voucherId": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "description": "The UUID format string",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "metadata": {
      "type": "object",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "title": "Metadata Schema",
      "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
      "properties": {
        "createdDate": {
          "description": "Date and time when the record was created",
          "type": "string",
          "format": "date-time"
        },
        "createdByUserId": {
          "description": "ID of the user who created the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "updatedDate": {
          "description": "Date and time when the record was last updated",
          "type": "string",
          "format": "date-time"
        },
        "updatedByUserId": {
          "description": "ID of the user who last updated the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "amount",
    "externalAccountNumber",
    "fundDistributions",
    "sourceIds",
    "voucherId"
  ]
}

Example:

{
  "id": "7a09dfd7-8588-49b5-bd15-5119414ff0b5",
  "amount": 23.45,
  "externalAccountNumber": "54321098",
  "fundDistributions": [
    {
      "fundId": "1d1574f1-9196-4a57-8d1f-3b2e4309eb81",
      "distributionType": "percentage",
      "value": 50,
      "code": "USHIST",
      "encumbrance": "1c8fc9f4-d2cc-4bd1-aa9a-cb02291cbe65",
      "invoiceLineId": "e0d08448-343b-118a-8c2f-4fb50248d672"
    },
    {
      "fundId": "63157e96-0693-426d-b0df-948bacdfdb08",
      "distributionType": "percentage",
      "value": 50,
      "code": "EUHIST",
      "encumbrance": "5f9bfc74-f6ff-4877-be1f-793f8ce90ade",
      "invoiceLineId": "e0d08448-343b-118a-8c2f-4fb50248d672"
    }
  ],
  "sourceIds": [
    "e0d08448-343b-118a-8c2f-4fb50248d672"
  ],
  "subTransactionId": "7b1f7179-b83f-4eab-a4db-3c600eebe271",
  "voucherId": "a9b99f8a-7100-47f2-9903-6293d44a9905",
  "metadata": {
    "createdDate": "2019-05-06T00:00:00.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

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",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "type": "object",
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

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

POST /voucher/voucher-number/start/{value}

(Re)set the start value of the voucher number sequence

POST /voucher/voucher-number/start/{value}
URI Parameters
  • value: required (string)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 204

Start value successfully updated

Response 400

Bad request

Body

Media type: text/plain

Type: any

Example:

Bad request

Media type: application/json

Type: any

Example:

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

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "type": "object",
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

Media type: application/json

Type: any

Example:

{
  "errors": [
    {
      "message": "Internal server error, contact administrator",
      "code": "genericError"
    }
  ]
}

GET /voucher/voucher-number/start

Get the current start value of the voucher number sequence

GET /voucher/voucher-number/start
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Sequence number object",
  "type": "object",
  "properties": {
    "sequenceNumber": {
      "description": "Sequence number",
      "type": "string"
    }
  },
  "required": [
    "sequenceNumber"
  ],
  "additionalProperties": false
}

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",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "type": "object",
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: application/json

Type: any

Example:

{
  "errors": [
    {
      "message": "Internal server error, contact administrator",
      "code": "genericError"
    }
  ]
}