Orders Storage version v3
http://github.com/org/folio/mod-orders-storage
Reporting Code
CRUD APIs used to manage reporting codes.
/orders-storage/reporting-codes
Collection of reporting-code items.
Get list of reporting Codes
Create a new reporting-code item.
get /orders-storage/reporting-codes
Get list of reporting Codes
Query Parameters
- 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 code
Example:
(username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode ["code", "MEDGRANT", "="]
- 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
HTTP status code 200
Returns a list of reporting-code items
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "collection of reporting code records",
"type": "object",
"properties": {
"reportingCodes": {
"description": "collection of reporting code records",
"type": "array",
"id": "reportingCodes",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "purchase order line reporting code",
"properties": {
"id": {
"description": "UUID of this reporting code record",
"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}$"
},
"code": {
"description": "a reporting code",
"type": "string",
"pattern": "^[a-zA-Z0-9]{4}[a-zA-Z0-9]*$"
},
"description": {
"description": "description of this reporting code",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"code"
]
}
},
"totalRecords": {
"description": "The number of objects contained in this collection",
"type": "integer"
}
},
"additionalProperties": false,
"required": [
"reportingCodes",
"totalRecords"
]
}
Example:
{
"reportingRodes":
[
{
"id": "5926dcd7-85f5-4504-8283-712595ebc38b",
"code": "CODE1",
"description": "ABCDEF"
}
],
"totalRecords": 1
}
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: text/plain
Type: any
Example:
unable to list reporting-codes -- malformed parameter 'query', syntax error at column 6
HTTP status code 401
Not authorized to perform requested action
Body
Media type: text/plain
Type: any
Example:
unable to list reporting-codes -- unauthorized
HTTP status code 500
Internal server error, e.g. due to misconfiguration
Body
Media type: text/plain
Type: any
Example:
internal server error, contact administrator
post /orders-storage/reporting-codes
Create a new reporting-code item.
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "purchase order line reporting code",
"type": "object",
"properties": {
"id": {
"description": "UUID of this reporting code record",
"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}$"
},
"code": {
"description": "a reporting code",
"type": "string",
"pattern": "^[a-zA-Z0-9]{4}[a-zA-Z0-9]*$"
},
"description": {
"description": "description of this reporting code",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"code"
]
}
Example:
{
"code": "CODE1",
"description": "ABCDEF"
}
HTTP status code 201
Returns a newly created item, with server-controlled fields like 'id' populated
Headers
- Location: required(string)
URI to the created reporting-code item
Body
Media type: application/json
Type: any
Example:
{
"code": "CODE1",
"description": "ABCDEF"
}
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: text/plain
Type: any
Example:
"unable to add reporting-code -- malformed JSON at 13:3"
HTTP status code 401
Not authorized to perform requested action
Body
Media type: text/plain
Type: any
Example:
unable to create reporting-codes -- unauthorized
HTTP status code 500
Internal server error, e.g. due to misconfiguration
Body
Media type: text/plain
Type: any
Example:
Internal server error, contact administrator
Entity representing a reporting-code
Retrieve reporting-code item with given {reporting-codeId}
Delete reporting-code item with given {reporting-codeId}
Update reporting-code item with given {reporting-codeId}
get /orders-storage/reporting-codes/{id}
Retrieve reporting-code item with given {reporting-codeId}
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 Reporting Code
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": "purchase order line reporting code",
"type": "object",
"properties": {
"id": {
"description": "UUID of this reporting code record",
"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}$"
},
"code": {
"description": "a reporting code",
"type": "string",
"pattern": "^[a-zA-Z0-9]{4}[a-zA-Z0-9]*$"
},
"description": {
"description": "description of this reporting code",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"code"
]
}
Example:
{
"code": "CODE1",
"description": "ABCDEF"
}
HTTP status code 404
Item with a given ID not found
Body
Media type: text/plain
Type: any
Example:
"reporting-code not found"
HTTP status code 500
Internal server error, e.g. due to misconfiguration
Body
Media type: text/plain
Type: any
Example:
internal server error, contact administrator
delete /orders-storage/reporting-codes/{id}
Delete reporting-code item with given {reporting-codeId}
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 Reporting Code
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: text/plain
Type: any
Example:
"unable to delete reporting-code -- constraint violation"
HTTP status code 404
Item with a given ID not found
Body
Media type: text/plain
Type: any
Example:
"reporting-code not found"
HTTP status code 500
Internal server error, e.g. due to misconfiguration
Body
Media type: text/plain
Type: any
Example:
Internal server error, contact administrator
put /orders-storage/reporting-codes/{id}
Update reporting-code item with given {reporting-codeId}
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 Reporting Code
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "purchase order line reporting code",
"type": "object",
"properties": {
"id": {
"description": "UUID of this reporting code record",
"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}$"
},
"code": {
"description": "a reporting code",
"type": "string",
"pattern": "^[a-zA-Z0-9]{4}[a-zA-Z0-9]*$"
},
"description": {
"description": "description of this reporting code",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"code"
]
}
Example:
{
"code": "CODE1",
"description": "ABCDEF"
}
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: text/plain
Type: any
Example:
"unable to update reporting-code -- malformed JSON at 13:4"
HTTP status code 404
Item with a given ID not found
Body
Media type: text/plain
Type: any
Example:
"reporting-code 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: text/plain
Type: any
Example:
internal server error, contact administrator