Vouchers (v1)

http://github.com/folio-org/mod-invoice-storage

Table of contents

Vouchers CRUD API

This documents the API calls that can be made to manage vouchers;This API is intended for internal use only

/voucher-storage

GET /voucher-storage/vouchers

Get list of vouchers

GET /voucher-storage/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.

    with valid searchable fields: for example voucherStatus

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    voucherStatus=="Paid"
    
  • 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",
        "$ref": "voucher.json"
      }
    },
    "totalRecords": {
      "description": "total number of records in the array",
      "type": "integer"
    }
  },
  "required": [
    "vouchers",
    "totalRecords"
  ]
}

Example:

{
  "vouchers": [
    {
      "id": "a9b99f8a-7100-47f2-9903-6293d44a9905",
      "systemCurrency": "USD",
      "invoiceCurrency": "EUR",
      "exchangeRate": 1.12,
      "exportToAccounting": false,
      "voucherType": "Payment",
      "voucherStatus": "Awaiting Payment",
      "voucherAmount": 23.45,
      "voucherDate": "2019-05-06T00:00:00.000+0000",
      "voucherNumber": "1000",
      "batchNumber": "101",
      "invoiceId": "c0d08448-347b-418a-8c2f-5fb50248d67e",
      "userId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1",
      "voucherLines": [
        {
           "id": "e0d08448-343b-118a-8c2f-4fb50248d672",
           "externalAccountNumber": "54321098",
           "voucherLineAmount": 23.45,
           "sourceId": "d0ae323e-552d-4649-881c-f8b56468ea84",
           "fundId": "172364c7-AaAa-A0C2-C12C-e35CeCcbfaF2",
           "fundDistributions": "efee4b3a-fcd5-40c8-8cf4-0ee3d76ddf4d",
           "subTransactionId": "7b1f7179-b83f-4eab-a4db-3c600eebe271"
        }
      ],
      "accountingCode": "0206",
      "disbursementNumber": "EFT546789",
      "disbursementDate": "2019-05-05T00:00:00.000+0000",
      "disbursementAmount": 5,
      "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: text/plain

Type: any

Example:

unable to list vouchers -- 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 vouchers -- unauthorized

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

POST /voucher-storage/vouchers

Create a new voucher item.

POST /voucher-storage/vouchers
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",
      "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}$"
    },
    "systemCurrency": {
      "description": "The currency in which the voucher was paid",
      "type": "string"
    },
    "invoiceCurrency": {
      "description": "The currency in which invoice was originally defined",
      "type": "string"
    },
    "exchangeRate": {
      "description": "Exchange rate used to generate transaction",
      "type": "number"
    },
    "exportToAccounting": {
      "description": "Export this payment record to a financial system",
      "type": "boolean"
    },
    "voucherType":{
      "description": "Indicates type of payment to account",
      "type": "string",
      "enum": [
        "Payment",
        "Pre-Payment",
        "Credit",
        "Voucher"
      ]
    },
    "voucherStatus":{
      "description": "Status of the voucher",
      "type": "string",
      "enum": [
        "Awaiting Payment",
        "Paid"
      ]
    },
    "voucherAmount": {
      "description": "The amount that is actually paid",
      "type": "number"
    },
    "voucherDate": {
      "description": "The date the invoice status changes to approved",
      "type": "string",
      "format": "date-time"
    },
    "voucherNumber": {
      "description": "Invoice number in folio system",
      "type": "string",
      "pattern": "^[a-zA-Z0-9]*$"
    },
    "batchNumber": {
      "description": "Only required when voucher is being output automatically",
      "type": "string"
    },
    "invoiceId": {
      "description": "Corresponding invoice Id",
      "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}$"
    },
    "voucherLines": {
      "description": "references the voucher lines associated to the voucher",
      "id": "voucherLines",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "voucher_line.json"
      }
    },
    "accountingCode": {
      "description": "Number that represents the vendor is an external accounting system;This is the number as stated on the invoice",
      "type": "string"
    },
    "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"
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
     "systemCurrency",
     "invoiceCurrency",
     "exportToAccounting",
     "voucherType",
     "voucherStatus",
     "voucherAmount",
     "voucherNumber",
     "batchNumber",
     "invoiceId",
     "accountingCode"
  ]
}

Example:

{
  "id": "a9b99f8a-7100-47f2-9903-6293d44a9905",
  "systemCurrency": "USD",
  "invoiceCurrency": "EUR",
  "exchangeRate": 1.12,
  "exportToAccounting": false,
  "voucherType": "Payment",
  "voucherStatus": "Awaiting Payment",
  "voucherAmount": 23.45,
  "voucherDate": "2019-05-06T00:00:00.000+0000",
  "voucherNumber": "1000",
  "batchNumber": "101",
  "invoiceId": "c0d08448-347b-418a-8c2f-5fb50248d67e",
  "voucherLines": [
     {
        "id": "e0d08448-343b-118a-8c2f-4fb50248d672",
        "externalAccountNumber": "54321098",
        "voucherLineAmount": 23.45,
        "sourceId": "d0ae323e-552d-4649-881c-f8b56468ea84",
        "fundId": "172364c7-AaAa-A0C2-C12C-e35CeCcbfaF2",
        "fundDistributions": "efee4b3a-fcd5-40c8-8cf4-0ee3d76ddf4d",
        "subTransactionId": "7b1f7179-b83f-4eab-a4db-3c600eebe271"
     }
  ],
  "accountingCode": "0206",
  "disbursementNumber": "EFT546789",
  "disbursementDate": "2019-05-05T00:00:00.000+0000",
  "disbursementAmount": 5,
  "metadata": {
    "createdDate": "2019-05-06T00:00:00.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

Response 201

Returns a newly created item, with server-controlled fields like 'id' populated

Headers
  • Location: required (string)

    URI to the created voucher item

Body

Media type: application/json

Type: any

Example:

{
  "id": "a9b99f8a-7100-47f2-9903-6293d44a9905",
  "systemCurrency": "USD",
  "invoiceCurrency": "EUR",
  "exchangeRate": 1.12,
  "exportToAccounting": false,
  "voucherType": "Payment",
  "voucherStatus": "Awaiting Payment",
  "voucherAmount": 23.45,
  "voucherDate": "2019-05-06T00:00:00.000+0000",
  "voucherNumber": "1000",
  "batchNumber": "101",
  "invoiceId": "c0d08448-347b-418a-8c2f-5fb50248d67e",
  "voucherLines": [
     {
        "id": "e0d08448-343b-118a-8c2f-4fb50248d672",
        "externalAccountNumber": "54321098",
        "voucherLineAmount": 23.45,
        "sourceId": "d0ae323e-552d-4649-881c-f8b56468ea84",
        "fundId": "172364c7-AaAa-A0C2-C12C-e35CeCcbfaF2",
        "fundDistributions": "efee4b3a-fcd5-40c8-8cf4-0ee3d76ddf4d",
        "subTransactionId": "7b1f7179-b83f-4eab-a4db-3c600eebe271"
     }
  ],
  "accountingCode": "0206",
  "disbursementNumber": "EFT546789",
  "disbursementDate": "2019-05-05T00:00:00.000+0000",
  "disbursementAmount": 5,
  "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: text/plain

Type: any

Example:

"unable to add voucher -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create vouchers -- unauthorized

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

GET /voucher-storage/vouchers/{id}

Retrieve voucher item with given {voucherId}

GET /voucher-storage/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 a 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",
      "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}$"
    },
    "systemCurrency": {
      "description": "The currency in which the voucher was paid",
      "type": "string"
    },
    "invoiceCurrency": {
      "description": "The currency in which invoice was originally defined",
      "type": "string"
    },
    "exchangeRate": {
      "description": "Exchange rate used to generate transaction",
      "type": "number"
    },
    "exportToAccounting": {
      "description": "Export this payment record to a financial system",
      "type": "boolean"
    },
    "voucherType":{
      "description": "Indicates type of payment to account",
      "type": "string",
      "enum": [
        "Payment",
        "Pre-Payment",
        "Credit",
        "Voucher"
      ]
    },
    "voucherStatus":{
      "description": "Status of the voucher",
      "type": "string",
      "enum": [
        "Awaiting Payment",
        "Paid"
      ]
    },
    "voucherAmount": {
      "description": "The amount that is actually paid",
      "type": "number"
    },
    "voucherDate": {
      "description": "The date the invoice status changes to approved",
      "type": "string",
      "format": "date-time"
    },
    "voucherNumber": {
      "description": "Invoice number in folio system",
      "type": "string",
      "pattern": "^[a-zA-Z0-9]*$"
    },
    "batchNumber": {
      "description": "Only required when voucher is being output automatically",
      "type": "string"
    },
    "invoiceId": {
      "description": "Corresponding invoice Id",
      "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}$"
    },
    "voucherLines": {
      "description": "references the voucher lines associated to the voucher",
      "id": "voucherLines",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "voucher_line.json"
      }
    },
    "accountingCode": {
      "description": "Number that represents the vendor is an external accounting system;This is the number as stated on the invoice",
      "type": "string"
    },
    "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"
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
     "systemCurrency",
     "invoiceCurrency",
     "exportToAccounting",
     "voucherType",
     "voucherStatus",
     "voucherAmount",
     "voucherNumber",
     "batchNumber",
     "invoiceId",
     "accountingCode"
  ]
}

Example:

{
  "id": "a9b99f8a-7100-47f2-9903-6293d44a9905",
  "systemCurrency": "USD",
  "invoiceCurrency": "EUR",
  "exchangeRate": 1.12,
  "exportToAccounting": false,
  "voucherType": "Payment",
  "voucherStatus": "Awaiting Payment",
  "voucherAmount": 23.45,
  "voucherDate": "2019-05-06T00:00:00.000+0000",
  "voucherNumber": "1000",
  "batchNumber": "101",
  "invoiceId": "c0d08448-347b-418a-8c2f-5fb50248d67e",
  "voucherLines": [
     {
        "id": "e0d08448-343b-118a-8c2f-4fb50248d672",
        "externalAccountNumber": "54321098",
        "voucherLineAmount": 23.45,
        "sourceId": "d0ae323e-552d-4649-881c-f8b56468ea84",
        "fundId": "172364c7-AaAa-A0C2-C12C-e35CeCcbfaF2",
        "fundDistributions": "efee4b3a-fcd5-40c8-8cf4-0ee3d76ddf4d",
        "subTransactionId": "7b1f7179-b83f-4eab-a4db-3c600eebe271"
     }
  ],
  "accountingCode": "0206",
  "disbursementNumber": "EFT546789",
  "disbursementDate": "2019-05-05T00:00:00.000+0000",
  "disbursementAmount": 5,
  "metadata": {
    "createdDate": "2019-05-06T00:00:00.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"voucher not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

DELETE /voucher-storage/vouchers/{id}

Delete voucher item with given {voucherId}

DELETE /voucher-storage/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 a voucher

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

    Requested language. Optional. [lang=en]

Response 204

Item deleted successfully

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 delete voucher -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"voucher not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

PUT /voucher-storage/vouchers/{id}

Update voucher item with given {voucherId}

PUT /voucher-storage/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 a 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",
      "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}$"
    },
    "systemCurrency": {
      "description": "The currency in which the voucher was paid",
      "type": "string"
    },
    "invoiceCurrency": {
      "description": "The currency in which invoice was originally defined",
      "type": "string"
    },
    "exchangeRate": {
      "description": "Exchange rate used to generate transaction",
      "type": "number"
    },
    "exportToAccounting": {
      "description": "Export this payment record to a financial system",
      "type": "boolean"
    },
    "voucherType":{
      "description": "Indicates type of payment to account",
      "type": "string",
      "enum": [
        "Payment",
        "Pre-Payment",
        "Credit",
        "Voucher"
      ]
    },
    "voucherStatus":{
      "description": "Status of the voucher",
      "type": "string",
      "enum": [
        "Awaiting Payment",
        "Paid"
      ]
    },
    "voucherAmount": {
      "description": "The amount that is actually paid",
      "type": "number"
    },
    "voucherDate": {
      "description": "The date the invoice status changes to approved",
      "type": "string",
      "format": "date-time"
    },
    "voucherNumber": {
      "description": "Invoice number in folio system",
      "type": "string",
      "pattern": "^[a-zA-Z0-9]*$"
    },
    "batchNumber": {
      "description": "Only required when voucher is being output automatically",
      "type": "string"
    },
    "invoiceId": {
      "description": "Corresponding invoice Id",
      "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}$"
    },
    "voucherLines": {
      "description": "references the voucher lines associated to the voucher",
      "id": "voucherLines",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "voucher_line.json"
      }
    },
    "accountingCode": {
      "description": "Number that represents the vendor is an external accounting system;This is the number as stated on the invoice",
      "type": "string"
    },
    "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"
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
     "systemCurrency",
     "invoiceCurrency",
     "exportToAccounting",
     "voucherType",
     "voucherStatus",
     "voucherAmount",
     "voucherNumber",
     "batchNumber",
     "invoiceId",
     "accountingCode"
  ]
}

Example:

{
  "id": "a9b99f8a-7100-47f2-9903-6293d44a9905",
  "systemCurrency": "USD",
  "invoiceCurrency": "EUR",
  "exchangeRate": 1.12,
  "exportToAccounting": false,
  "voucherType": "Payment",
  "voucherStatus": "Awaiting Payment",
  "voucherAmount": 23.45,
  "voucherDate": "2019-05-06T00:00:00.000+0000",
  "voucherNumber": "1000",
  "batchNumber": "101",
  "invoiceId": "c0d08448-347b-418a-8c2f-5fb50248d67e",
  "voucherLines": [
     {
        "id": "e0d08448-343b-118a-8c2f-4fb50248d672",
        "externalAccountNumber": "54321098",
        "voucherLineAmount": 23.45,
        "sourceId": "d0ae323e-552d-4649-881c-f8b56468ea84",
        "fundId": "172364c7-AaAa-A0C2-C12C-e35CeCcbfaF2",
        "fundDistributions": "efee4b3a-fcd5-40c8-8cf4-0ee3d76ddf4d",
        "subTransactionId": "7b1f7179-b83f-4eab-a4db-3c600eebe271"
     }
  ],
  "accountingCode": "0206",
  "disbursementNumber": "EFT546789",
  "disbursementDate": "2019-05-05T00:00:00.000+0000",
  "disbursementAmount": 5,
  "metadata": {
    "createdDate": "2019-05-06T00:00:00.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

Response 204

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

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"voucher not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

GET /voucher-storage/voucher-lines

Get list of voucher lines

GET /voucher-storage/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.

    with valid searchable fields: for example externalAccountNumber

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    externalAccountNumber=="567891045"
    
  • 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": "collection of voucher lines",
  "type": "object",
  "properties": {
    "voucherLines": {
      "description": "an array of voucher line records",
      "id": "voucherLines",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "voucher_line.json"
      }
    },
    "totalRecords": {
      "description": "total number of records in the array",
      "type": "integer"
    }
  },
  "required": [
    "voucherLines",
    "totalRecords"
  ]
}

Example:

{
  "voucherLines": [
   {
     "id": "e0d08448-343b-118a-8c2f-4fb50248d672",
     "externalAccountNumber": "54321098",
     "voucherLineAmount": 23.45,
     "fundId": "172364c7-AaAa-A0C2-C12C-e35CeCcbfaF2",
     "fundDistributions": "efee4b3a-fcd5-40c8-8cf4-0ee3d76ddf4d",
     "subTransactionId": "7b1f7179-b83f-4eab-a4db-3c600eebe271"
   }
  ]
  "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: 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: text/plain

Type: any

Example:

unable to list voucher-lines -- unauthorized

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

POST /voucher-storage/voucher-lines

Create a new voucher-line item.

POST /voucher-storage/voucher-lines
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",
      "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}$"
    },
    "externalAccountNumber": {
      "description": "All distributions that come from funds with the same account number are grouped by voucher line",
      "type": "string"
    },
    "voucherLineAmount": {
      "description": "Total amount of this voucher",
      "type": "number"
    },
    "sourceId": {
      "description": "UUID of source, grouped on a voucher line based on External Account Number",
      "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": "The fund Id",
      "type": "string"
    },
    "fundDistributions": {
      "description": "UUID of the fund distribution amount associated with particular fund;referenced from the invoice",
      "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": {
      "description": "UUID of sub transactions",
      "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",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "externalAccountNumber",
    "voucherLineAmount",
    "sourceId",
    "fundId",
    "fundDistributions",
    "subTransactionId"
  ]
}

Example:

{
  "id": "e0d08448-343b-118a-8c2f-4fb50248d672",
  "externalAccountNumber": "54321098",
  "voucherLineAmount": 23.45,
  "fundId": "172364c7-AaAa-A0C2-C12C-e35CeCcbfaF2",
  "fundDistributions": "efee4b3a-fcd5-40c8-8cf4-0ee3d76ddf4d",
  "sourceId": "825fc0f9-6634-47ec-a750-da33c5cfbab6",
  "subTransactionId": "7b1f7179-b83f-4eab-a4db-3c600eebe271",
  "metadata": {
    "createdDate": "2019-05-06T00:00:00.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

Response 201

Returns a newly created item, with server-controlled fields like 'id' populated

Headers
  • Location: required (string)

    URI to the created voucher-line item

Body

Media type: application/json

Type: any

Example:

{
  "id": "e0d08448-343b-118a-8c2f-4fb50248d672",
  "externalAccountNumber": "54321098",
  "voucherLineAmount": 23.45,
  "fundId": "172364c7-AaAa-A0C2-C12C-e35CeCcbfaF2",
  "fundDistributions": "efee4b3a-fcd5-40c8-8cf4-0ee3d76ddf4d",
  "sourceId": "825fc0f9-6634-47ec-a750-da33c5cfbab6",
  "subTransactionId": "7b1f7179-b83f-4eab-a4db-3c600eebe271",
  "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: text/plain

Type: any

Example:

"unable to add voucher-line -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create voucher-lines -- unauthorized

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

PUT /voucher-storage/voucher-lines/{id}

Update voucher-line item with given {voucher-lineId}

PUT /voucher-storage/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 an 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",
      "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}$"
    },
    "externalAccountNumber": {
      "description": "All distributions that come from funds with the same account number are grouped by voucher line",
      "type": "string"
    },
    "voucherLineAmount": {
      "description": "Total amount of this voucher",
      "type": "number"
    },
    "sourceId": {
      "description": "UUID of source, grouped on a voucher line based on External Account Number",
      "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": "The fund Id",
      "type": "string"
    },
    "fundDistributions": {
      "description": "UUID of the fund distribution amount associated with particular fund;referenced from the invoice",
      "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": {
      "description": "UUID of sub transactions",
      "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",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "externalAccountNumber",
    "voucherLineAmount",
    "sourceId",
    "fundId",
    "fundDistributions",
    "subTransactionId"
  ]
}

Example:

{
  "id": "e0d08448-343b-118a-8c2f-4fb50248d672",
  "externalAccountNumber": "54321098",
  "voucherLineAmount": 23.45,
  "fundId": "172364c7-AaAa-A0C2-C12C-e35CeCcbfaF2",
  "fundDistributions": "efee4b3a-fcd5-40c8-8cf4-0ee3d76ddf4d",
  "sourceId": "825fc0f9-6634-47ec-a750-da33c5cfbab6",
  "subTransactionId": "7b1f7179-b83f-4eab-a4db-3c600eebe271",
  "metadata": {
    "createdDate": "2019-05-06T00:00:00.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

Response 204

Item 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-line -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

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

Type: any

Example:

internal server error, contact administrator

GET /voucher-storage/voucher-lines/{id}

Retrieve voucher-line item with given {voucher-lineId}

GET /voucher-storage/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 an voucher line

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 line",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this voucher line",
      "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}$"
    },
    "externalAccountNumber": {
      "description": "All distributions that come from funds with the same account number are grouped by voucher line",
      "type": "string"
    },
    "voucherLineAmount": {
      "description": "Total amount of this voucher",
      "type": "number"
    },
    "sourceId": {
      "description": "UUID of source, grouped on a voucher line based on External Account Number",
      "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": "The fund Id",
      "type": "string"
    },
    "fundDistributions": {
      "description": "UUID of the fund distribution amount associated with particular fund;referenced from the invoice",
      "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": {
      "description": "UUID of sub transactions",
      "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",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "externalAccountNumber",
    "voucherLineAmount",
    "sourceId",
    "fundId",
    "fundDistributions",
    "subTransactionId"
  ]
}

Example:

{
  "id": "e0d08448-343b-118a-8c2f-4fb50248d672",
  "externalAccountNumber": "54321098",
  "voucherLineAmount": 23.45,
  "fundId": "172364c7-AaAa-A0C2-C12C-e35CeCcbfaF2",
  "fundDistributions": "efee4b3a-fcd5-40c8-8cf4-0ee3d76ddf4d",
  "sourceId": "825fc0f9-6634-47ec-a750-da33c5cfbab6",
  "subTransactionId": "7b1f7179-b83f-4eab-a4db-3c600eebe271",
  "metadata": {
    "createdDate": "2019-05-06T00:00:00.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"voucher-line not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

DELETE /voucher-storage/voucher-lines/{id}

Delete voucher-line item with given {voucher-lineId}

DELETE /voucher-storage/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 an voucher line

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

    Requested language. Optional. [lang=en]

Response 204

Item deleted successfully

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 delete voucher-line -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"voucher-line not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator