Orders Storage API documentation version v1
http://github.com/org/folio/mod-orders-storage
Renewals
CRUD API
/orders-storage/renewals
Collection of renewal items.
Get list of renewals
Create a new renewal item.
get /orders-storage/renewals
Get list of renewals
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", "="]
- 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
- lang: (string - default: en - pattern: [a-zA-Z]{2})
Requested language. Optional. [lang=en]
HTTP status code 200
Returns a list of renewal items
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "collection of renewal records",
"type": "object",
"properties": {
"renewals": {
"description": "collection of renewal records",
"type": "array",
"id": "renewals",
"items": {
"type": "object",
"$ref": "renewal.json"
}
},
"total_records": {
"description": "The number of objects contained in this collection",
"type": "integer"
},
"first": {
"description": "The index of the first object contained in this collection",
"type": "integer"
},
"last": {
"description": "The index of the last object contained in this collection",
"type": "integer"
}
},
"additionalProperties": false,
"required": [
"renewals",
"total_records"
]
}
Example:
{
"renewals":
[
{
"id": "8e414baa-8cf2-4916-a90f-d1da4009e06e",
"interval": 182,
"cycle": "6 Months",
"manual_renewal": true,
"review_period": 30,
"renewal_date": "2019-04-09T00:00:00.000Z",
"po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
}
],
"total_records": 1,
"first": 1,
"last": 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 renewals -- 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 renewals -- 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/renewals
Create a new renewal item.
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": "purchase order line renewal details",
"type": "object",
"properties": {
"id": {
"description": "UUID of this renewal 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}$"
},
"cycle": {
"description": "length of the renewal cycle",
"type": "string",
"enum": [
"Two Years",
"One Year",
"3 Months",
"6 Months",
"1 Month",
"Manual"
]
},
"interval": {
"description": "renewal interval (in days?)",
"type": "integer"
},
"manual_renewal": {
"description": "whether or not this is a manual renewal",
"type": "boolean"
},
"review_period": {
"description": "time prior to renewal where changes can be made to subscription",
"type": "integer"
},
"renewal_date": {
"description": "date renewal was confirmed by vendor or sent to vendor",
"type": [
"string",
"null"
],
"format": "date-time"
},
"po_line_id": {
"description": "UUID of the purchase order line this record is associated with",
"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}$"
}
},
"additionalProperties": false,
"required": [
"interval"
]
}
Example:
{
"interval": 182,
"cycle": "6 Months",
"manual_renewal": true,
"review_period": 30,
"renewal_date": "2019-04-09T00:00:00.000Z",
"po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
}
HTTP status code 201
Returns a newly created item, with server-controlled fields like 'id' populated
Headers
- Location: required (string)
URI to the created renewal item
Body
Media type: application/json
Type: any
Example:
{
"interval": 182,
"cycle": "6 Months",
"manual_renewal": true,
"review_period": 30,
"renewal_date": "2019-04-09T00:00:00.000Z",
"po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
}
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 renewal -- 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 renewals -- 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 renewal
Retrieve renewal item with given {renewalId}
Delete renewal item with given {renewalId}
Update renewal item with given {renewalId}
get /orders-storage/renewals/{id}
Retrieve renewal item with given {renewalId}
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 Renewal
Query Parameters
- lang: (string - default: en - pattern: [a-zA-Z]{2})
Requested language. Optional. [lang=en]
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 renewal details",
"type": "object",
"properties": {
"id": {
"description": "UUID of this renewal 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}$"
},
"cycle": {
"description": "length of the renewal cycle",
"type": "string",
"enum": [
"Two Years",
"One Year",
"3 Months",
"6 Months",
"1 Month",
"Manual"
]
},
"interval": {
"description": "renewal interval (in days?)",
"type": "integer"
},
"manual_renewal": {
"description": "whether or not this is a manual renewal",
"type": "boolean"
},
"review_period": {
"description": "time prior to renewal where changes can be made to subscription",
"type": "integer"
},
"renewal_date": {
"description": "date renewal was confirmed by vendor or sent to vendor",
"type": [
"string",
"null"
],
"format": "date-time"
},
"po_line_id": {
"description": "UUID of the purchase order line this record is associated with",
"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}$"
}
},
"additionalProperties": false,
"required": [
"interval"
]
}
Example:
{
"id": "8e414baa-8cf2-4916-a90f-d1da4009e06e",
"interval": 182,
"cycle": "6 Months",
"manual_renewal": true,
"review_period": 30,
"renewal_date": "2019-04-09T00:00:00.000Z",
"po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
}
HTTP status code 404
Item with a given ID not found
Body
Media type: text/plain
Type: any
Example:
"renewal 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/renewals/{id}
Delete renewal item with given {renewalId}
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 Renewal
Query Parameters
- lang: (string - default: en - pattern: [a-zA-Z]{2})
Requested language. Optional. [lang=en]
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 renewal -- constraint violation"
HTTP status code 404
Item with a given ID not found
Body
Media type: text/plain
Type: any
Example:
"renewal 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/renewals/{id}
Update renewal item with given {renewalId}
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 Renewal
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": "purchase order line renewal details",
"type": "object",
"properties": {
"id": {
"description": "UUID of this renewal 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}$"
},
"cycle": {
"description": "length of the renewal cycle",
"type": "string",
"enum": [
"Two Years",
"One Year",
"3 Months",
"6 Months",
"1 Month",
"Manual"
]
},
"interval": {
"description": "renewal interval (in days?)",
"type": "integer"
},
"manual_renewal": {
"description": "whether or not this is a manual renewal",
"type": "boolean"
},
"review_period": {
"description": "time prior to renewal where changes can be made to subscription",
"type": "integer"
},
"renewal_date": {
"description": "date renewal was confirmed by vendor or sent to vendor",
"type": [
"string",
"null"
],
"format": "date-time"
},
"po_line_id": {
"description": "UUID of the purchase order line this record is associated with",
"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}$"
}
},
"additionalProperties": false,
"required": [
"interval"
]
}
Example:
{
"id": "8e414baa-8cf2-4916-a90f-d1da4009e06e",
"interval": 182,
"cycle": "6 Months",
"manual_renewal": true,
"review_period": 30,
"renewal_date": "2019-04-09T00:00:00.000Z",
"po_line_id": "8c778aee-97fa-4586-b131-3ea588a728e2"
}
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 renewal -- malformed JSON at 13:4"
HTTP status code 404
Item with a given ID not found
Body
Media type: text/plain
Type: any
Example:
"renewal 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