Batch Vouchers (v2.0)

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

Table of contents

Batch Vouchers API

API used to manage batch vouchers.

/batch-voucher/batch-vouchers

GET /batch-voucher/batch-vouchers/{id}

Retrieve batch-voucher item with given {batch-voucherId}

GET /batch-voucher/batch-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 batch voucher

Headers
  • Accept: required (string)

    either application/xml or application/json

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/xml

Type: any

Example:

<batchVoucher>
  <id>cb7592ae-621c-4f35-bc1d-47909e55f9f5</id>
  <batchGroup>Amherst College (AC)</batchGroup>
  <created>2019-12-07T00:01:04Z</created>
  <start>2019-12-06T00:00:00Z</start>
  <end>2019-12-07T00:00:00Z</end>
  <batchedVouchers>
    <batchedVoucher>
      <accountingCode>0206</accountingCode>
      <amount>23.45</amount>
      <batchedVoucherLines>
        <batchedVoucherLine>
          <amount>23.45</amount>
          <fundCodes>
            <fundCode>HIST</fundCode>
            <fundCode>LATHIST</fundCode>
            <fundCode>CANHIST</fundCode>
          </fundCodes>
          <externalAccountNumber>54321098</externalAccountNumber>
        </batchedVoucherLine>
      </batchedVoucherLines>
      <disbursementNumber>EFT546789</disbursementNumber>
      <disbursementDate>2019-12-06T00:01:04Z</disbursementDate>
      <disbursementAmount>23.45</disbursementAmount>
      <enclosureNeeded>false</enclosureNeeded>
      <exchangeRate>1</exchangeRate>
      <folioInvoiceNo>123folionumber456</folioInvoiceNo>
      <invoiceCurrency>USD</invoiceCurrency>
      <invoiceNote>Process immediately</invoiceNote>
      <status>Paid</status>
      <systemCurrency>USD</systemCurrency>
      <type>Voucher</type>
      <vendorInvoiceNo>YK75851</vendorInvoiceNo>
      <vendorName>GOBI</vendorName>
      <voucherDate>2019-12-06T00:00:00Z</voucherDate>
      <voucherNumber>1023</voucherNumber>
    </batchedVoucher>
  </batchedVouchers>
  <totalRecords>1</totalRecords>
</batchVoucher>

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "top-level batch voucher, i.e. a collection of batched vouchers",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of batch 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}$"
    },
    "batchGroup": {
      "description": "The human-readable name of the batch group used when generating this batch voucher",
      "type": "string"
    },
    "batchedVouchers": {
      "description": "an array of batched voucher records",
      "id": "batchVouchers",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "A single voucher which is part of a batch voucher",
        "properties": {
          "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"
          },
          "batchedVoucherLines": {
            "description": "an array of batched voucher line records",
            "id": "batchedVoucherLines",
            "type": "array",
            "items": {
              "type": "object",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "description": "One line of a batched voucher",
              "properties": {
                "amount": {
                  "description": "Total amount of this voucher",
                  "type": "number"
                },
                "fundCodes": {
                  "description": "an array of fund codes",
                  "id": "fundCodes",
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "externalAccountNumber": {
                  "description": "All distributions that come from funds with the same account number are grouped by voucher line",
                  "type": "string"
                }
              },
              "additionalProperties": false,
              "required": [
                "amount",
                "externalAccountNumber",
                "fundCodes"
              ]
            }
          },
          "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"
          },
          "enclosureNeeded": {
            "description": "Indicates that an enclosure is needed",
            "type": "boolean",
            "default": false
          },
          "exchangeRate": {
            "description": "Exchange rate used to generate transaction",
            "type": "number"
          },
          "folioInvoiceNo": {
            "description": "Represents associated invoice number",
            "type": "string"
          },
          "invoiceCurrency": {
            "description": "The currency in which invoice was originally defined",
            "type": "string"
          },
          "invoiceNote": {
            "description": "Free-form notes from the invoice",
            "type": "string"
          },
          "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"
            ]
          },
          "vendorInvoiceNo": {
            "description": "Corresponding invoice's vendorInvoiceNo",
            "type": "string"
          },
          "vendorName": {
            "description": "The name of the vendor",
            "type": "string"
          },
          "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]*$"
          }
        },
        "additionalProperties": false,
        "required": [
          "accountingCode",
          "amount",
          "batchedVoucherLines",
          "folioInvoiceNo",
          "invoiceCurrency",
          "status",
          "systemCurrency",
          "type",
          "vendorInvoiceNo",
          "vendorName",
          "voucherDate",
          "voucherNumber"
        ]
      }
    },
    "created": {
      "description": "When this batch voucher was created",
      "type": "string",
      "format": "date-time"
    },
    "start": {
      "description": "This export is for all vouchers between start and end",
      "type": "string",
      "format": "date-time"
    },
    "end": {
      "description": "This export is for all vouchers between start and end",
      "type": "string",
      "format": "date-time"
    },
    "totalRecords": {
      "description": "total number of records in the array",
      "type": "integer"
    }
  },
  "required": [
    "batchGroup",
    "batchedVouchers",
    "created",
    "start",
    "end",
    "totalRecords"
  ]
}

Example:

{
  "id": "35657479-83b9-4760-9c39-b58dcd02ee27",
  "batchGroup": "Amherst College (AC)",
  "start": "2019-12-06T00:00:00.000+0000",
  "end": "2019-12-07T00:00:00.000+0000",
  "created": "2019-12-07T00:01:04.000+0000",
  "batchedVouchers": [
    {
      "accountingCode": "0206",
      "amount": 23.45,
      "disbursementNumber": "EFT546789",
      "disbursementDate": "2019-12-06T00:01:04.000+0000",
      "disbursementAmount": 23.45,
      "enclosureNeeded": false,
      "exchangeRate": 1,
      "folioInvoiceNo": "123invoicenumber45",
      "invoiceCurrency": "USD",
      "invoiceNote": "Process immediately",
      "status": "Paid",
      "systemCurrency": "USD",
      "type": "Voucher",
      "voucherDate": "2019-12-06T00:00:00.000+0000",
      "voucherNumber": "1023",
      "vendorName": "GOBI",
      "vendorInvoiceNo": "YK75851",
      "batchVoucherLines": [
        {
          "amount": 23.45,
          "externalAccountNumber": "54321098",
          "fundCodes": [
            "HIST",
            "LATHIST",
            "CANHIST"
          ]
        }
      ]
    }
  ],
  "totalRecords": 1
}

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 batch-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:

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