Export history version v1
https://github.com/folio-org/mod-orders
Export history Logic API
API for managing export history
Pieces
Create export-history record
Retrieve a list of export-history items.
Create export-history record
get /orders-storage/export-history
Retrieve a list of export-history items.
Query Parameters
- totalRecords: (string - default: auto - pattern: exact|estimated|none|auto)
How to calculate the totalRecords property. "exact" for the correct number, "estimated" for an estimation, "auto" to automatically select "exact" or "estimated", "none" for suppressing the totalRecords property. For details see https://github.com/folio-org/raml-module-builder#estimated-totalrecords
Example:
none
- 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 export-history records)
Example:
(username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode exportType=="EDIFACT_ORDERS_EXPORT"
HTTP status code 200
Returns a list of export-history items
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Collection of export histories",
"type": "object",
"properties": {
"exportHistories": {
"description": "Collection of export histories",
"type": "array",
"id": "export_history",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Export orders or order lines history",
"properties": {
"id": {
"description": "UUID of this history record",
"$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}$"
},
"exportJobId": {
"description": "UUID of the export Job",
"$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}$"
},
"exportType": {
"description": "Export type",
"type": "string"
},
"jobStatus": {
"description": "Job status",
"type": "string"
},
"jobName": {
"description": "Job name",
"type": "string"
},
"exportMethod": {
"description": "Export method name",
"type": "string"
},
"exportFileName": {
"description": "Export file name",
"type": "string"
},
"vendorId": {
"description": "UUID of vendor",
"$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}$"
},
"vendorName": {
"description": "Vendor name",
"type": "string"
},
"exportDate": {
"description": "Export date",
"type": "string",
"format": "date-time"
},
"exportedPoLineIds": {
"description": "References the purchase order lines associated to the export",
"id": "exportedPoLineIds",
"type": "array",
"items": {
"description": "UUID of the purchase order line",
"type": "string"
}
}
},
"additionalProperties": false,
"required": [
"exportType",
"exportJobId",
"exportDate"
]
}
},
"totalRecords": {
"description": "The number of objects contained in this collection",
"type": "integer"
}
},
"additionalProperties": false,
"required": [
"exportHistories",
"totalRecords"
]
}
Example:
{
"exportHistories":
[
{
"id": "99fb699a-cdf1-11e9-a9d9-f2801f1b9aa1",
"exportType": "EDIFACT_ORDERS_EXPORT",
"exportJobId": "22fb627a-cdf1-11e8-a8d5-f2801f1b9aa1",
"exportDate": "2020-12-25",
"exportedPoLineIds": [
"11fb627a-cdf1-11e8-a8d5-f2801f1b9fd1",
"11fb627a-cdf1-11e8-a8d5-f2801f1b9fd2",
"11fb627a-cdf1-11e8-a8d5-f2801f1b9fd3",
"11fb627a-cdf1-11e8-a8d5-f2801f1b9fd4"
]
},
{
"id": "99fb699a-cdf1-11e9-a9d9-f2801f1b9aa2",
"exportType": "EDIFACT_ORDERS_EXPORT",
"exportJobId": "22fb627a-cdf1-11e8-a8d5-f2801f1b9aa2",
"exportDate": "2020-12-26",
"exportedPoLineIds": [
"11fb627a-cdf1-11e8-a8d5-f2801f1b9fd4",
"11fb627a-cdf1-11e8-a8d5-f2801f1b9fd2",
"11fb627a-cdf1-11e8-a8d5-f2801f1b9fd5",
"11fb627a-cdf1-11e8-a8d5-f2801f1b9fd4"
]
}
],
"totalRecords": 2
}
HTTP status code 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 export-history -- malformed parameter 'query', syntax error at column 6
HTTP status code 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 export-history -- unauthorized
HTTP status code 422
Validation errors
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "errors.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#",
"id": "error.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": {
"description": "Error message parameters",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "parameters.schema",
"type": "array",
"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"
}
]
}
]
}
HTTP status code 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
post /orders-storage/export-history
Create export-history record
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Export orders or order lines history",
"type": "object",
"properties": {
"id": {
"description": "UUID of this history record",
"$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}$"
},
"exportJobId": {
"description": "UUID of the export Job",
"$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}$"
},
"exportType": {
"description": "Export type",
"type": "string"
},
"jobStatus": {
"description": "Job status",
"type": "string"
},
"jobName": {
"description": "Job name",
"type": "string"
},
"exportMethod": {
"description": "Export method name",
"type": "string"
},
"exportFileName": {
"description": "Export file name",
"type": "string"
},
"vendorId": {
"description": "UUID of vendor",
"$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}$"
},
"vendorName": {
"description": "Vendor name",
"type": "string"
},
"exportDate": {
"description": "Export date",
"type": "string",
"format": "date-time"
},
"exportedPoLineIds": {
"description": "References the purchase order lines associated to the export",
"id": "exportedPoLineIds",
"type": "array",
"items": {
"description": "UUID of the purchase order line",
"type": "string"
}
}
},
"additionalProperties": false,
"required": [
"exportType",
"exportJobId",
"exportDate"
]
}
Example:
{
"id": "99fb699a-cdf1-11e9-a9d9-f2801f1b9aa1",
"exportType": "EDIFACT_ORDERS_EXPORT",
"exportMethod": "EdifactExport",
"exportFileName": "my_order.edi",
"vendorId": "88fb699a-cdf1-11e9-88d9-f2801f188aa1",
"vendorName": "Amazon",
"jobName": "TestJob",
"exportJobId": "22fb627a-cdf1-11e8-a8d5-f2801f1b9aa1",
"exportDate": "2020-12-25",
"exportedPoLineIds": [
"11fb627a-cdf1-11e8-a8d5-f2801f1b9fd1",
"11fb627a-cdf1-11e8-a8d5-f2801f1b9fd2",
"11fb627a-cdf1-11e8-a8d5-f2801f1b9fd3",
"11fb627a-cdf1-11e8-a8d5-f2801f1b9fd4"
]
}
HTTP status code 201
Returns a newly created item, with server-controlled fields like 'id' populated
Headers
- Location: required(string)
URI to the created export-history item
Body
Media type: application/json
Type: any
Example:
{
"id": "99fb699a-cdf1-11e9-a9d9-f2801f1b9aa1",
"exportType": "EDIFACT_ORDERS_EXPORT",
"exportMethod": "EdifactExport",
"exportFileName": "my_order.edi",
"vendorId": "88fb699a-cdf1-11e9-88d9-f2801f188aa1",
"vendorName": "Amazon",
"jobName": "TestJob",
"exportJobId": "22fb627a-cdf1-11e8-a8d5-f2801f1b9aa1",
"exportDate": "2020-12-25",
"exportedPoLineIds": [
"11fb627a-cdf1-11e8-a8d5-f2801f1b9fd1",
"11fb627a-cdf1-11e8-a8d5-f2801f1b9fd2",
"11fb627a-cdf1-11e8-a8d5-f2801f1b9fd3",
"11fb627a-cdf1-11e8-a8d5-f2801f1b9fd4"
]
}
HTTP status code 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 add export-history -- malformed JSON at 13:3"
HTTP status code 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 create export-history -- unauthorized
HTTP status code 422
Validation errors
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "errors.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#",
"id": "error.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": {
"description": "Error message parameters",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "parameters.schema",
"type": "array",
"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"
}
]
}
]
}
HTTP status code 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, Delete or Update a specific export history
Retrieve export-history item with given {export-historyId}
Delete export-history item with given {export-historyId}
Update export-history item with given {export-historyId}
get /orders-storage/export-history/{id}
Retrieve export-history item with given {export-historyId}
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 Export history
HTTP status code 200
Returns item with a given ID
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Export orders or order lines history",
"type": "object",
"properties": {
"id": {
"description": "UUID of this history record",
"$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}$"
},
"exportJobId": {
"description": "UUID of the export Job",
"$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}$"
},
"exportType": {
"description": "Export type",
"type": "string"
},
"jobStatus": {
"description": "Job status",
"type": "string"
},
"jobName": {
"description": "Job name",
"type": "string"
},
"exportMethod": {
"description": "Export method name",
"type": "string"
},
"exportFileName": {
"description": "Export file name",
"type": "string"
},
"vendorId": {
"description": "UUID of vendor",
"$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}$"
},
"vendorName": {
"description": "Vendor name",
"type": "string"
},
"exportDate": {
"description": "Export date",
"type": "string",
"format": "date-time"
},
"exportedPoLineIds": {
"description": "References the purchase order lines associated to the export",
"id": "exportedPoLineIds",
"type": "array",
"items": {
"description": "UUID of the purchase order line",
"type": "string"
}
}
},
"additionalProperties": false,
"required": [
"exportType",
"exportJobId",
"exportDate"
]
}
Example:
{
"id": "99fb699a-cdf1-11e9-a9d9-f2801f1b9aa1",
"exportType": "EDIFACT_ORDERS_EXPORT",
"exportMethod": "EdifactExport",
"exportFileName": "my_order.edi",
"vendorId": "88fb699a-cdf1-11e9-88d9-f2801f188aa1",
"vendorName": "Amazon",
"jobName": "TestJob",
"exportJobId": "22fb627a-cdf1-11e8-a8d5-f2801f1b9aa1",
"exportDate": "2020-12-25",
"exportedPoLineIds": [
"11fb627a-cdf1-11e8-a8d5-f2801f1b9fd1",
"11fb627a-cdf1-11e8-a8d5-f2801f1b9fd2",
"11fb627a-cdf1-11e8-a8d5-f2801f1b9fd3",
"11fb627a-cdf1-11e8-a8d5-f2801f1b9fd4"
]
}
HTTP status code 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:
"export-history not found"
HTTP status code 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
delete /orders-storage/export-history/{id}
Delete export-history item with given {export-historyId}
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 Export history
HTTP status code 204
Item deleted successfully
HTTP status code 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 delete export-history -- constraint violation"
HTTP status code 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:
"export-history not found"
HTTP status code 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 /orders-storage/export-history/{id}
Update export-history item with given {export-historyId}
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 Export history
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Export orders or order lines history",
"type": "object",
"properties": {
"id": {
"description": "UUID of this history record",
"$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}$"
},
"exportJobId": {
"description": "UUID of the export Job",
"$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}$"
},
"exportType": {
"description": "Export type",
"type": "string"
},
"jobStatus": {
"description": "Job status",
"type": "string"
},
"jobName": {
"description": "Job name",
"type": "string"
},
"exportMethod": {
"description": "Export method name",
"type": "string"
},
"exportFileName": {
"description": "Export file name",
"type": "string"
},
"vendorId": {
"description": "UUID of vendor",
"$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}$"
},
"vendorName": {
"description": "Vendor name",
"type": "string"
},
"exportDate": {
"description": "Export date",
"type": "string",
"format": "date-time"
},
"exportedPoLineIds": {
"description": "References the purchase order lines associated to the export",
"id": "exportedPoLineIds",
"type": "array",
"items": {
"description": "UUID of the purchase order line",
"type": "string"
}
}
},
"additionalProperties": false,
"required": [
"exportType",
"exportJobId",
"exportDate"
]
}
Example:
{
"id": "99fb699a-cdf1-11e9-a9d9-f2801f1b9aa1",
"exportType": "EDIFACT_ORDERS_EXPORT",
"exportMethod": "EdifactExport",
"exportFileName": "my_order.edi",
"vendorId": "88fb699a-cdf1-11e9-88d9-f2801f188aa1",
"vendorName": "Amazon",
"jobName": "TestJob",
"exportJobId": "22fb627a-cdf1-11e8-a8d5-f2801f1b9aa1",
"exportDate": "2020-12-25",
"exportedPoLineIds": [
"11fb627a-cdf1-11e8-a8d5-f2801f1b9fd1",
"11fb627a-cdf1-11e8-a8d5-f2801f1b9fd2",
"11fb627a-cdf1-11e8-a8d5-f2801f1b9fd3",
"11fb627a-cdf1-11e8-a8d5-f2801f1b9fd4"
]
}
HTTP status code 204
Item successfully updated
HTTP status code 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 update export-history -- malformed JSON at 13:4"
HTTP status code 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:
"export-history not found"
HTTP status code 409
Optimistic locking version conflict
Body
Media type: text/plain
Type: any
Example:
version conflict
HTTP status code 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