Orders Storage (v1)

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

Table of contents

Acquisitions units

CRUD APIs used to manage acquisitions unit assignments.

/orders-storage/acquisitions-unit-assignments

Collection of acquisitions-unit-assignment items.

POST /orders-storage/acquisitions-unit-assignments

Create new acquisitions unit assignment

POST /orders-storage/acquisitions-unit-assignments
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": "Relationship between a record (purchase order, invoice, etc...) and acquisition unit",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this acquisitions unit assignment 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}$"
    },
    "recordId": {
      "description": "UUID of the PO to associate with this acquisitions unit",
      "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}$"
    },
    "acquisitionsUnitId": {
      "description": "UUID of acquisitions unit associated with this PO ",
      "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}$"
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "recordId",
    "acquisitionsUnitId"
  ]
}

Example:

{
  "recordId": "57b575a1-c6bc-4b6e-b91a-06bc0034b768",
  "acquisitionsUnitId": "c2d6608f-6d1f-45f7-8817-5d32c2416116"
}

Response 201

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

Headers
  • Location: required (string)

    URI to the created acquisitions-unit-assignment item

Body

Media type: application/json

Type: any

Example:

{
  "recordId": "57b575a1-c6bc-4b6e-b91a-06bc0034b768",
  "acquisitionsUnitId": "c2d6608f-6d1f-45f7-8817-5d32c2416116"
}

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 acquisitions-unit-assignment -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create acquisitions-unit-assignments -- 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-storage/acquisitions-unit-assignments

Get list of acquisitions unit assignments

GET /orders-storage/acquisitions-unit-assignments
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 recordId

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    ["recordId", "68a8d546-33e0-4613-8a47-a72fca7f576b"]
    
  • 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 acquisitions-unit-assignment items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "collection of acquisitions unit assignment records",
  "type": "object",
  "properties": {
    "acquisitionsUnitAssignments": {
      "description": "collection of acquisitions unit assignment records",
      "type": "array",
      "id": "acquisitionsUnitAssignments",
      "items": {
        "type": "object",
        "$ref": "acquisitions_unit_assignment.json"
      }
    },
    "totalRecords": {
      "description": "The number of objects contained in this collection",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "acquisitionsUnitAssignments",
    "totalRecords"
  ]
}

Example:

{
  "acquisitionsUnitAssignments": [
    {
      "id": "8ad580ee-d3f1-4271-bff4-c7c80ccb22e5",
      "recordId": "57b575a1-c6bc-4b6e-b91a-06bc0034b768",
      "acquisitionsUnitId": "c2d6608f-6d1f-45f7-8817-5d32c2416116",
      "metadata": {
        "createdDate": "2018-08-19T00:00:00.000+0000",
        "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
      }
    }
  ],
  "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 acquisitions-unit-assignments -- 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 acquisitions-unit-assignments -- 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-storage/acquisitions-unit-assignments/{id}

Update acquisitions unit assignment

PUT /orders-storage/acquisitions-unit-assignments/{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 acquisitions unit assignment

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": "Relationship between a record (purchase order, invoice, etc...) and acquisition unit",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this acquisitions unit assignment 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}$"
    },
    "recordId": {
      "description": "UUID of the PO to associate with this acquisitions unit",
      "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}$"
    },
    "acquisitionsUnitId": {
      "description": "UUID of acquisitions unit associated with this PO ",
      "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}$"
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "recordId",
    "acquisitionsUnitId"
  ]
}

Example:

{
  "id": "8ad580ee-d3f1-4271-bff4-c7c80ccb22e5",
  "recordId": "57b575a1-c6bc-4b6e-b91a-06bc0034b768",
  "acquisitionsUnitId": "c2d6608f-6d1f-45f7-8817-5d32c2416116",
  "metadata": {
    "createdDate": "2018-08-19T00:00:00.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

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 acquisitions-unit-assignment -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"acquisitions-unit-assignment 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-storage/acquisitions-unit-assignments/{id}

Retrieve acquisitions-unit-assignment item with given {acquisitions-unit-assignmentId}

GET /orders-storage/acquisitions-unit-assignments/{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 acquisitions unit assignment

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": "Relationship between a record (purchase order, invoice, etc...) and acquisition unit",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this acquisitions unit assignment 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}$"
    },
    "recordId": {
      "description": "UUID of the PO to associate with this acquisitions unit",
      "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}$"
    },
    "acquisitionsUnitId": {
      "description": "UUID of acquisitions unit associated with this PO ",
      "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}$"
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "recordId",
    "acquisitionsUnitId"
  ]
}

Example:

{
  "id": "8ad580ee-d3f1-4271-bff4-c7c80ccb22e5",
  "recordId": "57b575a1-c6bc-4b6e-b91a-06bc0034b768",
  "acquisitionsUnitId": "c2d6608f-6d1f-45f7-8817-5d32c2416116",
  "metadata": {
    "createdDate": "2018-08-19T00:00:00.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"acquisitions-unit-assignment 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-storage/acquisitions-unit-assignments/{id}

Delete acquisitions-unit-assignment item with given {acquisitions-unit-assignmentId}

DELETE /orders-storage/acquisitions-unit-assignments/{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 acquisitions unit assignment

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 acquisitions-unit-assignment -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"acquisitions-unit-assignment 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