https://github.com/folio-org/mod-orders
API for managing export history
Create export-history record
Retrieve a list of export-history items.
GET /orders-storage/export-history
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
Skip over a number of elements by specifying an offset value for the query
Example:
0
Limit the number of elements returned in the response
Example:
10
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"
Returns a list of export-history items
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
}
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.
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
Not authorized to perform requested action
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
Validation errors
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"
}
]
}
]
}
Internal server error, e.g. due to misconfiguration
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
Create export-history record
POST /orders-storage/export-history
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"
]
}
Returns a newly created item, with server-controlled fields like 'id' populated
URI to the created export-history item
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"
]
}
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.
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"
Not authorized to perform requested action
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
Validation errors
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"
}
]
}
]
}
Internal server error, e.g. due to misconfiguration
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
Retrieve export-history item with given {export-historyId}
GET /orders-storage/export-history/{id}
The UUID of a Export history
Returns item with a given ID
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"
]
}
Item with a given ID not found
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"
Internal server error, e.g. due to misconfiguration
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 export-history item with given {export-historyId}
DELETE /orders-storage/export-history/{id}
The UUID of a Export history
Item deleted successfully
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.
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"
Item with a given ID not found
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"
Internal server error, e.g. due to misconfiguration
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
Update export-history item with given {export-historyId}
PUT /orders-storage/export-history/{id}
The UUID of a Export history
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"
]
}
Item successfully updated
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.
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"
Item with a given ID not found
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"
Optimistic locking version conflict
Media type: text/plain
Type: any
Example:
version conflict
Internal server error, e.g. due to misconfiguration
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