Sample-Module (v1)

http://github.com/org/folio/sample-module

Table of contents

mod-orders (Vendor Detail)

CRUD APIs used to manage reporting codes.

/vendor_detail

Collection of vendor_detail items.

GET /vendor_detail

Get list of locationss

GET /vendor_detail
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]

Response 200

Returns a list of vendor_detail items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "collection of vendor detail records",
  "type": "object",
  "properties": {
    "vendor_details": {
      "description": "collection of vendor detail records",
      "type": "array",
      "id": "vendor_details",
      "items": {
        "type": "object",
        "$ref": "vendor_detail.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": [
    "vendor_details",
    "total_records"
  ]
}

Example:

{
  "vendor_details":
    [
      {
        "id": "d5065f0d-fb88-4d23-b0c1-57e754fba40e",
        "instructions": "ABCDEFG",
        "note_from_vendor": "ABCDEFGHIKJKLMNOP",
        "ref_number": "123456-78",
        "ref_number_type": "Supplier's unique order line reference number",
        "vendor_account": "8910-25",
        "po_line_id": "e64c2756-6441-4db4-ac30-b45c0d2d2194"
      }
    ],
  "total_records": 1,
  "first": 1,
  "last": 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 vendor_detail -- 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 vendor_detail -- unauthorized

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

POST /vendor_detail

Create a new vendor_detail item.

POST /vendor_detail
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 vendor details",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this vendor details 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}$"
    },
    "instructions": {
      "description": "special instructions for the vendor",
      "type": "string"
    },
    "note_from_vendor": {
      "description": "free-form notes from the vendor",
      "type": "string"
    },
    "ref_number": {
      "description": "a reference number for this purchase order line",
      "type": "string"
    },
    "ref_number_type": {
      "description": "the reference number type",
      "type": "string",
      "enum": [
        "Supplier's continuation order",
        "Supplier's unique order line reference number",
        "Agent's unique subscription reference number",
        "Library's continuation order number",
        "Internal vendor number"
      ]
    },
    "vendor_account": {
      "description": "the accound number on the vendor's end associated with this purchase order line",
      "type": "string"
    },
    "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": [
    "instructions"
  ]
}

Example:

{
  "instructions": "ABCDEFG",
  "note_from_vendor": "ABCDEFGHIKJKLMNOP",
  "ref_number": "123456-78",
  "ref_number_type": "Supplier's unique order line reference number",
  "vendor_account": "8910-25",
  "po_line_id": "e64c2756-6441-4db4-ac30-b45c0d2d2194"
}

Response 201

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

Headers
  • Location: required (string)

    URI to the created vendor_detail item

Body

Media type: application/json

Type: any

Example:

{
  "instructions": "ABCDEFG",
  "note_from_vendor": "ABCDEFGHIKJKLMNOP",
  "ref_number": "123456-78",
  "ref_number_type": "Supplier's unique order line reference number",
  "vendor_account": "8910-25",
  "po_line_id": "e64c2756-6441-4db4-ac30-b45c0d2d2194"
}

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

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create vendor_detail -- unauthorized

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

GET /vendor_detail/{id}

Retrieve vendor_detail item with given {vendor_detailId}

GET /vendor_detail/{id}
URI Parameters
  • id: required (string)
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 line vendor details",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this vendor details 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}$"
    },
    "instructions": {
      "description": "special instructions for the vendor",
      "type": "string"
    },
    "note_from_vendor": {
      "description": "free-form notes from the vendor",
      "type": "string"
    },
    "ref_number": {
      "description": "a reference number for this purchase order line",
      "type": "string"
    },
    "ref_number_type": {
      "description": "the reference number type",
      "type": "string",
      "enum": [
        "Supplier's continuation order",
        "Supplier's unique order line reference number",
        "Agent's unique subscription reference number",
        "Library's continuation order number",
        "Internal vendor number"
      ]
    },
    "vendor_account": {
      "description": "the accound number on the vendor's end associated with this purchase order line",
      "type": "string"
    },
    "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": [
    "instructions"
  ]
}

Example:

{
  "id": "d5065f0d-fb88-4d23-b0c1-57e754fba40e",
  "instructions": "ABCDEFG",
  "note_from_vendor": "ABCDEFGHIKJKLMNOP",
  "ref_number": "123456-78",
  "ref_number_type": "Supplier's unique order line reference number",
  "vendor_account": "8910-25",
  "po_line_id": "e64c2756-6441-4db4-ac30-b45c0d2d2194"
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"vendor_detail 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 /vendor_detail/{id}

Delete vendor_detail item with given {vendor_detailId}

DELETE /vendor_detail/{id}
URI Parameters
  • id: required (string)
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 vendor_detail -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"vendor_detail 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

PUT /vendor_detail/{id}

Update vendor_detail item with given {vendor_detailId}

PUT /vendor_detail/{id}
URI Parameters
  • id: required (string)
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 vendor details",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this vendor details 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}$"
    },
    "instructions": {
      "description": "special instructions for the vendor",
      "type": "string"
    },
    "note_from_vendor": {
      "description": "free-form notes from the vendor",
      "type": "string"
    },
    "ref_number": {
      "description": "a reference number for this purchase order line",
      "type": "string"
    },
    "ref_number_type": {
      "description": "the reference number type",
      "type": "string",
      "enum": [
        "Supplier's continuation order",
        "Supplier's unique order line reference number",
        "Agent's unique subscription reference number",
        "Library's continuation order number",
        "Internal vendor number"
      ]
    },
    "vendor_account": {
      "description": "the accound number on the vendor's end associated with this purchase order line",
      "type": "string"
    },
    "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": [
    "instructions"
  ]
}

Example:

{
  "id": "d5065f0d-fb88-4d23-b0c1-57e754fba40e",
  "instructions": "ABCDEFG",
  "note_from_vendor": "ABCDEFGHIKJKLMNOP",
  "ref_number": "123456-78",
  "ref_number_type": "Supplier's unique order line reference number",
  "vendor_account": "8910-25",
  "po_line_id": "e64c2756-6441-4db4-ac30-b45c0d2d2194"
}

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

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"vendor_detail 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