http://github.com/folio-org/mod-orders-storage
This module implements the CRUD interface for Order Template Categories API. This API is intended for internal use only.
Collection of order-template-category items.
Create new order template
POST /orders-storage/order-template-categories
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Order Template Category",
"type": "object",
"javaName": "OrderTemplateCategory",
"properties": {
"id": {
"description": "UUID of order template category",
"$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}$"
},
"name": {
"description": "The name of order template category",
"type": "string"
}
},
"additionalProperties": true,
"required": [
"name"
]
}
Example:
{
"name": "Sample Order Template Category"
}
Returns a newly created item, with server-controlled fields like 'id' populated
URI to the created order-template-category item
Media type: application/json
Type: any
Example:
{
"name": "Sample Order Template Category"
}
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: text/plain
Type: any
Example:
"unable to add order-template-category -- malformed JSON at 13:3"
Not authorized to perform requested action
Media type: text/plain
Type: any
Example:
unable to create order-template-categories -- 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: text/plain
Type: any
Example:
Internal server error, contact administrator
Get list of order template category
GET /orders-storage/order-template-categories
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 name
Example:
(username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
["name", "Fiction", "="]
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
Returns a list of order-template-category items
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Collection of order template categories",
"type": "object",
"javaName": "OrderTemplateCategoryCollection",
"properties": {
"orderTemplateCategories": {
"description": "Collection of order template categories",
"type": "array",
"id": "orderTemplateCategories",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Order Template Category",
"javaName": "OrderTemplateCategory",
"properties": {
"id": {
"description": "UUID of order template category",
"$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}$"
},
"name": {
"description": "The name of order template category",
"type": "string"
}
},
"additionalProperties": true,
"required": [
"name"
]
}
},
"totalRecords": {
"description": "The number of objects in DB in general for incoming search criteria.",
"type": "integer"
}
},
"additionalProperties": false,
"required": [
"orderTemplateCategories",
"totalRecords"
]
}
Example:
{
"orderTemplateCategories": [
{
"id": "3dee318b-f5b3-40dc-be93-cc89b8c45b6f",
"name": "Sample Order Template Category"
}
],
"totalRecords": 1
}
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: text/plain
Type: any
Example:
unable to list order-template-categories -- malformed parameter 'query', syntax error at column 6
Not authorized to perform requested action
Media type: text/plain
Type: any
Example:
unable to list order-template-categories -- unauthorized
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
internal server error, contact administrator
Update order template category
PUT /orders-storage/order-template-categories/{id}
The UUID of an Order Template Category
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Order Template Category",
"type": "object",
"javaName": "OrderTemplateCategory",
"properties": {
"id": {
"description": "UUID of order template category",
"$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}$"
},
"name": {
"description": "The name of order template category",
"type": "string"
}
},
"additionalProperties": true,
"required": [
"name"
]
}
Example:
{
"id": "3dee318b-f5b3-40dc-be93-cc89b8c45b6f",
"name": "Sample Order Template Category"
}
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: text/plain
Type: any
Example:
"unable to update order-template-category -- malformed JSON at 13:4"
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"order-template-category not found"
Optimistic locking version conflict
Media type: text/plain
Type: any
Example:
version conflict
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: text/plain
Type: any
Example:
internal server error, contact administrator
Delete order template category
DELETE /orders-storage/order-template-categories/{id}
The UUID of an Order Template Category
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: text/plain
Type: any
Example:
"unable to delete order-template-category -- constraint violation"
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"order-template-category not found"
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: text/plain
Type: any
Example:
Internal server error, contact administrator
Retrieve order-template-category item with given {order-template-categoryId}
GET /orders-storage/order-template-categories/{id}
The UUID of an Order Template Category
Returns item with a given ID
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Order Template Category",
"type": "object",
"javaName": "OrderTemplateCategory",
"properties": {
"id": {
"description": "UUID of order template category",
"$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}$"
},
"name": {
"description": "The name of order template category",
"type": "string"
}
},
"additionalProperties": true,
"required": [
"name"
]
}
Example:
{
"id": "3dee318b-f5b3-40dc-be93-cc89b8c45b6f",
"name": "Sample Order Template Category"
}
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"order-template-category not found"
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
internal server error, contact administrator