Batch voucher export configurations (v1.0)

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

Table of contents

Batch voucher export configurations CRUD API

This documents the API calls that can be made to manage batch voucher export configurations; This API is intended for internal use only

/batch-voucher-storage/export-configurations

Collection of export-configuration items.

GET /batch-voucher-storage/export-configurations

Get list of batch voucher export configurations

GET /batch-voucher-storage/export-configurations
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 format

    Example:

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

    Requested language. Optional. [lang=en]

Response 200

Returns a list of export-configuration items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "collection of batch voucher export configurations",
  "type": "object",
  "properties": {
    "exportConfigs": {
      "description": "an array of batch voucher export configuration records",
      "id": "exportConfigs",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "export_configuration.json"
      }
    },
    "totalRecords": {
      "description": "total number of records in the array",
      "type": "integer"
    }
  },
  "required": [
    "exportConfigs",
    "totalRecords"
  ]
}

Example:

{
  "exportConfigs": [
    {
      "id": "3e3a52b2-9097-49ad-8ff1-8135af0db573",
      "batchGroupId": "e91d44e4-ae4f-401a-b355-3ea44f57a628",
      "startTime": "00:00",
      "weekdays": [ "Monday", "Wednesday" ],
      "enableScheduledExport": true,
      "format": "Application/xml",
      "uploadURI": "ftp://ftp.amherst-lib.edu/invoices/",
      "metadata": {
        "createdDate": "2020-01-28T00:12:04.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 export-configurations -- 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 export-configurations -- 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 /batch-voucher-storage/export-configurations

Create a new export-configuration item.

POST /batch-voucher-storage/export-configurations
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": "Configuration information for a voucher export - there's only one of these for a given batchGroup",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of the configuration record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "batchGroupId": {
      "description": "UUID of the batch group this configuration is associated with",
      "$ref": "../../common/schemas/uuid.json"
    },
    "enableScheduledExport": {
      "description": "Whether or not to enable scheduled batch voucher exports",
      "type": "boolean",
      "default": false
    },
    "format": {
      "description": "Desired format (MIME type) of the batch voucher",
      "type": "string",
      "enum": [
        "Application/json",
        "Application/xml"
      ],
      "default": "Application/json"
    },
    "startTime": {
      "description": "The time of day to trigger an export if enableDailyExport == true.  Format: HH:MM",
      "type": "string",
      "pattern": "^([0-9]|0[0-9]|1[0-9]|2[0-3])[:][0-5][0-9]$",
      "default": "00:00"
    },
    "uploadURI": {
      "description": "URI batch vouchers should be uploaded to.  Limited to FTP initially",
      "type": "string",
      "pattern": "^ftp://([\\.\\_\\-a-z0-9]+)(/([\\./\\-\\_\\.a-z0-9]?)+)?$"
    },
    "weekdays": {
      "description": "An array of weekdays (enum: Sunday, Monday, etc.) indicating which days to trigger exports on.  If empty, indicates daily exports",
      "type": "array",
      "items": {
        "type": "string",
        "enum": [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ],
        "uniqueItems": true
      }
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "batchGroupId"
  ]
}

Example:

{
  "id": "3e3a52b2-9097-49ad-8ff1-8135af0db573",
  "batchGroupId": "e91d44e4-ae4f-401a-b355-3ea44f57a628",
  "startTime": "00:00",
  "weekdays": [ "Monday", "Wednesday" ],
  "enableScheduledExport": true,
  "format": "Application/xml",
  "uploadURI": "ftp://ftp.amherst-lib.edu/invoices/",
  "metadata": {
    "createdDate": "2020-01-28T00:12:04.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 export-configuration item

Body

Media type: application/json

Type: any

Example:

{
  "id": "3e3a52b2-9097-49ad-8ff1-8135af0db573",
  "batchGroupId": "e91d44e4-ae4f-401a-b355-3ea44f57a628",
  "startTime": "00:00",
  "weekdays": [ "Monday", "Wednesday" ],
  "enableScheduledExport": true,
  "format": "Application/xml",
  "uploadURI": "ftp://ftp.amherst-lib.edu/invoices/",
  "metadata": {
    "createdDate": "2020-01-28T00:12:04.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 export-configuration -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create export-configurations -- 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 /batch-voucher-storage/export-configurations/{id}

Retrieve export-configuration item with given {export-configurationId}

GET /batch-voucher-storage/export-configurations/{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 export configuration

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": "Configuration information for a voucher export - there's only one of these for a given batchGroup",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of the configuration record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "batchGroupId": {
      "description": "UUID of the batch group this configuration is associated with",
      "$ref": "../../common/schemas/uuid.json"
    },
    "enableScheduledExport": {
      "description": "Whether or not to enable scheduled batch voucher exports",
      "type": "boolean",
      "default": false
    },
    "format": {
      "description": "Desired format (MIME type) of the batch voucher",
      "type": "string",
      "enum": [
        "Application/json",
        "Application/xml"
      ],
      "default": "Application/json"
    },
    "startTime": {
      "description": "The time of day to trigger an export if enableDailyExport == true.  Format: HH:MM",
      "type": "string",
      "pattern": "^([0-9]|0[0-9]|1[0-9]|2[0-3])[:][0-5][0-9]$",
      "default": "00:00"
    },
    "uploadURI": {
      "description": "URI batch vouchers should be uploaded to.  Limited to FTP initially",
      "type": "string",
      "pattern": "^ftp://([\\.\\_\\-a-z0-9]+)(/([\\./\\-\\_\\.a-z0-9]?)+)?$"
    },
    "weekdays": {
      "description": "An array of weekdays (enum: Sunday, Monday, etc.) indicating which days to trigger exports on.  If empty, indicates daily exports",
      "type": "array",
      "items": {
        "type": "string",
        "enum": [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ],
        "uniqueItems": true
      }
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "batchGroupId"
  ]
}

Example:

{
  "id": "3e3a52b2-9097-49ad-8ff1-8135af0db573",
  "batchGroupId": "e91d44e4-ae4f-401a-b355-3ea44f57a628",
  "startTime": "00:00",
  "weekdays": [ "Monday", "Wednesday" ],
  "enableScheduledExport": true,
  "format": "Application/xml",
  "uploadURI": "ftp://ftp.amherst-lib.edu/invoices/",
  "metadata": {
    "createdDate": "2020-01-28T00:12:04.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:

"export-configuration 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 /batch-voucher-storage/export-configurations/{id}

Delete export-configuration item with given {export-configurationId}

DELETE /batch-voucher-storage/export-configurations/{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 export configuration

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 export-configuration -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"export-configuration 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 /batch-voucher-storage/export-configurations/{id}

Update export-configuration item with given {export-configurationId}

PUT /batch-voucher-storage/export-configurations/{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 export configuration

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": "Configuration information for a voucher export - there's only one of these for a given batchGroup",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of the configuration record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "batchGroupId": {
      "description": "UUID of the batch group this configuration is associated with",
      "$ref": "../../common/schemas/uuid.json"
    },
    "enableScheduledExport": {
      "description": "Whether or not to enable scheduled batch voucher exports",
      "type": "boolean",
      "default": false
    },
    "format": {
      "description": "Desired format (MIME type) of the batch voucher",
      "type": "string",
      "enum": [
        "Application/json",
        "Application/xml"
      ],
      "default": "Application/json"
    },
    "startTime": {
      "description": "The time of day to trigger an export if enableDailyExport == true.  Format: HH:MM",
      "type": "string",
      "pattern": "^([0-9]|0[0-9]|1[0-9]|2[0-3])[:][0-5][0-9]$",
      "default": "00:00"
    },
    "uploadURI": {
      "description": "URI batch vouchers should be uploaded to.  Limited to FTP initially",
      "type": "string",
      "pattern": "^ftp://([\\.\\_\\-a-z0-9]+)(/([\\./\\-\\_\\.a-z0-9]?)+)?$"
    },
    "weekdays": {
      "description": "An array of weekdays (enum: Sunday, Monday, etc.) indicating which days to trigger exports on.  If empty, indicates daily exports",
      "type": "array",
      "items": {
        "type": "string",
        "enum": [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ],
        "uniqueItems": true
      }
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "batchGroupId"
  ]
}

Example:

{
  "id": "3e3a52b2-9097-49ad-8ff1-8135af0db573",
  "batchGroupId": "e91d44e4-ae4f-401a-b355-3ea44f57a628",
  "startTime": "00:00",
  "weekdays": [ "Monday", "Wednesday" ],
  "enableScheduledExport": true,
  "format": "Application/xml",
  "uploadURI": "ftp://ftp.amherst-lib.edu/invoices/",
  "metadata": {
    "createdDate": "2020-01-28T00:12:04.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 export-configuration -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"export-configuration 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

POST /batch-voucher-storage/export-configurations/{id}/credentials

Create credentials for a batch voucher configuration

POST /batch-voucher-storage/export-configurations/{id}/credentials
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 export configuration

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": "Credentials used to upload batch vouchers.  Part of the batch voucher export configuration, but separated for security reasons",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this credentials record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "username": {
      "description": "The username portion of these credentials",
      "type": "string"
    },
    "password": {
      "description": "The password portion of these credentials",
      "type": "string"
    },
    "exportConfigId": {
      "description": "UUID of the batch voucher export configuration record these credentials as associated with",
      "$ref": "../../common/schemas/uuid.json"
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "exportConfigId",
    "username"
  ]
}

Example:

{
  "id": "574f0791-beca-4470-8037-050660cfb73a",
  "exportConfigId": "e91d44e4-ae4f-401a-b355-3ea44f57a628",
  "username": "jsmith",
  "password": "letmein",
  "metadata": {
    "createdDate": "2020-01-28T00:12:04.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

Response 201

Returns the newly created credentials, with server-controlled fields like 'id' populated

Headers
  • Location: required (string)

    URI to the created credentials

Body

Media type: application/json

Type: any

Example:

{
  "id": "574f0791-beca-4470-8037-050660cfb73a",
  "exportConfigId": "e91d44e4-ae4f-401a-b355-3ea44f57a628",
  "username": "jsmith",
  "password": "letmein",
  "metadata": {
    "createdDate": "2020-01-28T00:12:04.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 credentials -- malformed JSON at 13:3

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create credentials -- 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 /batch-voucher-storage/export-configurations/{id}/credentials

Retrieve credential item with given {credentialId}

GET /batch-voucher-storage/export-configurations/{id}/credentials
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 export configuration

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": "Credentials used to upload batch vouchers.  Part of the batch voucher export configuration, but separated for security reasons",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this credentials record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "username": {
      "description": "The username portion of these credentials",
      "type": "string"
    },
    "password": {
      "description": "The password portion of these credentials",
      "type": "string"
    },
    "exportConfigId": {
      "description": "UUID of the batch voucher export configuration record these credentials as associated with",
      "$ref": "../../common/schemas/uuid.json"
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "exportConfigId",
    "username"
  ]
}

Example:

{
  "id": "574f0791-beca-4470-8037-050660cfb73a",
  "exportConfigId": "e91d44e4-ae4f-401a-b355-3ea44f57a628",
  "username": "jsmith",
  "password": "letmein",
  "metadata": {
    "createdDate": "2020-01-28T00:12:04.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:

"credential 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 /batch-voucher-storage/export-configurations/{id}/credentials

Delete credential item with given {credentialId}

DELETE /batch-voucher-storage/export-configurations/{id}/credentials
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 export configuration

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 credential -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"credential 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 /batch-voucher-storage/export-configurations/{id}/credentials

Update credential item with given {credentialId}

PUT /batch-voucher-storage/export-configurations/{id}/credentials
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 export configuration

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": "Credentials used to upload batch vouchers.  Part of the batch voucher export configuration, but separated for security reasons",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this credentials record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "username": {
      "description": "The username portion of these credentials",
      "type": "string"
    },
    "password": {
      "description": "The password portion of these credentials",
      "type": "string"
    },
    "exportConfigId": {
      "description": "UUID of the batch voucher export configuration record these credentials as associated with",
      "$ref": "../../common/schemas/uuid.json"
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "exportConfigId",
    "username"
  ]
}

Example:

{
  "id": "574f0791-beca-4470-8037-050660cfb73a",
  "exportConfigId": "e91d44e4-ae4f-401a-b355-3ea44f57a628",
  "username": "jsmith",
  "password": "letmein",
  "metadata": {
    "createdDate": "2020-01-28T00:12:04.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 credential -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

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