Batch Vouchers (v1.1)

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>
      <exchangeRate>1</exchangeRate>
      <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",
      "$ref": "../../common/schemas/uuid.json"
    },
    "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",
        "$ref": "batched_voucher.json"
      }
    },
    "created": {
      "description": "When this batch voucher was created",
      "type": "string",
      "format": "datetime"
    },
    "start": {
      "description": "This export is for all vouchers between start and end",
      "type": "string",
      "format": "datetime"
    },
    "end": {
      "description": "This export is for all vouchers between start and end",
      "type": "string",
      "format": "datetime"
    },
    "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,
      "exchangeRate": 1,
      "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",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

internal server error, contact administrator