mod-orders (v1.0)

http://github.com/folio-org/mod-orders

Table of contents

Orders configuration

API for managing purchase orders configuration

/orders/configuration

POST /orders/configuration/reasons-for-closure

Create new reason for closure

POST /orders/configuration/reasons-for-closure
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": "Reason for closure object",
  "type": "object",
  "javaType" : "org.folio.rest.jaxrs.model.ReasonForClosure",
  "extends" : {
    "$ref" : "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "description": "UUID of this Reason for closure record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "reason": {
      "description": "Reason for closure",
      "type": "string"
    },
    "source": {
      "description": "Source of reason for closure",
      "type": "string",
      "enum": [
        "User",
        "System"
      ],
      "default": "User"
    }
  },
  "additionalProperties": false,
  "required": [
    "reason",
    "source"
  ]
}

Example:

{
  "reason": "Lack of funds",
  "source": "System"
}

Response 201

Returns a newly created item, with server-controlled fields like 'id' populated

Headers
  • Location: required (string)

    URI to the created reasons-for-closure item

Body

Media type: application/json

Type: any

Example:

{
  "reason": "Lack of funds",
  "source": "System"
}

Response 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 reasons-for-closure -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create reasons-for-closure -- unauthorized

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

GET /orders/configuration/reasons-for-closure

Get list of reasons for closure

GET /orders/configuration/reasons-for-closure
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 reasonForClosure

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    ["reasonForClosure", "Denied", "="]
    
  • 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]

Response 200

Returns a list of reasons-for-closure items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Collection of reasons for closure",
  "type": "object",
  "properties": {
    "reasonsForClosure": {
      "description": "Collection of reasons for closure",
      "type": "array",
      "id": "reasonsForClosure",
      "items": {
        "type": "object",
        "$ref": "reason_for_closure.json"
      }
    },
    "totalRecords": {
      "description": "The number of objects contained in this collection",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "reasonsForClosure",
    "totalRecords"
  ]
}

Example:

{
    "reasonsForClosure":
        [
          {
            "id": "41153a11-6bb8-4217-93b8-0c83c8b019f5",
            "reason": "Lack of funds",
            "source": "System"
          }
        ],
    "totalRecords": 1
}

Response 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 reasons-for-closure -- malformed parameter 'query', syntax error at column 6

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to list reasons-for-closure -- unauthorized

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

PUT /orders/configuration/reasons-for-closure/{id}

Update reason for closure

PUT /orders/configuration/reasons-for-closure/{id}
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 reason for closure

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": "Reason for closure object",
  "type": "object",
  "javaType" : "org.folio.rest.jaxrs.model.ReasonForClosure",
  "extends" : {
    "$ref" : "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "description": "UUID of this Reason for closure record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "reason": {
      "description": "Reason for closure",
      "type": "string"
    },
    "source": {
      "description": "Source of reason for closure",
      "type": "string",
      "enum": [
        "User",
        "System"
      ],
      "default": "User"
    }
  },
  "additionalProperties": false,
  "required": [
    "reason",
    "source"
  ]
}

Example:

{
  "id": "41153a11-6bb8-4217-93b8-0c83c8b019f5",
  "reason": "Lack of funds",
  "source": "System"
}

Response 204

Item successfully updated

Response 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 reasons-for-closure -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"reasons-for-closure not found"

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

GET /orders/configuration/reasons-for-closure/{id}

Retrieve reasons-for-closure item with given {reasons-for-closureId}

GET /orders/configuration/reasons-for-closure/{id}
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 reason for closure

Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Returns item with a given ID

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Reason for closure object",
  "type": "object",
  "javaType" : "org.folio.rest.jaxrs.model.ReasonForClosure",
  "extends" : {
    "$ref" : "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "description": "UUID of this Reason for closure record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "reason": {
      "description": "Reason for closure",
      "type": "string"
    },
    "source": {
      "description": "Source of reason for closure",
      "type": "string",
      "enum": [
        "User",
        "System"
      ],
      "default": "User"
    }
  },
  "additionalProperties": false,
  "required": [
    "reason",
    "source"
  ]
}

Example:

{
  "id": "41153a11-6bb8-4217-93b8-0c83c8b019f5",
  "reason": "Lack of funds",
  "source": "System"
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"reasons-for-closure not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

DELETE /orders/configuration/reasons-for-closure/{id}

Delete reasons-for-closure item with given {reasons-for-closureId}

DELETE /orders/configuration/reasons-for-closure/{id}
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 reason for closure

Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 204

Item deleted successfully

Response 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 reasons-for-closure -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"reasons-for-closure not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

POST /orders/configuration/prefixes

Create new prefix

POST /orders/configuration/prefixes
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 number prefix",
  "type": "object",
  "extends" : {
    "$ref" : "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "description": "UUID of this prefix",
      "$ref": "../../common/schemas/uuid.json"
    },
    "name": {
      "description": "Prefix name",
      "type": "string"
    },
    "description": {
      "description": "Prefix description",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}

Example:

{
  "name": "Custom prefix",
  "description": "Custom prefix description"
}

Response 201

Returns a newly created item, with server-controlled fields like 'id' populated

Headers
  • Location: required (string)

    URI to the created prefix item

Body

Media type: application/json

Type: any

Example:

{
  "name": "Custom prefix",
  "description": "Custom prefix description"
}

Response 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 prefix -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create prefixes -- unauthorized

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

GET /orders/configuration/prefixes

Get list of prefixes

GET /orders/configuration/prefixes
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 prefix

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    ["prefix", "Prx", "="]
    
  • 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]

Response 200

Returns a list of prefix items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Collection of purchase order number prefixes",
  "type": "object",
  "properties": {
    "prefixes": {
      "description": "Collection of prefixes",
      "type": "array",
      "id": "prefixes",
      "items": {
        "type": "object",
        "$ref": "prefix.json"
      }
    },
    "totalRecords": {
      "description": "The number of objects contained in this collection",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "prefixes",
    "totalRecords"
  ]
}

Example:

{
    "prefixes":
        [
          {
            "id": "db9f5d17-0ca3-4d14-ae49-16b63c8fc083",
            "name": "Custom prefix",
            "description": "Custom prefix description"
          }
        ],
    "totalRecords": 1
}

Response 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 prefixes -- malformed parameter 'query', syntax error at column 6

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to list prefixes -- unauthorized

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

PUT /orders/configuration/prefixes/{id}

Update prefix

PUT /orders/configuration/prefixes/{id}
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 prefix

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 number prefix",
  "type": "object",
  "extends" : {
    "$ref" : "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "description": "UUID of this prefix",
      "$ref": "../../common/schemas/uuid.json"
    },
    "name": {
      "description": "Prefix name",
      "type": "string"
    },
    "description": {
      "description": "Prefix description",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}

Example:

{
  "id": "db9f5d17-0ca3-4d14-ae49-16b63c8fc083",
  "name": "Custom prefix",
  "description": "Custom prefix description"
}

Response 204

Item successfully updated

Response 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 prefix -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"prefix not found"

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

GET /orders/configuration/prefixes/{id}

Retrieve prefix item with given {prefixId}

GET /orders/configuration/prefixes/{id}
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 prefix

Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 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 number prefix",
  "type": "object",
  "extends" : {
    "$ref" : "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "description": "UUID of this prefix",
      "$ref": "../../common/schemas/uuid.json"
    },
    "name": {
      "description": "Prefix name",
      "type": "string"
    },
    "description": {
      "description": "Prefix description",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}

Example:

{
  "id": "db9f5d17-0ca3-4d14-ae49-16b63c8fc083",
  "name": "Custom prefix",
  "description": "Custom prefix description"
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"prefix not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

DELETE /orders/configuration/prefixes/{id}

Delete prefix item with given {prefixId}

DELETE /orders/configuration/prefixes/{id}
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 prefix

Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 204

Item deleted successfully

Response 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 prefix -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"prefix not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

POST /orders/configuration/suffixes

Create new suffix

POST /orders/configuration/suffixes
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 number suffix",
  "type": "object",
  "extends" : {
    "$ref" : "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "description": "UUID of this suffix",
      "$ref": "../../common/schemas/uuid.json"
    },
    "name": {
      "description": "Suffix name",
      "type": "string"
    },
    "description": {
      "description": "Suffix description",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}

Example:

{
  "name": "Custom suffix",
  "description": "Custom suffix description"
}

Response 201

Returns a newly created item, with server-controlled fields like 'id' populated

Headers
  • Location: required (string)

    URI to the created suffix item

Body

Media type: application/json

Type: any

Example:

{
  "name": "Custom suffix",
  "description": "Custom suffix description"
}

Response 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 suffix -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create suffixes -- unauthorized

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

GET /orders/configuration/suffixes

Get list of suffixes

GET /orders/configuration/suffixes
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 suffix

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    ["code", "Sfx", "="]
    
  • 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]

Response 200

Returns a list of suffix items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Collection of purchase order number suffixes",
  "type": "object",
  "properties": {
    "suffixes": {
      "description": "Collection of suffixes",
      "type": "array",
      "id": "suffixes",
      "items": {
        "type": "object",
        "$ref": "suffix.json"
      }
    },
    "totalRecords": {
      "description": "The number of objects contained in this collection",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "suffixes",
    "totalRecords"
  ]
}

Example:

{
    "suffixes":
        [
          {
            "id": "0c966bd2-0ca6-43a2-9388-3a4403f19e6f",
            "name": "Custom suffix",
            "description": "Custom suffix description"
          }
        ],
    "totalRecords": 1
}

Response 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 suffixes -- malformed parameter 'query', syntax error at column 6

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to list suffixes -- unauthorized

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

PUT /orders/configuration/suffixes/{id}

Update suffix

PUT /orders/configuration/suffixes/{id}
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 suffix

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 number suffix",
  "type": "object",
  "extends" : {
    "$ref" : "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "description": "UUID of this suffix",
      "$ref": "../../common/schemas/uuid.json"
    },
    "name": {
      "description": "Suffix name",
      "type": "string"
    },
    "description": {
      "description": "Suffix description",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}

Example:

{
  "id": "0c966bd2-0ca6-43a2-9388-3a4403f19e6f",
  "name": "Custom suffix",
  "description": "Custom suffix description"
}

Response 204

Item successfully updated

Response 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 suffix -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"suffix not found"

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

GET /orders/configuration/suffixes/{id}

Retrieve suffix item with given {suffixId}

GET /orders/configuration/suffixes/{id}
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 suffix

Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 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 number suffix",
  "type": "object",
  "extends" : {
    "$ref" : "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "description": "UUID of this suffix",
      "$ref": "../../common/schemas/uuid.json"
    },
    "name": {
      "description": "Suffix name",
      "type": "string"
    },
    "description": {
      "description": "Suffix description",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}

Example:

{
  "id": "0c966bd2-0ca6-43a2-9388-3a4403f19e6f",
  "name": "Custom suffix",
  "description": "Custom suffix description"
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"suffix not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

DELETE /orders/configuration/suffixes/{id}

Delete suffix item with given {suffixId}

DELETE /orders/configuration/suffixes/{id}
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 suffix

Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 204

Item deleted successfully

Response 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 suffix -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"suffix not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator